@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 @onready var pro_worship_sprite = $"Pro李癞拜老鼠精" as ProAnimatedSprite2D @onready var light_worship = $"PointLight拜老鼠" as PointLight2D @onready var light_cut_tounge = $"PointLight剪舌头" as PointLight2D func _on_stage_updated() -> void: pro_worship_sprite.visible = stage == 1 if stage == 1: # 开始演出 SceneManager.get_player().set_facing_direction(Vector2.LEFT) SceneManager.lock_player() light_worship.show() light_worship.energy = 0.0 var tween = create_tween() tween.tween_property(light_worship, "energy", 0.6, 0.7) await Util.wait(4.0) tween = create_tween() tween.tween_property(light_worship, "energy", 0.0, 0.7) tween.parallel().tween_property(pro_worship_sprite, "modulate:a", 0.0, 1.0) await tween.finished 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 = 1.0 func _on_exit_room() -> void: # 拔舌头 EventManager.set_stage_if_greater("c03_lilai_worship_mouse", 3) var sprite = $"Pro陆仁剪舌头" as ProAnimatedSprite2D sprite.show() sprite.play() $"Sfx拔舌头".global_play() # Util.timer(0.5, $"Sfx拔舌头".global_play) SceneManager.pop_debug_dialog_info("音效", "惊悚: 拔舌头") EventManager.set_stage_if_greater("handnote_c03_prop_tounge", 1) light_cut_tounge.show() light_cut_tounge.energy = 0.0 var tween = create_tween() tween.tween_property(light_cut_tounge, "energy", 3.0, 0.1) tween.tween_property(light_cut_tounge, "energy", 1.0, 0.05) tween.tween_property(light_cut_tounge, "energy", 3.0, 0.05) tween.tween_property(light_cut_tounge, "energy", 0.5, 0.05) tween.tween_property(light_cut_tounge, "energy", 3.0, 0.05)