diff --git a/asset/art/gif/c02_空房间/frames.tres b/asset/art/gif/c02_空房间/frames.tres index e315ee4f..da65dc14 100644 --- a/asset/art/gif/c02_空房间/frames.tres +++ b/asset/art/gif/c02_空房间/frames.tres @@ -1,27 +1,27 @@ [gd_resource type="SpriteFrames" load_steps=26 format=3 uid="uid://cwes55ajc3rd4"] -[ext_resource type="Texture2D" path="res://asset/art/gif/c02_空房间/坐箱子小婵丢人偶/0.png" id="1_12kys"] +[ext_resource type="Texture2D" uid="uid://cm278bkgitg0a" path="res://asset/art/gif/c02_空房间/坐箱子小婵丢人偶/0.png" id="1_12kys"] [ext_resource type="Texture2D" uid="uid://by4v54we4c7df" path="res://asset/art/gif/c02_空房间/小猫玩具合并动画/0.png" id="1_245sa"] -[ext_resource type="Texture2D" path="res://asset/art/gif/c02_空房间/坐箱子小婵丢人偶/1.png" id="2_0djjc"] +[ext_resource type="Texture2D" uid="uid://bli1sjaraq83t" path="res://asset/art/gif/c02_空房间/坐箱子小婵丢人偶/1.png" id="2_0djjc"] [ext_resource type="Texture2D" uid="uid://bwnhn23iqfvog" path="res://asset/art/gif/c02_空房间/小猫玩具合并动画/1.png" id="2_hci3o"] -[ext_resource type="Texture2D" path="res://asset/art/gif/c02_空房间/坐箱子小婵丢人偶/2.png" id="3_dsf5i"] +[ext_resource type="Texture2D" uid="uid://bmee8g350issh" path="res://asset/art/gif/c02_空房间/坐箱子小婵丢人偶/2.png" id="3_dsf5i"] [ext_resource type="Texture2D" uid="uid://ds3pku3801pt6" path="res://asset/art/gif/c02_空房间/小猫玩具合并动画/2.png" id="3_msbc3"] -[ext_resource type="Texture2D" path="res://asset/art/gif/c02_空房间/坐箱子小婵丢人偶/3.png" id="4_245sa"] +[ext_resource type="Texture2D" uid="uid://o5n7xghmtc71" path="res://asset/art/gif/c02_空房间/坐箱子小婵丢人偶/3.png" id="4_245sa"] [ext_resource type="Texture2D" uid="uid://2y0q4hblw025" path="res://asset/art/gif/c02_空房间/小猫玩具合并动画/3.png" id="4_lur72"] -[ext_resource type="Texture2D" path="res://asset/art/gif/c02_空房间/坐箱子小婵丢人偶/4.png" id="5_hci3o"] +[ext_resource type="Texture2D" uid="uid://cvtcdti0qv8u6" path="res://asset/art/gif/c02_空房间/坐箱子小婵丢人偶/4.png" id="5_hci3o"] [ext_resource type="Texture2D" uid="uid://b5aowor1nsoso" path="res://asset/art/gif/c02_空房间/小猫玩具合并动画/4.png" id="5_lfse4"] -[ext_resource type="Texture2D" path="res://asset/art/gif/c02_空房间/坐箱子小婵丢人偶/5.png" id="6_msbc3"] +[ext_resource type="Texture2D" uid="uid://rr7j154rggay" path="res://asset/art/gif/c02_空房间/坐箱子小婵丢人偶/5.png" id="6_msbc3"] [ext_resource type="Texture2D" uid="uid://b7mds784tdnwt" path="res://asset/art/gif/c02_空房间/小猫玩具合并动画/5.png" id="6_qhv73"] [ext_resource type="Texture2D" uid="uid://bc251r06haudt" path="res://asset/art/gif/c02_空房间/小猫玩具合并动画/6.png" id="7_ai4dh"] -[ext_resource type="Texture2D" path="res://asset/art/gif/c02_空房间/坐箱子小婵丢人偶/6.png" id="7_lur72"] -[ext_resource type="Texture2D" path="res://asset/art/gif/c02_空房间/坐箱子小婵丢人偶/7.png" id="8_lfse4"] +[ext_resource type="Texture2D" uid="uid://ch3kllngxetnr" path="res://asset/art/gif/c02_空房间/坐箱子小婵丢人偶/6.png" id="7_lur72"] +[ext_resource type="Texture2D" uid="uid://ccrthkvtlqp7m" path="res://asset/art/gif/c02_空房间/坐箱子小婵丢人偶/7.png" id="8_lfse4"] [ext_resource type="Texture2D" uid="uid://df2qi7f8b60fx" path="res://asset/art/gif/c02_空房间/小猫玩具合并动画/7.png" id="8_n3ca1"] [ext_resource type="Texture2D" uid="uid://xm343ibk52v0" path="res://asset/art/gif/c02_空房间/小猫玩具合并动画/8.png" id="9_jlpis"] -[ext_resource type="Texture2D" path="res://asset/art/gif/c02_空房间/坐箱子小婵丢人偶/8.png" id="9_qhv73"] -[ext_resource type="Texture2D" path="res://asset/art/gif/c02_空房间/坐箱子小婵丢人偶/9.png" id="10_ai4dh"] +[ext_resource type="Texture2D" uid="uid://d1m0wsiffxtvn" path="res://asset/art/gif/c02_空房间/坐箱子小婵丢人偶/8.png" id="9_qhv73"] +[ext_resource type="Texture2D" uid="uid://61canqiiy3a0" path="res://asset/art/gif/c02_空房间/坐箱子小婵丢人偶/9.png" id="10_ai4dh"] [ext_resource type="Texture2D" uid="uid://8lu1o38ncf7j" path="res://asset/art/gif/c02_空房间/小猫玩具合并动画/9.png" id="10_yict2"] [ext_resource type="Texture2D" uid="uid://bwc0q8x0ruuup" path="res://asset/art/gif/c02_空房间/小猫玩具合并动画/10.png" id="11_jckan"] -[ext_resource type="Texture2D" path="res://asset/art/gif/c02_空房间/坐箱子小婵丢人偶/10.png" id="11_n3ca1"] +[ext_resource type="Texture2D" uid="uid://b6gmwbpa2mlmg" path="res://asset/art/gif/c02_空房间/坐箱子小婵丢人偶/10.png" id="11_n3ca1"] [ext_resource type="Texture2D" uid="uid://djcfgav3q2qeb" path="res://asset/art/gif/c02_空房间/小猫玩具合并动画/11.png" id="12_pyxyr"] [ext_resource type="Texture2D" uid="uid://d4ckvfn4yroux" path="res://asset/art/gif/c02_空房间/小猫玩具合并动画/12.png" id="13_4y6bn"] [ext_resource type="Texture2D" uid="uid://cyq22ykrm8mm1" path="res://asset/art/gif/c02_空房间/小猫玩具合并动画/13.png" id="14_j4ar5"] @@ -62,7 +62,7 @@ animations = [{ "duration": 6.0, "texture": ExtResource("11_n3ca1") }], -"loop": true, +"loop": false, "name": &"坐箱子小婵丢人偶", "speed": 30.0 }, { @@ -109,7 +109,7 @@ animations = [{ "duration": 6.0, "texture": ExtResource("14_j4ar5") }], -"loop": true, +"loop": false, "name": &"小猫玩具合并动画", "speed": 30.0 }] diff --git a/asset/art/prop/c02/新小猫全身.png b/asset/art/prop/c02/新小猫全身.png new file mode 100644 index 00000000..300e2532 Binary files /dev/null and b/asset/art/prop/c02/新小猫全身.png differ diff --git a/asset/art/prop/c02/新小猫全身.png.import b/asset/art/prop/c02/新小猫全身.png.import new file mode 100644 index 00000000..d1fe44ba --- /dev/null +++ b/asset/art/prop/c02/新小猫全身.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c2w2d5c7exd2n" +path="res://.godot/imported/新小猫全身.png-9101c1ddff8ccc4ca54a6c2ece004c02.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://asset/art/prop/c02/新小猫全身.png" +dest_files=["res://.godot/imported/新小猫全身.png-9101c1ddff8ccc4ca54a6c2ece004c02.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/asset/art/gif/c02_空房间/头.png b/asset/art/prop/c02/新小猫头.png similarity index 100% rename from asset/art/gif/c02_空房间/头.png rename to asset/art/prop/c02/新小猫头.png diff --git a/asset/art/gif/c02_空房间/头.png.import b/asset/art/prop/c02/新小猫头.png.import similarity index 70% rename from asset/art/gif/c02_空房间/头.png.import rename to asset/art/prop/c02/新小猫头.png.import index 0e7af31b..f04cef15 100644 --- a/asset/art/gif/c02_空房间/头.png.import +++ b/asset/art/prop/c02/新小猫头.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://dg43u88jwlbpu" -path="res://.godot/imported/头.png-e41f817763424de9a6841a5164c1d933.ctex" +path="res://.godot/imported/新小猫头.png-42cc92ccc1ad25fb4b2036a18b8e6c2d.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://asset/art/gif/c02_空房间/头.png" -dest_files=["res://.godot/imported/头.png-e41f817763424de9a6841a5164c1d933.ctex"] +source_file="res://asset/art/prop/c02/新小猫头.png" +dest_files=["res://.godot/imported/新小猫头.png-42cc92ccc1ad25fb4b2036a18b8e6c2d.ctex"] [params] diff --git a/asset/art/gif/c02_空房间/身体.png b/asset/art/prop/c02/新小猫身体.png similarity index 100% rename from asset/art/gif/c02_空房间/身体.png rename to asset/art/prop/c02/新小猫身体.png diff --git a/asset/art/gif/c02_空房间/身体.png.import b/asset/art/prop/c02/新小猫身体.png.import similarity index 69% rename from asset/art/gif/c02_空房间/身体.png.import rename to asset/art/prop/c02/新小猫身体.png.import index ed8a1920..74bbed54 100644 --- a/asset/art/gif/c02_空房间/身体.png.import +++ b/asset/art/prop/c02/新小猫身体.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://lk4warbvclhr" -path="res://.godot/imported/身体.png-f93c064f9e6290c7c465828c91389975.ctex" +path="res://.godot/imported/新小猫身体.png-2299912ddd00544af00c112812857b0e.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://asset/art/gif/c02_空房间/身体.png" -dest_files=["res://.godot/imported/身体.png-f93c064f9e6290c7c465828c91389975.ctex"] +source_file="res://asset/art/prop/c02/新小猫身体.png" +dest_files=["res://.godot/imported/新小猫身体.png-2299912ddd00544af00c112812857b0e.ctex"] [params] diff --git a/asset/dialogue/item_description.csv b/asset/dialogue/item_description.csv index ca54b525..4f1c702f 100644 --- a/asset/dialogue/item_description.csv +++ b/asset/dialogue/item_description.csv @@ -42,10 +42,10 @@ prop_信碎片2,信碎片(二),,,[#texture=c01/信件右上.png] prop_银元,银元,,,[#texture=c01/银元.png] prop_院长的信,院长的信,,,[#texture=c01/院长的信物品.png][#inspect=c01/院长的信.png] prop_火柴,火柴,,,[#texture=c02/火柴.png] -prop_小猫玩具的脑袋,小猫玩具的脑袋,,,[#texture=c02/小猫玩具脑袋物品.png][#inspect=c02/小猫玩具脑袋.png] -prop_无头小猫玩具,无头小猫玩具,,,[#texture=c02/小猫玩具身体.png] +prop_小猫玩具的脑袋,小猫玩具的脑袋,,,[#texture=c02/新小猫头.png] +prop_无头小猫玩具,无头小猫玩具,,,[#texture=c02/新小猫身体.png] +prop_小猫玩具完整,小猫玩具,,,[#texture=c02/新小猫全身.png] prop_撕下的照片上,撕下的照片(上),,,[#texture=c02/照片_上.png] -prop_小猫玩具完整,小猫玩具,,,[#texture=c02/小猫玩具完整物品.png][#inspect=c02/小猫玩具完整.png] prop_老虎钳,老虎钳,,,[#texture=c02/老虎钳物品.png][#inspect=c02/老虎钳.png] prop_锡箔元宝,锡箔元宝,,,[#texture=c02/锡箔元宝.png] prop_小鞋子1,小鞋子1,,,[#texture=c02/小鞋子.png] @@ -54,8 +54,8 @@ prop_麻将,麻将,,,[#texture=c02/麻将.png] prop_新鲜的肉,新鲜的肉,,,[#texture=c02/新鲜的肉.png] prop_弹珠,弹珠,,,[#texture=c02/弹珠.png] prop_木头人偶,木头人偶,,,[#texture=c02/小蝉人偶.png] -prop_2014钥匙,2014钥匙,,,[#texture=c02/1012钥匙物品.png] prop_一把香,一把香,,,[#texture=c02/一把香.png] +prop_2014钥匙,2014钥匙,,,[#texture=c02/1012钥匙物品.png] prop_重要物品示例,重要物品示例,,,[#texture=c01/银元.png] prop_1012钥匙,1012钥匙,,,[#texture=c02/1012钥匙物品.png][#inspect=c02/1012钥匙.png] prop_绳子,绳子,,,[#texture=c02/绳子物品.png][#inspect=c02/绳子.png] diff --git a/asset/dialogue/item_description.dialogue b/asset/dialogue/item_description.dialogue index 546f85e4..09165858 100644 --- a/asset/dialogue/item_description.dialogue +++ b/asset/dialogue/item_description.dialogue @@ -52,10 +52,10 @@ # c02 火柴 [#texture=c02/火柴.png] [ID:prop_火柴] -小猫玩具的脑袋 [#texture=c02/小猫玩具脑袋物品.png][#inspect=c02/小猫玩具脑袋.png] [ID:prop_小猫玩具的脑袋] -无头小猫玩具 [#texture=c02/小猫玩具身体.png] [ID:prop_无头小猫玩具] +小猫玩具的脑袋 [#texture=c02/新小猫头.png] [ID:prop_小猫玩具的脑袋] +无头小猫玩具 [#texture=c02/新小猫身体.png] [ID:prop_无头小猫玩具] +小猫玩具 [#texture=c02/新小猫全身.png] [ID:prop_小猫玩具完整] 撕下的照片(上) [#texture=c02/照片_上.png] [ID:prop_撕下的照片上] -小猫玩具 [#texture=c02/小猫玩具完整物品.png][#inspect=c02/小猫玩具完整.png] [ID:prop_小猫玩具完整] 老虎钳 [#texture=c02/老虎钳物品.png][#inspect=c02/老虎钳.png] [ID:prop_老虎钳] 锡箔元宝 [#texture=c02/锡箔元宝.png] [ID:prop_锡箔元宝] 小鞋子1 [#texture=c02/小鞋子.png] [ID:prop_小鞋子1] diff --git a/config/animation/entity_sprite_frames.tres b/config/animation/entity_sprite_frames.tres index c774493e..a807d74f 100644 --- a/config/animation/entity_sprite_frames.tres +++ b/config/animation/entity_sprite_frames.tres @@ -1,4 +1,4 @@ -[gd_resource type="SpriteFrames" load_steps=691 format=3 uid="uid://b7fhheih1hbvf"] +[gd_resource type="SpriteFrames" load_steps=692 format=3 uid="uid://b7fhheih1hbvf"] [ext_resource type="Texture2D" uid="uid://bpqrd6vo3j17m" path="res://asset/art/animation/c00_吕萍_记笔记_right/吕萍-拿本子记录1.png" id="1_6sdvl"] [ext_resource type="Texture2D" uid="uid://dvq64espa37lx" path="res://asset/art/animation/c00_吕萍_idle_left/zhhx1.png" id="1_ekv0l"] @@ -124,6 +124,7 @@ [ext_resource type="Texture2D" uid="uid://bxcav6337gvfx" path="res://asset/art/animation/c01_捡球男孩_关键帧/7.png" id="61_ndg51"] [ext_resource type="Texture2D" uid="uid://cjrbbv8doi28y" path="res://asset/art/gif/c02_杂项/拿纸杯/9.png" id="62_1ad0b"] [ext_resource type="Texture2D" uid="uid://dh6c0phkayb46" path="res://asset/art/animation/c01_捡球男孩_关键帧/8.png" id="62_xah2w"] +[ext_resource type="Texture2D" uid="uid://ijhq1ddie3bs" path="res://asset/art/临时草稿/c02_第一章/小蝶拖柜子.png" id="63_a7x1c"] [ext_resource type="Texture2D" uid="uid://bvc3t2lwcecax" path="res://asset/art/animation/c01_捡球男孩_关键帧/9.png" id="63_gwbdy"] [ext_resource type="Texture2D" uid="uid://bfjtdlhom8285" path="res://asset/art/animation/c01_捡球男孩_关键帧/10.png" id="64_cd0ob"] [ext_resource type="Texture2D" uid="uid://rg0hshb2i7qk" path="res://asset/art/animation/c01_捡球男孩_关键帧/11.png" id="65_cd5ki"] @@ -930,6 +931,30 @@ animations = [{ "speed": 30.0 }, { "frames": [{ +"duration": 1.0, +"texture": ExtResource("63_a7x1c") +}], +"loop": true, +"name": &"c00_吕萍_推柜子_idle", +"speed": 2.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": ExtResource("63_a7x1c") +}], +"loop": true, +"name": &"c00_吕萍_推柜子_l", +"speed": 2.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": ExtResource("63_a7x1c") +}], +"loop": true, +"name": &"c00_吕萍_推柜子_r", +"speed": 2.0 +}, { +"frames": [{ "duration": 5.0, "texture": ExtResource("445_dsiga") }, { @@ -1475,85 +1500,85 @@ animations = [{ "speed": 30.0 }, { "frames": [{ -"duration": 10.0, +"duration": 7.0, "texture": ExtResource("184_tsskx") }, { -"duration": 10.0, +"duration": 7.0, "texture": ExtResource("185_adpbv") }, { -"duration": 10.0, +"duration": 7.0, "texture": ExtResource("186_xaqjo") }, { -"duration": 10.0, +"duration": 7.0, "texture": ExtResource("187_exmgj") }, { -"duration": 10.0, +"duration": 7.0, "texture": ExtResource("188_glo3y") }, { -"duration": 10.0, +"duration": 7.0, "texture": ExtResource("189_y86r8") }, { -"duration": 10.0, +"duration": 7.0, "texture": ExtResource("190_16mpc") }, { -"duration": 10.0, +"duration": 7.0, "texture": ExtResource("191_0ssab") }, { -"duration": 10.0, +"duration": 7.0, "texture": ExtResource("192_moer7") }, { -"duration": 10.0, +"duration": 7.0, "texture": ExtResource("193_6xoj6") }, { -"duration": 10.0, +"duration": 7.0, "texture": ExtResource("194_n7qvh") }, { -"duration": 10.0, +"duration": 7.0, "texture": ExtResource("195_077om") }, { -"duration": 10.0, +"duration": 7.0, "texture": ExtResource("196_b6i75") }, { -"duration": 10.0, +"duration": 7.0, "texture": ExtResource("197_2um7t") }, { -"duration": 10.0, +"duration": 7.0, "texture": ExtResource("198_iimum") }, { -"duration": 10.0, +"duration": 7.0, "texture": ExtResource("199_u2jno") }, { -"duration": 10.0, +"duration": 7.0, "texture": ExtResource("200_13qfd") }, { -"duration": 10.0, +"duration": 7.0, "texture": ExtResource("201_a0f2d") }, { -"duration": 10.0, +"duration": 7.0, "texture": ExtResource("202_ypwpj") }, { -"duration": 10.0, +"duration": 7.0, "texture": ExtResource("203_3qf2e") }, { -"duration": 10.0, +"duration": 7.0, "texture": ExtResource("204_ktwt1") }, { -"duration": 10.0, +"duration": 7.0, "texture": ExtResource("205_2v3u4") }, { -"duration": 10.0, +"duration": 7.0, "texture": ExtResource("206_dlydb") }, { -"duration": 10.0, +"duration": 7.0, "texture": ExtResource("207_xewty") }, { -"duration": 10.0, +"duration": 7.0, "texture": ExtResource("208_yjsfv") }, { -"duration": 10.0, +"duration": 7.0, "texture": ExtResource("209_253oi") }, { -"duration": 10.0, +"duration": 7.0, "texture": ExtResource("210_mlkjm") }], "loop": false, diff --git a/manager/scene/scene_manager.gd b/manager/scene/scene_manager.gd index f98b561f..a34130de 100644 --- a/manager/scene/scene_manager.gd +++ b/manager/scene/scene_manager.gd @@ -74,11 +74,17 @@ func unlock_player(): player.action_locked = false -func is_palyer_freezed_or_locked() -> bool: - var player = get_player() - if not player: - return true - return player.action_locked or player.action_freezed +# func is_palyer_operational() -> bool: +# var player = get_player() as MainPlayer +# if not player: +# return true +# return player.operational + + +# func set_player_operational(val := true): +# var player = get_player() as MainPlayer +# if player: +# player.operational = val # action_freezed 对应 freeze 与 release 方法 @@ -158,6 +164,13 @@ func get_current_prop(must_selected: bool) -> String: return prop_hud.inventory.current_item_key() return "" +# 静默增加 prop,一般用于提前保存数据,确保数据一致性(防止在 await 时退出等导致丢数据) +func enable_prop_item_silently(prop_key: String) -> void: + var prop_hud = get_prop_hud() + if prop_hud: + prop_hud.inventory.enable_item(prop_key) + else: + printerr("enable_prop_item_silently PropHud node not found") func enable_prop_item(prop_key: String) -> void: var prop_hud = get_prop_hud() diff --git a/scene/entity/pickable.gd b/scene/entity/pickable.gd index 37cd455f..0cdbe036 100644 --- a/scene/entity/pickable.gd +++ b/scene/entity/pickable.gd @@ -28,6 +28,14 @@ func reset() -> void: _check_sign_display() +# 渐渐浮现 +func enable_with_ease(duration := 1.0): + enabled = true + if not picked: + var tween = create_tween() + tween.tween_property(self, "modulate:a", 1.0, duration).from(0.0) + + # Called when the node enters the scene tree for the first time. func _ready() -> void: if Engine.is_editor_hint(): diff --git a/scene/entity/ux/sign.gd b/scene/entity/ux/sign.gd index eed0f076..c4716adf 100644 --- a/scene/entity/ux/sign.gd +++ b/scene/entity/ux/sign.gd @@ -5,7 +5,7 @@ signal interacted signal cancel signal toggle_active(activated: bool) -@export var lock_on_player_freezed := false +# @export var lock_on_player_freezed := false @export var enabled := true: set(val): if enabled == val: @@ -171,7 +171,9 @@ func disactivate(_body: Node2D) -> void: func _unhandled_input(event: InputEvent) -> void: if Engine.is_editor_hint() or not enabled or pass_unhandled_input: return - if lock_on_player_freezed and SceneManager.is_palyer_freezed_or_locked(): + # if lock_on_player_freezed and SceneManager.is_palyer_freezed_or_locked(): + # return + if SceneManager.get_player().action_locked: return if activated: if event.is_action_pressed("interact"): diff --git a/scene/entity/ux/刮刮乐.gdshader b/scene/entity/ux/刮刮乐.gdshader index 2f0699ab..8833f709 100644 --- a/scene/entity/ux/刮刮乐.gdshader +++ b/scene/entity/ux/刮刮乐.gdshader @@ -1,8 +1,10 @@ shader_type canvas_item; uniform float grey_scale = .33; +uniform sampler2D sampler; void fragment() { - //COLOR.a = step(COLOR.r, .0); + //vec2 pos = VERTEX; + COLOR.a = step(COLOR.r, .0); //COLOR.rgb = vec3(grey_scale - COLOR.r); } diff --git a/scene/ground/scene/c02/s03_animation.gd b/scene/ground/scene/c02/s03_animation.gd index 423dc6d2..27ce9ced 100644 --- a/scene/ground/scene/c02/s03_animation.gd +++ b/scene/ground/scene/c02/s03_animation.gd @@ -39,10 +39,10 @@ func _on_ground_ready() -> void: counter.enabled = true madman_ambush = $"../DeployLayer/Ambush井边疯子" - # c02_madman_hitwall 之后, ball_game_stage==2(游戏结束) 之前 + # c02_madman_hitwall 之后, c02_ball_game_stage==2(游戏结束) 之前 if ( ArchiveManager.get_global_value("c02_madman_hitwall") - and ArchiveManager.get_global_value("ball_game_stage", 0) < 2 + and ArchiveManager.get_global_value("c02_ball_game_stage", 0) < 2 ): madman_ambush.visible = true madman_ambush.enabled = true @@ -51,19 +51,15 @@ func _on_ground_ready() -> void: bully_layer = $"../DeployLayer/霸凌" burning_layer = $"../DeployLayer/火灾" - if ArchiveManager.get_global_value("ball_game_stage", 0) >= 2: + if ArchiveManager.get_global_value("c02_ball_game_stage", 0) >= 2: _setup_bully_or_burning() - if ArchiveManager.get_global_value("madman_interacted", false) and not data.camera_played: + if ArchiveManager.get_global_value("c02_madman_interacted", false) and not data.camera_played: SceneManager.freeze_player(0) play("镜头上下运动") SceneManager.pop_debug_dialog_info("美术", "小鞋子掉落") $"../CameraFocusMarker".limit_top -= 1000 - # # 0:默认 1:等待去院子 2:等待消失 3:已消失 - # var stage = ArchiveManager.get_global_value("一楼挡路疯子消失阶段", 0) - # if stage == 1: - # ArchiveManager.set_global_entry("一楼挡路疯子消失阶段", 2) func cg_end() -> void: diff --git a/scene/ground/scene/c02/s05_animation.gd b/scene/ground/scene/c02/s05_animation.gd index 8e9e032e..0651236b 100644 --- a/scene/ground/scene/c02/s05_animation.gd +++ b/scene/ground/scene/c02/s05_animation.gd @@ -24,7 +24,7 @@ func _on_ground_ready() -> void: else: gaslight.lighted.connect(_display_bright_bg) var bucket = $"../DeployLayer/Ambush桶" - bucket.enabled = ArchiveManager.get_global_value("meat_bucket_enabled", false) + bucket.enabled = ArchiveManager.get_global_value("c02_meat_bucket_enabled", false) var madman = $"../DeployLayer/Npc疯子" as Npc2D @@ -37,7 +37,7 @@ func _on_ground_ready() -> void: func _on_madman_interacted() -> void: - ArchiveManager.set_global_entry("madman_interacted", true) + ArchiveManager.set_global_entry("c02_madman_interacted", true) func _display_bright_bg() -> void: diff --git a/scene/ground/scene/c02/s06_animation.gd b/scene/ground/scene/c02/s06_animation.gd index f9897762..eb77176c 100644 --- a/scene/ground/scene/c02/s06_animation.gd +++ b/scene/ground/scene/c02/s06_animation.gd @@ -31,8 +31,8 @@ func _on_ground_ready() -> void: ball_game_boys_ambush = $"../DeployLayer/Ambush三男孩" # 0:默认; 1:寻找弹珠(老虎钳可以换弹珠); 2:游戏结束 if ( - ArchiveManager.get_global_value("进入瞎子卧室", false) - and ArchiveManager.get_global_value("ball_game_stage", 0) < 2 + ArchiveManager.get_global_value("c02_the_blind_room_entered", false) + and ArchiveManager.get_global_value("c02_ball_game_stage", 0) < 2 ): # 进入瞎子卧室后,可开始弹珠游戏 ball_game_boys_ambush.enabled = true @@ -72,10 +72,10 @@ func _on_mice_hole_interacted(): func boys_ball_game() -> void: # 0:默认; 1:寻找弹珠(老虎钳可以换弹珠); 2:游戏结束 - var stage = ArchiveManager.get_global_value("ball_game_stage", 0) + var stage = ArchiveManager.get_global_value("c02_ball_game_stage", 0) if stage == 0: - ArchiveManager.set_global_entry("ball_game_stage", 1) - ArchiveManager.set_global_entry("pliers_to_ball", true) + ArchiveManager.set_global_entry("c02_ball_game_stage", 1) + ArchiveManager.set_global_entry("c02_pliers_to_ball", true) SceneManager.freeze_player(0) DialogueManager.show_dialogue_balloon(dialogue_c02, "c02_s05_三男孩弹珠游戏1") await DialogueManager.dialogue_ended diff --git a/scene/ground/scene/c02/s08_animation.gd b/scene/ground/scene/c02/s08_animation.gd index 73ec427c..0232639d 100644 --- a/scene/ground/scene/c02/s08_animation.gd +++ b/scene/ground/scene/c02/s08_animation.gd @@ -61,7 +61,7 @@ func enter_room() -> void: player.visible = true SceneManager.release_player() # - ArchiveManager.set_global_entry("进入瞎子卧室", true) + ArchiveManager.set_global_entry("c02_the_blind_room_entered", true) func setup_rect_after_entered() -> void: diff --git a/scene/ground/scene/c02/s09_animation.gd b/scene/ground/scene/c02/s09_animation.gd index c063e503..ae724494 100644 --- a/scene/ground/scene/c02/s09_animation.gd +++ b/scene/ground/scene/c02/s09_animation.gd @@ -14,7 +14,16 @@ func _ready() -> void: func _on_ground_ready() -> void: - pass + var counter = $"../DeployLayer/柜子" + # counter 默认在 s10 中 x 为 364.0 + if ArchiveManager.get_global_value("c02_counter_pushed_out"): + counter.queue_free() + else: + var default_counter_x = 364.0 + var counter_x = ArchiveManager.get_global_value("c02_counter_x", default_counter_x) + var diff = counter_x - default_counter_x + counter.position.x += diff + func mouse_animation() -> void: - $"../DeployLayer/老鼠衔大洋".play() \ No newline at end of file + $"../DeployLayer/老鼠衔大洋".play() diff --git a/scene/ground/scene/c02/s09_裂缝.tscn b/scene/ground/scene/c02/s09_裂缝.tscn index 4ed8f120..a028f93c 100644 --- a/scene/ground/scene/c02/s09_裂缝.tscn +++ b/scene/ground/scene/c02/s09_裂缝.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=13 format=3 uid="uid://ryups1dnwdto"] +[gd_scene load_steps=14 format=3 uid="uid://ryups1dnwdto"] [ext_resource type="PackedScene" uid="uid://dayyx4jerj7io" path="res://scene/ground/ground.tscn" id="1_o0m5w"] [ext_resource type="Script" uid="uid://beqnywn1dlnax" path="res://scene/ground/scene/c02/s09_animation.gd" id="2_34a6f"] @@ -10,6 +10,7 @@ [ext_resource type="Texture2D" uid="uid://dnkqaiugxsegs" path="res://asset/art/scene/c02/s09_裂缝/红色场景/黑手.png" id="6_71bf1"] [ext_resource type="Texture2D" uid="uid://dpmf4w76ln2uo" path="res://asset/art/scene/c02/旧版/s10_裂缝通道/fg_裂缝通道.png" id="6_nntqg"] [ext_resource type="PackedScene" uid="uid://b8ncf4d0jda8r" path="res://scene/entity/partical/particals_ash_horizontal.tscn" id="7_4a1t6"] +[ext_resource type="Texture2D" uid="uid://cuno8okh8ytw2" path="res://asset/art/scene/c02/s10_空房间/柜子.png" id="10_ow44k"] [sub_resource type="SpriteFrames" id="SpriteFrames_4a1t6"] animations = [{ @@ -86,6 +87,10 @@ position = Vector2(1715, 5) [node name="ParticalsAsh3" parent="Ground/DeployLayer" index="8" instance=ExtResource("7_4a1t6")] position = Vector2(2574, -5) +[node name="柜子" type="Sprite2D" parent="Ground/DeployLayer" index="9"] +position = Vector2(3749, -46) +texture = ExtResource("10_ow44k") + [node name="MainPlayer" parent="Ground" index="5"] position = Vector2(3750, 88) character = "吕萍爬行" diff --git a/scene/ground/scene/c02/s10_animation.gd b/scene/ground/scene/c02/s10_animation.gd index 8e59ddeb..ae166788 100644 --- a/scene/ground/scene/c02/s10_animation.gd +++ b/scene/ground/scene/c02/s10_animation.gd @@ -16,109 +16,193 @@ func _ready() -> void: return +const default_counter_x := 364.0 +# 玩家推柜子时,距 counter 中间的相对 x +const player_push_offset_x := 50.0 + var xiao_chan_sprite: AnimatedSprite2D var xiao_chan_interactable: Interactable2D var counter: Interactable2D -var wood_puppet: Ambush2D -var catty_head: Ambush2D +var wood_puppet: Pickable2D +var catty_head: Pickable2D +var door: Portal2D var portal: Portal2D +var portal_block: Sprite2D func _on_ground_ready() -> void: - if not data["entered"]: - print("第一次进入房间") - #TODO - SceneManager.pop_debug_dialog_info("美术", "第一次进入房间,蔓延的血脚印") - $"../DeployLayer/血脚印".play() - set_data("entered", true) - xiao_chan_sprite = $"../DeployLayer/大头小蝉" xiao_chan_interactable = $"../DeployLayer/Interactable小蝉" counter = $"../DeployLayer/Interactable柜子" - wood_puppet = $"../DeployLayer/Ambush木头人偶" - catty_head = $"../DeployLayer/Ambush小猫玩具脑袋" + wood_puppet = $"../DeployLayer/Pickable木头人偶" + catty_head = $"../DeployLayer/Pickable小猫玩具脑袋" + door = $"../DeployLayer/portal_left" portal = $"../DeployLayer/portal_1" + portal_block = $"../DeployLayer/墙壁封住" + + #TODO 更新贴图 进过瞎子卧室后,通道关闭 + portal_block.visible = ArchiveManager.get_global_value("c02_the_blind_room_entered", false) + + if not data["entered"]: + print("第一次进入第一章空房间") + #TODO + SceneManager.freeze_player(0) + xiao_chan_sprite.modulate.a = 0 + SceneManager.pop_debug_dialog_info("美术", "第一次进入房间,蔓延的血脚印") + var sprite = $"../DeployLayer/血脚印" as AnimatedSprite2D + sprite.play() + await sprite.animation_finished + var tween = create_tween() + tween.tween_property(xiao_chan_sprite, "modulate:a", 1.0, 1.0) + tween.tween_callback(_gaslight_on) + tween.tween_callback(SceneManager.release_player) + + door.before_pre_transport_wait.connect(_on_leave_room) - wood_puppet.visible = data["display_wood_puppet"] wood_puppet.enabled = data["display_wood_puppet"] + wood_puppet.triggered.connect(_on_pick_wood_puppet) + + catty_head.triggered.connect(_on_pick_catty_head) if xiao_chan_interactable.interacted_times > 0: - catty_head.enabled = true xiao_chan_sprite.visible = false counter.enabled = true else: - counter.enabled = false xiao_chan_interactable.interacted.connect(_on_xiao_chan_interacted) - if catty_head.played: - catty_head.visible = false - # 捡起猫头后启用传送门 - portal.enabled = true - - if ArchiveManager.get_global_value("c02_counter_pushed_out"): + counter_pushed_out = ArchiveManager.get_global_value("c02_counter_pushed_out") + if counter_pushed_out: counter.visible = false counter.enabled = false else: + # 空柜子 x 坐标 + var counter_x = ArchiveManager.get_global_value("c02_counter_x", default_counter_x) counter.interacted.connect(_on_counter_interacted) - if counter.interacted_times > 0: - counter.position.x += 50 - counter_moved_and_realease_player() + counter.global_position.x = counter_x + after_counter_moved() + + +# 点亮煤油灯 +func _gaslight_on(): + set_data("entered", true) + var gaslight = $"../DeployLayer/煤油灯" as Gaslight + gaslight.turn_on() func _on_xiao_chan_interacted() -> void: - #TODO - SceneManager.pop_debug_dialog_info("美术", "小蝉丢下木头人偶并消失") - xiao_chan_sprite.visible = false - counter.enabled = true - await get_tree().create_timer(1.0).timeout - set_data("display_wood_puppet", true) - wood_puppet.visible = true wood_puppet.enabled = true - - -func pick_wood_puppet() -> void: - set_data("display_wood_puppet", false) - SceneManager.enable_prop_item("prop_木头人偶") - wood_puppet.visible = false - wood_puppet.enabled = false - - -func _on_counter_interacted(): - if counter.interacted_times == 0: - play("pull_counter") - else: - # TODO 整段逻辑调整 - SceneManager.pop_debug_dialog_info("美术", "玩家将箱子推出房间") - ArchiveManager.set_global_entry("c02_counter_pushed_out", true) - - SceneManager.freeze_player(0) - SceneManager.get_player().walk_to(Vector2(80, 96.622), 4.0) - create_tween().tween_property(counter, "position:x", 120.0, 4.0) - await get_tree().create_timer(4.5).timeout - SceneManager.get_ground_loader().transition_to_scene("c02_s03", "3") - - -func walk_to_right_side() -> void: + wood_puppet.modulate.a = 0 + # 小蝉丢下木头人偶并消失 SceneManager.freeze_player(0) - # 走到右侧 - var player = SceneManager.get_player() as MainPlayer - player.walk_to(Vector2(410, 96.622), 1.0) - # TODO 播放动画 - SceneManager.pop_debug_dialog_info("美术", "拉动柜子的动画") - - -func counter_moved_and_realease_player(): - if catty_head.played: - portal.enabled = true - catty_head.visible = false - else: - catty_head.enabled = true + xiao_chan_sprite.play() + var tween = create_tween() + tween.tween_interval(1.0) + tween.tween_property(wood_puppet, "modulate:a", 1.0, 1.0) + await xiao_chan_sprite.animation_finished + tween = create_tween() + tween.tween_property(xiao_chan_sprite, "modulate:a", 0.0, 1.0) + counter.enabled = true SceneManager.release_player() -func pick_catty_head() -> void: - SceneManager.enable_prop_item("prop_小猫玩具的脑袋") - catty_head.visible = false - # 捡起猫头后再启用传送门 - portal.enabled = true +func _on_pick_wood_puppet() -> void: + set_data("display_wood_puppet", false) + + +func _on_leave_room(): + if pushing_counter: + counter_pushed_out = true + ArchiveManager.set_global_entry("c02_counter_pushed_out", true) + SceneManager.pop_debug_dialog_info("美术", "玩家将箱子推出房间") + + +var pushing_counter = false +var counter_pushed_out = false + + +func _on_counter_interacted(): + var player = SceneManager.get_player() as MainPlayer + if pushing_counter: + # unconnect signal + player.position_updated.disconnect(on_player_moved_counter) + player.character = "吕萍" + player.player_movement_rect.position.x -= 80 + player.player_movement_rect.size.x += 90 + else: + player.player_movement_rect.position.x += 80 + player.player_movement_rect.size.x -= 90 + SceneManager.freeze_player(0) + var x = counter.global_position.x + player_push_offset_x + # 走到右侧 + player.walk_to(Vector2(x, 96.622), 1.0) + await get_tree().create_timer(1.1).timeout + SceneManager.release_player() + player.position_updated.connect(on_player_moved_counter) + player.character = "吕萍推柜子" + # TODO 播放动画 + SceneManager.pop_debug_dialog_info("美术", "拉动柜子的动画") + + pushing_counter = !pushing_counter + + +func on_player_moved_counter(global_pos: Vector2): + var x = global_pos.x - player_push_offset_x + ArchiveManager.set_global_entry("c02_counter_x", x) + counter.global_position.x = x + after_counter_moved() + + +func _unhandled_input(event: InputEvent) -> void: + if event.is_action_pressed("cancel") and pushing_counter: + _on_counter_interacted() + get_viewport().set_input_as_handled() + + # if counter.interacted_times == 0: + # play("pull_counter") + # else: + # # TODO 整段逻辑调整 + # SceneManager.pop_debug_dialog_info("美术", "玩家将箱子推出房间") + # ArchiveManager.set_global_entry("c02_counter_pushed_out", true) + + # SceneManager.freeze_player(0) + # SceneManager.get_player().walk_to(Vector2(80, 96.622), 4.0) + # create_tween().tween_property(counter, "position:x", 120.0, 4.0) + # await get_tree().create_timer(4.5).timeout + # SceneManager.get_ground_loader().transition_to_scene("c02_s03", "3") + + +# 柜子移动后,检查是否展示后面的洞 +func after_counter_moved(): + if not counter_pushed_out: + var current_x = counter.global_position.x + # default_counter_x +- 30 + var x_diff = current_x - default_counter_x + if x_diff > -30 and x_diff < 30: + portal.enabled = false + catty_head.enabled = false + return + catty_head.enabled = true + # 进过瞎子卧室后,通道关闭 + var entered = ArchiveManager.get_global_value("c02_the_blind_room_entered", false) + if not entered and catty_head.picked: + portal.enabled = true + + +func _on_pick_catty_head() -> void: + # 进过瞎子卧室后,通道关闭 + var entered = ArchiveManager.get_global_value("c02_the_blind_room_entered", false) + if not entered and catty_head.picked: + portal.enabled = true + var inspector = SceneManager.get_inspector() + await inspector.quit_and_hidden + # 将小猫头与身子合并 + SceneManager.disable_prop_item("prop_小猫玩具的脑袋") + SceneManager.disable_prop_item("prop_无头小猫玩具") + SceneManager.enable_prop_item_silently("prop_小猫玩具完整") + var sprite = $"../DeployLayer/拼接小猫玩具" + sprite.visible = true + sprite.play() + await sprite.animation_finished + sprite.visible = false + SceneManager.enable_prop_item("prop_小猫玩具完整") diff --git a/scene/ground/scene/c02/s10_空房间.tscn b/scene/ground/scene/c02/s10_空房间.tscn index bc08e7fb..1c861a81 100644 --- a/scene/ground/scene/c02/s10_空房间.tscn +++ b/scene/ground/scene/c02/s10_空房间.tscn @@ -1,17 +1,19 @@ -[gd_scene load_steps=18 format=3 uid="uid://dny21yhtuteap"] +[gd_scene load_steps=19 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="Texture2D" uid="uid://molvyfyy63ik" path="res://asset/art/scene/c02/s10_空房间/bg_空房间.png" id="3_ox8et"] [ext_resource type="PackedScene" uid="uid://61pis75a8fdq" path="res://scene/entity/portal.tscn" id="4_pde4i"] +[ext_resource type="Texture2D" uid="uid://0uwun1mo726u" path="res://asset/art/prop/c02/绳子物品.png" id="5_3ftnp"] [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="Texture2D" uid="uid://c60erv8i2bvw4" path="res://asset/art/临时草稿/c02_第一章/血脚印.png" id="7_mty8e"] -[ext_resource type="Texture2D" uid="uid://bvoo34sy2yvas" path="res://asset/art/临时草稿/c02_第一章/小婵.png" id="8_b6d0m"] -[ext_resource type="Texture2D" uid="uid://ce3kclg1i81l3" path="res://asset/art/scene/c02/s02_大门过道/e_头套(场景中).png" id="9_psect"] -[ext_resource type="PackedScene" uid="uid://bnf3lkcbpx1ar" path="res://scene/entity/ambush.tscn" id="10_psect"] -[ext_resource type="Texture2D" uid="uid://cca4c6xgyy0sl" path="res://asset/art/prop/c02/木头人偶.png" id="11_ob1ax"] -[ext_resource type="Texture2D" uid="uid://cesymrbjogfmy" path="res://asset/art/prop/c02/小猫玩具脑袋物品.png" id="12_uapvb"] +[ext_resource type="Texture2D" uid="uid://dg43u88jwlbpu" path="res://asset/art/prop/c02/新小猫头.png" id="8_3ftnp"] +[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="SpriteFrames" uid="uid://cwes55ajc3rd4" path="res://asset/art/gif/c02_空房间/frames.tres" id="15_2j5dr"] +[ext_resource type="Texture2D" uid="uid://cgghff16powfg" path="res://asset/art/ui/prop/prop遮罩.png" id="16_kqj5r"] [sub_resource type="Animation" id="Animation_mty8e"] length = 0.001 @@ -118,21 +120,13 @@ _data = { [sub_resource type="SpriteFrames" id="SpriteFrames_ylhfc"] animations = [{ "frames": [{ -"duration": 1.0, +"duration": 2.0, +"texture": ExtResource("7_mty8e") +}, { +"duration": 2.0, "texture": ExtResource("7_mty8e") }], -"loop": true, -"name": &"default", -"speed": 5.0 -}] - -[sub_resource type="SpriteFrames" id="SpriteFrames_mty8e"] -animations = [{ -"frames": [{ -"duration": 1.0, -"texture": ExtResource("8_b6d0m") -}], -"loop": true, +"loop": false, "name": &"default", "speed": 5.0 }] @@ -178,59 +172,79 @@ portal_name = "1" target_scene = "c02_s09" target_portal = "right" -[node name="血脚印" type="AnimatedSprite2D" parent="Ground/DeployLayer" index="3"] +[node name="墙壁封住" type="Sprite2D" parent="Ground/DeployLayer" index="3"] +position = Vector2(366, 37.4657) +scale = Vector2(0.2, 0.2) +texture = ExtResource("5_3ftnp") + +[node name="Label" type="Label" parent="Ground/DeployLayer/墙壁封住"] +offset_right = 40.0 +offset_bottom = 15.0 +theme_override_font_sizes/font_size = 20 +text = "洞口封住 +" + +[node name="血脚印" type="AnimatedSprite2D" parent="Ground/DeployLayer" index="4"] position = Vector2(263, 35.4939) sprite_frames = SubResource("SpriteFrames_ylhfc") flip_h = true -[node name="Ambush小猫玩具脑袋" parent="Ground/DeployLayer" index="4" instance=ExtResource("10_psect")] -position = Vector2(360, 62.1142) +[node name="Pickable小猫玩具脑袋" parent="Ground/DeployLayer" index="5" instance=ExtResource("6_27dvh")] +position = Vector2(360, 58.1705) enabled = false -trigger_mode = "interact" -hook_method = "pick_catty_head" +prop_key = "prop_小猫玩具的脑袋" -[node name="Sprite2D" type="Sprite2D" parent="Ground/DeployLayer/Ambush小猫玩具脑袋"] +[node name="Sprite2D" type="Sprite2D" parent="Ground/DeployLayer/Pickable小猫玩具脑袋"] show_behind_parent = true -position = Vector2(0, 5.91564) -rotation = -1.19178 -scale = Vector2(0.13, 0.13) -texture = ExtResource("12_uapvb") +rotation = -0.364126 +scale = Vector2(0.3, 0.3) +texture = ExtResource("8_3ftnp") -[node name="Interactable柜子" parent="Ground/DeployLayer" index="5" instance=ExtResource("5_ylhfc")] +[node name="Interactable柜子" parent="Ground/DeployLayer" index="6" instance=ExtResource("5_ylhfc")] position = Vector2(364, 44.3673) texture = ExtResource("6_mty8e") enabled = false mute_when_interacted = true one_shot = false -[node name="大头小蝉" type="AnimatedSprite2D" parent="Ground/DeployLayer" index="6"] -position = Vector2(341, 3.94376) -sprite_frames = SubResource("SpriteFrames_mty8e") +[node name="大头小蝉" type="AnimatedSprite2D" parent="Ground/DeployLayer" index="7"] +position = Vector2(351, 19.7188) +sprite_frames = ExtResource("15_2j5dr") +animation = &"坐箱子小婵丢人偶" -[node name="Sprite2D" type="Sprite2D" parent="Ground/DeployLayer/大头小蝉"] -position = Vector2(-38, -59.1564) -rotation = -0.662191 -scale = Vector2(1.2576, 1.01944) -texture = ExtResource("9_psect") - -[node name="Interactable小蝉" parent="Ground/DeployLayer" index="7" instance=ExtResource("5_ylhfc")] -position = Vector2(340, 10.8453) +[node name="Interactable小蝉" parent="Ground/DeployLayer" index="8" instance=ExtResource("5_ylhfc")] +position = Vector2(349, 6.90158) mute_when_interacted = true disable_prop_after_interacted = true prop_key = "prop_木头人偶" -[node name="Ambush木头人偶" parent="Ground/DeployLayer" index="8" instance=ExtResource("10_psect")] -position = Vector2(324, 73.9455) -trigger_mode = "interact" -one_shot = false -hook_method = "pick_wood_puppet" +[node name="Pickable木头人偶" parent="Ground/DeployLayer" index="9" instance=ExtResource("6_27dvh")] +position = Vector2(423, 76.9034) +enabled = false +prop_key = "prop_木头人偶" -[node name="Sprite2D" type="Sprite2D" parent="Ground/DeployLayer/Ambush木头人偶"] +[node name="Sprite2D" type="Sprite2D" parent="Ground/DeployLayer/Pickable木头人偶"] show_behind_parent = true -position = Vector2(0, 5.91564) rotation = -1.19178 -scale = Vector2(0.13, 0.13) -texture = ExtResource("11_ob1ax") +scale = Vector2(0.25, 0.25) +texture = ExtResource("12_27dvh") + +[node name="煤油灯" parent="Ground/DeployLayer" index="10" instance=ExtResource("13_27dvh")] +position = Vector2(300, 3.94376) +debug_light_switch = false +prop_key2 = "" +prop_key3 = "" + +[node name="拼接小猫玩具" type="AnimatedSprite2D" parent="Ground/DeployLayer" index="11"] +visible = false +z_index = 10 +position = Vector2(303, 1.97188) +sprite_frames = ExtResource("15_2j5dr") +animation = &"小猫玩具合并动画" + +[node name="Sprite2D" type="Sprite2D" parent="Ground/DeployLayer/拼接小猫玩具"] +show_behind_parent = true +texture = ExtResource("16_kqj5r") [node name="MainPlayer" parent="Ground" index="5"] position = Vector2(410, 96.622) diff --git a/scene/ground/script/c02/s00_煤油灯.gd b/scene/ground/script/c02/s00_煤油灯.gd index 9c26a273..266ab211 100644 --- a/scene/ground/script/c02/s00_煤油灯.gd +++ b/scene/ground/script/c02/s00_煤油灯.gd @@ -1,6 +1,6 @@ @tool -extends Interactable2D +class_name Gaslight extends Interactable2D # 点燃信号 signal lighted @@ -67,6 +67,13 @@ func _ready() -> void: _switch_gaslight(false) interacted.connect(_gaslight_interacted) +# 永久打开煤油灯 +func turn_on(): + # 保存打开次数 + interacted_times = 1 + _switch_gaslight() + _check_sign_display() + func _switch_gaslight(state := true): point_light.enabled = state diff --git a/scene/ground/script/c02/小手讨东西.gd b/scene/ground/script/c02/小手讨东西.gd index fe4dbf06..5e43eead 100644 --- a/scene/ground/script/c02/小手讨东西.gd +++ b/scene/ground/script/c02/小手讨东西.gd @@ -94,9 +94,9 @@ func _set_sign_texture_to_prop(key): if key == "prop_锡箔元宝": interactable = true elif accept_ball_or_plier and key == "prop_老虎钳": - interactable = ArchiveManager.get_global_value("pliers_to_ball", false) + interactable = ArchiveManager.get_global_value("c02_pliers_to_ball", false) elif accept_ball_or_plier and key == "prop_弹珠": - interactable = not ArchiveManager.get_global_value("pliers_to_ball", false) + interactable = not ArchiveManager.get_global_value("c02_pliers_to_ball", false) if interactable: sign_mark.sprite2d.texture = matched_sign_texture @@ -206,7 +206,7 @@ func _on_interacted() -> void: coin.visible = true # 是否允许老虎钳换弹珠 - var pliers_to_ball = ArchiveManager.get_global_value("pliers_to_ball", false) + var pliers_to_ball = ArchiveManager.get_global_value("c02_pliers_to_ball", false) if accept_ball_or_plier and key == "prop_老虎钳" and pliers_to_ball: interacted_success = true SceneManager.disable_prop_item("prop_老虎钳") diff --git a/scene/ground/script/c02/敲门游戏.gd b/scene/ground/script/c02/敲门游戏.gd index 509f8057..65266f43 100644 --- a/scene/ground/script/c02/敲门游戏.gd +++ b/scene/ground/script/c02/敲门游戏.gd @@ -2,9 +2,8 @@ extends CanvasLayer signal exit(success: bool) -@onready var button = $Button as Button - -var current_id = 0 +@onready var knock_sfx = $Knock as AudioStreamPlayer +@onready var button = $TextureButton as TextureButton var dialogue = preload("res://asset/dialogue/c02.dialogue") @@ -16,15 +15,36 @@ func _ready() -> void: SceneManager.pop_debug_dialog_info("对白", "理发上楼,看病上楼") DialogueManager.show_dialogue_balloon(dialogue, "c02_s03_敲门游戏") - if not ArchiveManager.get_global_value("c02_eavesdrop_finished", false): - button.queue_free() + if ( + # 未偷听,或已敲门成功,则禁用 + not ArchiveManager.get_global_value("c02_eavesdrop_finished", false) + or ArchiveManager.get_global_value("c02_meat_bucket_enabled", false) + ): + button.disabled = true + + +var current_id = 0 +var knock_time := 0.0 func _on_button_pressed() -> void: + knock_sfx.play() current_id += 1 - # TODO 敲门游戏节奏设计 - button.text = "敲门节奏&次数:" + str(current_id) - if current_id >= 5: - button.text = "成功!" - ArchiveManager.set_global_entry("meat_bucket_enabled", true) + var last_knock_time = knock_time + knock_time = Time.get_ticks_msec() + var diff = knock_time - last_knock_time + # 敲门游戏节奏: 三快(<0.8s)三慢(>1s & <5s) + if current_id > 1 and current_id <= 3: + if diff > 800: + current_id = 0 + else: + if diff < 1000 or diff > 5000: + current_id = 0 + if current_id == 6: + ArchiveManager.set_global_entry("c02_eavesdrop_finished", true) + SceneManager.pop_debug_dialog_info("音效", "敲门游戏成功!") + current_id = 0 + button.disabled = true exit.emit(true) + else: + SceneManager.pop_debug_dialog_info("音效", "敲门:" + str(current_id)) diff --git a/scene/ground/script/c02/敲门游戏.tscn b/scene/ground/script/c02/敲门游戏.tscn index b53c7039..df88273e 100644 --- a/scene/ground/script/c02/敲门游戏.tscn +++ b/scene/ground/script/c02/敲门游戏.tscn @@ -1,30 +1,21 @@ -[gd_scene load_steps=3 format=3 uid="uid://bxpexbk7f3rax"] +[gd_scene load_steps=4 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="Texture2D" uid="uid://djpmubo5y3jvo" path="res://asset/art/临时草稿/敲门门板.png" id="2_dnsvv"] +[ext_resource type="AudioStream" uid="uid://c7k1gohcfiyg3" path="res://asset/audio/sfx/ui/开门.mp3" id="2_n5c57"] +[ext_resource type="Texture2D" uid="uid://dkvuc5llqax6d" path="res://asset/art/scene/c02/肉铺门板.png" id="3_n5c57"] [node name="敲门游戏" type="CanvasLayer"] script = ExtResource("1_dnsvv") -[node name="TextureRect" type="TextureRect" parent="."] -anchors_preset = 8 -anchor_left = 0.5 -anchor_top = 0.5 -anchor_right = 0.5 -anchor_bottom = 0.5 -offset_left = -309.0 -offset_top = -145.0 -offset_right = 1475.0 -offset_bottom = 685.0 +[node name="Knock" type="AudioStreamPlayer" parent="."] +stream = ExtResource("2_n5c57") +bus = &"game_sfx" + +[node name="TextureButton" type="TextureButton" parent="."] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -scale = Vector2(0.35, 0.35) -texture = ExtResource("2_dnsvv") - -[node name="Button" type="Button" parent="."] -offset_left = 168.0 -offset_top = 139.0 -offset_right = 373.0 -offset_bottom = 177.0 -theme_override_font_sizes/font_size = 24 -text = "敲门节奏&次数:1" +texture_normal = ExtResource("3_n5c57") +stretch_mode = 6 diff --git a/scene/little_game/八音盒.gd b/scene/little_game/八音盒.gd index fe633daf..85dd1b08 100644 --- a/scene/little_game/八音盒.gd +++ b/scene/little_game/八音盒.gd @@ -9,13 +9,13 @@ signal exit(success: bool) var xiaochan_plugged := false: set(value): xiaochan_plugged = value - ArchiveManager.set_global_entry("musicbox_xiaochan_plugged", value) + ArchiveManager.set_global_entry("c02_musicbox_xiaochan_plugged", value) func _ready() -> void: if Engine.is_editor_hint(): return - xiaochan_plugged = ArchiveManager.get_global_value("musicbox_xiaochan_plugged", false) + xiaochan_plugged = ArchiveManager.get_global_value("c02_musicbox_xiaochan_plugged", false) # %"小蝉人偶".visible = xiaochan_plugged diff --git a/scene/little_game/弹珠游戏/弹珠游戏.gd b/scene/little_game/弹珠游戏/弹珠游戏.gd index 7559252d..9b4a7053 100644 --- a/scene/little_game/弹珠游戏/弹珠游戏.gd +++ b/scene/little_game/弹珠游戏/弹珠游戏.gd @@ -110,7 +110,7 @@ func _unhandled_input(event: InputEvent) -> void: func game_over() -> void: exit.emit(true) # 0:默认; 1:寻找弹珠(老虎钳可以换弹珠); 2:游戏结束 - ArchiveManager.set_global_entry("ball_game_stage", 2) + ArchiveManager.set_global_entry("c02_ball_game_stage", 2) SceneManager.disable_prop_item("prop_弹珠") SceneManager.pop_debug_dialog_info("弹珠", "游戏关卡待完善") DialogueManager.show_dialogue_balloon(dialogue_c02, "c02_弹珠游戏5") diff --git a/scene/little_game/弹珠游戏/弹珠游戏.tscn b/scene/little_game/弹珠游戏/弹珠游戏.tscn index 9099cc38..875be0e3 100644 --- a/scene/little_game/弹珠游戏/弹珠游戏.tscn +++ b/scene/little_game/弹珠游戏/弹珠游戏.tscn @@ -71,3 +71,27 @@ id = "3" position = Vector2(204, 126) scale = Vector2(1.2275, 1.2275) collision_layer = 132 + +[node name="MarginContainer" type="MarginContainer" parent="."] +anchors_preset = 5 +anchor_left = 0.5 +anchor_right = 0.5 +offset_left = -20.0 +offset_right = 20.0 +offset_bottom = 40.0 +grow_horizontal = 2 +theme_override_constants/margin_top = 40 + +[node name="RichTextLabel" type="RichTextLabel" parent="MarginContainer"] +custom_minimum_size = Vector2(200, 0) +layout_mode = 2 +size_flags_horizontal = 4 +size_flags_vertical = 4 +theme_override_colors/default_color = Color(0.856067, 0.856067, 0.856067, 1) +theme_override_colors/font_outline_color = Color(0.401628, 0.253369, 0.0745033, 1) +theme_override_constants/outline_size = 5 +theme_override_font_sizes/normal_font_size = 24 +bbcode_enabled = true +text = "[wave amp=20.0 freq=5.0 connected=1][shake rate=10.0 level=3 connected=1]弹珠拿出来[/shake][/wave]" +fit_content = true +horizontal_alignment = 1 diff --git a/scene/player/main_player.gd b/scene/player/main_player.gd index f1896091..301f23b0 100644 --- a/scene/player/main_player.gd +++ b/scene/player/main_player.gd @@ -3,11 +3,12 @@ extends CharacterBody2D class_name MainPlayer +signal position_updated(global_pos: Vector2) signal os_finished signal animation_finished @export var camera_marker: CameraFocusMarker -@export_enum("吕萍", "吕萍爬行", "吕萍带小猫", "小小蝶") var character := "吕萍": +@export_enum("吕萍", "吕萍爬行", "吕萍带小猫", "吕萍推柜子", "小小蝶") var character := "吕萍": set(val): character = val # 使用 new,方便在 editor 中刷新新值 @@ -20,7 +21,7 @@ signal animation_finished @export var player_movement_rect := Rect2(50, -500, 1400, 1000) @export var velocity_ratio := 1.0 @export var running_locked := false -# action_locked 用于设置界面等强制锁定,action_freezed 用于查看物品等锁定 +# action_locked 用于设置界面等强制锁定(禁止游戏场景内的任何操作),action_freezed 用于查看物品等锁定(主要用于禁止在场景中移动) # action_locked 优先级高于 action_freezed # action_locked 对应 lock 与 unlock 方法 @export var action_locked := false: @@ -196,6 +197,7 @@ func _physics_process(_delta: float) -> void: # if delta_x: # SceneManager.player_moved_delta_x(delta_x) _tweak_camera_marker() + position_updated.emit(global_position) # drag the camera marker against the player movement diff --git a/scene/player/player_animation_config.gd b/scene/player/player_animation_config.gd index cd699856..d785cfe4 100644 --- a/scene/player/player_animation_config.gd +++ b/scene/player/player_animation_config.gd @@ -67,6 +67,21 @@ var ANIMATION_CONFIG = { MOVEMENT_WALKING: [&"c00_吕萍带小猫_walking_left", &"c00_吕萍带小猫_walking_right"], MOVEMENT_RUNNING: [&"c00_吕萍带小猫_walking_left", &"c00_吕萍带小猫_walking_right"], }, + "吕萍推柜子": + { + "scale": Vector2(1.0, 1.0), + "speed_walking": 40.0, + "can_run": false, + "speed_runnig": 40.0, + "walk_footstep": 0.5, + "run_footstep": 0.5, + "os_height": 120.0, + # 人物脚底 offset,吕萍为 0,高 200px,足底在 100px 处 + "foot_offset": Vector2(0, -44), + MOVEMENT_IDLE: [&"c00_吕萍_推柜子_idle", &"c00_吕萍_推柜子_idle"], + MOVEMENT_WALKING: [&"c00_吕萍_推柜子_l", &"c00_吕萍_推柜子_r"], + MOVEMENT_RUNNING: [&"c00_吕萍_推柜子_l", &"c00_吕萍_推柜子_r"], + }, # "小蝶": # { # "scale": Vector2.ONE, diff --git a/scene/prop/prop_inventory_resource.gd b/scene/prop/prop_inventory_resource.gd index 40a5d6ba..d20c2f80 100644 --- a/scene/prop/prop_inventory_resource.gd +++ b/scene/prop/prop_inventory_resource.gd @@ -29,6 +29,7 @@ func current_item_key() -> String: func enable_item(prop_key: String) -> void: + # 重复 enable 无负面影响 if not enabled_items.has(prop_key): enabled_items.append(prop_key) # 新增后直接选中