72 lines
2.0 KiB
GDScript
72 lines
2.0 KiB
GDScript
@tool
|
|
extends AnimationRoot
|
|
|
|
|
|
# 覆盖该方法
|
|
func _default_data() -> Dictionary:
|
|
return {}
|
|
|
|
|
|
func _ready() -> void:
|
|
super._ready()
|
|
if Engine.is_editor_hint():
|
|
return
|
|
|
|
|
|
#region node_reference
|
|
var ambush进门看到小蝉: Sprite2D
|
|
var closeup花名册: Closeup2D
|
|
var closeup折锡纸: Closeup2D
|
|
var 小蝉写字: AnimatedSprite2D
|
|
#endregion
|
|
|
|
|
|
func _setup_node_reference() -> void:
|
|
小蝉写字 = $"../DeployLayer/小蝉写字"
|
|
ambush进门看到小蝉 = $"../DeployLayer/Ambush进门看到小蝉"
|
|
closeup花名册 = $"../DeployLayer/Closeup花名册"
|
|
closeup折锡纸 = $"../DeployLayer/Closeup折锡纸"
|
|
|
|
|
|
func _on_ground_ready() -> void:
|
|
if not ArchiveManager.get_global_value(&"c02_tin_coin_taken"):
|
|
closeup折锡纸.exit.connect(_on_closeup_tin_coin_exited)
|
|
|
|
if closeup花名册.icount == 0 and EventManager.get_chapter_stage() <= 2:
|
|
closeup花名册.exit.connect(_on_first_read, CONNECT_ONE_SHOT)
|
|
closeup花名册.exit.connect(_on_name_book_exited)
|
|
|
|
if ambush进门看到小蝉.played:
|
|
小蝉写字.visible = false
|
|
|
|
# 第二章之后关闭 closeup折锡纸
|
|
if EventManager.get_chapter_stage() >= 3:
|
|
closeup折锡纸.enabled = false
|
|
|
|
|
|
func _on_closeup_tin_coin_exited(arg = null):
|
|
if arg == true:
|
|
ArchiveManager.set_global_entry(&"c02_tin_coin_taken", true)
|
|
SceneManager.enable_prop_item_silently("prop_锡箔元宝")
|
|
await Util.wait(0.5)
|
|
SceneManager.enable_prop_item("prop_锡箔元宝")
|
|
|
|
|
|
func _on_first_read(_arg) -> void:
|
|
await SceneManager.pop_os_with_str("c02_保卫科花名册首次互动结束")
|
|
EventManager.set_stage(&"handnote_c02_list_namesAndGoal", 1)
|
|
|
|
|
|
func _on_name_book_exited(_arg) -> void:
|
|
if EventManager.get_chapter_stage() >= 3:
|
|
# 在 Event 节点脚本中执行演出
|
|
EventManager.set_stage_if_greater("c03_lilai_worship_mouse", 1)
|
|
|
|
|
|
func xiaochan_disappear():
|
|
await SceneManager.pop_os_with_str("c02_保卫科看到小蝉")
|
|
var tween = create_tween()
|
|
tween.tween_property(小蝉写字, "modulate:a", 0.0, 2.0)
|
|
await tween.finished
|
|
SceneManager.pop_os_with_str("c02_保卫科小蝉消失")
|