From 3495ae55da76fd86ae2891bfc0ebaab3e5324e2f Mon Sep 17 00:00:00 2001 From: Wickedness Date: Thu, 18 Jun 2026 23:23:19 +0900 Subject: [PATCH] Add Qingzhou branch camp content --- data/scenarios/004_qingzhou_campaign.json | 63 ++++++++++++++++- tools/smoke_camp_conversation_rewards.gd | 85 +++++++++++++++++++++++ tools/smoke_visual_assets.gd | 59 ++++++++++++++++ 3 files changed, 206 insertions(+), 1 deletion(-) diff --git a/data/scenarios/004_qingzhou_campaign.json b/data/scenarios/004_qingzhou_campaign.json index cac2308..86a294b 100644 --- a/data/scenarios/004_qingzhou_campaign.json +++ b/data/scenarios/004_qingzhou_campaign.json @@ -33,6 +33,60 @@ "Supplies gathered after Sishui let Cao Cao press into Qingzhou with a steadier line." ] } + ], + "camp_conversations": [ + { + "id": "qingzhou_settlement_council", + "group": "officer", + "officer_id": "cao_cao", + "label": "Cao Cao - Lasting Army", + "speaker": "Cao Cao", + "summary": "Discuss turning scattered victories into a standing force.", + "lines": [ + { "speaker": "Cao Cao", "side": "left", "text": "The coalition scattered after chasing shadows. Qingzhou gives us a harder task: turn hungry men into a disciplined army." }, + { "speaker": "Xiahou Dun", "side": "right", "text": "Then we break the worst of the remnants and give the rest a reason to stand in our line." } + ] + }, + { + "id": "qingzhou_village_screen", + "group": "officer", + "officer_id": "cao_ren", + "label": "Cao Ren - Village Screen", + "speaker": "Cao Ren", + "summary": "Protect villages and trade roads while the vanguard advances.", + "lines": [ + { "speaker": "Cao Ren", "side": "right", "text": "The villages fear every banner now. If our line tramples their fields, they will see no difference between us and the rebels." }, + { "speaker": "Cao Cao", "side": "left", "text": "Hold the road, not the harvest. Order is worth more than a hurried victory." } + ] + }, + { + "id": "qingzhou_hardened_veterans", + "campaign_flags": { "pursued_dong_zhuo": true }, + "group": "topic", + "label": "Hardened Veterans", + "summary": "Issue wine to the men who survived the forced pursuit.", + "lines": [ + { "speaker": "Xiahou Yuan", "side": "right", "text": "The men who chased Dong Zhuo through Xingyang still march light. They complain less, which worries me more." }, + { "speaker": "Cao Cao", "side": "left", "text": "Give the veterans a little wine before the road opens. A steady hand matters more than a proud silence." } + ], + "effects": [ + { "type": "grant_item", "item_id": "wine", "count": 1, "text": "The hardened veterans add Wine to the field supplies." } + ] + }, + { + "id": "qingzhou_sishui_stores", + "campaign_flags": { "regrouped_after_sishui": true }, + "group": "topic", + "label": "Sishui Stores", + "summary": "Open the supplies preserved during the regroup.", + "lines": [ + { "speaker": "Coalition Merchant", "side": "left", "text": "Those Sishui stores traveled farther than some lords did. I kept the dry beans aside before the wagons bogged down." }, + { "speaker": "Cao Ren", "side": "right", "text": "Good. Feed the front rank before we ask them to spare the villages." } + ], + "effects": [ + { "type": "grant_item", "item_id": "bean", "count": 1, "text": "The Sishui stores add a Bean to the field supplies." } + ] + } ] }, "shop": { @@ -47,7 +101,14 @@ "hand_axe", "leather_armor", "iron_armor" - ] + ], + "merchant": { + "name": "Qingzhou Road Merchant", + "lines": [ + "The villages pay in grain, not coin, but a road army still needs steel and medicine.", + "Buy before the drums start. Once the remnants scatter, every cart on this road will claim to be a refugee." + ] + } }, "roster": { "max_units": 4, diff --git a/tools/smoke_camp_conversation_rewards.gd b/tools/smoke_camp_conversation_rewards.gd index 656464d..7879c8c 100644 --- a/tools/smoke_camp_conversation_rewards.gd +++ b/tools/smoke_camp_conversation_rewards.gd @@ -11,6 +11,8 @@ const SISHUI_SCENARIO_PATH := "res://data/scenarios/002_sishui_gate.json" const SISHUI_CONVERSATION_ID := "sishui_quartermaster_antidote" const BRANCH_SCENARIO_ID := "003_xingyang_ambush" const BRANCH_SCENARIO_PATH := "res://data/scenarios/003_xingyang_ambush.json" +const QINGZHOU_SCENARIO_ID := "004_qingzhou_campaign" +const QINGZHOU_SCENARIO_PATH := "res://data/scenarios/004_qingzhou_campaign.json" const WUCHAO_SCENARIO_ID := "013_wuchao_raid" const WUCHAO_SCENARIO_PATH := "res://data/scenarios/013_wuchao_raid.json" const SAVE_PATH := "user://campaign_save.json" @@ -28,6 +30,7 @@ func _init() -> void: _check_manual_checkpoint_reverts_claim(failures) _check_completed_replay_cannot_claim(failures) _check_conditional_camp_conversations(failures) + _check_qingzhou_branch_camp_conversations(failures) _check_wuchao_branch_camp_conversations(failures) _check_talk_menu_closes_on_cancel_and_reload(failures) @@ -227,6 +230,88 @@ func _check_conditional_camp_conversations(failures: Array[String]) -> void: regroup_scene.free() +func _check_qingzhou_branch_camp_conversations(failures: Array[String]) -> void: + var base_scene = _new_prebattle_scene_for(failures, "Qingzhou base camp", QINGZHOU_SCENARIO_ID, QINGZHOU_SCENARIO_PATH) + if base_scene != null: + if base_scene._camp_conversation_by_id("qingzhou_settlement_council").is_empty(): + failures.append("Qingzhou should expose lasting army officer conversation") + if base_scene._camp_conversation_by_id("qingzhou_village_screen").is_empty(): + failures.append("Qingzhou should expose village screen officer conversation") + if not base_scene._camp_conversation_by_id("qingzhou_hardened_veterans").is_empty(): + failures.append("Qingzhou pursuit supplies should be hidden without pursuit flag") + if not base_scene._camp_conversation_by_id("qingzhou_sishui_stores").is_empty(): + failures.append("Qingzhou Sishui stores should be hidden without regroup flag") + var merchant: Dictionary = base_scene.state.get_shop_merchant() + if str(merchant.get("name", "")) != "Qingzhou Road Merchant": + failures.append("Qingzhou shop merchant name should be present") + var merchant_lines: Array = merchant.get("lines", []) + if merchant_lines.size() < 2: + failures.append("Qingzhou shop merchant should expose flavor lines") + if base_scene._format_talk_status_text(base_scene._camp_conversation_entries()) != "Camp conversations | 2 topics": + failures.append("Qingzhou base talk status should summarize two non-supply topics") + base_scene.free() + + var pursuit_scene = _new_prebattle_scene_for( + failures, + "Qingzhou pursuit camp", + QINGZHOU_SCENARIO_ID, + QINGZHOU_SCENARIO_PATH, + {"pursued_dong_zhuo": true} + ) + if pursuit_scene != null: + var veterans: Dictionary = pursuit_scene._camp_conversation_by_id("qingzhou_hardened_veterans") + if veterans.is_empty(): + failures.append("pursuit flag should expose Qingzhou hardened veterans") + if not pursuit_scene._camp_conversation_by_id("qingzhou_sishui_stores").is_empty(): + failures.append("pursuit flag should not expose Qingzhou Sishui stores") + if not veterans.is_empty(): + if pursuit_scene._format_talk_status_text(pursuit_scene._camp_conversation_entries()) != "Camp conversations | 3 topics | 1 supplies ready": + failures.append("Qingzhou pursuit talk status should show one ready supply") + if not pursuit_scene._format_camp_conversation_button_text(veterans).contains("Supply Wine"): + failures.append("Qingzhou hardened veterans button should show Wine supply") + var before_wine := int(pursuit_scene.campaign_state.get_inventory_snapshot().get("wine", 0)) + pursuit_scene._apply_camp_conversation_effects(veterans) + if int(pursuit_scene.campaign_state.get_inventory_snapshot().get("wine", 0)) != before_wine + 1: + failures.append("Qingzhou hardened veterans should add Wine to campaign inventory") + if int(pursuit_scene.state.get_inventory_snapshot().get("wine", 0)) != before_wine + 1: + failures.append("Qingzhou hardened veterans should refresh battle Wine inventory") + if not pursuit_scene.campaign_state.has_claimed_camp_conversation_effects(QINGZHOU_SCENARIO_ID, "qingzhou_hardened_veterans"): + failures.append("Qingzhou hardened veterans claim should be saved") + if pursuit_scene._format_talk_status_text(pursuit_scene._camp_conversation_entries()) != "Camp conversations | 3 topics | 1 claimed": + failures.append("Qingzhou pursuit talk status should show claimed supply after claim") + pursuit_scene.free() + + var regroup_scene = _new_prebattle_scene_for( + failures, + "Qingzhou regroup camp", + QINGZHOU_SCENARIO_ID, + QINGZHOU_SCENARIO_PATH, + {"regrouped_after_sishui": true} + ) + if regroup_scene != null: + var stores: Dictionary = regroup_scene._camp_conversation_by_id("qingzhou_sishui_stores") + if stores.is_empty(): + failures.append("regroup flag should expose Qingzhou Sishui stores") + if not regroup_scene._camp_conversation_by_id("qingzhou_hardened_veterans").is_empty(): + failures.append("regroup flag should not expose Qingzhou hardened veterans") + if not stores.is_empty(): + if regroup_scene._format_talk_status_text(regroup_scene._camp_conversation_entries()) != "Camp conversations | 3 topics | 1 supplies ready": + failures.append("Qingzhou regroup talk status should show one ready supply") + if not regroup_scene._format_camp_conversation_button_text(stores).contains("Supply Bean"): + failures.append("Qingzhou Sishui stores button should show Bean supply") + var before_bean := int(regroup_scene.campaign_state.get_inventory_snapshot().get("bean", 0)) + regroup_scene._apply_camp_conversation_effects(stores) + if int(regroup_scene.campaign_state.get_inventory_snapshot().get("bean", 0)) != before_bean + 1: + failures.append("Qingzhou Sishui stores should add Bean to campaign inventory") + if int(regroup_scene.state.get_inventory_snapshot().get("bean", 0)) != before_bean + 1: + failures.append("Qingzhou Sishui stores should refresh battle Bean inventory") + if not regroup_scene.campaign_state.has_claimed_camp_conversation_effects(QINGZHOU_SCENARIO_ID, "qingzhou_sishui_stores"): + failures.append("Qingzhou Sishui stores claim should be saved") + if regroup_scene._format_talk_status_text(regroup_scene._camp_conversation_entries()) != "Camp conversations | 3 topics | 1 claimed": + failures.append("Qingzhou regroup talk status should show claimed supply after claim") + regroup_scene.free() + + func _check_wuchao_branch_camp_conversations(failures: Array[String]) -> void: var base_scene = _new_prebattle_scene_for(failures, "Wuchao base camp", WUCHAO_SCENARIO_ID, WUCHAO_SCENARIO_PATH) if base_scene != null: diff --git a/tools/smoke_visual_assets.gd b/tools/smoke_visual_assets.gd index fdb74bd..41dc9bb 100644 --- a/tools/smoke_visual_assets.gd +++ b/tools/smoke_visual_assets.gd @@ -137,6 +137,58 @@ func _check_battle_visual_data(failures: Array[String]) -> void: if (gate_merchant.get("lines", []) as Array).size() < 2: failures.append("002 shop should expose merchant flavor lines") + var qingzhou_state = BattleStateScript.new() + if not qingzhou_state.load_battle("res://data/scenarios/004_qingzhou_campaign.json"): + failures.append("could not load Qingzhou Campaign camp data") + else: + var qingzhou_conversations: Array = qingzhou_state.get_briefing().get("camp_conversations", []) + if qingzhou_conversations.size() != 2: + failures.append("004 base briefing should expose exactly two camp conversations") + else: + _check_camp_conversation(failures, qingzhou_conversations[0], "qingzhou_settlement_council", "officer", "cao_cao") + _check_camp_conversation(failures, qingzhou_conversations[1], "qingzhou_village_screen", "officer", "cao_ren") + var qingzhou_merchant := qingzhou_state.get_shop_merchant() + if str(qingzhou_merchant.get("name", "")) != "Qingzhou Road Merchant": + failures.append("004 shop should expose Qingzhou merchant name") + if (qingzhou_merchant.get("lines", []) as Array).size() < 2: + failures.append("004 shop should expose merchant flavor lines") + + var qingzhou_pursuit_state = BattleStateScript.new() + if not qingzhou_pursuit_state.load_battle("res://data/scenarios/004_qingzhou_campaign.json", {}, {}, {"pursued_dong_zhuo": true}): + failures.append("could not load Qingzhou pursuit camp data") + else: + var veterans: Dictionary = _find_camp_conversation( + qingzhou_pursuit_state.get_briefing().get("camp_conversations", []), + "qingzhou_hardened_veterans" + ) + if veterans.is_empty(): + failures.append("004 pursuit flag should expose hardened veterans conversation") + else: + _check_camp_conversation_effect(failures, veterans, "wine", 1) + if not _find_camp_conversation( + qingzhou_pursuit_state.get_briefing().get("camp_conversations", []), + "qingzhou_sishui_stores" + ).is_empty(): + failures.append("004 pursuit flag should not expose Sishui stores conversation") + + var qingzhou_regroup_state = BattleStateScript.new() + if not qingzhou_regroup_state.load_battle("res://data/scenarios/004_qingzhou_campaign.json", {}, {}, {"regrouped_after_sishui": true}): + failures.append("could not load Qingzhou regroup camp data") + else: + var stores: Dictionary = _find_camp_conversation( + qingzhou_regroup_state.get_briefing().get("camp_conversations", []), + "qingzhou_sishui_stores" + ) + if stores.is_empty(): + failures.append("004 regroup flag should expose Sishui stores conversation") + else: + _check_camp_conversation_effect(failures, stores, "bean", 1) + if not _find_camp_conversation( + qingzhou_regroup_state.get_briefing().get("camp_conversations", []), + "qingzhou_hardened_veterans" + ).is_empty(): + failures.append("004 regroup flag should not expose hardened veterans conversation") + for item_id in ["bronze_sword", "training_spear", "short_bow", "hand_axe", "iron_armor", "panacea"]: var item := state.get_item_def(item_id) if item.is_empty(): @@ -722,6 +774,13 @@ func _check_skill_motion_signal(failures: Array[String], skill_id: String, expec failures.append("%s motion signal missing `%s`: %s" % [skill_id, expected, str(motions)]) +func _find_camp_conversation(conversations: Array, conversation_id: String) -> Dictionary: + for conversation in conversations: + if typeof(conversation) == TYPE_DICTIONARY and str(conversation.get("id", "")) == conversation_id: + return conversation + return {} + + func _check_camp_conversation_effect(failures: Array[String], conversation: Dictionary, expected_item_id: String, expected_count: int) -> void: var effects: Array = conversation.get("effects", []) if effects.is_empty():