50 lines
1.2 KiB
GDScript3
50 lines
1.2 KiB
GDScript3
|
@tool
|
||
|
extends Event2D
|
||
|
|
||
|
# var prev_stage := 0
|
||
|
# var stage := 0
|
||
|
|
||
|
|
||
|
func _ready() -> void:
|
||
|
super._ready()
|
||
|
if Engine.is_editor_hint():
|
||
|
return
|
||
|
|
||
|
|
||
|
func _on_global_stage_updated(e: StringName, s: int) -> void:
|
||
|
super._on_global_stage_updated(e, s)
|
||
|
|
||
|
|
||
|
func _on_ground_ready(_ground: Ground2D) -> void:
|
||
|
_on_stage_updated()
|
||
|
|
||
|
|
||
|
func _on_pre_stage_updated() -> void:
|
||
|
pass
|
||
|
|
||
|
|
||
|
func _on_stage_updated() -> void:
|
||
|
$"Pro李癞拜老鼠精".visible = stage == 1
|
||
|
if stage == 1:
|
||
|
# 开始演出
|
||
|
SceneManager.get_player().set_facing_direction(Vector2.LEFT)
|
||
|
SceneManager.lock_player()
|
||
|
await Util.wait(3.0)
|
||
|
EventManager.set_stage_if_greater("c03_lilai_worship_mouse", 2)
|
||
|
SceneManager.pop_os_with_str("c03_保卫科_李癞拜老鼠精")
|
||
|
SceneManager.unlock_player()
|
||
|
elif stage == 2:
|
||
|
var portal = $"../portal_left" as Portal2D
|
||
|
portal.before_pre_transport_wait.connect(_on_exit_room)
|
||
|
portal.pre_transport_wait_time = 2.0
|
||
|
|
||
|
|
||
|
func _on_exit_room() -> void:
|
||
|
# 拔舌头
|
||
|
EventManager.set_stage_if_greater("c03_lilai_worship_mouse", 3)
|
||
|
var sprite = $"Pro陆仁剪舌头" as ProAnimatedSprite2D
|
||
|
sprite.show()
|
||
|
$"Sfx拔舌头amb".global_play()
|
||
|
Util.timer(0.5, $"Sfx拔舌头".global_play)
|
||
|
SceneManager.pop_debug_dialog_info("音效", "惊悚: 拔舌头")
|