xiandie/scene/ground/script/c02/s03_event_2d第二章结束井边演出.gd

75 lines
2.2 KiB
GDScript3
Raw Normal View History

@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:
# c03_well_show: 0:初始化 1:准备演出 2:演出完成
if stage == 1:
_start_well_show()
const start_x = 2236.0
@onready var xchan = $"Pro小蝉" as ProAnimatedSprite2D
func _start_well_show() -> void:
2025-07-29 14:14:54 +00:00
SceneManager.toggle_hud_display(false)
xchan.modulate.a = 0.0
var player = SceneManager.get_player()
SceneManager.lock_player()
player.position.x = start_x
player.set_facing_direction(Vector2.LEFT)
# c02_吕萍_背靠呼吸
player.player_action(20, false)
2025-07-29 14:14:54 +00:00
# 多坐一会
await Util.wait(3.0)
2025-08-13 10:01:52 +00:00
# 惊醒喘气
$"Sfx惊醒喘气".play()
await Util.wait(2.5)
2025-07-29 14:14:54 +00:00
# c02_吕萍_背靠起身
await player.player_action(19, true)
await Util.wait(2.0)
var tween = create_tween()
tween.tween_property(xchan, "modulate:a", 1.0, 1.0)
await tween.finished
2025-07-29 07:41:00 +00:00
await Util.wait(2.5)
2025-08-08 06:03:10 +00:00
DialogueManager.show_dialogue_balloon(GlobalConfig.DIALOG_C03, "c03_井边回忆")
await DialogueManager.dialogue_ended
var was_choosen = ArchiveManager.get_global_value("c03_exited_by_player_choice")
2025-08-07 12:18:54 +00:00
if not was_choosen:
2025-08-08 06:03:10 +00:00
DialogueManager.show_dialogue_balloon(GlobalConfig.DIALOG_C03, "c03_井边回忆_选择")
await DialogueManager.dialogue_ended
2025-08-07 12:18:54 +00:00
$"Sfx井边演出结束".play()
tween = create_tween()
tween.tween_interval(2.5)
tween.tween_property(xchan, "modulate:a", 0.0, 1.5)
DialogueManager.show_dialogue_balloon(GlobalConfig.DIALOG_C03, "c03_井边回忆_结束", [GlobalConfig.DIALOG_IGNORE_INPUT])
await DialogueManager.dialogue_ended
2025-08-13 10:42:05 +00:00
await Util.wait(1.0)
# 如果选择离开,此处不会设置,需要在 GlobalFunctor.c03_final_choose_exit() 中设置
EventManager.set_stage_if_greater("c03_well_show", 2)
2025-08-13 10:42:05 +00:00
EventManager.set_stage_if_greater("handnote_c03_illusion_and_memory", 1)
EventManager.set_stage_if_greater("handnote_c03_the_coming_truth", 1)
SceneManager.unlock_player()
2025-07-29 14:14:54 +00:00
SceneManager.toggle_hud_display(true)
func _on_pre_stage_updated() -> void:
pass
func _on_stage_updated() -> void:
pass