xiandie/scene/ground/scene/c02/s04_保卫科.gd

72 lines
2.0 KiB
GDScript3
Raw Normal View History

@tool
extends AnimationRoot
# 覆盖该方法
func _default_data() -> Dictionary:
2025-06-20 17:51:36 +00:00
return {}
func _ready() -> void:
super._ready()
if Engine.is_editor_hint():
return
2025-07-02 16:32:37 +00:00
#region node_reference
2025-07-02 16:32:37 +00:00
var ambush进门看到小蝉: Sprite2D
var closeup花名册: Closeup2D
var closeup折锡纸: Closeup2D
var : AnimatedSprite2D
#endregion
2025-06-20 17:51:36 +00:00
2025-06-04 14:02:22 +00:00
func _setup_node_reference() -> void:
2025-07-02 16:32:37 +00:00
= $"../DeployLayer/小蝉写字"
ambush进门看到小蝉 = $"../DeployLayer/Ambush进门看到小蝉"
closeup花名册 = $"../DeployLayer/Closeup花名册"
closeup折锡纸 = $"../DeployLayer/Closeup折锡纸"
2025-06-20 17:51:36 +00:00
2025-07-02 16:32:37 +00:00
func _on_ground_ready() -> void:
if not ArchiveManager.get_global_value(&"c02_tin_coin_taken"):
closeup折锡纸.exit.connect(_on_closeup_tin_coin_exited)
2025-08-12 14:17:03 +00:00
if closeup花名册.icount == 0 and EventManager.get_chapter_stage() <= 2:
2025-07-02 16:32:37 +00:00
closeup花名册.exit.connect(_on_first_read, CONNECT_ONE_SHOT)
2025-08-12 14:17:03 +00:00
closeup花名册.exit.connect(_on_name_book_exited)
2025-07-02 16:32:37 +00:00
if ambush进门看到小蝉.played:
.visible = false
2025-06-20 17:51:36 +00:00
# 第二章之后关闭 closeup折锡纸
if EventManager.get_chapter_stage() >= 3:
closeup折锡纸.enabled = false
2025-06-20 17:51:36 +00:00
func _on_closeup_tin_coin_exited(arg = null):
if arg == true:
2025-06-27 14:52:46 +00:00
ArchiveManager.set_global_entry(&"c02_tin_coin_taken", true)
SceneManager.enable_prop_item_silently("prop_锡箔元宝")
2025-06-30 10:33:40 +00:00
await Util.wait(0.5)
SceneManager.enable_prop_item("prop_锡箔元宝")
2025-07-01 11:40:30 +00:00
2025-07-02 16:32:37 +00:00
2025-07-01 11:40:30 +00:00
func _on_first_read(_arg) -> void:
2025-07-02 11:58:36 +00:00
await SceneManager.pop_os_with_str("c02_保卫科花名册首次互动结束")
EventManager.set_stage(&"handnote_c02_list_namesAndGoal", 1)
2025-07-02 16:32:37 +00:00
2025-08-12 14:17:03 +00:00
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_保卫科小蝉消失")