xiandie/manager/archive_manager/assembled_archive.gd

53 lines
1.5 KiB
GDScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

class_name AssembledArchive extends Resource
@export var archive_id := 0
@export var entrance_portal := ""
@export var current_scene := "":
set(val):
current_scene = val
if val and val.length() == 7:
current_chapter = int(val.substr(1, 2))
current_section = int(val.substr(5))
# current_chapter and current_section are derived from current_scene
@export var current_chapter := 0
@export var current_section := 0
# player's info
@export var player_global_position := Vector2(0, 0)
@export var player_direction := Vector2(0, 0)
# game total seconds
@export var game_seconds_all := 0
@export var game_seconds_current := 0
# created time
@export var created_time := "2024-12-24 00:00:00"
# 不同场景的地面物品状态存档
@export var ground_archives = {}
# true 为匿名false 非匿名
@export var npc_anonymous_states = {}
# prop hud 显示道具
@export var prop_inventory: PropInventory
@export_group("八音盒", "bayinhe")
@export var bayinhe_current_answer := [0, 0, 0, 0, 0, 0, 0, 0, 0]
@export_enum("closed", "opened", "playing", "finished") var bayinhe_mode := "closed"
func _init() -> void:
if not prop_inventory:
prop_inventory = PropInventory.new()
func ground_archive(scene_name := current_scene) -> GroundArchive:
if not scene_name:
printerr("getting GroundArchive: scene_name is null")
return null
if not ground_archives.has(scene_name):
var g = GroundArchive.new()
g.scene_name = scene_name
ground_archives[scene_name] = g
# # 保存新建的 GroundArchive
# ArchiveManager.save_all()
return ground_archives[scene_name]