diff --git a/asset/art/gif/c02_盒子猫/c02_盒子猫_frames.tres b/asset/art/gif/c02_盒子猫/c02_盒子猫_frames.tres index 8076fc7f..9430968a 100644 --- a/asset/art/gif/c02_盒子猫/c02_盒子猫_frames.tres +++ b/asset/art/gif/c02_盒子猫/c02_盒子猫_frames.tres @@ -78,13 +78,13 @@ [resource] animations = [{ "frames": [{ -"duration": 30.0, +"duration": 15.0, "texture": ExtResource("1_g47xo") }, { -"duration": 30.0, +"duration": 15.0, "texture": ExtResource("2_3lx3k") }], -"loop": true, +"loop": false, "name": &"猪头怪呼吸", "speed": 30.0 }, { @@ -155,12 +155,65 @@ animations = [{ "duration": 30.0, "texture": ExtResource("24_6cnpw") }], -"loop": true, +"loop": false, "name": &"猪头怪抓盒子猫", "speed": 30.0 }, { "frames": [{ "duration": 6.0, +"texture": ExtResource("9_3b7wk") +}, { +"duration": 6.0, +"texture": ExtResource("10_lvj16") +}, { +"duration": 15.0, +"texture": ExtResource("11_ty3yp") +}, { +"duration": 15.0, +"texture": ExtResource("12_x3isd") +}, { +"duration": 15.0, +"texture": ExtResource("13_hwoj5") +}, { +"duration": 6.0, +"texture": ExtResource("14_n6lou") +}, { +"duration": 6.0, +"texture": ExtResource("15_6p0ya") +}, { +"duration": 30.0, +"texture": ExtResource("16_uxs1n") +}, { +"duration": 6.0, +"texture": ExtResource("17_rdknj") +}, { +"duration": 6.0, +"texture": ExtResource("18_c28wc") +}, { +"duration": 6.0, +"texture": ExtResource("19_eo0ng") +}, { +"duration": 15.0, +"texture": ExtResource("20_r7gaq") +}, { +"duration": 30.0, +"texture": ExtResource("21_0tnvn") +}, { +"duration": 9.0, +"texture": ExtResource("22_algl1") +}, { +"duration": 9.0, +"texture": ExtResource("23_hexfl") +}, { +"duration": 30.0, +"texture": ExtResource("24_6cnpw") +}], +"loop": false, +"name": &"猪头怪抓盒子猫后段", +"speed": 30.0 +}, { +"frames": [{ +"duration": 6.0, "texture": ExtResource("25_ty3yp") }, { "duration": 6.0, @@ -184,7 +237,7 @@ animations = [{ "duration": 6.0, "texture": ExtResource("32_c28wc") }], -"loop": true, +"loop": false, "name": &"猪头怪走路", "speed": 30.0 }, { diff --git a/asset/audio/mixkit/mixkit-water-bubble-1317.wav b/asset/audio/mixkit/mixkit-water-bubble-1317.wav new file mode 100644 index 00000000..4ee597cf Binary files /dev/null and b/asset/audio/mixkit/mixkit-water-bubble-1317.wav differ diff --git a/asset/audio/mixkit/mixkit-water-bubble-1317.wav.import b/asset/audio/mixkit/mixkit-water-bubble-1317.wav.import new file mode 100644 index 00000000..fbde4b6d --- /dev/null +++ b/asset/audio/mixkit/mixkit-water-bubble-1317.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://cm2p6wqgfuv8y" +path="res://.godot/imported/mixkit-water-bubble-1317.wav-be4e28e0eae2edccd40066c5a04b907b.sample" + +[deps] + +source_file="res://asset/audio/mixkit/mixkit-water-bubble-1317.wav" +dest_files=["res://.godot/imported/mixkit-water-bubble-1317.wav-be4e28e0eae2edccd40066c5a04b907b.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=2 diff --git a/asset/audio/sfx/交互/第一章/sfx_敲门1.wav b/asset/audio/sfx/交互/sfx_敲门1.wav similarity index 100% rename from asset/audio/sfx/交互/第一章/sfx_敲门1.wav rename to asset/audio/sfx/交互/sfx_敲门1.wav diff --git a/asset/audio/sfx/交互/第一章/sfx_敲门1.wav.import b/asset/audio/sfx/交互/sfx_敲门1.wav.import similarity index 52% rename from asset/audio/sfx/交互/第一章/sfx_敲门1.wav.import rename to asset/audio/sfx/交互/sfx_敲门1.wav.import index 3ccf4c89..89b2512d 100644 --- a/asset/audio/sfx/交互/第一章/sfx_敲门1.wav.import +++ b/asset/audio/sfx/交互/sfx_敲门1.wav.import @@ -3,12 +3,12 @@ importer="wav" type="AudioStreamWAV" uid="uid://7of24bqow07e" -path="res://.godot/imported/sfx_敲门1.wav-1c8265fc5da1dd78fdf657a9fa511d7b.sample" +path="res://.godot/imported/sfx_敲门1.wav-aa81516cb458ddb022d4221cfa4911f8.sample" [deps] -source_file="res://asset/audio/sfx/交互/第一章/sfx_敲门1.wav" -dest_files=["res://.godot/imported/sfx_敲门1.wav-1c8265fc5da1dd78fdf657a9fa511d7b.sample"] +source_file="res://asset/audio/sfx/交互/sfx_敲门1.wav" +dest_files=["res://.godot/imported/sfx_敲门1.wav-aa81516cb458ddb022d4221cfa4911f8.sample"] [params] diff --git a/asset/audio/sfx/交互/第一章/sfx_敲门2.wav b/asset/audio/sfx/交互/sfx_敲门2.wav similarity index 100% rename from asset/audio/sfx/交互/第一章/sfx_敲门2.wav rename to asset/audio/sfx/交互/sfx_敲门2.wav diff --git a/asset/audio/sfx/交互/第一章/sfx_敲门2.wav.import b/asset/audio/sfx/交互/sfx_敲门2.wav.import similarity index 52% rename from asset/audio/sfx/交互/第一章/sfx_敲门2.wav.import rename to asset/audio/sfx/交互/sfx_敲门2.wav.import index c8d1c5f5..ce6ca0a2 100644 --- a/asset/audio/sfx/交互/第一章/sfx_敲门2.wav.import +++ b/asset/audio/sfx/交互/sfx_敲门2.wav.import @@ -3,12 +3,12 @@ importer="wav" type="AudioStreamWAV" uid="uid://dw8dprxhvas85" -path="res://.godot/imported/sfx_敲门2.wav-f372a18cad0983ad8369afcad6836870.sample" +path="res://.godot/imported/sfx_敲门2.wav-917059eb9a36ca4ab352ab80b1d16167.sample" [deps] -source_file="res://asset/audio/sfx/交互/第一章/sfx_敲门2.wav" -dest_files=["res://.godot/imported/sfx_敲门2.wav-f372a18cad0983ad8369afcad6836870.sample"] +source_file="res://asset/audio/sfx/交互/sfx_敲门2.wav" +dest_files=["res://.godot/imported/sfx_敲门2.wav-917059eb9a36ca4ab352ab80b1d16167.sample"] [params] diff --git a/asset/dialogue/c02.csv b/asset/dialogue/c02.csv index 6f8ffbc0..e707cdf6 100644 --- a/asset/dialogue/c02.csv +++ b/asset/dialogue/c02.csv @@ -8,6 +8,8 @@ c02_11肉铺敲门_3,不做生意赶紧滚!,???,, c02_纸人互动_离开公寓1,你要离开芦昌公寓吗?,,, c02_纸人互动_离开公寓2,离开,(response),, c02_纸人互动_离开公寓3,留下,(response),, +c02_钻入隧道询问1,是否钻入隧道?,,, +c02_钻入隧道询问2,进入,(response),, c02_6偷听对话_李氏_1_fx,真的假的?你钻进去啦,你这个体型进得去哒?,李兰,, c02_6偷听对话_癞子_1_fx,小声点,让人听见了倒惹麻烦。,王守义,,[#db=3] c02_6偷听对话_李氏_2_fx,那你说说,都看到什么啦?,李兰,,[#db=-5] diff --git a/asset/dialogue/c02.dialogue b/asset/dialogue/c02.dialogue index 3207dadb..8b46b4d5 100644 --- a/asset/dialogue/c02.dialogue +++ b/asset/dialogue/c02.dialogue @@ -5,6 +5,13 @@ - 留下 [ID:c02_纸人互动_离开公寓3] => END +~ c02_钻入隧道询问 +是否钻入隧道? [ID:c02_钻入隧道询问1] +- 进入 [ID:c02_钻入隧道询问2] + do GlobalFunctor.transfer_to_tunnel() +- 留下 [ID:c02_纸人互动_离开公寓3] +=> END + ~ c02_04_李氏癞子 #[#anonymous] 李兰: 真的假的?你钻进去啦,你这个体型进得去哒? [ID:c02_6偷听对话_李氏_1_fx] diff --git a/config/animation/entity_sprite_frames.tres b/config/animation/entity_sprite_frames.tres index 84c5a2ca..9c89fd2f 100644 --- a/config/animation/entity_sprite_frames.tres +++ b/config/animation/entity_sprite_frames.tres @@ -3482,7 +3482,7 @@ animations = [{ }], "loop": false, "name": &"c02_盒子猫停止躲藏", -"speed": 5.0 +"speed": 7.0 }, { "frames": [{ "duration": 1.0, @@ -3560,7 +3560,7 @@ animations = [{ }], "loop": false, "name": &"c02_盒子猫躲藏", -"speed": 5.0 +"speed": 8.0 }, { "frames": [{ "duration": 1.0, diff --git a/manager/archive_manager/assembled_archive.gd b/manager/archive_manager/assembled_archive.gd index e084e3e6..84bc7dea 100644 --- a/manager/archive_manager/assembled_archive.gd +++ b/manager/archive_manager/assembled_archive.gd @@ -40,6 +40,8 @@ class_name AssembledArchive extends Resource @export var player_running_locked := true # prop hud 显示道具 @export var prop_inventory: PropInventory +@export var prop_inventory_xxdie: PropInventory +@export var prop_inventory_xxxdie: PropInventory @export_group("八音盒", "bayinhe") @export var bayinhe_current_answer := [0, 0, 0, 0, 0, 0, 0, 0, 0] @@ -49,6 +51,10 @@ class_name AssembledArchive extends Resource func _init() -> void: if not prop_inventory: prop_inventory = PropInventory.new() + if not prop_inventory_xxdie: + prop_inventory_xxdie = PropInventory.new() + if not prop_inventory_xxxdie: + prop_inventory_xxxdie = PropInventory.new() func ground_archive(scene_name := current_scene) -> GroundArchive: diff --git a/manager/deploy/deployer_window.gd b/manager/deploy/deployer_window.gd deleted file mode 100644 index 6cb95e29..00000000 --- a/manager/deploy/deployer_window.gd +++ /dev/null @@ -1,10 +0,0 @@ -extends Window - -signal changed - -@export var archive: AssembledArchive - -func _ready() -> void: - var screen_size = DisplayServer.screen_get_size() - position = screen_size / 3 - close_requested.connect(queue_free) diff --git a/manager/deploy/deployer_window.gd.uid b/manager/deploy/deployer_window.gd.uid deleted file mode 100644 index 8030f459..00000000 --- a/manager/deploy/deployer_window.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://457olpnqqdhr diff --git a/manager/deploy/deployer_window.tscn b/manager/deploy/deployer_window.tscn deleted file mode 100644 index a7961b5d..00000000 --- a/manager/deploy/deployer_window.tscn +++ /dev/null @@ -1,12 +0,0 @@ -[gd_scene load_steps=2 format=3 uid="uid://dfbmctdmc4ue6"] - -[ext_resource type="Script" uid="uid://457olpnqqdhr" path="res://manager/deploy/deployer_window.gd" id="1_rhcam"] - -[node name="DeployerWindow" type="Window"] -auto_translate_mode = 1 -title = "deployer" -position = Vector2i(2000, 300) -size = Vector2i(1200, 1000) -always_on_top = true -min_size = Vector2i(100, 100) -script = ExtResource("1_rhcam") diff --git a/manager/deploy/section_deployer.gd b/manager/deploy/section_deployer.gd deleted file mode 100644 index 32723e3f..00000000 --- a/manager/deploy/section_deployer.gd +++ /dev/null @@ -1,12 +0,0 @@ -extends Node2D - -@export var section_config: SectionConfig - -# Called when the node enters the scene tree for the first time. -func _ready() -> void: - pass # Replace with function body. - - -# Called every frame. 'delta' is the elapsed time since the previous frame. -func _process(delta: float) -> void: - pass diff --git a/manager/deploy/section_deployer.gd.uid b/manager/deploy/section_deployer.gd.uid deleted file mode 100644 index 15bb1d80..00000000 --- a/manager/deploy/section_deployer.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://cy8jsbw6w8sg0 diff --git a/manager/deploy/section_deployer.tscn b/manager/deploy/section_deployer.tscn deleted file mode 100644 index aa197c21..00000000 --- a/manager/deploy/section_deployer.tscn +++ /dev/null @@ -1,15 +0,0 @@ -[gd_scene load_steps=4 format=3 uid="uid://jveao8k40jp1"] - -[ext_resource type="Script" uid="uid://cy8jsbw6w8sg0" path="res://manager/deploy/section_deployer.gd" id="1_komad"] -[ext_resource type="PackedScene" uid="uid://dygvcmykn02n8" path="res://scene/main.tscn" id="2_si45r"] -[ext_resource type="PackedScene" uid="uid://dfbmctdmc4ue6" path="res://manager/deploy/deployer_window.tscn" id="3_iq8me"] - -[node name="SectionDeployer" type="Node2D"] -script = ExtResource("1_komad") - -[node name="Main" parent="." instance=ExtResource("2_si45r")] - -[node name="DeployerWindow" parent="." instance=ExtResource("3_iq8me")] -position = Vector2i(390, 300) - -[editable path="Main"] diff --git a/manager/scene/global_functor.gd b/manager/scene/global_functor.gd new file mode 100644 index 00000000..13050f0c --- /dev/null +++ b/manager/scene/global_functor.gd @@ -0,0 +1,25 @@ +extends Node + + +# called from dialogue +# 传送进入隧道 +func transfer_to_tunnel(): + SceneManager.get_ground_loader().transition_to_scene("c02_s09", "right") + +# called from Amush2D's global_method +# c02 盒子猫游戏,小猫交互门 +var knocking = false + + +func c02_cat_play_with_door(): + if knocking: + return + knocking = true + var knock_stream = preload("uid://7of24bqow07e") + SceneManager.freeze_player(1.5, 6, true) + await get_tree().create_timer(0.8).timeout + AudioManager.play_sfx(knock_stream) + await get_tree().create_timer(0.3).timeout + AudioManager.play_sfx(knock_stream) + await get_tree().create_timer(0.5).timeout + knocking = false diff --git a/manager/scene/global_functor.gd.uid b/manager/scene/global_functor.gd.uid new file mode 100644 index 00000000..0ed6d35a --- /dev/null +++ b/manager/scene/global_functor.gd.uid @@ -0,0 +1 @@ +uid://cylss15sumkuw diff --git a/manager/scene/scene_manager.gd b/manager/scene/scene_manager.gd index 79c17dbc..b1373f19 100644 --- a/manager/scene/scene_manager.gd +++ b/manager/scene/scene_manager.gd @@ -22,6 +22,13 @@ func _ready(): func get_ground_loader() -> GroundLoader: return get_node_or_null("/root/Main/GroundLoader") as GroundLoader +# restart scene in debug launch... +func is_restarting() -> bool: + var ground = get_ground() + if ground: + return ground.restarting + return false + func get_ground() -> Ground2D: var loader = get_ground_loader() @@ -150,6 +157,25 @@ func get_prop_hud() -> PropHud: return get_node_or_null("/root/Main/UILayer/PropHUD") as PropHud +func toggle_hud_display(display_hud: bool): + var prop_hud = get_prop_hud() as PropHud + if prop_hud: + if display_hud: + prop_hud.display_hud() + else: + prop_hud.hide_hud() + else: + printerr("toggle_hud_display: PropHud node not found") + + +func checkout_prop_inventory(inv): + var prop_hud = get_prop_hud() as PropHud + if prop_hud: + prop_hud.checkout_inventory(inv) + else: + printerr("checkout_prop_inventory: PropHud node not found") + + func get_current_prop(must_selected: bool) -> String: var prop_hud = get_prop_hud() if prop_hud and (not must_selected or prop_hud.selected): @@ -170,7 +196,7 @@ func enable_prop_item_silently(prop_key: String) -> void: if prop_hud: prop_hud.enable_prop_item(prop_key, false) else: - printerr("enable_prop_item_silently PropHud node not found") + printerr("enable_prop_item_silently: PropHud node not found") func enable_prop_item(prop_key: String) -> void: diff --git a/project.godot b/project.godot index 407ca2a6..bde2ba13 100644 --- a/project.godot +++ b/project.godot @@ -48,6 +48,7 @@ SceneManager="*res://manager/scene/scene_manager.gd" AudioManager="*res://manager/audio_manager/audio_manager.gd" EventManager="*res://manager/event_manager/event_manager.gd" DialogueManager="*res://addons/dialogue_manager/dialogue_manager.gd" +GlobalFunctor="*res://manager/scene/global_functor.gd" [debug] diff --git a/scene/entity/ambush.gd b/scene/entity/ambush.gd index c1a94a4f..4b8728e3 100644 --- a/scene/entity/ambush.gd +++ b/scene/entity/ambush.gd @@ -14,17 +14,17 @@ signal sign_mark_offset_updated set(val): enabled = val if is_node_ready(): - # sign_mark.enabled = val _check_sign_display() @export_enum("enter", "area_enter", "interact") var trigger_mode := "enter": set(val): trigger_mode = val if is_node_ready(): _check_sign_display() +@export var interacted_sign_texture: Texture2D @export var one_shot := true # 首次进入 tree 就直接启用 @export var on_first_enter_tree := false -@export var freeze_time := 5.0 +@export var freeze_time := 0.5 var hook_animation = "" @export var lock_player_on_playing_dialogue = true @export var hook_os_key := "" @@ -48,6 +48,7 @@ var hook_animation = "" notify_property_list_changed() var hook_dialogue_title := "" var hook_method := "" +@export var global_method := "" var dialogue_c01 = preload("res://asset/dialogue/c01.dialogue") var dialogue_c02 = preload("res://asset/dialogue/c02.dialogue") @@ -72,6 +73,8 @@ var played: bool: played = val if not Engine.is_editor_hint() and ground_archive: ground_archive.set_pair(name, "played", played) + if is_node_ready() and val and interacted_sign_texture: + sign_mark.sprite2d.texture = interacted_sign_texture # Called when the node enters the scene tree for the first time. @@ -81,28 +84,33 @@ func _ready() -> void: # 更新 hook_animation 的可选项 if animation_player: animation_player.animation_libraries_updated.connect(notify_property_list_changed) + # editor 中展示 sign + sign_mark.enabled = true + sign_mark.display_sign = true return # setup default value ground_archive = ArchiveManager.archive.ground_archive() played = ground_archive.get_value(name, "played", false) played_time = 0.0 - sign_mark.enabled = enabled _check_sign_display() if played: if GlobalConfig.DEBUG: print("Ambush has played, name=", name, " one_shot=", one_shot) + if interacted_sign_texture: + sign_mark.sprite2d.texture = interacted_sign_texture if one_shot: return sign_mark.interacted.connect(_interacted) area.body_entered.connect(_entered) area.area_entered.connect(_area_entered) if on_first_enter_tree: - call_deferred("_do_trigger") + _do_trigger.call_deferred() func _check_sign_display(): - sign_mark.enabled = enabled and (not one_shot or not played) - sign_mark.display_sign = trigger_mode == "interact" + sign_mark.enabled = enabled and (not played or not one_shot) + sign_mark.display_sign = trigger_mode == "interact" + func _get_animation_player() -> AnimationPlayer: var node = get_parent() @@ -131,12 +139,12 @@ func _area_entered(_area = null): _do_trigger() -func _do_trigger(): +func _do_trigger() -> bool: var time = Time.get_ticks_msec() # 确保只有一个线程进入该逻辑,因为有时 player 碰撞和首次进入 tree 都会触发该方法 if not trigger_mutex.try_lock(): print("Ambush trigger mutex lock fail, name=", name) - return + return false print("Ambush trigger mutex locked, name=", name) if not one_shot and freeze_time > 0: var time_left = freeze_time - (time - played_time) * 0.001 @@ -144,10 +152,10 @@ func _do_trigger(): if GlobalConfig.DEBUG: print("Ambush freeze time not reached, time left=", time_left) trigger_mutex.unlock() - return + return false if one_shot and played: trigger_mutex.unlock() - return + return false played_time = time played = true trigger_mutex.unlock() @@ -169,10 +177,13 @@ func _do_trigger(): var animation_player = _get_animation_player() if animation_player: animation_player.call(hook_method) + if global_method: + GlobalFunctor.call(global_method) triggered.emit() if GlobalConfig.DEBUG: print("ambush triggered! name=", name) _check_sign_display() + return true func _on_dialogue_ended(_res): diff --git a/scene/entity/ambush.tscn b/scene/entity/ambush.tscn index 93762516..b2db994a 100644 --- a/scene/entity/ambush.tscn +++ b/scene/entity/ambush.tscn @@ -1,6 +1,7 @@ -[gd_scene load_steps=4 format=3 uid="uid://bnf3lkcbpx1ar"] +[gd_scene load_steps=5 format=3 uid="uid://bnf3lkcbpx1ar"] [ext_resource type="Script" uid="uid://pf3dyid8b35p" path="res://scene/entity/ambush.gd" id="1_rxgbr"] +[ext_resource type="Texture2D" uid="uid://gui0ubwlwoi0" path="res://asset/art/ui/action_mark/UI手.png" id="2_1tnxk"] [ext_resource type="PackedScene" uid="uid://c4tipnj1cr1j3" path="res://scene/entity/ux/sign.tscn" id="2_n51wc"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_iwrfx"] @@ -9,14 +10,13 @@ size = Vector2(10, 70) [node name="Ambush" type="Sprite2D"] script = ExtResource("1_rxgbr") -freeze_time = 0.5 +interacted_sign_texture = ExtResource("2_1tnxk") hook_dialogue_title = "" hook_animation = "" hook_method = "" [node name="Sign" parent="." instance=ExtResource("2_n51wc")] unique_name_in_owner = true -display_sign = false [node name="Area2D" type="Area2D" parent="."] unique_name_in_owner = true diff --git a/scene/ground/ground.gd b/scene/ground/ground.gd index 21c06c80..2aa886a4 100644 --- a/scene/ground/ground.gd +++ b/scene/ground/ground.gd @@ -5,6 +5,7 @@ class_name Ground2D extends Node2D # 用于在 debug 时态下,指定进入的 portal @export_enum("left", "right", "1", "2", "3", "4", "5", "6", "7", "8", "9") var default_portal := "left" +@export var display_hud := true @export_group("Player", "player_") @export var player_y_fixed := true: set(val): @@ -77,6 +78,7 @@ func _ready() -> void: printerr("scene_name is not valid") if Engine.is_editor_hint(): return + SceneManager.toggle_hud_display(display_hud) # 隐藏 player_line player_line.visible = false _set_camera_and_player_boundary() diff --git a/scene/ground/ground.tscn b/scene/ground/ground.tscn index f8903600..277ac327 100644 --- a/scene/ground/ground.tscn +++ b/scene/ground/ground.tscn @@ -1,7 +1,6 @@ -[gd_scene load_steps=10 format=3 uid="uid://dayyx4jerj7io"] +[gd_scene load_steps=9 format=3 uid="uid://dayyx4jerj7io"] [ext_resource type="Script" uid="uid://bee4ot74k4wg2" path="res://scene/ground/ground.gd" id="1_0vrlo"] -[ext_resource type="PackedScene" uid="uid://dygvcmykn02n8" path="res://scene/main.tscn" id="2_6ggqv"] [ext_resource type="PackedScene" uid="uid://cjhw5ecygrqty" path="res://scene/player/main_player.tscn" id="3_atha7"] [ext_resource type="PackedScene" uid="uid://61pis75a8fdq" path="res://scene/entity/portal.tscn" id="3_t73yw"] [ext_resource type="PackedScene" uid="uid://cqkeegrcdjyg4" path="res://scene/ground/camera/camera_focus_marker.tscn" id="4_mgk0a"] @@ -24,7 +23,6 @@ height = 500 [node name="Ground" type="Node2D"] script = ExtResource("1_0vrlo") -main_scene = ExtResource("2_6ggqv") [node name="AnimationPlayer" type="AnimationPlayer" parent="."] diff --git a/scene/ground/scene/c01/s08_书店.tscn b/scene/ground/scene/c01/s08_书店.tscn index 5d90d363..32ca2f93 100644 --- a/scene/ground/scene/c01/s08_书店.tscn +++ b/scene/ground/scene/c01/s08_书店.tscn @@ -75,11 +75,10 @@ metadata/_custom_type_script = "uid://rq6w1vuhuq1m" [node name="诡异环境音" type="AudioStreamPlayer" parent="Ground/AnimationPlayer" index="1"] stream = ExtResource("5_eerhd") volume_db = -7.0 -autoplay = true bus = &"game_sfx" script = ExtResource("4_p6k3c") mode = "场景背景音" -"自动开始" = true +"自动开始" = false "循环播放" = true "感应玩家操作" = false metadata/_custom_type_script = "uid://rq6w1vuhuq1m" diff --git a/scene/ground/scene/c02/s10_animation.gd b/scene/ground/scene/c02/s10_animation.gd index 78a9b104..2ad180a5 100644 --- a/scene/ground/scene/c02/s10_animation.gd +++ b/scene/ground/scene/c02/s10_animation.gd @@ -26,7 +26,7 @@ var counter: Interactable2D var wood_puppet: Pickable2D var catty_head: Pickable2D var door: Portal2D -var portal: Portal2D +var portal_note: Note2D func _on_ground_ready() -> void: @@ -36,7 +36,7 @@ func _on_ground_ready() -> void: wood_puppet = $"../DeployLayer/Pickable木头人偶" catty_head = $"../DeployLayer/Pickable小猫玩具脑袋" door = $"../DeployLayer/portal_left" - portal = $"../DeployLayer/portal_1" + portal_note = $"../DeployLayer/Note进入隧道询问" # 进过瞎子卧室后,通道关闭 if ArchiveManager.get_global_value("c02_the_blind_room_unlocked"): @@ -165,14 +165,14 @@ func after_counter_moved(): # default_counter_x +- 40 var x_diff = current_x - default_counter_x if x_diff > -40 and x_diff < 40: - portal.enabled = false + portal_note.enabled = false catty_head.enabled = false return catty_head.enabled = true # 进过瞎子卧室后,通道关闭 var entered = ArchiveManager.get_global_value("c02_the_blind_room_unlocked", false) if not entered and catty_head.picked: - portal.enabled = true + portal_note.enabled = true func _on_pick_catty_head() -> void: @@ -191,4 +191,4 @@ func _on_pick_catty_head() -> void: SceneManager.enable_prop_item("prop_小猫玩具完整") # 进过瞎子卧室后,通道关闭 if not ArchiveManager.get_global_value("c02_the_blind_room_unlocked"): - portal.enabled = true + portal_note.enabled = true diff --git a/scene/ground/scene/c02/s10_空房间.tscn b/scene/ground/scene/c02/s10_空房间.tscn index 97675b9d..5015f173 100644 --- a/scene/ground/scene/c02/s10_空房间.tscn +++ b/scene/ground/scene/c02/s10_空房间.tscn @@ -1,15 +1,16 @@ -[gd_scene load_steps=25 format=3 uid="uid://dny21yhtuteap"] +[gd_scene load_steps=26 format=3 uid="uid://dny21yhtuteap"] [ext_resource type="PackedScene" uid="uid://dayyx4jerj7io" path="res://scene/ground/ground.tscn" id="1_w7j0m"] [ext_resource type="Script" uid="uid://dkkey7qillk15" path="res://scene/ground/scene/c02/s10_animation.gd" id="2_egtqi"] [ext_resource type="AudioStream" uid="uid://6gttowdwmado" path="res://asset/audio/sfx/环境音/第一章/房间内部场景1.wav" id="3_chbaa"] [ext_resource type="Texture2D" uid="uid://molvyfyy63ik" path="res://asset/art/scene/c02/s10_空房间/bg_空房间.png" id="3_ox8et"] [ext_resource type="Script" uid="uid://rq6w1vuhuq1m" path="res://scene/entity/audio/sfx.gd" id="4_chbaa"] -[ext_resource type="PackedScene" uid="uid://61pis75a8fdq" path="res://scene/entity/portal.tscn" id="4_pde4i"] [ext_resource type="PackedScene" uid="uid://cw3q5pvciumil" path="res://scene/entity/interactable.tscn" id="5_ylhfc"] [ext_resource type="PackedScene" uid="uid://dsa6frlw6e6gg" path="res://scene/entity/pickable.tscn" id="6_27dvh"] [ext_resource type="Texture2D" uid="uid://cuno8okh8ytw2" path="res://asset/art/scene/c02/s10_空房间/柜子.png" id="6_mty8e"] +[ext_resource type="PackedScene" uid="uid://jr1yd46wm5je" path="res://scene/entity/note.tscn" id="7_th1ek"] [ext_resource type="Texture2D" uid="uid://dg43u88jwlbpu" path="res://asset/art/prop/c02/新小猫头.png" id="8_3ftnp"] +[ext_resource type="Texture2D" uid="uid://gui0ubwlwoi0" path="res://asset/art/ui/action_mark/UI手.png" id="8_to1d1"] [ext_resource type="Texture2D" uid="uid://cdsq0ylmgtfq0" path="res://asset/art/prop/c02/小蝉人偶.png" id="12_27dvh"] [ext_resource type="PackedScene" uid="uid://cxw5rovg5mu1a" path="res://scene/ground/script/c02/s00_煤油灯.tscn" id="13_27dvh"] [ext_resource type="PackedScene" uid="uid://bnf3lkcbpx1ar" path="res://scene/entity/ambush.tscn" id="14_3ftnp"] @@ -71,7 +72,6 @@ metadata/_edit_horizontal_guides_ = [87.0, 86.0] [node name="Ground" parent="." instance=ExtResource("1_w7j0m")] scene_name = "c02_s10" -default_portal = "1" player_y = 60 [node name="AnimationPlayer" parent="Ground" index="0"] @@ -109,14 +109,12 @@ matched_sign_texture = null position = Vector2(510, 20.7047) matched_sign_texture = null -[node name="portal_1" parent="Ground/DeployLayer" index="2" instance=ExtResource("4_pde4i")] -position = Vector2(363, 54.2267) -debug_note = "通往裂缝" -enabled = false -portal_name = "1" -target_scene = "c02_s09" -target_portal = "right" -matched_sign_texture = null +[node name="Note进入隧道询问" parent="Ground/DeployLayer" index="2" instance=ExtResource("7_th1ek")] +position = Vector2(362, 20) +mode = "ballon" +dialogue = "c02" +note_sign_texture = ExtResource("8_to1d1") +note_key = "c02_钻入隧道询问" [node name="小蜡烛" type="AnimatedSprite2D" parent="Ground/DeployLayer" index="3"] self_modulate = Color(0.611765, 0.611765, 0.611765, 1) diff --git a/scene/ground/scene/c02/s12_盒子猫.tscn b/scene/ground/scene/c02/s12_盒子猫.tscn index b93e9fca..70f0d9a7 100644 --- a/scene/ground/scene/c02/s12_盒子猫.tscn +++ b/scene/ground/scene/c02/s12_盒子猫.tscn @@ -10,6 +10,7 @@ [node name="Ground" parent="." instance=ExtResource("1_ngo77")] scene_name = "c02_s12" +display_hud = null player_y = 87 footstep_type = "盒子猫" @@ -22,13 +23,13 @@ texture = ExtResource("3_oskpk") offset = Vector2(0, -102) [node name="portal_left" parent="Ground/DeployLayer" index="0"] -position = Vector2(152, 50) +position = Vector2(152, 56) target_scene = "c02_s17" target_portal = "1" status = "opened" [node name="portal_right" parent="Ground/DeployLayer" index="1"] -position = Vector2(579, 0) +position = Vector2(465, 21) [node name="小猫初始动画" type="AnimatedSprite2D" parent="Ground/DeployLayer" index="2"] position = Vector2(211, 3) @@ -49,6 +50,9 @@ position = Vector2(3584, -7) [node name="PlayerLine2D" parent="Ground/ParallaxForeground" index="2"] points = PackedVector2Array(37, 150, 400, 150) +[node name="DirectionalLight2D" parent="Ground" index="8"] +blend_mode = 1 + [node name="盒子猫CanvasLayer" parent="Ground" instance=ExtResource("4_vv3sh")] visible = false offset = Vector2(-40, -158) diff --git a/scene/ground/scene/c02/s13_盒子猫二楼.tscn b/scene/ground/scene/c02/s13_盒子猫二楼.tscn index 6ea31b79..8311baa8 100644 --- a/scene/ground/scene/c02/s13_盒子猫二楼.tscn +++ b/scene/ground/scene/c02/s13_盒子猫二楼.tscn @@ -1,20 +1,24 @@ -[gd_scene load_steps=11 format=3 uid="uid://bvjutch6jex0v"] +[gd_scene load_steps=13 format=3 uid="uid://bvjutch6jex0v"] [ext_resource type="PackedScene" uid="uid://dayyx4jerj7io" path="res://scene/ground/ground.tscn" id="1_71lma"] [ext_resource type="Script" uid="uid://28ujp27cbdh2" path="res://scene/ground/scene/c02/s13_animation.gd" id="2_w5nqu"] [ext_resource type="AudioStream" uid="uid://ccng5y2fip6mc" path="res://asset/audio/sfx/UI/开锁声.mp3" id="3_g6cxj"] [ext_resource type="Texture2D" uid="uid://dweafdywxenu6" path="res://asset/art/scene/c02/s12_to_s17_盒子猫/bg_二楼楼道.png" id="3_miykx"] [ext_resource type="Texture2D" uid="uid://b3ootg88b63rb" path="res://asset/art/scene/c02/旧版/s13_院子诡异版/fg_楼梯调色后.png" id="4_4adgb"] -[ext_resource type="PackedScene" uid="uid://61pis75a8fdq" path="res://scene/entity/portal.tscn" id="4_u2fv1"] [ext_resource type="Script" uid="uid://rq6w1vuhuq1m" path="res://scene/entity/audio/sfx.gd" id="4_yywsi"] [ext_resource type="PackedScene" uid="uid://jr1yd46wm5je" path="res://scene/entity/note.tscn" id="5_gge8e"] [ext_resource type="Texture2D" uid="uid://csrfyvaufo1wb" path="res://asset/art/scene/c02/s12_to_s17_盒子猫/l_瞎子理发店光.png" id="6_gge8e"] +[ext_resource type="Texture2D" uid="uid://gui0ubwlwoi0" path="res://asset/art/ui/action_mark/UI手.png" id="7_g6cxj"] [ext_resource type="PackedScene" uid="uid://khwxm5qbfj3k" path="res://scene/ground/script/c02/盒子猫canvas_layer.tscn" id="7_u2fv1"] +[ext_resource type="PackedScene" uid="uid://bnf3lkcbpx1ar" path="res://scene/entity/ambush.tscn" id="9_yywsi"] +[ext_resource type="PackedScene" uid="uid://dewbg4phd8c17" path="res://scene/ground/script/c02/追猫猪头怪.tscn" id="10_kmk38"] [node name="S13" type="Node2D"] [node name="Ground" parent="." instance=ExtResource("1_71lma")] scene_name = "c02_s13" +display_hud = null +player_y = 85 footstep_type = "盒子猫" [node name="AnimationPlayer" parent="Ground" index="0"] @@ -29,35 +33,57 @@ metadata/_custom_type_script = "uid://rq6w1vuhuq1m" [node name="BGSprite2D" parent="Ground" index="1"] texture = ExtResource("3_miykx") -offset = Vector2(0, -105) +offset = Vector2(0, -102) [node name="portal_left" parent="Ground/DeployLayer" index="0"] -position = Vector2(40, 48) +position = Vector2(36, 54) target_scene = "c02_s14" target_portal = "left" [node name="portal_right" parent="Ground/DeployLayer" index="1"] -position = Vector2(776, 52) +position = Vector2(776, 55) target_scene = "c02_s17" target_portal = "right" -[node name="portal_1" parent="Ground/DeployLayer" index="2" instance=ExtResource("4_u2fv1")] -position = Vector2(106, 51) -portal_name = "1" -target_scene = "c02_s12" -target_portal = "left" -status = "opened" - -[node name="NotePortal" parent="Ground/DeployLayer" index="3" instance=ExtResource("5_gge8e")] -position = Vector2(852, 0) +[node name="NotePortal" parent="Ground/DeployLayer" index="2" instance=ExtResource("5_gge8e")] +position = Vector2(853, 6) +note_sign_texture = ExtResource("7_g6cxj") note_key = "notes_无法通过" -[node name="终点光芒" type="Sprite2D" parent="Ground/DeployLayer" index="4"] +[node name="终点光芒" type="Sprite2D" parent="Ground/DeployLayer" index="3"] modulate = Color(1, 1, 1, 0.34902) position = Vector2(226, 11) texture = ExtResource("6_gge8e") +[node name="Ambush猫咪敲门互动" parent="Ground/DeployLayer" index="4" instance=ExtResource("9_yywsi")] +position = Vector2(103, 6) +trigger_mode = "interact" +one_shot = false +freeze_time = 1.5 +global_method = "c02_cat_play_with_door" + +[node name="Ambush猫咪敲门互动2" parent="Ground/DeployLayer" index="5" instance=ExtResource("9_yywsi")] +position = Vector2(539, 6) +trigger_mode = "interact" +one_shot = false +freeze_time = 1.5 +global_method = "c02_cat_play_with_door" + +[node name="Ambush猫咪敲门互动3" parent="Ground/DeployLayer" index="6" instance=ExtResource("9_yywsi")] +position = Vector2(663, 5) +trigger_mode = "interact" +one_shot = false +freeze_time = 1.5 +global_method = "c02_cat_play_with_door" + +[node name="追猫猪头怪" parent="Ground/DeployLayer" index="7" instance=ExtResource("10_kmk38")] +position = Vector2(642, 17) + +[node name="追猫猪头怪2" parent="Ground/DeployLayer" index="8" instance=ExtResource("10_kmk38")] +position = Vector2(154, 18) + [node name="MainPlayer" parent="Ground" index="4"] +position = Vector2(41, 73) character = "盒子猫" [node name="楼梯" type="Sprite2D" parent="Ground/ParallaxForeground/BGParallaxLayer" index="0"] diff --git a/scene/ground/scene/c02/s14_盒子猫二楼内侧.tscn b/scene/ground/scene/c02/s14_盒子猫二楼内侧.tscn index c7403444..dd24e785 100644 --- a/scene/ground/scene/c02/s14_盒子猫二楼内侧.tscn +++ b/scene/ground/scene/c02/s14_盒子猫二楼内侧.tscn @@ -10,6 +10,8 @@ [node name="Ground" parent="." instance=ExtResource("1_cr1hi")] scene_name = "c02_s14" +display_hud = null +player_y = 85 footstep_type = "盒子猫" [node name="AnimationPlayer" parent="Ground" index="0"] @@ -18,30 +20,32 @@ oneshot_animation = "" [node name="BGSprite2D" parent="Ground" index="1"] texture = ExtResource("3_cr1hi") -offset = Vector2(0, -105) +offset = Vector2(0, -102) [node name="portal_left" parent="Ground/DeployLayer" index="0"] -position = Vector2(354, 49) +position = Vector2(363, 58) target_scene = "c02_s13" target_portal = "left" [node name="portal_right" parent="Ground/DeployLayer" index="1"] -position = Vector2(564, 48) +position = Vector2(565, 56) target_scene = "c02_s15" target_portal = "right" [node name="portal_1" parent="Ground/DeployLayer" index="2" instance=ExtResource("4_o47bv")] -position = Vector2(494, 48) +position = Vector2(492, 57) portal_name = "1" target_scene = "c02_s16" target_portal = "right" [node name="MainPlayer" parent="Ground" index="4"] +position = Vector2(41, 73) character = "盒子猫" [node name="PlayerLine2D" parent="Ground/ParallaxForeground" index="2"] -points = PackedVector2Array(37, 150, 660, 150) +points = PackedVector2Array(101, 150, 660, 150) [node name="盒子猫CanvasLayer" parent="Ground" instance=ExtResource("5_cr1hi")] +visible = false [editable path="Ground"] diff --git a/scene/ground/scene/c02/s15_盒子猫一楼内侧.tscn b/scene/ground/scene/c02/s15_盒子猫一楼内侧.tscn index 13894c62..7cdf995b 100644 --- a/scene/ground/scene/c02/s15_盒子猫一楼内侧.tscn +++ b/scene/ground/scene/c02/s15_盒子猫一楼内侧.tscn @@ -1,16 +1,18 @@ -[gd_scene load_steps=6 format=3 uid="uid://b21p53g42j2nt"] +[gd_scene load_steps=7 format=3 uid="uid://b21p53g42j2nt"] [ext_resource type="PackedScene" uid="uid://dayyx4jerj7io" path="res://scene/ground/ground.tscn" id="1_qxg0l"] [ext_resource type="Script" uid="uid://ebaq235h32fd" path="res://scene/ground/scene/c02/s15_animation.gd" id="2_etqjj"] [ext_resource type="Texture2D" uid="uid://c4eb71kdnqy3y" path="res://asset/art/scene/c02/s12_to_s17_盒子猫/bg_一楼内侧楼道(粉笔画).png" id="3_qxg0l"] [ext_resource type="PackedScene" uid="uid://jr1yd46wm5je" path="res://scene/entity/note.tscn" id="4_etqjj"] [ext_resource type="PackedScene" uid="uid://khwxm5qbfj3k" path="res://scene/ground/script/c02/盒子猫canvas_layer.tscn" id="5_isic3"] +[ext_resource type="Texture2D" uid="uid://gui0ubwlwoi0" path="res://asset/art/ui/action_mark/UI手.png" id="5_qxg0l"] [node name="S15" type="Node2D"] [node name="Ground" parent="." instance=ExtResource("1_qxg0l")] scene_name = "c02_s15" -player_y = 60 +display_hud = null +player_y = 85 footstep_type = "盒子猫" [node name="AnimationPlayer" parent="Ground" index="0"] @@ -19,22 +21,23 @@ oneshot_animation = "" [node name="BGSprite2D" parent="Ground" index="1"] texture = ExtResource("3_qxg0l") -offset = Vector2(0, -105) +offset = Vector2(0, -102) [node name="portal_left" parent="Ground/DeployLayer" index="0"] -position = Vector2(64, 13) +position = Vector2(160, 57) [node name="portal_right" parent="Ground/DeployLayer" index="1"] -position = Vector2(496, 47) +position = Vector2(496, 57) target_scene = "c02_s14" target_portal = "right" [node name="NotePortal" parent="Ground/DeployLayer" index="2" instance=ExtResource("4_etqjj")] -position = Vector2(362, 0) +position = Vector2(366, 10) +note_sign_texture = ExtResource("5_qxg0l") note_key = "notes_无法通过" [node name="MainPlayer" parent="Ground" index="4"] -position = Vector2(64, 98) +position = Vector2(64, 73) character = "盒子猫" facing_direction = Vector2(1, 0) @@ -42,8 +45,9 @@ facing_direction = Vector2(1, 0) position = Vector2(-1, -15) [node name="PlayerLine2D" parent="Ground/ParallaxForeground" index="2"] -points = PackedVector2Array(37, 150, 660, 150) +points = PackedVector2Array(125, 150, 660, 150) [node name="盒子猫CanvasLayer" parent="Ground" instance=ExtResource("5_isic3")] +visible = false [editable path="Ground"] diff --git a/scene/ground/scene/c02/s16_盒子猫三楼内侧.tscn b/scene/ground/scene/c02/s16_盒子猫三楼内侧.tscn index 62d8fcc0..99114fd2 100644 --- a/scene/ground/scene/c02/s16_盒子猫三楼内侧.tscn +++ b/scene/ground/scene/c02/s16_盒子猫三楼内侧.tscn @@ -1,15 +1,17 @@ -[gd_scene load_steps=6 format=3 uid="uid://22hc3oe8t0id"] +[gd_scene load_steps=7 format=3 uid="uid://22hc3oe8t0id"] [ext_resource type="PackedScene" uid="uid://dayyx4jerj7io" path="res://scene/ground/ground.tscn" id="1_umyae"] [ext_resource type="Script" uid="uid://dx2w5v1erjyls" path="res://scene/ground/scene/c02/s16_animation.gd" id="2_tmnwc"] [ext_resource type="Texture2D" uid="uid://by4ymjhnma8c6" path="res://asset/art/scene/c02/s12_to_s17_盒子猫/bg_三楼内侧楼道(粉笔画).png" id="3_tmnwc"] [ext_resource type="PackedScene" uid="uid://61pis75a8fdq" path="res://scene/entity/portal.tscn" id="4_qkv3g"] +[ext_resource type="PackedScene" uid="uid://bnf3lkcbpx1ar" path="res://scene/entity/ambush.tscn" id="5_qkv3g"] [ext_resource type="PackedScene" uid="uid://khwxm5qbfj3k" path="res://scene/ground/script/c02/盒子猫canvas_layer.tscn" id="5_tmnwc"] [node name="S16" type="Node2D"] [node name="Ground" parent="." instance=ExtResource("1_umyae")] scene_name = "c02_s16" +display_hud = false player_y = 85 footstep_type = "盒子猫" @@ -19,22 +21,29 @@ oneshot_animation = "" [node name="BGSprite2D" parent="Ground" index="1"] texture = ExtResource("3_tmnwc") -offset = Vector2(0, -105) +offset = Vector2(0, -102) [node name="portal_left" parent="Ground/DeployLayer" index="0"] -position = Vector2(100, 25) +position = Vector2(57, 56) [node name="portal_right" parent="Ground/DeployLayer" index="1"] -position = Vector2(563, 48) +position = Vector2(564, 56) target_scene = "c02_s14" target_portal = "1" [node name="portal_1" parent="Ground/DeployLayer" index="2" instance=ExtResource("4_qkv3g")] -position = Vector2(363, 49) +position = Vector2(363, 58) portal_name = "1" target_scene = "c02_s17" target_portal = "left" +[node name="Ambush猫咪敲门互动" parent="Ground/DeployLayer" index="3" instance=ExtResource("5_qkv3g")] +position = Vector2(105, 16) +trigger_mode = "interact" +one_shot = false +freeze_time = 1.5 +global_method = "c02_cat_play_with_door" + [node name="MainPlayer" parent="Ground" index="4"] position = Vector2(235, 73) character = "盒子猫" @@ -47,5 +56,6 @@ position = Vector2(3584, -7) points = PackedVector2Array(37, 150, 655, 150) [node name="盒子猫CanvasLayer" parent="Ground" instance=ExtResource("5_tmnwc")] +visible = false [editable path="Ground"] diff --git a/scene/ground/scene/c02/s17_盒子猫三楼.tscn b/scene/ground/scene/c02/s17_盒子猫三楼.tscn index d723e75e..6aef09f7 100644 --- a/scene/ground/scene/c02/s17_盒子猫三楼.tscn +++ b/scene/ground/scene/c02/s17_盒子猫三楼.tscn @@ -1,10 +1,12 @@ -[gd_scene load_steps=6 format=3 uid="uid://cbr6gbgrl2wb1"] +[gd_scene load_steps=8 format=3 uid="uid://cbr6gbgrl2wb1"] [ext_resource type="PackedScene" uid="uid://dayyx4jerj7io" path="res://scene/ground/ground.tscn" id="1_e436a"] [ext_resource type="Script" uid="uid://bkkhxiyblu2lo" path="res://scene/ground/scene/c02/s17_animation.gd" id="2_e436a"] [ext_resource type="Texture2D" uid="uid://iyeqjguyrhog" path="res://asset/art/scene/c02/s12_to_s17_盒子猫/bg_三楼楼道(粉笔画).png" id="3_e436a"] [ext_resource type="PackedScene" uid="uid://61pis75a8fdq" path="res://scene/entity/portal.tscn" id="4_e436a"] [ext_resource type="PackedScene" uid="uid://khwxm5qbfj3k" path="res://scene/ground/script/c02/盒子猫canvas_layer.tscn" id="4_n3bxc"] +[ext_resource type="PackedScene" uid="uid://dewbg4phd8c17" path="res://scene/ground/script/c02/追猫猪头怪.tscn" id="6_pfgbg"] +[ext_resource type="PackedScene" uid="uid://bnf3lkcbpx1ar" path="res://scene/entity/ambush.tscn" id="8_m6dyn"] [node name="S17" type="Node2D"] @@ -19,24 +21,40 @@ oneshot_animation = "" [node name="BGSprite2D" parent="Ground" index="1"] texture = ExtResource("3_e436a") -offset = Vector2(0, -105) +offset = Vector2(0, -102) [node name="portal_left" parent="Ground/DeployLayer" index="0"] -position = Vector2(34, 48) +position = Vector2(35, 56) target_scene = "c02_s16" target_portal = "1" [node name="portal_right" parent="Ground/DeployLayer" index="1"] -position = Vector2(853, 47) +position = Vector2(853, 56) target_scene = "c02_s13" target_portal = "right" [node name="portal_1" parent="Ground/DeployLayer" index="2" instance=ExtResource("4_e436a")] -position = Vector2(661, 50) +position = Vector2(662, 57) debug_note = "出来就不能回来了" portal_name = "1" target_scene = "c02_s12" +[node name="Ambush猫咪敲门互动" parent="Ground/DeployLayer" index="3" instance=ExtResource("8_m6dyn")] +position = Vector2(661, 7) +trigger_mode = "interact" +one_shot = false +freeze_time = 1.5 +global_method = "c02_cat_play_with_door" + +[node name="Ambush猫咪敲门互动2" parent="Ground/DeployLayer" index="4" instance=ExtResource("8_m6dyn")] +position = Vector2(106, 6) +trigger_mode = "interact" +one_shot = false +freeze_time = 1.5 +global_method = "c02_cat_play_with_door" + +[node name="追猫猪头怪" parent="Ground/DeployLayer" index="5" instance=ExtResource("6_pfgbg")] + [node name="MainPlayer" parent="Ground" index="4"] position = Vector2(235, 73) character = "盒子猫" diff --git a/scene/ground/script/c02/敲门游戏.tscn b/scene/ground/script/c02/敲门游戏.tscn index 77bb4dbd..1037d137 100644 --- a/scene/ground/script/c02/敲门游戏.tscn +++ b/scene/ground/script/c02/敲门游戏.tscn @@ -1,9 +1,9 @@ [gd_scene load_steps=7 format=3 uid="uid://bxpexbk7f3rax"] [ext_resource type="Script" uid="uid://chap3ifmyg20c" path="res://scene/ground/script/c02/敲门游戏.gd" id="1_dnsvv"] -[ext_resource type="AudioStream" uid="uid://dw8dprxhvas85" path="res://asset/audio/sfx/交互/第一章/sfx_敲门2.wav" id="2_hgfqc"] +[ext_resource type="AudioStream" uid="uid://dw8dprxhvas85" path="res://asset/audio/sfx/交互/sfx_敲门2.wav" id="2_hgfqc"] [ext_resource type="Texture2D" uid="uid://dkvuc5llqax6d" path="res://asset/art/scene/c02/s03_公寓一楼院子/肉铺门板.png" id="3_n5c57"] -[ext_resource type="AudioStream" uid="uid://7of24bqow07e" path="res://asset/audio/sfx/交互/第一章/sfx_敲门1.wav" id="3_ue6qj"] +[ext_resource type="AudioStream" uid="uid://7of24bqow07e" path="res://asset/audio/sfx/交互/sfx_敲门1.wav" id="3_ue6qj"] [ext_resource type="AudioStream" uid="uid://sjanwwtxggtq" path="res://asset/audio/effect/impact/impactWood_medium_002.ogg" id="4_hgfqc"] [ext_resource type="AudioStream" uid="uid://b1kaqn1ewg2ly" path="res://asset/audio/sfx/交互/第一章/sfx_肉落下.wav" id="5_t58cl"] diff --git a/scene/ground/script/c02/水盆特写.gd b/scene/ground/script/c02/水盆特写.gd index 3b10a862..5a56670b 100644 --- a/scene/ground/script/c02/水盆特写.gd +++ b/scene/ground/script/c02/水盆特写.gd @@ -56,6 +56,7 @@ func _make_ripple(pos:Vector2) -> bool: if p_pos.x < 0 or p_pos.x > image_size.x or p_pos.y < 0 or p_pos.y > image_size.y: return false if image.get_pixelv(p_pos).a > 0: + $"Sfx水滴".play() # setup shader_parameter/offset var m_offset = -Vector2(pos.x / 564 - 0.5, pos.y / 316 - 0.5) shader.material.set("shader_parameter/offset", m_offset) diff --git a/scene/ground/script/c02/水盆特写.tscn b/scene/ground/script/c02/水盆特写.tscn index 364fdac2..71c47ba6 100644 --- a/scene/ground/script/c02/水盆特写.tscn +++ b/scene/ground/script/c02/水盆特写.tscn @@ -1,9 +1,11 @@ -[gd_scene load_steps=8 format=3 uid="uid://trkypc4gox20"] +[gd_scene load_steps=10 format=3 uid="uid://trkypc4gox20"] [ext_resource type="Script" uid="uid://bica4jcy2w6ta" path="res://scene/ground/script/c02/水盆特写.gd" id="1_qtddk"] [ext_resource type="Texture2D" uid="uid://oiswtv7jqcqy" path="res://asset/art/scene/c02/s06_二楼楼道/ux_水盆特写.png" id="2_h4mql"] +[ext_resource type="AudioStream" uid="uid://cm2p6wqgfuv8y" path="res://asset/audio/mixkit/mixkit-water-bubble-1317.wav" id="2_qpkvl"] [ext_resource type="Texture2D" uid="uid://bfum7jdjilgif" path="res://asset/art/scene/c02/s06_二楼楼道/ux_水中倒影成年.png" id="3_31ty5"] [ext_resource type="Texture2D" uid="uid://b0o1bgwdn6tcn" path="res://asset/art/scene/c02/s06_二楼楼道/ux_水中倒影幼年.png" id="3_ekkoo"] +[ext_resource type="Script" uid="uid://rq6w1vuhuq1m" path="res://scene/entity/audio/sfx.gd" id="3_j0ps2"] [ext_resource type="Texture2D" uid="uid://s1c6gytu0gbx" path="res://asset/art/scene/c02/s06_二楼楼道/ux_水盆波纹.png" id="3_rdtwt"] [ext_resource type="Shader" uid="uid://hxcx4sbqtniu" path="res://asset/shader/ripple.gdshader" id="4_qtddk"] @@ -22,6 +24,13 @@ script = ExtResource("1_qtddk") metadata/_edit_vertical_guides_ = [424.0] metadata/_edit_horizontal_guides_ = [253.0] +[node name="Sfx水滴" type="AudioStreamPlayer" parent="."] +stream = ExtResource("2_qpkvl") +volume_db = -5.0 +bus = &"game_sfx" +script = ExtResource("3_j0ps2") +metadata/_custom_type_script = "uid://rq6w1vuhuq1m" + [node name="背景" type="TextureRect" parent="."] anchors_preset = 15 anchor_right = 1.0 diff --git a/scene/ground/script/c02/盒子猫canvas_layer.gd b/scene/ground/script/c02/盒子猫canvas_layer.gd index 40fbab02..23b8c730 100644 --- a/scene/ground/script/c02/盒子猫canvas_layer.gd +++ b/scene/ground/script/c02/盒子猫canvas_layer.gd @@ -18,3 +18,46 @@ func _ready(): create_tween().tween_property(cat, "modulate:a", 0.0, show_cat_duration) else: cat.visible = false + + +var down_pressing = false: + set(val): + # print("down_pressing: ", val) + down_pressing = val + _try_toggle_crawl() + +var crawling = false: + set(val): + crawling = val + # print("crawling: ", val) + if val != down_pressing: + # 执行结束后,如果发现不一致,尝试切换 + # print("crawling mismatch, swtich to: ", down_pressing) + # 需要重置 tween + crawling_toggle_tween = null + _try_toggle_crawl() + +var crawling_toggle_tween: Tween + + +func _try_toggle_crawl(): + if crawling_toggle_tween and crawling_toggle_tween.is_valid(): + # print("tweening, skip.") + return + crawling_toggle_tween = create_tween() + var crawl = down_pressing + if crawl: + SceneManager.freeze_player(0, 7) + else: + SceneManager.freeze_player(0, 8, true) + crawling_toggle_tween.tween_interval(0.4) + if not crawl: + crawling_toggle_tween.tween_callback(SceneManager.release_player) + crawling_toggle_tween.tween_callback(func(): crawling = crawl) + + +func _unhandled_input(event: InputEvent) -> void: + if event.is_action_pressed("down") and not down_pressing: + down_pressing = true + elif event.is_action_released("down") and down_pressing: + down_pressing = false diff --git a/scene/ground/script/c02/追猫猪头怪.gd b/scene/ground/script/c02/追猫猪头怪.gd new file mode 100644 index 00000000..61a89faa --- /dev/null +++ b/scene/ground/script/c02/追猫猪头怪.gd @@ -0,0 +1,57 @@ +extends Node2D + +@export var enabled := true +# 追击开始距离 +@export var start_distance := 400 +# 追击开始方位(左/右) +@export var from_left := true +# 追击速度 +@export var speed := 30 +# 脚步声周期时间 +@export var footstep_wait_time := 0.7 + +@onready var sfx_footstep = $SfxFootstep as Sfx + +var footstep_timer + + +func _ready() -> void: + var player = SceneManager.get_player() + # 高度对齐 + position.y = player.position.y + # 脚步声 timer + footstep_timer = Timer.new() + footstep_timer.autostart = false + footstep_timer.wait_time = footstep_wait_time + add_child(footstep_timer) + footstep_timer.timeout.connect(_on_footstep_timer_timeout) + + +func _on_footstep_timer_timeout() -> void: + sfx_footstep.play() + # shake camera + + +# 启用/禁用脚步声 +func toggle_footstep_sfx(play := true): + if play: + footstep_timer.start() + else: + footstep_timer.stop() + +var move_tween :Tween + +# 开始追击 +func start_chasing() -> void: + toggle_footstep_sfx(true) + # 初始位置与方向 + + +# 停止追击 +func stop_chasing() -> void: + toggle_footstep_sfx(false) + +# 转身追击 +func turn_back(): + # 呼吸一帧,然后转身 + pass diff --git a/scene/ground/script/c02/追猫猪头怪.gd.uid b/scene/ground/script/c02/追猫猪头怪.gd.uid new file mode 100644 index 00000000..4ac95fcc --- /dev/null +++ b/scene/ground/script/c02/追猫猪头怪.gd.uid @@ -0,0 +1 @@ +uid://tn7sfe0qmix2 diff --git a/scene/ground/script/c02/追猫猪头怪.tscn b/scene/ground/script/c02/追猫猪头怪.tscn new file mode 100644 index 00000000..2b1fe4b7 --- /dev/null +++ b/scene/ground/script/c02/追猫猪头怪.tscn @@ -0,0 +1,29 @@ +[gd_scene load_steps=6 format=3 uid="uid://dewbg4phd8c17"] + +[ext_resource type="Script" uid="uid://tn7sfe0qmix2" path="res://scene/ground/script/c02/追猫猪头怪.gd" id="1_lrjfo"] +[ext_resource type="Script" uid="uid://wapo47a1oddf" path="res://scene/entity/audio/sfx2d.gd" id="2_35vtd"] +[ext_resource type="AudioStream" uid="uid://dd2whbtg7ah8a" path="res://asset/audio/sfx/脚步/猫咪走路2.wav" id="2_e62rv"] +[ext_resource type="SpriteFrames" uid="uid://b85gyfhk1mg6r" path="res://asset/art/gif/c02_盒子猫/c02_盒子猫_frames.tres" id="4_3sbui"] + +[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_3sbui"] +playback_mode = 1 +streams_count = 1 +stream_0/stream = ExtResource("2_e62rv") + +[node name="追猫猪头怪" type="Node2D"] +script = ExtResource("1_lrjfo") + +[node name="SfxFootstep" type="AudioStreamPlayer2D" parent="."] +stream = SubResource("AudioStreamRandomizer_3sbui") +max_distance = 600.0 +attenuation = 1.7411 +bus = &"game_sfx" +script = ExtResource("2_35vtd") +metadata/_custom_type_script = "uid://wapo47a1oddf" + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] +z_index = 20 +sprite_frames = ExtResource("4_3sbui") +animation = &"猪头怪呼吸" +frame = 1 +frame_progress = 1.0 diff --git a/scene/player/main_player.gd b/scene/player/main_player.gd index 73097a1d..e13a136b 100644 --- a/scene/player/main_player.gd +++ b/scene/player/main_player.gd @@ -21,14 +21,12 @@ signal animation_finished @export var lock_move_left := false @export var lock_move_right := false @export var camera_marker: CameraFocusMarker -@export_enum("吕萍", "吕萍爬行", "吕萍带小猫", "吕萍推柜子", "小小蝶", "盒子猫") var character := "吕萍": +@export_enum("吕萍", "吕萍爬行", "吕萍带小猫", "吕萍推柜子", "小小蝶", "盒子猫", "小小小蝶") var character := "吕萍": set(val): character = val - # 使用 new,方便在 editor 中刷新新值 - current_animation_config = PlayerAnimationConfig.new().ANIMATION_CONFIG[val] - current_status = PlayerAnimationConfig.MOVEMENT_IDLE if is_node_ready(): - sprite.scale = current_animation_config["scale"] + # 切换 inventory + _check_character_runtime_status() # @export var shadow_color := Color(0.1, 0.1, 0.1, 0.7) # var shadow_y := 0.0 @export var player_movement_rect := Rect2(50, -500, 1400, 1000) @@ -61,15 +59,14 @@ signal animation_finished if not Engine.is_editor_hint(): return debug_freeze = val - current_animation_config = PlayerAnimationConfig.new().ANIMATION_CONFIG[character] - if val > 3: - freeze_player(0, val, true) - release_player() + if is_node_ready(): + _check_character_runtime_status() + if val > 3: + freeze_player(0, val, true) + release_player() # 使用 new,方便在 editor 中刷新新值 -var current_animation_config := ( - PlayerAnimationConfig.new().ANIMATION_CONFIG[character] as Dictionary -) +var current_animation_config: Dictionary @onready var light = $PointLight2D as PointLight2D @onready var catty_light = $CattyPointLight2D as PointLight2D @@ -86,28 +83,48 @@ func _ready() -> void: sprite.visible = not hide_sprite light.enabled = enable_light os_contaner.modulate.a = 0.0 - # set up animated sprite - sprite.scale = current_animation_config["scale"] + _check_character_runtime_status() _play_animation() - if Engine.is_editor_hint(): + if not Engine.is_editor_hint(): + footstep_timer.timeout.connect(_on_footstep_timer_timeout) + footstep_timer.stop() + sprite.animation_finished.connect(animation_finished.emit) + + +# func _enter_tree() -> void: +# if is_node_ready() and not Engine.is_editor_hint(): +# _check_character_runtime_status() + + +func _check_character_runtime_status(): + # set up animated sprite + # 使用 new,方便在 editor 中刷新新值 + current_animation_config = PlayerAnimationConfig.new().ANIMATION_CONFIG[character] + current_status = PlayerAnimationConfig.MOVEMENT_IDLE + sprite.scale = current_animation_config["scale"] + # editor 中无需检查下列项目 + if Engine.is_editor_hint() or not is_node_ready() or SceneManager.is_restarting(): return - footstep_timer.timeout.connect(_on_footstep_timer_timeout) - footstep_timer.stop() - sprite.animation_finished.connect(animation_finished.emit) - _check_character_status() # 如果当前是 prop_小猫玩具完整 ,尝试点亮玩家的灯效;否则无需点亮 if SceneManager.get_current_prop(false) == "prop_小猫玩具完整": set_catty_light(true) - - -func _enter_tree() -> void: - if is_node_ready() and not Engine.is_editor_hint(): - _check_character_status() - - -func _check_character_status(): - # 检查角色锁定状态 - running_locked = ArchiveManager.archive.player_running_locked + else: + set_catty_light(false) + # 设置 inventory + if not ArchiveManager or not ArchiveManager.archive: + printerr("player _checkout_inventory failed. ArchiveManager or Archive is not ready.") + else: + # 每个角色有对应 inverntory + var archive = ArchiveManager.archive + # 检查角色锁定状态 + running_locked = archive.player_running_locked + match character: + "小小蝶": + SceneManager.checkout_prop_inventory(archive.prop_inventory_xxdie) + "小小小蝶": + SceneManager.checkout_prop_inventory(archive.prop_inventory_xxxdie) + _: + SceneManager.checkout_prop_inventory(archive.prop_inventory) func _on_footstep_timer_timeout(): diff --git a/scene/player/player_animation_config.gd b/scene/player/player_animation_config.gd index a1c348e5..88530311 100644 --- a/scene/player/player_animation_config.gd +++ b/scene/player/player_animation_config.gd @@ -163,4 +163,23 @@ var ANIMATION_CONFIG = { 7: [&"c02_盒子猫躲藏", Vector2.ONE, Vector2(0, -68.0)], 8: [&"c02_盒子猫停止躲藏", Vector2.ONE, Vector2(0, -68.0)], }, + "小小小蝶": + { + "scale": Vector2(1, 1), + "speed_walking": 55.0, + "can_run": true, + "speed_runnig": 100.0, + "walk_footstep": 0.5, + "run_footstep": 7.0 / 9.0 / 2.0, + "os_height": 70.0, + "light_height": 20.0, + # 如果使用 auto,就会自动以最低点为基准 + # "auto_foot_offset": true, + "foot_offset": Vector2(0, -68.0), + MOVEMENT_IDLE: [&"", &"c02_盒子猫_idle_r"], + # 此处为[2][3]分别为 sprite 向左、向右时的 offset + MOVEMENT_WALKING: [&"", &"c02_盒子猫_walking_r"], + MOVEMENT_RUNNING: [&"", &"c02_盒子猫_running_r"], + 5: [&"c02_盒子猫钻进盒子", Vector2.ONE, Vector2(-20, -68.0)], + }, } diff --git a/scene/prop/prop_hud.gd b/scene/prop/prop_hud.gd index 15d2a42d..ddb7c969 100644 --- a/scene/prop/prop_hud.gd +++ b/scene/prop/prop_hud.gd @@ -55,12 +55,16 @@ var item_config_res = preload("res://asset/dialogue/item_description.dialogue") var path_prefix = "res://asset/art/prop/" var cached_inventory_textures := {} +# hud 展示与隐藏动效 var listen_mouse = false var displaying = false var timer := Timer.new() var display_tween: Tween var container_tween: Tween +# hud 是否监听快捷键 +var listening_hotkey = true + func _emit_changed(prop_key := ""): if not selected: @@ -127,7 +131,7 @@ func _load_items(): items_dict[item.key] = item # # 检查是否是重要物品,如果是,则添加到 items_description_dict items_description_dict[item.key] = tr(item.key + "_说明").replace("
", "\n") - + # if item_config_res.titles.has(item.key): # var important_item_line_id = item_config_res.titles[item.key] # items_description_dict[item.key] = get_import_item_content(important_item_line_id) @@ -160,6 +164,25 @@ func _load_from_archive() -> void: _update_prop_display_with_texture() +func checkout_inventory(inv: PropInventory) -> void: + inventory = inv + _align_container_size() + _load_texture_cache() + _update_prop_display_with_texture() + + +func hide_hud(): + # 隐藏 hud 并静音 + hide() + listening_hotkey = false + + +func display_hud(): + # 显示 hud 并取消静音 + show() + listening_hotkey = true + + func _load_texture_cache() -> void: if not inventory: return @@ -359,7 +382,7 @@ func _on_timer_timeout() -> void: func _unhandled_input(event: InputEvent) -> void: - if locked: + if locked or not listening_hotkey: return if event.is_action_pressed("prop_left"): on_left_pressed()