diff --git a/asset/art/gif/c01_孤儿院围墙/frames.tres b/asset/art/gif/c01_孤儿院围墙/frames.tres index 41ab4549..a5f1080a 100644 --- a/asset/art/gif/c01_孤儿院围墙/frames.tres +++ b/asset/art/gif/c01_孤儿院围墙/frames.tres @@ -112,7 +112,7 @@ animations = [{ "duration": 30.0, "texture": ExtResource("2_gc6kb") }], -"loop": true, +"loop": false, "name": &"【画画小女孩】回头", "speed": 30.0 }, { @@ -129,7 +129,7 @@ animations = [{ "duration": 12.0, "texture": ExtResource("4_td1ff") }], -"loop": true, +"loop": false, "name": &"【画画小女孩】画画", "speed": 30.0 }, { diff --git a/asset/art/gif/c01_孤儿院长廊/frames.tres b/asset/art/gif/c01_孤儿院长廊/frames.tres index 20d61333..3b616173 100644 --- a/asset/art/gif/c01_孤儿院长廊/frames.tres +++ b/asset/art/gif/c01_孤儿院长廊/frames.tres @@ -274,13 +274,13 @@ animations = [{ "duration": 10.5, "texture": ExtResource("49_5qald") }, { -"duration": 10.5, +"duration": 50.0, "texture": ExtResource("50_ndrgc") }, { "duration": 10.5, "texture": ExtResource("51_rtpby") }, { -"duration": 10.5, +"duration": 10.0, "texture": ExtResource("52_yncgy") }], "loop": false, @@ -334,7 +334,7 @@ animations = [{ "duration": 6.0, "texture": ExtResource("64_6j8gg") }, { -"duration": 6.0, +"duration": 30.0, "texture": ExtResource("65_5sckl") }, { "duration": 6.0, diff --git a/scene/entity/ambush.gd b/scene/entity/ambush.gd index 2072a71b..ff88ae20 100644 --- a/scene/entity/ambush.gd +++ b/scene/entity/ambush.gd @@ -31,6 +31,7 @@ var hook_animation = "" if is_node_ready() and Engine.is_editor_hint(): notify_property_list_changed() var hook_dialogue_title = "" +var hook_method = "" var dialogue_c01 = preload("res://asset/dialogue/c01.dialogue") var dialogue_c02 = preload("res://asset/dialogue/c02.dialogue") @@ -128,6 +129,10 @@ func _do_trigger(): SceneManager.freeze_player(0.0) DialogueManager.show_dialogue_balloon(dialogue_res, hook_dialogue_title) DialogueManager.dialogue_ended.connect(_on_dialogue_ended, CONNECT_ONE_SHOT) + if hook_method: + var animation_player = _get_animation_player() + if animation_player: + animation_player.call(hook_method) triggered.emit() if GlobalConfig.DEBUG: print("ambush triggered! name=", name) @@ -147,6 +152,8 @@ func _get(property: StringName) -> Variant: return hook_dialogue_title elif property == "hook_animation": return hook_animation + elif property == "hook_method": + return hook_method return null @@ -157,25 +164,54 @@ func _set(property: StringName, value: Variant) -> bool: elif property == "hook_animation": hook_animation = value return true + elif property == "hook_method": + hook_method = value + return true return false func _get_property_list() -> Array[Dictionary]: - var animation_list: PackedStringArray - var animation_player = _get_animation_player() - if animation_player: - animation_list = animation_player.get_animation_list() + var hint_methods = "" + var hint_animation = "" + if Engine.is_editor_hint(): + var animation_player = _get_animation_player() + if animation_player: + # 更新 hook_animation 的可选项 + var animation_list = animation_player.get_animation_list() + hint_animation = ",".join(animation_list) + # 更新 hook_method 的可选项 + var method_list = animation_player.get_method_list() + var methods = [] + for method in method_list: + if ( + # bit operation + (method.flags == METHOD_FLAG_NORMAL) + # and method.args.size() == method.default_args.size() + and method.args.is_empty() + and not method.name.begins_with("_") + ): + methods.append(method.name) + hint_methods = ",".join(methods) + var hint_dialogue_title = "" + if Engine.is_editor_hint(): + hint_dialogue_title = ",".join(dialogue_res.get_ordered_titles()) return [ { "name": "hook_dialogue_title", "type": TYPE_STRING, "hint": PROPERTY_HINT_ENUM_SUGGESTION, - "hint_string": ",".join(dialogue_res.get_ordered_titles()) + "hint_string": hint_dialogue_title }, { "name": "hook_animation", "type": TYPE_STRING, "hint": PROPERTY_HINT_ENUM_SUGGESTION, - "hint_string": ",".join(animation_list) + "hint_string": hint_animation + }, + { + "name": "hook_method", + "type": TYPE_STRING, + "hint": PROPERTY_HINT_ENUM_SUGGESTION, + "hint_string": hint_methods } ] diff --git a/scene/entity/ambush.tscn b/scene/entity/ambush.tscn index c94e07a2..4627e302 100644 --- a/scene/entity/ambush.tscn +++ b/scene/entity/ambush.tscn @@ -11,9 +11,12 @@ size = Vector2(10, 70) script = ExtResource("1_rxgbr") hook_dialogue_title = "" hook_animation = "" +hook_method = "" [node name="Sign" parent="." instance=ExtResource("2_n51wc")] unique_name_in_owner = true +modulate = Color(1, 1, 1, 0) +display_sign = false [node name="Area2D" type="Area2D" parent="."] unique_name_in_owner = true diff --git a/scene/entity/general/autoplay_animated_sprite.gd b/scene/entity/general/autoplay_animated_sprite.gd new file mode 100644 index 00000000..1033932e --- /dev/null +++ b/scene/entity/general/autoplay_animated_sprite.gd @@ -0,0 +1,84 @@ +@tool +extends AnimatedSprite2D + +@export var autostart := true +@export var state_configs := [] as Array[StateActionConfigResource] +var auto_checkout_dict = { +# intro -> {state_config instance} +} + + +func _ready() -> void: + _load_config() + if Engine.is_editor_hint(): + return + if autostart and animation: + # 制造一点错差 + frame = randi() % sprite_frames.get_frame_count(animation) + play() + animation_finished.connect(_on_animation_finished) + + +func _load_config(): + for i in range(state_configs.size()): + var state_config = state_configs[i] + if sprite_frames and sprite_frames.has_animation(state_config.animation_intro): + # intro 的 animation 关闭循环 + sprite_frames.set_animation_loop(state_config.animation_intro, false) + auto_checkout_dict[state_config.animation_intro] = { + "animation_next": state_config.animation_next, + "animation_wait_time": state_config.animation_wait_time, + "intro_loop": max(1, state_config.intro_loop) + } + + +func _on_animation_finished() -> void: + if auto_checkout_dict.has(animation): + auto_checkout_dict[animation].intro_loop -= 1 + if auto_checkout_dict[animation].intro_loop <= 0: + var wait_time = auto_checkout_dict[animation].animation_wait_time + var next = auto_checkout_dict[animation].animation_next + if wait_time > 0: + pause() + get_tree().create_timer(wait_time).timeout.connect(play.bind(next)) + else: + play(next) + + +# const gif_root_dir = "res://asset/art/gif/" +# var gif_dir: +# set(val): +# gif_dir = val +# # 只在编辑器模式下加载配置 +# if Engine.is_editor_hint() and gif_dir: +# sprite_frames = load(gif_root_dir + gif_dir + "/frames.tres") + + +# func _get(property: StringName) -> Variant: +# if property == "gif_dir": +# return gif_dir +# return null + + +# func _set(property: StringName, value: Variant) -> bool: +# if property == "gif_dir": +# gif_dir = value +# return true +# return false + + +# func _get_property_list() -> Array[Dictionary]: +# # 只在编辑器模式下加载配置 +# var hint_str = "" +# if Engine.is_editor_hint(): +# var dir_access = DirAccess.open(gif_root_dir) as DirAccess +# var dirs = dir_access.get_directories() +# hint_str = ",".join(dirs) +# return [ +# { +# "name": "gif_dir", +# "type": TYPE_STRING, +# "hint": PROPERTY_HINT_ENUM_SUGGESTION, +# "hint_string": hint_str +# } +# ] diff --git a/scene/entity/general/autoplay_animated_sprite.tscn b/scene/entity/general/autoplay_animated_sprite.tscn new file mode 100644 index 00000000..81eddacf --- /dev/null +++ b/scene/entity/general/autoplay_animated_sprite.tscn @@ -0,0 +1,9 @@ +[gd_scene load_steps=3 format=3 uid="uid://b50n0hvs4yh75"] + +[ext_resource type="Script" path="res://scene/entity/general/autoplay_animated_sprite.gd" id="1_21eda"] +[ext_resource type="Script" path="res://scene/entity/general/state_action_res.gd" id="2_pvtjh"] + +[node name="AutoplayAnimatedSprite" type="AnimatedSprite2D"] +script = ExtResource("1_21eda") +state_configs = Array[ExtResource("2_pvtjh")]([]) +gif_dir = "" diff --git a/scene/entity/general/state_action_res.gd b/scene/entity/general/state_action_res.gd new file mode 100644 index 00000000..7518a015 --- /dev/null +++ b/scene/entity/general/state_action_res.gd @@ -0,0 +1,8 @@ +class_name StateActionConfigResource extends Resource + +@export var animation_intro := "" +# intro 播放几次 +@export var intro_loop := 1 +# 这个最好使用延长动画帧最后一帧时长的方式来实现 +@export var animation_wait_time := 0.0 +@export var animation_next := "" diff --git a/scene/entity/interactable.gd b/scene/entity/interactable.gd index b5bc0632..e5f23d3a 100644 --- a/scene/entity/interactable.gd +++ b/scene/entity/interactable.gd @@ -33,7 +33,6 @@ var items: PackedStringArray func _ready() -> void: if Engine.is_editor_hint(): _reload_items() - notify_property_list_changed() return area2d.body_entered.connect(_reset) area2d.body_exited.connect(_on_cancel) @@ -48,6 +47,7 @@ func _ready() -> void: texture = texture_after func _reload_items() -> void: + items.clear() var id = item_config_res.titles["PropItems"] var current_line = item_config_res.lines[id] while current_line: @@ -56,6 +56,7 @@ func _reload_items() -> void: if not current_line.has("next_id") or current_line.next_id == "end": break current_line = item_config_res.lines[current_line.next_id] + notify_property_list_changed() func _reset(_body = null) -> void: diff --git a/scene/entity/local_inspectable.gd b/scene/entity/local_inspectable.gd index 248caae9..48305775 100644 --- a/scene/entity/local_inspectable.gd +++ b/scene/entity/local_inspectable.gd @@ -138,23 +138,23 @@ func _get(property: StringName) -> Variant: return null -func _get_property_list() -> Array[Dictionary]: # only show notes_ properties in editor - if Engine.is_editor_hint() and editor_filter and editor_filter != "none": - var filted_titles = content_dialogue.get_ordered_titles().filter(_filter_property) - return [ - { - "name": "content_key", - "type": TYPE_STRING, - "hint": PROPERTY_HINT_ENUM_SUGGESTION, - "hint_string": ",".join(filted_titles) - } - ] +func _get_property_list() -> Array[Dictionary]: + var titles = "" + # only show notes_ properties in editor + if Engine.is_editor_hint(): + var ordered_titles = content_dialogue.get_ordered_titles() + if editor_filter and editor_filter != "none": + var filted_titles = ordered_titles.filter(_filter_property) + if filted_titles.size() > 0: + titles = ",".join(filted_titles) + else: + titles = ",".join(ordered_titles) return [ { "name": "content_key", "type": TYPE_STRING, "hint": PROPERTY_HINT_ENUM_SUGGESTION, - "hint_string": ",".join(content_dialogue.get_ordered_titles()) + "hint_string": titles } ] diff --git a/scene/entity/note.gd b/scene/entity/note.gd index a59a1f9e..c5066cf3 100644 --- a/scene/entity/note.gd +++ b/scene/entity/note.gd @@ -122,23 +122,24 @@ func _get(property: StringName) -> Variant: func _get_property_list() -> Array[Dictionary]: # only show notes_ properties in editor var titles = "" - var title_arr = [] - if dialogue == "items": - var id = dialogue_items.titles["Notes"] - var current_line = dialogue_items.lines[id] - while current_line: - if current_line.has("translation_key"): - title_arr.append(current_line.translation_key) - if not current_line.has("next_id") or current_line.next_id == "end": - break - current_line = dialogue_items.lines[current_line.next_id] - else: - title_arr = dialogue_res.get_ordered_titles() - if Engine.is_editor_hint() and title_filter and title_filter != "none": - var filted_titles = title_arr.filter(_filter_property) - titles = ",".join(filted_titles) - else: - titles = ",".join(title_arr) + if Engine.is_editor_hint(): + var title_arr = [] + if dialogue == "items": + var id = dialogue_items.titles["Notes"] + var current_line = dialogue_items.lines[id] + while current_line: + if current_line.has("translation_key"): + title_arr.append(current_line.translation_key) + if not current_line.has("next_id") or current_line.next_id == "end": + break + current_line = dialogue_items.lines[current_line.next_id] + else: + title_arr = dialogue_res.get_ordered_titles() + if title_filter and title_filter != "none": + var filted_titles = title_arr.filter(_filter_property) + titles = ",".join(filted_titles) + else: + titles = ",".join(title_arr) return [ { "name": "note_key", diff --git a/scene/entity/npc.gd b/scene/entity/npc.gd index 27b6fd6b..fbe8f1f2 100644 --- a/scene/entity/npc.gd +++ b/scene/entity/npc.gd @@ -74,11 +74,14 @@ func _set(property: StringName, value: Variant) -> bool: func _get_property_list() -> Array[Dictionary]: + var hint_str = "" + if Engine.is_editor_hint(): + hint_str = ",".join(dialogue_res.get_ordered_titles()) return [ { "name": "dialogue_title", "type": TYPE_STRING, "hint": PROPERTY_HINT_ENUM_SUGGESTION, - "hint_string": ",".join(dialogue_res.get_ordered_titles()) + "hint_string": hint_str } ] diff --git a/scene/ground/camera/camera_focus_marker.gd b/scene/ground/camera/camera_focus_marker.gd index 968da4a7..879a3c43 100644 --- a/scene/ground/camera/camera_focus_marker.gd +++ b/scene/ground/camera/camera_focus_marker.gd @@ -30,6 +30,12 @@ var zooming_and_focus_progress := 1.0 func _ready() -> void: if not focusing_node: push_error("Focusing node not found") + reset_position_immediately() + + +func _enter_tree() -> void: + if is_node_ready(): + reset_position_immediately() func reset_position_immediately(): diff --git a/scene/ground/ground.tscn b/scene/ground/ground.tscn index 945ea00f..4b460b5a 100644 --- a/scene/ground/ground.tscn +++ b/scene/ground/ground.tscn @@ -58,15 +58,6 @@ camera_marker = NodePath("../CameraFocusMarker") unique_name_in_owner = true position = Vector2(26, 88) focusing_node = NodePath("../MainPlayer") -force_offset = null -lock_horizontal = null -speed = null -half_screen_size = null -shaded_height = null -shake_enabled = null -shake_strength = null -shake_recovery_speed = null -zoom_ratio = null [node name="ParallaxForeground" type="ParallaxBackground" parent="."] unique_name_in_owner = true diff --git a/scene/ground/scene/c01/s05_院长房间.tscn b/scene/ground/scene/c01/s05_院长房间.tscn index 23a4195d..a0ec7d54 100644 --- a/scene/ground/scene/c01/s05_院长房间.tscn +++ b/scene/ground/scene/c01/s05_院长房间.tscn @@ -648,6 +648,7 @@ position = Vector2(270, 23.5) texture = ExtResource("12_jtglg") trigger_mode = "interact" hook_animation = "使用鸡毛掸子" +hook_method = null [node name="使用鸡毛掸子" type="AnimatedSprite2D" parent="Ground/DeployLayer" index="7"] visible = false @@ -724,6 +725,13 @@ character = "小小蝶" [node name="CameraFocusMarker" parent="Ground" index="6"] force_offset = Vector2(0, 0) +lock_horizontal = true +speed = 5.0 +half_screen_size = Vector2(282, 120) +shaded_height = 38 +shake_enabled = false +shake_strength = 2.0 +shake_recovery_speed = 8.0 zoom_ratio = 1.0 [node name="FGSprite2D" parent="Ground/ParallaxForeground/FGParallaxLayer" index="0"] diff --git a/scene/ground/scene/c01/s06_animation.gd b/scene/ground/scene/c01/s06_animation.gd index e41123f3..9ab86a4c 100644 --- a/scene/ground/scene/c01/s06_animation.gd +++ b/scene/ground/scene/c01/s06_animation.gd @@ -16,10 +16,12 @@ func _ready() -> void: var dean var red_girl +var drawing_kids func _on_ground_ready() -> void: dean = $"../ParallaxForeground/BGParallaxLayer/门口_院长" red_girl = $"../ParallaxForeground/BGParallaxLayer/门口_红衣姑娘" + drawing_kids = $"../DeployLayer/drawing_kids" # 院长翻书 var timer = Timer.new() timer.set_wait_time(5.0) @@ -29,6 +31,11 @@ func _on_ground_ready() -> void: timer.timeout.connect(_dean_flip_book) +func play_drawing() -> void: + for c in drawing_kids.get_children(): + if c is AnimatedSprite2D: + c.play(c.name + "画画") + func _dean_flip_book() -> void: if dean.animation == "院长呼吸": # 翻书后会自动播放呼吸动画 diff --git a/scene/ground/scene/c01/s06_孤儿院长廊围墙.tscn b/scene/ground/scene/c01/s06_孤儿院长廊围墙.tscn index ae1c907b..aa4d9c26 100644 --- a/scene/ground/scene/c01/s06_孤儿院长廊围墙.tscn +++ b/scene/ground/scene/c01/s06_孤儿院长廊围墙.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=16 format=3 uid="uid://bx16c8nn32f40"] +[gd_scene load_steps=30 format=3 uid="uid://bx16c8nn32f40"] [ext_resource type="PackedScene" uid="uid://dayyx4jerj7io" path="res://scene/ground/ground.tscn" id="1_bitx7"] [ext_resource type="Script" path="res://scene/ground/scene/c01/s06_animation.gd" id="2_fkfhi"] @@ -9,8 +9,9 @@ [ext_resource type="SpriteFrames" uid="uid://cemn2bnebsfko" path="res://asset/art/scene/c01/s06_孤儿院长廊围墙/全局参考.gif" id="4_8hecq"] [ext_resource type="Texture2D" uid="uid://bllt2wycchkp2" path="res://asset/art/scene/c01/s06_孤儿院长廊围墙/e_红柱子.png" id="4_dtycx"] [ext_resource type="PackedScene" uid="uid://cpc5037mesjl7" path="res://scene/ground/script/c01/s06_踢球男孩.tscn" id="5_erliv"] -[ext_resource type="Script" path="res://scene/ground/script/general/autoplay_animated_sprite.gd" id="6_4o4lo"] [ext_resource type="SpriteFrames" uid="uid://c6okvaeemoodq" path="res://asset/art/gif/c01_孤儿院围墙/frames.tres" id="7_dsj2r"] +[ext_resource type="Script" path="res://scene/entity/general/state_action_res.gd" id="9_lg0nw"] +[ext_resource type="PackedScene" uid="uid://b50n0hvs4yh75" path="res://scene/entity/general/autoplay_animated_sprite.tscn" id="9_on7ga"] [ext_resource type="PackedScene" uid="uid://bnf3lkcbpx1ar" path="res://scene/entity/ambush.tscn" id="11_tudob"] [sub_resource type="Animation" id="Animation_723yg"] @@ -40,7 +41,7 @@ tracks/1/path = NodePath("ParallaxForeground/BGParallaxLayer/门口_红衣姑娘 tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/keys = { -"times": PackedFloat32Array(0), +"times": PackedFloat32Array(0.0333333), "transitions": PackedFloat32Array(1), "values": [{ "args": [&"红衣姑娘抬头", 1.0, false], @@ -54,6 +55,94 @@ _data = { "门口_观望": SubResource("Animation_2113b") } +[sub_resource type="Resource" id="Resource_g8vrg"] +script = ExtResource("9_lg0nw") +animation_intro = "【画画小女孩】回头" +intro_loop = 1 +animation_wait_time = 0.0 +animation_next = "【画画小女孩】呼吸" + +[sub_resource type="Resource" id="Resource_nivp4"] +script = ExtResource("9_lg0nw") +animation_intro = "【画画小女孩】画画" +intro_loop = 1 +animation_wait_time = 2.0 +animation_next = "【画画小女孩】呼吸" + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_600pb"] +resource_local_to_scene = true +size = Vector2(100, 70) + +[sub_resource type="Resource" id="Resource_yc62b"] +script = ExtResource("9_lg0nw") +animation_intro = "【画画男孩-1】画画" +intro_loop = 2 +animation_wait_time = 0.0 +animation_next = "【画画男孩-1】呼吸" + +[sub_resource type="Resource" id="Resource_ls4y8"] +script = ExtResource("9_lg0nw") +animation_intro = "【画画男孩-2】画画" +intro_loop = 2 +animation_wait_time = 0.0 +animation_next = "【画画男孩-2】呼吸" + +[sub_resource type="Resource" id="Resource_0muca"] +script = ExtResource("9_lg0nw") +animation_intro = "【站立小孩-1】挠痒呼吸" +intro_loop = 1 +animation_wait_time = 0.0 +animation_next = "【站立小孩-1】侧面呼吸" + +[sub_resource type="Resource" id="Resource_unrl6"] +script = ExtResource("9_lg0nw") +animation_intro = "【站立小孩-2】转身" +intro_loop = 1 +animation_wait_time = 0.0 +animation_next = "【站立小孩-3】侧面呼吸" + +[sub_resource type="Resource" id="Resource_7sdb8"] +script = ExtResource("9_lg0nw") +animation_intro = "【站立小孩-3】转身" +intro_loop = 1 +animation_wait_time = 0.0 +animation_next = "【站立小孩-3】走路" + +[sub_resource type="Resource" id="Resource_wae3q"] +script = ExtResource("9_lg0nw") +animation_intro = "【胖小孩背着残疾小孩】-画画" +intro_loop = 2 +animation_wait_time = 0.0 +animation_next = "【胖小孩背着残疾小孩】-呼吸" + +[sub_resource type="Resource" id="Resource_1yioc"] +script = ExtResource("9_lg0nw") +animation_intro = "【胖小孩背着残疾小孩】-正面抖肩" +intro_loop = 1 +animation_wait_time = 0.0 +animation_next = "【胖小孩背着残疾小孩】-正面呼吸" + +[sub_resource type="Resource" id="Resource_iyt0p"] +script = ExtResource("9_lg0nw") +animation_intro = "红衣姑娘抬头" +intro_loop = 1 +animation_wait_time = 0.0 +animation_next = "红衣姑娘呼吸" + +[sub_resource type="Resource" id="Resource_y85tj"] +script = ExtResource("9_lg0nw") +animation_intro = "院长翻书" +intro_loop = 1 +animation_wait_time = 0.0 +animation_next = "院长呼吸" + +[sub_resource type="Resource" id="Resource_yvgum"] +script = ExtResource("9_lg0nw") +animation_intro = "院长抬头" +intro_loop = 1 +animation_wait_time = 0.0 +animation_next = "院长呼吸" + [node name="S06" type="Node2D"] metadata/_edit_horizontal_guides_ = [158.0, 88.0] @@ -92,67 +181,78 @@ position = Vector2(299, 42) one_shot = false freeze_time = 3.0 hook_animation = "门口_观望" +hook_method = null [node name="踢球男孩" parent="Ground/DeployLayer" index="3" instance=ExtResource("5_erliv")] position = Vector2(535, -3) range_x = 450.0 speed = 90.0 -[node name="跷跷板" type="AnimatedSprite2D" parent="Ground/DeployLayer" index="4"] -position = Vector2(1358.5, -0.5) -sprite_frames = ExtResource("2_l4axy") -animation = &"跷跷板" -script = ExtResource("6_4o4lo") - -[node name="秋千" type="AnimatedSprite2D" parent="Ground/DeployLayer" index="5"] -position = Vector2(1241.5, -0.5) +[node name="秋千" parent="Ground/DeployLayer" index="4" instance=ExtResource("9_on7ga")] +position = Vector2(1241, -1) sprite_frames = ExtResource("2_l4axy") animation = &"秋千" -frame = 6 -frame_progress = 0.530616 -script = ExtResource("6_4o4lo") +state_configs = Array[ExtResource("9_lg0nw")]([SubResource("Resource_g8vrg"), SubResource("Resource_nivp4")]) -[node name="围墙_画画小女孩" type="AnimatedSprite2D" parent="Ground/DeployLayer" index="6"] -position = Vector2(1593, 2) +[node name="跷跷板" parent="Ground/DeployLayer" index="5" instance=ExtResource("9_on7ga")] +position = Vector2(1358, 0) +sprite_frames = ExtResource("2_l4axy") +animation = &"跷跷板" +state_configs = Array[ExtResource("9_lg0nw")]([SubResource("Resource_g8vrg"), SubResource("Resource_nivp4")]) + +[node name="drawing_ambush" parent="Ground/DeployLayer" index="6" instance=ExtResource("11_tudob")] +position = Vector2(1615, 44) +one_shot = false +hook_method = "play_drawing" + +[node name="CollisionShape2D" parent="Ground/DeployLayer/drawing_ambush/Area2D" index="0"] +position = Vector2(13, 1) +shape = SubResource("RectangleShape2D_600pb") + +[node name="drawing_kids" type="Node2D" parent="Ground/DeployLayer" index="7"] +position = Vector2(0, -1) + +[node name="【画画小女孩】" parent="Ground/DeployLayer/drawing_kids" instance=ExtResource("9_on7ga")] +position = Vector2(1593, 3) sprite_frames = ExtResource("7_dsj2r") animation = &"【画画小女孩】呼吸" -script = ExtResource("6_4o4lo") +state_configs = Array[ExtResource("9_lg0nw")]([SubResource("Resource_g8vrg"), SubResource("Resource_nivp4")]) -[node name="围墙_画画男孩1" type="AnimatedSprite2D" parent="Ground/DeployLayer" index="7"] -position = Vector2(1638, 2) +[node name="【画画男孩-1】" parent="Ground/DeployLayer/drawing_kids" instance=ExtResource("9_on7ga")] +position = Vector2(1638, 3) sprite_frames = ExtResource("7_dsj2r") animation = &"【画画男孩-1】呼吸" -script = ExtResource("6_4o4lo") +state_configs = Array[ExtResource("9_lg0nw")]([SubResource("Resource_yc62b")]) -[node name="围墙_画画男孩2" type="AnimatedSprite2D" parent="Ground/DeployLayer" index="8"] +[node name="【画画男孩-2】" parent="Ground/DeployLayer/drawing_kids" instance=ExtResource("9_on7ga")] position = Vector2(1666, 2) sprite_frames = ExtResource("7_dsj2r") animation = &"【画画男孩-2】呼吸" -script = ExtResource("6_4o4lo") +state_configs = Array[ExtResource("9_lg0nw")]([SubResource("Resource_ls4y8")]) -[node name="围墙_站立小孩1" type="AnimatedSprite2D" parent="Ground/DeployLayer" index="9"] +[node name="围墙_站立小孩1" parent="Ground/DeployLayer" index="8" instance=ExtResource("9_on7ga")] position = Vector2(1485, -6) sprite_frames = ExtResource("7_dsj2r") animation = &"【站立小孩-1】侧面呼吸" -script = ExtResource("6_4o4lo") +state_configs = Array[ExtResource("9_lg0nw")]([SubResource("Resource_0muca")]) -[node name="围墙_站立小孩2" type="AnimatedSprite2D" parent="Ground/DeployLayer" index="10"] -position = Vector2(1513, -5) +[node name="围墙_站立小孩2" parent="Ground/DeployLayer" index="9" instance=ExtResource("9_on7ga")] +position = Vector2(1513, -6) sprite_frames = ExtResource("7_dsj2r") animation = &"【站立小孩-2】呼吸" -script = ExtResource("6_4o4lo") +state_configs = Array[ExtResource("9_lg0nw")]([SubResource("Resource_unrl6")]) -[node name="围墙_站立小孩3" type="AnimatedSprite2D" parent="Ground/DeployLayer" index="11"] +[node name="围墙_站立小孩3" parent="Ground/DeployLayer" index="10" instance=ExtResource("9_on7ga")] position = Vector2(1535, -5) sprite_frames = ExtResource("7_dsj2r") animation = &"【站立小孩-3】呼吸" -script = ExtResource("6_4o4lo") +state_configs = Array[ExtResource("9_lg0nw")]([SubResource("Resource_7sdb8")]) -[node name="围墙_胖小孩背着残疾小孩" type="AnimatedSprite2D" parent="Ground/DeployLayer" index="12"] +[node name="围墙_胖小孩背着残疾小孩" parent="Ground/DeployLayer" index="11" instance=ExtResource("9_on7ga")] position = Vector2(1714, 6) sprite_frames = ExtResource("7_dsj2r") animation = &"【胖小孩背着残疾小孩】-呼吸" -script = ExtResource("6_4o4lo") +state_configs = Array[ExtResource("9_lg0nw")]([SubResource("Resource_wae3q"), SubResource("Resource_1yioc")]) [node name="PointLight2D" type="PointLight2D" parent="Ground/AmbientLayer" index="0"] energy = 0.6 @@ -170,49 +270,38 @@ texture = ExtResource("4_dtycx") centered = false offset = Vector2(0, -153) -[node name="门口_中蓝衣小孩" type="AnimatedSprite2D" parent="Ground/ParallaxForeground/BGParallaxLayer" index="1"] -position = Vector2(377.5, -1.5) +[node name="门口_中蓝衣小孩" parent="Ground/ParallaxForeground/BGParallaxLayer" index="1" instance=ExtResource("9_on7ga")] +position = Vector2(377, -1) sprite_frames = ExtResource("2_l4axy") animation = &"中蓝衣小孩呼吸" -script = ExtResource("6_4o4lo") -[node name="门口_右绿衣男孩" type="AnimatedSprite2D" parent="Ground/ParallaxForeground/BGParallaxLayer" index="2"] -position = Vector2(408.5, 0.5) +[node name="门口_右绿衣男孩" parent="Ground/ParallaxForeground/BGParallaxLayer" index="2" instance=ExtResource("9_on7ga")] +position = Vector2(408, 1) sprite_frames = ExtResource("2_l4axy") animation = &"右绿衣男孩呼吸" -script = ExtResource("6_4o4lo") -[node name="门口_左2黄衣男" type="AnimatedSprite2D" parent="Ground/ParallaxForeground/BGParallaxLayer" index="3"] -position = Vector2(269.5, -1.5) +[node name="门口_左2黄衣男" parent="Ground/ParallaxForeground/BGParallaxLayer" index="3" instance=ExtResource("9_on7ga")] +position = Vector2(269, 0) sprite_frames = ExtResource("2_l4axy") animation = &"左2黄衣男呼吸" -script = ExtResource("6_4o4lo") -[node name="门口_左一绿衣男" type="AnimatedSprite2D" parent="Ground/ParallaxForeground/BGParallaxLayer" index="4"] -position = Vector2(426.5, -0.5) +[node name="门口_左一绿衣男" parent="Ground/ParallaxForeground/BGParallaxLayer" index="4" instance=ExtResource("9_on7ga")] +position = Vector2(230, 37) sprite_frames = ExtResource("2_l4axy") animation = &"左一绿衣男呼吸" -script = ExtResource("6_4o4lo") +flip_h = true -[node name="门口_红衣姑娘" type="AnimatedSprite2D" parent="Ground/ParallaxForeground/BGParallaxLayer" index="5"] -light_mask = 0 -position = Vector2(334, -2) +[node name="门口_红衣姑娘" parent="Ground/ParallaxForeground/BGParallaxLayer" index="5" instance=ExtResource("9_on7ga")] +position = Vector2(333, 0) sprite_frames = ExtResource("2_l4axy") animation = &"红衣姑娘呼吸" -script = ExtResource("6_4o4lo") -auto_checkout_dict = { -"红衣姑娘抬头": "红衣姑娘呼吸" -} +state_configs = Array[ExtResource("9_lg0nw")]([SubResource("Resource_iyt0p")]) -[node name="门口_院长" type="AnimatedSprite2D" parent="Ground/ParallaxForeground/BGParallaxLayer" index="6"] -position = Vector2(301.5, -1.5) +[node name="门口_院长" parent="Ground/ParallaxForeground/BGParallaxLayer" index="6" instance=ExtResource("9_on7ga")] +position = Vector2(301, -1) sprite_frames = ExtResource("2_l4axy") animation = &"院长呼吸" -script = ExtResource("6_4o4lo") -auto_checkout_dict = { -"院长抬头": "院长呼吸", -"院长翻书": "院长呼吸" -} +state_configs = Array[ExtResource("9_lg0nw")]([SubResource("Resource_y85tj"), SubResource("Resource_yvgum")]) [node name="FGSprite2D" parent="Ground/ParallaxForeground/FGParallaxLayer" index="0"] texture = null @@ -237,3 +326,4 @@ centered = false offset = Vector2(0, -159) [editable path="Ground"] +[editable path="Ground/DeployLayer/drawing_ambush"] diff --git a/scene/ground/scene/c02/s01_街道.tscn b/scene/ground/scene/c02/s01_街道.tscn index f3b5ca31..67a7721d 100644 --- a/scene/ground/scene/c02/s01_街道.tscn +++ b/scene/ground/scene/c02/s01_街道.tscn @@ -37,6 +37,7 @@ dialogue = "c02" [node name="Ambush" parent="Ground/DeployLayer" index="4" instance=ExtResource("6_vgxa0")] position = Vector2(135, 56) +hook_method = null [node name="MainPlayer" parent="Ground" index="5"] position = Vector2(78, 88) diff --git a/scene/ground/scene/c02/s02_走道.tscn b/scene/ground/scene/c02/s02_走道.tscn index 318a97fd..f559736a 100644 --- a/scene/ground/scene/c02/s02_走道.tscn +++ b/scene/ground/scene/c02/s02_走道.tscn @@ -96,6 +96,17 @@ shape = SubResource("RectangleShape2D_vc6i4") [node name="MainPlayer" parent="Ground" index="5"] position = Vector2(26, 98) +[node name="CameraFocusMarker" parent="Ground" index="6"] +force_offset = Vector2(0, 0) +lock_horizontal = true +speed = 5.0 +half_screen_size = Vector2(282, 120) +shaded_height = 38 +shake_enabled = false +shake_strength = 2.0 +shake_recovery_speed = 8.0 +zoom_ratio = 1.0 + [node name="FGSprite2D" parent="Ground/ParallaxForeground/FGParallaxLayer" index="0"] texture = null diff --git a/scene/ground/script/general/animated_sprite_state_machine.gd b/scene/ground/script/general/animated_sprite_state_machine.gd deleted file mode 100644 index 2f317f6f..00000000 --- a/scene/ground/script/general/animated_sprite_state_machine.gd +++ /dev/null @@ -1,11 +0,0 @@ -extends AnimatedSprite2D - -var animation_state_dict = { -} - -func _ready() -> void: - if animation: - play(animation) - - - diff --git a/scene/ground/script/general/autoplay_animated_sprite.gd b/scene/ground/script/general/autoplay_animated_sprite.gd deleted file mode 100644 index ae90d795..00000000 --- a/scene/ground/script/general/autoplay_animated_sprite.gd +++ /dev/null @@ -1,19 +0,0 @@ -extends AnimatedSprite2D - -# from - to -@export var auto_checkout_dict = {} - - -func _ready() -> void: - if animation: - # 制造一点错差 - frame = randi() % sprite_frames.get_frame_count(animation) - play() - animation_finished.connect(_on_animation_finished) - - -func _on_animation_finished() -> void: - if auto_checkout_dict.has(animation): - var next_animation = auto_checkout_dict[animation] - if next_animation: - play(next_animation) diff --git a/scene/ground/script/general/state_action_res.gd b/scene/ground/script/general/state_action_res.gd deleted file mode 100644 index 66d312d9..00000000 --- a/scene/ground/script/general/state_action_res.gd +++ /dev/null @@ -1,6 +0,0 @@ -class_name StateActionConfigResource extends Resource - -@export var action_name := "" -@export var animation_begin := "" -@export var animation_mid := "" -@export var animation_end := ""