59 lines
1.5 KiB
GDScript
59 lines
1.5 KiB
GDScript
@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:
|
|
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)
|
|
await Util.wait(3.0)
|
|
var tween = create_tween()
|
|
tween.tween_property(xchan, "modulate:a", 1.0, 1.0)
|
|
await tween.finished
|
|
if not ArchiveManager.get_global_value("has_exited_by_player_choice"):
|
|
DialogueManager.show_dialogue_balloon(GlobalConfig.DIALOG_C03, "c03_井边回忆")
|
|
else:
|
|
DialogueManager.show_dialogue_balloon(GlobalConfig.DIALOG_C03, "c03_井边回忆_无选项")
|
|
await DialogueManager.dialogue_ended
|
|
# 如果选择离开,此处不会设置,需要在 GlobalFunctor.c03_final_choose_exit() 中设置
|
|
EventManager.set_stage_if_greater("c03_well_show", 2)
|
|
create_tween().tween_property(xchan, "modulate:a", 0.0, 0.5)
|
|
await Util.wait(1.0)
|
|
# c02_吕萍_背靠起身
|
|
await player.player_action(19, true)
|
|
SceneManager.unlock_player()
|
|
|
|
|
|
func _on_pre_stage_updated() -> void:
|
|
pass
|
|
|
|
|
|
func _on_stage_updated() -> void:
|
|
pass
|