From 644d8bcc3942fd6b551fffd6e12e830e9867281f Mon Sep 17 00:00:00 2001 From: cakipaul Date: Thu, 17 Jul 2025 16:48:40 +0800 Subject: [PATCH] =?UTF-8?q?=E7=90=86=E5=8F=91=E5=BA=97=E6=BC=94=E5=87=BA?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- asset/dialogue/item_description.csv | 1 + asset/dialogue/item_description.dialogue | 1 + manager/scene/scene_manager.gd | 28 +++++++++++++++++++ scene/dialog/balloon.tscn | 1 - scene/effect/dizzy_shader.gd | 9 +++--- scene/effect/dizzy_shader.tscn | 2 +- scene/ground/scene/c03/s03_瞎子理发店.tscn | 25 ++++++++++++++++- .../ground/script/c03/s03_closeup瞎子糕点.gd | 10 ++++++- .../script/c03/s03_closeup瞎子糕点.tscn | 6 ++-- .../script/c03/s03_event_2d癞子剪辫子.gd | 9 ++++-- 10 files changed, 78 insertions(+), 14 deletions(-) diff --git a/asset/dialogue/item_description.csv b/asset/dialogue/item_description.csv index 26e09f7b..0326c07d 100644 --- a/asset/dialogue/item_description.csv +++ b/asset/dialogue/item_description.csv @@ -240,3 +240,4 @@ c03_s02_小蝉寻人启事,?小蝉寻人启事,,,,, c03_s03_获得剪刀纸舌头,?✂️纸人,,,,, c03_s03_桌子,?桌子,,,,, c03_s03_洗头盆,?洗头盆,,,,, +c03_s03_演出结束,?演出结束,刚刚他们?,,,,, diff --git a/asset/dialogue/item_description.dialogue b/asset/dialogue/item_description.dialogue index ea422901..6284f373 100644 --- a/asset/dialogue/item_description.dialogue +++ b/asset/dialogue/item_description.dialogue @@ -324,6 +324,7 @@ ?✂️纸人 [ID:c03_s03_获得剪刀纸舌头] ?桌子 [ID:c03_s03_桌子] ?洗头盆 [ID:c03_s03_洗头盆] +?演出结束,刚刚他们? [ID:] # s04 李癞房间 # s05 肉铺 diff --git a/manager/scene/scene_manager.gd b/manager/scene/scene_manager.gd index 02e26ce1..2ec2365d 100644 --- a/manager/scene/scene_manager.gd +++ b/manager/scene/scene_manager.gd @@ -479,3 +479,31 @@ func black_transition(half_duration := 0.7, wait_time := 0.5) -> void: await get_tree().process_frame get_tree().current_scene.add_child(scene) scene.run_effect(half_duration, wait_time) + + +# dizzy +var dizzy_scene = preload("uid://decfqoe5v0y6n") + + +func dizzy_effect(duration := 3.5, intensity := 1.5, play_animation :=true, play_sfx := true) -> void: + if GlobalConfig.DEBUG: + print("Dizzy effect started with duration:", duration, " and intensity:", intensity) + var dizzy = dizzy_scene.instantiate() + dizzy.name = "DizzyEffect" + get_tree().current_scene.add_child(dizzy) + dizzy.dizzy(duration, intensity) + if play_sfx: + var dizzy_sfx = preload("uid://b8sbtn3l37uh") #红屏 + AudioManager.play_sfx(dizzy_sfx) + if play_animation: + # 4.4s action + await lock_player(0, 17) + unlock_player() + if duration > 4.4: + # dizzy duration - player action + await Util.wait(maxf(duration, 0.001)) # 设置最小等待 + else: + # dizzy duration + await Util.wait(duration + 0.1) # 等待效果结束 + dizzy.queue_free() # 清理节点 + print("Dizzy effect finished and node freed.") diff --git a/scene/dialog/balloon.tscn b/scene/dialog/balloon.tscn index ee9910f9..46a8a640 100644 --- a/scene/dialog/balloon.tscn +++ b/scene/dialog/balloon.tscn @@ -6,7 +6,6 @@ [ext_resource type="Script" uid="uid://bb52rsfwhkxbn" path="res://addons/dialogue_manager/dialogue_responses_menu.gd" id="3_72ixx"] [node name="Balloon" type="CanvasLayer" groups=["balloon"]] -layer = 12 script = ExtResource("1_36de5") metadata/_edit_vertical_guides_ = [-78.0] metadata/_edit_horizontal_guides_ = [276.0] diff --git a/scene/effect/dizzy_shader.gd b/scene/effect/dizzy_shader.gd index 6de1a4d5..c3b54aef 100644 --- a/scene/effect/dizzy_shader.gd +++ b/scene/effect/dizzy_shader.gd @@ -10,14 +10,13 @@ func _ready() -> void: var tween: Tween +# duration 最短 1.5s func dizzy(duration := 3.5, intensity := 1.5) -> void: - if duration < 0.6: - return if tween and tween.is_valid(): tween.kill() show() tween = create_tween() - tween.tween_property(rect.material, "shader_parameter/intensity", intensity, 0.3) - tween.tween_interval(duration - 0.6) - tween.tween_property(rect.material, "shader_parameter/intensity", 0.0, 0.3) + tween.tween_property(rect.material, "shader_parameter/intensity", intensity, 0.5) + tween.tween_interval(maxf(duration - 1.5, 0.01)) + tween.tween_property(rect.material, "shader_parameter/intensity", 0.0, 1.0) tween.finished.connect(hide) diff --git a/scene/effect/dizzy_shader.tscn b/scene/effect/dizzy_shader.tscn index b341cd35..b42084e7 100644 --- a/scene/effect/dizzy_shader.tscn +++ b/scene/effect/dizzy_shader.tscn @@ -16,7 +16,7 @@ layer = 0 visible = false script = ExtResource("1_t0l4c") -[node name="TextureRect" type="TextureRect" parent="."] +[node name="Effect" type="TextureRect" parent="."] visible = false anchors_preset = 15 anchor_right = 1.0 diff --git a/scene/ground/scene/c03/s03_瞎子理发店.tscn b/scene/ground/scene/c03/s03_瞎子理发店.tscn index f3fd9cf0..1801d3ad 100644 --- a/scene/ground/scene/c03/s03_瞎子理发店.tscn +++ b/scene/ground/scene/c03/s03_瞎子理发店.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=21 format=3 uid="uid://bsqt2c061fmin"] +[gd_scene load_steps=22 format=3 uid="uid://bsqt2c061fmin"] [ext_resource type="PackedScene" uid="uid://dayyx4jerj7io" path="res://scene/ground/ground.tscn" id="1_40yjl"] [ext_resource type="Script" uid="uid://cim5bqm2nayls" path="res://scene/ground/scene/c03/s03_瞎子理发店.gd" id="2_irgvj"] @@ -18,6 +18,7 @@ [ext_resource type="SpriteFrames" uid="uid://b0icyhxpj16tv" path="res://asset/art/gif/c02_谢幕演出/c02_谢幕演出_frames.tres" id="11_6ryqd"] [ext_resource type="Script" uid="uid://cphfob11f7atx" path="res://addons/property-inspector/pro_animation_sprite2d/pro_animated_sprite.gd" id="12_15t2b"] [ext_resource type="SpriteFrames" uid="uid://cmvr3lbwe3h7p" path="res://asset/art/gif/c03_特写与游戏动画/c03_特写与游戏动画_frames.tres" id="14_pkhgt"] +[ext_resource type="PackedScene" uid="uid://0sofmhrl358m" path="res://scene/entity/npc.tscn" id="15_pkhgt"] [ext_resource type="Texture2D" uid="uid://cylsq5cvhlp18" path="res://asset/art/tool/point_light.png" id="17_fq03x"] [sub_resource type="AnimationLibrary" id="AnimationLibrary_k01ve"] @@ -92,13 +93,20 @@ position = Vector2(343, 43) sprite_frames = ExtResource("14_pkhgt") animation = &"癞子背坐呼吸" script = ExtResource("12_15t2b") +autostart = false action_configs = Array[Dictionary]([{ "animation_intro": "癞子背坐呼吸", &"animation_next": "癞子背对侧头呼吸", +"animation_wait_time": 0.0, &"intro_loop": 4 }]) metadata/_custom_type_script = "uid://cphfob11f7atx" +[node name="Npc癞子" parent="Ground/DeployLayer/Event2D癞子剪辫子/Pro癞子" instance=ExtResource("15_pkhgt")] +position = Vector2(0, 28) +enabled = false +hook_character_name = "癞子" + [node name="Pro瞎子" type="AnimatedSprite2D" parent="Ground/DeployLayer/Event2D癞子剪辫子"] position = Vector2(377, 48) sprite_frames = ExtResource("11_6ryqd") @@ -115,6 +123,11 @@ move_configs = Array[Dictionary]([{ debug_mov_animation = "方瞎子走路-右" metadata/_custom_type_script = "uid://cphfob11f7atx" +[node name="Npc瞎子" parent="Ground/DeployLayer/Event2D癞子剪辫子/Pro瞎子" instance=ExtResource("15_pkhgt")] +position = Vector2(5, 0) +enabled = false +hook_character_name = "瞎子" + [node name="Pro陆仁" type="AnimatedSprite2D" parent="Ground/DeployLayer/Event2D癞子剪辫子"] position = Vector2(297, 37) sprite_frames = ExtResource("14_pkhgt") @@ -123,6 +136,16 @@ autoplay = "父亲抱小孩" script = ExtResource("12_15t2b") metadata/_custom_type_script = "uid://cphfob11f7atx" +[node name="Npc陆仁" parent="Ground/DeployLayer/Event2D癞子剪辫子/Pro陆仁" instance=ExtResource("15_pkhgt")] +position = Vector2(-5, 8) +enabled = false +hook_character_name = "陆仁" + +[node name="Npc小小小蝶" parent="Ground/DeployLayer/Event2D癞子剪辫子/Pro陆仁" instance=ExtResource("15_pkhgt")] +position = Vector2(12, 14) +enabled = false +hook_character_name = "小小蝶" + [node name="Closeup瞎子糕点" parent="Ground/DeployLayer/Event2D癞子剪辫子" instance=ExtResource("5_d40x1")] unique_name_in_owner = true position = Vector2(357, -213) diff --git a/scene/ground/script/c03/s03_closeup瞎子糕点.gd b/scene/ground/script/c03/s03_closeup瞎子糕点.gd index 8fa91dfc..7065c524 100644 --- a/scene/ground/script/c03/s03_closeup瞎子糕点.gd +++ b/scene/ground/script/c03/s03_closeup瞎子糕点.gd @@ -12,7 +12,15 @@ func _ready() -> void: if not presentation_finished: await $PPTHelper.presentation_finished EventManager.set_stage("c03_s03_laizi_braid", 2) - SceneManager.unlock_player() + # 过渡到玩家画面 + SceneManager.black_transition(0.5, 0.5) + Util.timer(1.8, func(): + SceneManager.dizzy_effect(3.0) + await Util.wait(3.3) + await SceneManager.pop_os_with_str("c03_s03_演出结束") + SceneManager.unlock_player() + ) + await Util.wait(0.6) exit.emit(true) var presentation_finished = false diff --git a/scene/ground/script/c03/s03_closeup瞎子糕点.tscn b/scene/ground/script/c03/s03_closeup瞎子糕点.tscn index 26313690..57ab71d8 100644 --- a/scene/ground/script/c03/s03_closeup瞎子糕点.tscn +++ b/scene/ground/script/c03/s03_closeup瞎子糕点.tscn @@ -28,10 +28,10 @@ ease_in_type = "inout" ease_in_trans_type = "cubic" ease_in_duration = 0.5 ease_out_to_next = true -ease_out_wait_time = 1.0 +ease_out_wait_time = 0.8 ease_out_type = "inout" ease_out_trans_type = "cubic" -ease_out_duration = 0.3 +ease_out_duration = 0.7 [sub_resource type="Resource" id="Resource_va0t0"] script = ExtResource("8_b3tds") @@ -43,7 +43,7 @@ ease_out_to_next = true ease_out_wait_time = 1.5 ease_out_type = "inout" ease_out_trans_type = "cubic" -ease_out_duration = 0.2 +ease_out_duration = 0.0 [sub_resource type="Resource" id="Resource_svuqh"] script = ExtResource("8_b3tds") diff --git a/scene/ground/script/c03/s03_event_2d癞子剪辫子.gd b/scene/ground/script/c03/s03_event_2d癞子剪辫子.gd index d6a2627c..042e7580 100644 --- a/scene/ground/script/c03/s03_event_2d癞子剪辫子.gd +++ b/scene/ground/script/c03/s03_event_2d癞子剪辫子.gd @@ -31,7 +31,11 @@ func start_show() -> void: SceneManager.lock_player() # 隐藏玩家 SceneManager.get_player().visible = false - SceneManager.get_camera_marker().force_offset.x = 50.0 + $"Pro癞子".play("癞子背坐呼吸") + # 镜头靠近 + var camera = SceneManager.get_camera_marker() + camera.focus_node($"Pro癞子") + camera.tween_zoom(1.2, 2.0) # TODO SceneManager.pop_debug_dialog_info("美术&音效", "剪辫子演出") await Util.wait(2.5) @@ -40,6 +44,7 @@ func start_show() -> void: $"Pro瞎子".play("方瞎子走路-右") await Util.wait(2.0) $"Closeup瞎子糕点".display() - SceneManager.get_camera_marker().force_offset.x = 0.0 + # 重置镜头 + SceneManager.focus_player_and_reset_zoom() SceneManager.get_player().visible = true SceneManager.unlock_player()