2025-01-29 14:05:27 +00:00
|
|
|
|
@tool
|
|
|
|
|
extends AnimationRoot
|
|
|
|
|
|
|
|
|
|
var footstep_sfx: Sfx
|
|
|
|
|
var chapter_sfx: Sfx
|
|
|
|
|
var main_character: AnimatedSprite2D
|
|
|
|
|
# 2:33 ~ 3:44, 71s
|
|
|
|
|
var duration := 67.0
|
2025-03-18 14:19:39 +00:00
|
|
|
|
var target_x := 10750.0
|
2025-01-29 14:05:27 +00:00
|
|
|
|
var building_duration := 30.0
|
|
|
|
|
var building_y := 450.0
|
|
|
|
|
|
|
|
|
|
var title_1 = preload("res://asset/art/scene/c01/s04_旧版序章/f_动画字幕1.png")
|
|
|
|
|
var title_2 = preload("res://asset/art/scene/c01/s04_旧版序章/f_动画字幕2.png")
|
|
|
|
|
var title_3 = preload("res://asset/art/scene/c01/s04_旧版序章/f_动画字幕3.png")
|
|
|
|
|
var chapter_title = preload("res://asset/art/scene/c01/s04_旧版序章/f_第一章标题.png")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 覆盖该方法
|
|
|
|
|
func _default_data() -> Dictionary:
|
|
|
|
|
return {}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _ready() -> void:
|
|
|
|
|
super._ready()
|
|
|
|
|
if Engine.is_editor_hint():
|
|
|
|
|
return
|
2025-01-30 12:04:02 +00:00
|
|
|
|
|
2025-01-29 14:05:27 +00:00
|
|
|
|
|
|
|
|
|
func _on_ground_ready() -> void:
|
|
|
|
|
main_character = $"../DeployLayer/车夫与吕萍"
|
|
|
|
|
footstep_sfx = $"黄包车Sfx"
|
|
|
|
|
chapter_sfx = $chapter_sfx
|
|
|
|
|
SceneManager.get_camera_marker().limit_bottom = 158
|
|
|
|
|
SceneManager.get_camera_marker().limit_top = -158
|
2025-03-18 14:19:39 +00:00
|
|
|
|
SceneManager.set_camera_boundary(Rect2(0, -1000, 11360, 1158))
|
2025-03-17 14:12:53 +00:00
|
|
|
|
# 相机抖动
|
2025-03-18 14:19:39 +00:00
|
|
|
|
get_tree().create_timer(0.5).timeout.connect(SceneManager.get_camera_marker().shake_camera)
|
|
|
|
|
play("intro")
|
|
|
|
|
|
2025-01-29 14:05:27 +00:00
|
|
|
|
# ## test 测试最后运镜 ##
|
|
|
|
|
# main_character.global_position.x = target_x
|
2025-03-18 14:19:39 +00:00
|
|
|
|
# await get_tree().create_timer(1.0).timeout
|
|
|
|
|
# _on_finished()
|
2025-01-29 14:05:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func pop_title_1():
|
|
|
|
|
SceneManager.pop_center_texture(title_1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func pop_title_2():
|
|
|
|
|
SceneManager.pop_center_texture(title_2)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func pop_title_3():
|
|
|
|
|
SceneManager.pop_center_texture(title_3)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 又是这个梦.. 12句
|
|
|
|
|
func dialog1() -> void:
|
2025-01-30 12:04:02 +00:00
|
|
|
|
# debug 模式允许跳过
|
|
|
|
|
if GlobalConfig.DEBUG:
|
|
|
|
|
DialogueManager.show_dialogue_balloon(dialogue_c01, "c01_s11_车夫对话1")
|
|
|
|
|
else:
|
|
|
|
|
DialogueManager.show_dialogue_balloon(
|
|
|
|
|
dialogue_c01, "c01_s11_车夫对话1", [GlobalConfig.DIALOG_IGNORE_INPUT]
|
|
|
|
|
)
|
2025-01-29 14:05:27 +00:00
|
|
|
|
DialogueManager.dialogue_ended.connect(_start_running, CONNECT_ONE_SHOT)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _start_running(_res = null):
|
2025-03-09 14:01:51 +00:00
|
|
|
|
main_character.play("车夫跑")
|
2025-01-29 14:05:27 +00:00
|
|
|
|
footstep_sfx.play()
|
|
|
|
|
footstep_sfx.finished.connect(_loop_sfx)
|
|
|
|
|
var tween = create_tween()
|
|
|
|
|
tween.tween_property(main_character, "global_position:x", target_x, duration)
|
|
|
|
|
tween.tween_callback(_on_finished)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _loop_sfx():
|
|
|
|
|
footstep_sfx.play()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 车夫: “小姐,你这是回家过年是哇?”
|
|
|
|
|
# 车夫: “啊?不会是工作吧”
|
|
|
|
|
func dialog2() -> void:
|
2025-01-30 12:04:02 +00:00
|
|
|
|
DialogueManager.show_dialogue_balloon(
|
|
|
|
|
dialogue_c01, "c01_s11_车夫对话2", [GlobalConfig.DIALOG_IGNORE_INPUT]
|
|
|
|
|
)
|
2025-01-29 14:05:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 6句
|
|
|
|
|
# 车夫: “这不行的,你这小年夜还要安排工作啊”
|
|
|
|
|
# 吕萍: “......”
|
|
|
|
|
func dialog3() -> void:
|
2025-01-30 12:04:02 +00:00
|
|
|
|
DialogueManager.show_dialogue_balloon(
|
|
|
|
|
dialogue_c01, "c01_s11_车夫对话3", [GlobalConfig.DIALOG_IGNORE_INPUT]
|
|
|
|
|
)
|
2025-01-29 14:05:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _on_finished():
|
2025-03-18 14:19:39 +00:00
|
|
|
|
var camera = SceneManager.get_camera_marker()
|
2025-01-29 14:05:27 +00:00
|
|
|
|
footstep_sfx.stop()
|
|
|
|
|
# 吕萍: “是到了吗,师傅”
|
|
|
|
|
# 车夫: “到了,芦昌路26弄3号,就是这里”
|
|
|
|
|
# 6句
|
|
|
|
|
# 车夫: “嗯,钱正好,那么我先跑了”
|
2025-01-30 12:04:02 +00:00
|
|
|
|
DialogueManager.show_dialogue_balloon(
|
|
|
|
|
dialogue_c01, "c01_s11_车夫对话4", [GlobalConfig.DIALOG_IGNORE_INPUT]
|
|
|
|
|
)
|
2025-01-29 14:05:27 +00:00
|
|
|
|
# 运镜 marker
|
|
|
|
|
var marker = Node2D.new()
|
|
|
|
|
get_parent().add_child(marker)
|
2025-03-12 10:43:02 +00:00
|
|
|
|
main_character.play("车夫静止")
|
2025-01-29 14:05:27 +00:00
|
|
|
|
marker.global_position = main_character.global_position
|
|
|
|
|
var target_y = marker.global_position.y - building_y
|
2025-03-12 10:43:02 +00:00
|
|
|
|
camera.focus_node(marker, 0.0)
|
2025-01-29 14:05:27 +00:00
|
|
|
|
# 运镜,上下打量公寓楼
|
|
|
|
|
var tween = create_tween()
|
|
|
|
|
tween.tween_interval(3.0)
|
|
|
|
|
tween.tween_callback(camera.tween_zoom.bind(0.7, 3.0))
|
|
|
|
|
tween.tween_property(marker, "global_position:y", target_y, building_duration)
|
|
|
|
|
tween.tween_callback(_show_chapter)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 展示章节转场
|
|
|
|
|
func _show_chapter():
|
|
|
|
|
chapter_sfx.play()
|
|
|
|
|
SceneManager.pop_center_texture(chapter_title)
|
|
|
|
|
get_tree().create_timer(3.5).timeout.connect(_transition)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _transition():
|
2025-02-04 13:30:43 +00:00
|
|
|
|
SceneManager.get_ground_loader().transition_to_scene("c02_s01", "left")
|