From 1107a22eb53035d23303ca85e98a3b1bf8073a54 Mon Sep 17 00:00:00 2001 From: cakipaul Date: Fri, 11 Jul 2025 03:16:22 +0800 Subject: [PATCH] RELEASE_STAGE=1 --- manager/config_manager/global_config.gd | 6 +- manager/event_manager/event_manager.gd | 1 + scene/ground/scene/c03/s04_李癞房间.tscn | 2 +- scene/index/index_page.tscn | 14 +- scene/index/启动入口.gd | 11 +- scene/index/第二章.tres | 661 ++++++++++++++++++++++- util/tester.gd | 31 +- 7 files changed, 701 insertions(+), 25 deletions(-) diff --git a/manager/config_manager/global_config.gd b/manager/config_manager/global_config.gd index d9728a0a..8fe5d68e 100644 --- a/manager/config_manager/global_config.gd +++ b/manager/config_manager/global_config.gd @@ -4,8 +4,10 @@ signal streamer_mode_updated #const DEBUG = true static var DEBUG = false -# 影响事件的 release_stage # 0demo 1release -const RELEASE_STAGE := 0 +# 影响事件的 release_stage +# 0:demo +# 1:v1.0正式版 +const RELEASE_STAGE := 1 # 与 Editor 编辑器有 Debugger 连接 # static var EDITOR = false diff --git a/manager/event_manager/event_manager.gd b/manager/event_manager/event_manager.gd index 77a94c47..cab46028 100644 --- a/manager/event_manager/event_manager.gd +++ b/manager/event_manager/event_manager.gd @@ -9,6 +9,7 @@ func _ready() -> void: return # 0demo 1release set_stage("release_stage", GlobalConfig.RELEASE_STAGE) + print_rich("[color=brown] release_stage = %s[/color]" % GlobalConfig.RELEASE_STAGE) func get_chapter_stage() -> int: diff --git a/scene/ground/scene/c03/s04_李癞房间.tscn b/scene/ground/scene/c03/s04_李癞房间.tscn index a20c69e4..ad446101 100644 --- a/scene/ground/scene/c03/s04_李癞房间.tscn +++ b/scene/ground/scene/c03/s04_李癞房间.tscn @@ -64,7 +64,7 @@ enabled = false [node name="MainPlayer" parent="Ground" index="5"] position = Vector2(63, 100) catty_light_energy = 0.5 -player_movement_rect = Rect2(26, -158, 587, 316) +player_movement_rect = Rect2(26, -158, 445, 316) facing_direction = Vector2(1, 0) [node name="CameraFocusMarker" parent="Ground" index="6"] diff --git a/scene/index/index_page.tscn b/scene/index/index_page.tscn index fcebe6f9..5a6230c0 100644 --- a/scene/index/index_page.tscn +++ b/scene/index/index_page.tscn @@ -151,16 +151,22 @@ color = Color(0, 0, 0, 1) [node name="启动入口" type="VBoxContainer" parent="."] layout_mode = 0 -offset_left = 305.0 -offset_top = 114.0 -offset_right = 345.0 -offset_bottom = 154.0 +offset_left = 298.0 +offset_top = 50.0 +offset_right = 396.0 +offset_bottom = 172.0 script = ExtResource("7_1sxgt") [node name="Label" type="Label" parent="启动入口"] layout_mode = 2 text = "【仅测试版本启用】" +[node name="DebugMode" type="Button" parent="启动入口"] +custom_minimum_size = Vector2(50, 0) +layout_mode = 2 +text = "退出 debug mode(仅本次启动游戏有效,若想持续生效需退出游戏后改动 config.tres/.res )" +autowrap_mode = 3 + [node name="Chapter1" type="Button" parent="启动入口"] layout_mode = 2 text = "从第一章开始新游戏" diff --git a/scene/index/启动入口.gd b/scene/index/启动入口.gd index da2cd1b3..6ee3cbbf 100644 --- a/scene/index/启动入口.gd +++ b/scene/index/启动入口.gd @@ -5,12 +5,21 @@ func _ready() -> void: if not GlobalConfig.DEBUG: queue_free() return + $DebugMode.pressed.connect(_exit_debug_mode) $Chapter1.pressed.connect(_start_game.bind(1)) + $Chapter2.pressed.connect(_start_game.bind(2)) + $Chapter3.pressed.connect(_start_game.bind(3)) + + +func _exit_debug_mode() -> void: + GlobalConfig.DEBUG = false + print_rich("[color=orange]Debug mode disabled[/color]") + queue_free() func _start_game(chapter: int) -> void: $"../SfxClick".global_play() - var archive_res:AssembledArchive + var archive_res: AssembledArchive if chapter == 1: archive_res = load("uid://x2yr8b2ul5al") elif chapter == 2: diff --git a/scene/index/第二章.tres b/scene/index/第二章.tres index b0d6700c..dd3be4fa 100644 --- a/scene/index/第二章.tres +++ b/scene/index/第二章.tres @@ -1,17 +1,582 @@ -[gd_resource type="Resource" script_class="AssembledArchive" load_steps=5 format=3 uid="uid://b45y2iffjdieg"] +[gd_resource type="Resource" script_class="AssembledArchive" load_steps=19 format=3 uid="uid://b45y2iffjdieg"] [ext_resource type="Script" uid="uid://b63jgb1ag242f" path="res://manager/archive_manager/ground_archive.gd" id="1_6q3u4"] [ext_resource type="Script" uid="uid://cay6xv3x51phl" path="res://scene/ux/prop_inventory_resource.gd" id="2_sql7f"] [ext_resource type="Script" uid="uid://cusw17h37oc0g" path="res://manager/archive_manager/assembled_archive.gd" id="3_qjj7j"] [sub_resource type="Resource" id="Resource_6q3u4"] +script = ExtResource("1_6q3u4") +scene_name = "c02_s01" +data = { +"AnimationPlayer": {}, +"Local寻人启事": { +"icount": 0 +}, +"Note门口": { +"icount": 2 +}, +"portal_left": { +"icount": 0 +}, +"portal_right": { +"icount": 1 +} +} + +[sub_resource type="Resource" id="Resource_qjj7j"] +script = ExtResource("1_6q3u4") +scene_name = "c02_s02" +data = { +"Ambush太暗了": { +"played": true +}, +"Ambush小蝉闪现": { +"played": true +}, +"Ambush推小鞋子": { +"played": true +}, +"Ambush杂物堆": { +"played": true +}, +"Ambush纸人": { +"played": false +}, +"AnimationPlayer": { +"first_enter": true, +"flyer_shaven": true +}, +"Closeup八音盒": { +"icount": 8, +"interacted_times": 8 +}, +"Closeup刮海报": { +"icount": 1, +"interacted_times": 1 +}, +"InteractableLeftPortal": { +"icount": 0, +"interacted_times": 0 +}, +"Interactable小鞋子": { +"icount": 1, +"interacted_times": 1 +}, +"Note大头娃娃": { +"icount": 0 +}, +"Note老鼠洞": { +"icount": 0 +}, +"portal_left": { +"icount": 0 +}, +"portal_right": { +"icount": 3 +}, +"海报1": { +"icount": 1 +}, +"煤油灯": { +"icount": 0, +"interacted_times": 0 +}, +"青岛啤酒": { +"icount": 1 +}, +"鼠疫海报": { +"icount": 0 +} +} + +[sub_resource type="Resource" id="Resource_ja7w6"] +script = ExtResource("1_6q3u4") +scene_name = "c02_s03" +data = { +"Ambush保卫科旁边os": { +"played": true +}, +"Ambush偷听对话": { +"played": true +}, +"Ambush惊悚闪电": { +"played": true +}, +"Ambush点火游戏阻挡右移": { +"played": false +}, +"Ambush等待的小蝉": { +"played": true +}, +"Ambush老虎钳后小蝉跑": { +"played": true +}, +"Ambush要下雨了": { +"played": true +}, +"Ambush闷雷纸人": { +"played": true +}, +"Ambush霸凌": { +"played": true +}, +"AnimationPlayer": {}, +"Closeup井": { +"icount": 1, +"interacted_times": 1 +}, +"Closeup抓药游戏": { +"icount": 0, +"interacted_times": 0 +}, +"Closeup敲门游戏": { +"icount": 1, +"interacted_times": 1 +}, +"Interactable柜子": { +"icount": 2, +"interacted_times": 2 +}, +"Interactable铁门": { +"icount": 1, +"interacted_times": 1 +}, +"Note柜子可放置区域": { +"icount": 0 +}, +"Note算命摊位": { +"icount": 0 +}, +"Note血迹": { +"icount": 0 +}, +"Npc井边疯子": { +"icount": 2 +}, +"Pickable小鞋子": { +"picked": true +}, +"portal_1": { +"icount": 3 +}, +"portal_2": { +"icount": 4 +}, +"portal_3": { +"icount": 2 +}, +"portal_4": { +"icount": 0 +}, +"portal_5": { +"icount": 12 +}, +"portal_left": { +"icount": 2 +}, +"portal_right": { +"icount": 0 +} +} + +[sub_resource type="Resource" id="Resource_175lw"] +script = ExtResource("1_6q3u4") +scene_name = "c02_s04" +data = { +"Ambush进门看到小蝉": { +"played": true +}, +"AnimationPlayer": {}, +"Closeup折锡纸": { +"icount": 1, +"interacted_times": 1 +}, +"Closeup老鼠精": { +"icount": 0, +"interacted_times": 0 +}, +"Closeup花名册": { +"icount": 0, +"interacted_times": 0 +}, +"Local寻人启事": { +"icount": 0 +}, +"Pickable元宝": { +"picked": true +}, +"portal_left": { +"icount": 3 +}, +"portal_right": { +"icount": 0 +}, +"小手讨东西": { +"holding_prop": "", +"icount": 5, +"is_holding_cup": false, +"tin_coin_drop": false +} +} + +[sub_resource type="Resource" id="Resource_xnubk"] +script = ExtResource("1_6q3u4") +scene_name = "c02_s05" +data = { +"Ambush小蝉消失": { +"played": true +}, +"Ambush更新一楼地图": { +"played": true +}, +"Ambush杂物堆": { +"played": true +}, +"Ambush老鼠叼肉": { +"played": false +}, +"AnimationPlayer": {}, +"Closeup戏台": { +"icount": 0, +"interacted_times": 0 +}, +"Closeup拿人偶后记忆闪回": { +"icount": 0, +"interacted_times": 0 +}, +"Interactable粘鼠板": { +"icount": 1, +"interacted_times": 1 +}, +"Note一楼内侧通道": { +"icount": 0 +}, +"Note垃圾通道": { +"icount": 0 +}, +"Note死老鼠": { +"icount": 0 +}, +"Npc疯子": { +"icount": 1 +}, +"Pickable掉落的肉": { +"picked": true +}, +"portal_1": { +"icount": 3 +}, +"portal_2": { +"icount": 0 +}, +"portal_left": { +"icount": 5 +}, +"portal_right": { +"icount": 0 +} +} + +[sub_resource type="Resource" id="Resource_xfhwh"] +script = ExtResource("1_6q3u4") +scene_name = "c02_s06" +data = { +"Ambush三男孩": { +"played": true +}, +"Ambush小蝉偷看": { +"played": true +}, +"Ambush解锁二楼地图": { +"played": true +}, +"Ambush走到尽头后小蝉跑": { +"played": false +}, +"AnimationPlayer": {}, +"Closeup弹珠游戏": { +"icount": 0, +"interacted_times": 0 +}, +"Closeup水盆": { +"icount": 0, +"interacted_times": 0 +}, +"Closeup谢幕演出": { +"icount": 0, +"interacted_times": 0 +}, +"Inspectable小猫纸条": { +"icount": 1 +}, +"Interactable老鼠洞": { +"icount": 2, +"interacted_times": 2 +}, +"Note楼梯杂物堆": { +"icount": 0 +}, +"portal_1": { +"icount": 0 +}, +"portal_2": { +"icount": 0 +}, +"portal_3": { +"icount": 1 +}, +"portal_4": { +"icount": 0 +}, +"portal_left": { +"icount": 3 +}, +"portal_right": { +"icount": 0 +}, +"煤油灯": { +"icount": 2, +"interacted_times": 1 +} +} + +[sub_resource type="Resource" id="Resource_53fcv"] +script = ExtResource("1_6q3u4") +scene_name = "c02_s07" +data = { +"AnimationPlayer": { +"flyer_shaven": true +}, +"Closeup刮海报": { +"icount": 1, +"interacted_times": 1 +}, +"Note老鼠洞": { +"icount": 0 +}, +"Pickable元宝": { +"picked": false +}, +"Pickable粘鼠板": { +"picked": true +}, +"portal_1": { +"icount": 2 +}, +"portal_left": { +"icount": 0 +}, +"portal_right": { +"icount": 4 +}, +"小手讨东西": { +"holding_prop": "", +"icount": 2, +"is_holding_cup": true, +"tin_coin_drop": false +} +} + +[sub_resource type="Resource" id="Resource_cio48"] +script = ExtResource("1_6q3u4") +scene_name = "c02_s08" +data = { +"Ambush偷听": { +"played": true +}, +"Ambush回看洞口": { +"played": true +}, +"AnimationPlayer": { +"first_entered": false, +"hole_interacted_times": 3 +}, +"Closeup画": { +"icount": 1, +"interacted_times": 1 +}, +"Closeup讨厌他们": { +"icount": 1, +"interacted_times": 1 +}, +"Note八卦图": { +"icount": 1 +}, +"Note十字架": { +"icount": 0 +}, +"portal_1": { +"icount": 1 +}, +"portal_left": { +"icount": 1 +}, +"portal_right": { +"icount": 0 +}, +"煤油灯": { +"icount": 1, +"interacted_times": 1 +} +} + +[sub_resource type="Resource" id="Resource_i3b22"] +script = ExtResource("1_6q3u4") +scene_name = "c02_s09" +data = { +"Ambush剪影指天": { +"played": true +}, +"Ambush老鼠": { +"played": true +}, +"AnimationPlayer": {}, +"portal_left": { +"icount": 1 +}, +"portal_right": { +"icount": 0 +} +} + +[sub_resource type="Resource" id="Resource_cpr7i"] +script = ExtResource("1_6q3u4") +scene_name = "c02_s10" +data = { +"Ambush首次进入血脚印": { +"played": true +}, +"AnimationPlayer": { +"display_wood_puppet": false +}, +"Closeup头套": { +"icount": 1, +"interacted_times": 1 +}, +"Interactable小蝉": { +"icount": 1, +"interacted_times": 1 +}, +"Interactable柜子": { +"icount": 1, +"interacted_times": 1 +}, +"Note进入隧道询问": { +"icount": 1 +}, +"Pickable小猫玩具脑袋": { +"picked": true +}, +"Pickable小蝉人偶": { +"picked": true +}, +"portal_left": { +"icount": 1 +}, +"portal_right": { +"icount": 0 +}, +"煤油灯": { +"icount": 0, +"interacted_times": 1 +} +} + +[sub_resource type="Resource" id="Resource_06ncl"] +script = ExtResource("1_6q3u4") +scene_name = "c02_s12" +data = { +"AnimationPlayer": {}, +"portal_left": { +"icount": 2 +}, +"portal_right": { +"icount": 0 +} +} + +[sub_resource type="Resource" id="Resource_xhybu"] +script = ExtResource("1_6q3u4") +scene_name = "c02_s13" +data = { +"Ambush猫咪敲门互动": { +"played": false +}, +"Ambush猫咪敲门互动2": { +"played": false +}, +"Ambush猫咪敲门互动3": { +"played": false +}, +"Ambush终点光芒互动": { +"played": true +}, +"AnimationPlayer": {}, +"portal_1": { +"icount": 1 +}, +"portal_left": { +"icount": 0 +}, +"portal_right": { +"icount": 0 +} +} + +[sub_resource type="Resource" id="Resource_w25c8"] +script = ExtResource("1_6q3u4") +scene_name = "c02_s17" +data = { +"Ambush猫咪敲门互动2": { +"played": false +}, +"AnimationPlayer": {}, +"portal_1": { +"icount": 1 +}, +"portal_left": { +"icount": 0 +}, +"portal_right": { +"icount": 2 +} +} + +[sub_resource type="Resource" id="Resource_gujks"] +script = ExtResource("1_6q3u4") +scene_name = "c03_s01" +data = { +"Ambush偷听陆仁": { +"played": false +}, +"AnimationPlayer": {}, +"CloseupDemo公告": { +"icount": 1, +"interacted_times": 1 +}, +"Interactable放肉处": { +"icount": 1, +"interacted_times": 1 +}, +"Note治病木牌": { +"icount": 2 +}, +"portal_left": { +"icount": 0 +}, +"portal_right": { +"icount": 0 +} +} + +[sub_resource type="Resource" id="Resource_sql7f"] script = ExtResource("2_sql7f") owner = "" current_index = 0 -important_items = Array[String]([]) +important_items = Array[String](["prop_眼镜盒", "prop_船票", "prop_单只小鞋子", "prop_小蝉人偶"]) unviewed_important_items = Array[String]([]) default_enabled_items = Array[String]([]) -xdie_enabled_items = Array[String]([]) +xdie_enabled_items = Array[String](["prop_火柴", "prop_撕下的照片上", "prop_小猫玩具完整", "prop_麻将"]) xxdie_enabled_items = Array[String]([]) xxxdie_enabled_items = Array[String]([]) @@ -19,19 +584,89 @@ xxxdie_enabled_items = Array[String]([]) script = ExtResource("3_qjj7j") version = 5 archive_id = 1 -entrance_portal = &"left" -current_scene = &"c02_s01" -player_global_position_x = -100.0 -player_direction = Vector2(0, 0) -game_seconds = 0 +entrance_portal = &"right" +current_scene = &"c03_s01" +player_global_position_x = 616.833 +player_direction = Vector2(-1, 0) +game_seconds = 1170 created_time = "2025-07-11 01:22:58" -event_stage = Dictionary[StringName, int]({}) -global_data_dict = Dictionary[StringName, Variant]({}) -ground_archives = Dictionary[StringName, ExtResource("1_6q3u4")]({}) +event_stage = Dictionary[StringName, int]({ +&"c02_2f_xchan_run_away": 1, +&"c02_ball_game_stage": 4, +&"c02_burning_end_stage": 2, +&"c02_got_pliers": 2, +&"c02_little_hand": 2, +&"c02_madman_interacted_stage": 2, +&"c02_musicbox_stage": 4, +&"c03_s01_meat_put": 1, +&"current_chapter_stage": 3, +&"handnote_c02_gate_chain": 2, +&"handnote_c02_hand_exchange": 2, +&"handnote_c02_hand_requireCoin": 2, +&"handnote_c02_map_1Left": 1, +&"handnote_c02_map_1Right": 1, +&"handnote_c02_map_2": 1, +&"handnote_c02_meat_knockDoor": 1, +&"handnote_c02_musicbox_needPuppet": 2, +&"handnote_c02_road_address": 1, +&"handnote_c02_shoe_giveToMouce": 2, +&"handnote_c02_split_illusionSpace": 1, +&"handnote_c02_xchan_giveHerPuppet": 2, +&"handnote_c02_xchan_sheKnowsMe": 2 +}) +global_data_dict = Dictionary[StringName, Variant]({ +&"c02_boxcat_chasing_started": true, +&"c02_boxcat_skip_intro": true, +&"c02_burning": true, +&"c02_counter_pushed_out": true, +&"c02_counter_x": 159.0, +&"c02_eavesdrop_finished": true, +&"c02_entered_the_splitted_space": true, +&"c02_gaslight_first_failed": true, +&"c02_gaslight_first_lighted": true, +&"c02_little_hand_dropped_tin": true, +&"c02_madman_hitwall": true, +&"c02_meat_door_interacted": true, +&"c02_meat_dropping": true, +&"c02_meat_given": true, +&"c02_mouse_follow_player": false, +&"c02_musicbox_has_opened": false, +&"c02_musicbox_taken_prop_弹珠": true, +&"c02_musicbox_taken_prop_撕下的照片上": true, +&"c02_musicbox_taken_prop_无头小猫玩具": true, +&"c02_musicbox_taken_prop_木头人偶": true, +&"c02_ready_to_fire": true, +&"c02_s02_mouse_push_shoe": true, +&"c02_show_grounded_coins": true, +&"c02_the_blind_room_unlocked": true, +&"c02_tin_coin_taken": true, +&"c02_watched_the_well": true, +&"刮海报_二楼内侧": true, +&"刮海报_过道": true +}) +ground_archives = Dictionary[StringName, ExtResource("1_6q3u4")]({ +&"c02_s01": SubResource("Resource_6q3u4"), +&"c02_s02": SubResource("Resource_qjj7j"), +&"c02_s03": SubResource("Resource_ja7w6"), +&"c02_s04": SubResource("Resource_175lw"), +&"c02_s05": SubResource("Resource_xnubk"), +&"c02_s06": SubResource("Resource_xfhwh"), +&"c02_s07": SubResource("Resource_53fcv"), +&"c02_s08": SubResource("Resource_cio48"), +&"c02_s09": SubResource("Resource_i3b22"), +&"c02_s10": SubResource("Resource_cpr7i"), +&"c02_s12": SubResource("Resource_06ncl"), +&"c02_s13": SubResource("Resource_xhybu"), +&"c02_s17": SubResource("Resource_w25c8"), +&"c03_s01": SubResource("Resource_gujks") +}) npc_anonymous_states = Dictionary[StringName, bool]({}) player_running_locked = false -prop_inventory = SubResource("Resource_6q3u4") -mem_display_dict = Dictionary[int, bool]({}) +prop_inventory = SubResource("Resource_sql7f") +mem_display_dict = Dictionary[int, bool]({ +1: true, +2: true +}) bayinhe_current_answer = [0, 0, 0, 0, 0, 0, 0, 0, 0] bayinhe_mode = "closed" metadata/_custom_type_script = "uid://cusw17h37oc0g" diff --git a/util/tester.gd b/util/tester.gd index 78c46373..b2653409 100644 --- a/util/tester.gd +++ b/util/tester.gd @@ -99,29 +99,52 @@ func test_packed_array(): print("cow_arr: ", cow_arr) +func rand_good_night_wechat_emojis() -> void: + var regular = ["嘴唇", "玫瑰", "月亮", "拥抱", "爱心"] + var rarely = ["转圈", "跳跳", "得意", "礼物", "福", "烟花"] + var arr = [] + var regular_ratio = 0.9 + var regular_combo_weight = [6, 10, 2, 2, 1] + var size = 40 + # sum regular_combo_weight + var weights = 0 + for w in regular_combo_weight: + weights += w + while arr.size() < size: + if randf() >= regular_ratio: + var rand_regular = rarely.pick_random() + var weight = randi_range(0, weights) + var index = 0 + for w in regular_combo_weight: + if weight <= w: + break + index += 1 + weight -= w + for _i in index + 1: + arr.append(rand_regular) + else: + arr.append(regular.pick_random()) + print("[", "][".join(arr), "]") + # func _ready() -> void: # $Button.mouse_exited.connect(_free_btn) # _wait_btn() # get_tree().create_timer(3.0).timeout.connect(_free_self) - # func _wait_btn() -> void: # print("waiting...") # var res = await _waiting() # print("button pressed res", res) # print("hello") - # func _waiting() -> void: # await get_tree().create_timer(1.0).timeout - # func _free_btn() -> void: # print("free button") # $Button.queue_free() # print("button freed") - # func _free_self() -> void: # # print("free self") # # queue_free()