xiandie/scene/ground/scene/c03/s02_瞎子新卧室.gd

82 lines
2.3 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.

@tool
extends AnimationRoot
# 覆盖该方法
func _default_data() -> Dictionary:
return {}
func _ready() -> void:
super._ready()
if Engine.is_editor_hint():
return
#region node_reference
var pickable李癞钥匙: Pickable2D
var pickable邀请信: Pickable2D
var ambush小猫挠墙: Ambush2D
var note带血的手帕: Note2D
var note小蝉的寻人启事: Note2D
var closeup洋糕点: Closeup2D
var : Gaslight
var note小蝉的床: Note2D
var note通风管道: Note2D
#endregion
# 读取设置变量名
func _setup_node_reference() -> void:
pickable李癞钥匙 = $"../DeployLayer/Pickable李癞钥匙"
pickable邀请信 = $"../DeployLayer/Pickable邀请信"
ambush小猫挠墙 = $"../DeployLayer/Ambush小猫挠墙"
note带血的手帕 = $"../DeployLayer/Note带血的手帕"
note小蝉的寻人启事 = $"../DeployLayer/Note小蝉的寻人启事"
closeup洋糕点 = $"../DeployLayer/Closeup洋糕点"
= $"../DeployLayer/煤油灯"
note小蝉的床 = $"../DeployLayer/Note小蝉的床"
note通风管道 = $"../DeployLayer/Note通风管道"
func _on_ground_ready() -> void:
if .interacted_times == 0:
_set_notes_coverer("c03_s02_note_key_coverer")
.lighted.connect(_gaslight_up, CONNECT_ONE_SHOT)
else:
closeup洋糕点.enabled = true
if ambush小猫挠墙.played:
ambush小猫挠墙.visible = false
pickable李癞钥匙.visible = true
pickable李癞钥匙.triggered.connect(func():
await SceneManager.get_inspector().quit_and_hidden
SceneManager.pop_os_with_str("c03_s02_获得1015钥匙后")
)
pickable邀请信.triggered.connect(func():
await SceneManager.get_inspector().quit_and_hidden
SceneManager.dizzy_effect(3.5)
await Util.wait(6.0)
SceneManager.pop_os_with_str("c03_s02_看完信后")
)
func _gaslight_up() -> void:
closeup洋糕点.enabled = true
_set_notes_coverer("")
func _set_notes_coverer(coverer: String) -> void:
note小蝉的床.note_key_coverer = coverer
note通风管道.note_key_coverer = coverer
note小蝉的寻人启事.note_key_coverer = coverer
note带血的手帕.note_key_coverer = coverer
func scratching_cat_interacted() -> void:
# 蹲下 起立
SceneManager.lock_player()
$"../DeployLayer/Ambush小猫挠墙/小猫挠墙".play("小猫挠墙")
await Util.wait(3.5)
# 自动隐藏
EventManager.set_stage("c03_invite_xchan_supper", 3)
SceneManager.unlock_player()