2025-01-14 10:20:31 +00:00
|
|
|
@tool
|
|
|
|
extends AnimationRoot
|
|
|
|
|
2025-01-27 15:13:37 +00:00
|
|
|
var wind_blows: AnimatedSprite2D
|
|
|
|
var paper_man: Ambush2D
|
2025-01-16 12:24:21 +00:00
|
|
|
|
2025-01-15 04:02:11 +00:00
|
|
|
|
2025-01-14 10:20:31 +00:00
|
|
|
# 覆盖该方法
|
|
|
|
func _default_data() -> Dictionary:
|
2025-01-27 15:13:37 +00:00
|
|
|
return {"display_paper_man": false}
|
2025-01-14 10:20:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
func _ready() -> void:
|
|
|
|
super._ready()
|
2025-01-21 07:58:21 +00:00
|
|
|
if Engine.is_editor_hint():
|
|
|
|
return
|
2025-01-14 10:20:31 +00:00
|
|
|
|
|
|
|
|
2025-01-22 13:13:18 +00:00
|
|
|
func _on_ground_ready() -> void:
|
2025-01-27 15:13:37 +00:00
|
|
|
wind_blows = $"../DeployLayer/WindBlows"
|
|
|
|
wind_blows.visible = false
|
|
|
|
paper_man = $"../DeployLayer/Ambush纸人"
|
|
|
|
paper_man.enabled = data.display_paper_man
|
|
|
|
paper_man.visible = data.display_paper_man
|
|
|
|
|
|
|
|
|
2025-01-14 10:20:31 +00:00
|
|
|
func _oneshot_wind():
|
2025-01-16 12:24:21 +00:00
|
|
|
SceneManager.freeze_player(0)
|
|
|
|
%MainPlayer.visible = false
|
|
|
|
wind_blows.visible = true
|
|
|
|
wind_blows.play()
|
|
|
|
wind_blows.animation_finished.connect(_on_wind_finished, CONNECT_ONE_SHOT)
|
|
|
|
|
|
|
|
|
|
|
|
func _on_wind_finished():
|
|
|
|
%MainPlayer.visible = true
|
|
|
|
wind_blows.visible = false
|
2025-01-14 10:20:31 +00:00
|
|
|
DialogueManager.show_dialogue_balloon(dialogue_c02, "c02_s02_天冷")
|
|
|
|
DialogueManager.dialogue_ended.connect(_on_dialogue_ended, CONNECT_ONE_SHOT)
|
|
|
|
|
|
|
|
|
2025-01-15 04:02:11 +00:00
|
|
|
func _on_dialogue_ended(_res):
|
2025-01-14 10:20:31 +00:00
|
|
|
SceneManager.release_player()
|
2025-01-27 15:13:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
func _display_paper_man():
|
|
|
|
data.display_paper_man = true
|
|
|
|
paper_man.enabled = true
|
|
|
|
paper_man.visible = true
|
|
|
|
paper_man.get_node("Sfx").play()
|
|
|
|
|
|
|
|
|
|
|
|
func paper_man_interacted():
|
|
|
|
SceneManager.enable_prop_item("prop_1012钥匙")
|
|
|
|
|
|
|
|
|
|
|
|
func lumber_interacted():
|
|
|
|
SceneManager.pop_debug_dialog_info("美术", "杂物堆⾥有眼睛瞟向玩家/眨动,然后消失(动画)")
|
|
|
|
_display_paper_man()
|