class_name AssembledArchive extends Resource @export var archive_id := 0 @export var entrance_portal := "" @export var current_scene := "c00_s00": 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 # 只有在 >=0 的情况下才会生效 @export var player_global_position_x := -100.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 global_data_dict := {} # 不同场景的地面物品状态存档 @export var ground_archives = {} # true 为匿名,false 非匿名 @export var npc_anonymous_states = {} # 玩家跑步锁定状态 @export var player_running_locked := true # 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] func set_global_entry(property: StringName, value) -> void: global_data_dict[property] = value func get_global_value(property: StringName) -> Variant: return global_data_dict.get(property)