Add Weishui bridge and antique battle UI
This commit is contained in:
@@ -130,6 +130,12 @@ const TONG_PASS_JIANGLING_MEDICINE_CONVERSATION_ID := "tong_pass_jiangling_suppl
|
||||
const TONG_PASS_VANGUARD_RATIONS_CONVERSATION_ID := "tong_pass_vanguard_rations"
|
||||
const MA_CHAO_COUNTERSTROKE_SCENARIO_ID := "034_ma_chao_counterstroke"
|
||||
const MA_CHAO_COUNTERSTROKE_SCENARIO_PATH := "res://data/scenarios/034_ma_chao_counterstroke.json"
|
||||
const MA_CHAO_COUNTERSTROKE_FORTIFIED_MEDICINE_CONVERSATION_ID := "ma_chao_counterstroke_fortified_medicine"
|
||||
const MA_CHAO_COUNTERSTROKE_PRESSED_BEANS_CONVERSATION_ID := "ma_chao_counterstroke_pressed_beans"
|
||||
const WEISHUI_CAMPS_SCENARIO_ID := "035_weishui_camps"
|
||||
const WEISHUI_CAMPS_SCENARIO_PATH := "res://data/scenarios/035_weishui_camps.json"
|
||||
const WEISHUI_CAMPS_ANCHOR_MEDICINE_CONVERSATION_ID := "weishui_anchor_medicine"
|
||||
const WEISHUI_CAMPS_DOUBT_RATIONS_CONVERSATION_ID := "weishui_doubt_rations"
|
||||
const SAVE_PATH := "user://campaign_save.json"
|
||||
const MANUAL_SAVE_PATH := "user://campaign_manual_save.json"
|
||||
|
||||
@@ -172,6 +178,7 @@ func _init() -> void:
|
||||
_check_huarong_post_battle_choice_bridges_to_jiangling_rearguard(failures)
|
||||
_check_jiangling_rearguard_post_battle_choice_bridges_to_tong_pass(failures)
|
||||
_check_tong_pass_post_battle_choice_bridges_to_ma_chao_counterstroke(failures)
|
||||
_check_ma_chao_counterstroke_post_battle_choice_bridges_to_weishui_camps(failures)
|
||||
_check_manual_checkpoint_reverts_claim(failures)
|
||||
_check_completed_replay_cannot_claim(failures)
|
||||
_check_conditional_camp_conversations(failures)
|
||||
@@ -197,6 +204,8 @@ func _init() -> void:
|
||||
_check_huarong_branch_camp_conversations(failures)
|
||||
_check_jiangling_rearguard_branch_camp_conversations(failures)
|
||||
_check_tong_pass_branch_camp_conversations(failures)
|
||||
_check_ma_chao_counterstroke_branch_camp_conversations(failures)
|
||||
_check_weishui_camps_branch_camp_conversations(failures)
|
||||
_check_talk_menu_closes_on_cancel_and_reload(failures)
|
||||
|
||||
if not _restore_user_file(SAVE_PATH, save_backup):
|
||||
@@ -1482,6 +1491,29 @@ func _check_tong_pass_post_battle_choice_bridges_to_ma_chao_counterstroke(failur
|
||||
)
|
||||
|
||||
|
||||
func _check_ma_chao_counterstroke_post_battle_choice_bridges_to_weishui_camps(failures: Array[String]) -> void:
|
||||
_check_ma_chao_counterstroke_choice_branch_to_weishui_camps(
|
||||
failures,
|
||||
"anchor_weishui_camps",
|
||||
"anchored_weishui_camps",
|
||||
"sowed_han_sui_doubt",
|
||||
"imperial_seal",
|
||||
"war_drum",
|
||||
"Anchored camps along the Wei River",
|
||||
"anchored_camps_hold_line"
|
||||
)
|
||||
_check_ma_chao_counterstroke_choice_branch_to_weishui_camps(
|
||||
failures,
|
||||
"sow_han_sui_doubt",
|
||||
"sowed_han_sui_doubt",
|
||||
"anchored_weishui_camps",
|
||||
"war_drum",
|
||||
"imperial_seal",
|
||||
"Rumors between Han Sui and Ma Chao",
|
||||
"han_sui_doubt_splits_orders"
|
||||
)
|
||||
|
||||
|
||||
func _check_wuchao_choice_branch_to_cangting(
|
||||
failures: Array[String],
|
||||
choice_id: String,
|
||||
@@ -3029,6 +3061,86 @@ func _check_tong_pass_choice_branch_to_ma_chao_counterstroke(
|
||||
scene.free()
|
||||
|
||||
|
||||
func _check_ma_chao_counterstroke_choice_branch_to_weishui_camps(
|
||||
failures: Array[String],
|
||||
choice_id: String,
|
||||
expected_flag: String,
|
||||
cleared_flag: String,
|
||||
expected_shop_item_id: String,
|
||||
hidden_shop_item_id: String,
|
||||
expected_briefing_fragment: String,
|
||||
expected_event_id: String
|
||||
) -> void:
|
||||
var scene = _new_prebattle_scene_for(failures, "Ma Chao Counterstroke choice bridge %s" % choice_id, MA_CHAO_COUNTERSTROKE_SCENARIO_ID, MA_CHAO_COUNTERSTROKE_SCENARIO_PATH)
|
||||
if scene == null:
|
||||
return
|
||||
if not scene.campaign_state.joined_officers.has("zhang_he"):
|
||||
scene.campaign_state.joined_officers.append("zhang_he")
|
||||
if not scene.state.load_battle(
|
||||
MA_CHAO_COUNTERSTROKE_SCENARIO_PATH,
|
||||
scene.campaign_state.get_roster_overrides(),
|
||||
scene.campaign_state.get_inventory_snapshot(),
|
||||
scene.campaign_state.get_flags_snapshot(),
|
||||
scene.campaign_state.get_joined_officers_snapshot()
|
||||
):
|
||||
failures.append("Ma Chao Counterstroke choice bridge %s could not reload Ma Chao Counterstroke with Zhang He joined" % choice_id)
|
||||
scene.free()
|
||||
return
|
||||
scene.state.battle_status = "victory"
|
||||
var result: Dictionary = scene.campaign_state.apply_battle_result(scene.state)
|
||||
if not bool(result.get("saved", false)):
|
||||
failures.append("Ma Chao Counterstroke choice bridge %s should save 034 victory" % choice_id)
|
||||
scene.free()
|
||||
return
|
||||
if not scene.campaign_state.get_joined_officers_snapshot().has("zhang_he"):
|
||||
failures.append("Ma Chao Counterstroke choice bridge %s should keep Zhang He before Weishui Camps" % choice_id)
|
||||
if bool(result.get("choice_applied", true)):
|
||||
failures.append("Ma Chao Counterstroke choice bridge %s should wait for a selected post-battle choice" % choice_id)
|
||||
if scene.campaign_state.pending_post_battle_choice_scenario_id != MA_CHAO_COUNTERSTROKE_SCENARIO_ID:
|
||||
failures.append("Ma Chao Counterstroke choice bridge %s should mark Ma Chao Counterstroke choice pending" % choice_id)
|
||||
var choice := _find_choice_by_id(result.get("post_battle_choices", []), choice_id)
|
||||
if choice.is_empty():
|
||||
failures.append("Ma Chao Counterstroke choice bridge missing choice: %s" % choice_id)
|
||||
scene.free()
|
||||
return
|
||||
if not scene.campaign_state.try_apply_post_battle_choice(choice, MA_CHAO_COUNTERSTROKE_SCENARIO_ID):
|
||||
failures.append("Ma Chao Counterstroke choice bridge %s should save selected choice" % choice_id)
|
||||
scene.free()
|
||||
return
|
||||
var flags: Dictionary = scene.campaign_state.get_flags_snapshot()
|
||||
if flags.get(expected_flag, false) != true:
|
||||
failures.append("Ma Chao Counterstroke choice bridge %s should set %s" % [choice_id, expected_flag])
|
||||
if flags.get(cleared_flag, true) != false:
|
||||
failures.append("Ma Chao Counterstroke choice bridge %s should clear %s" % [choice_id, cleared_flag])
|
||||
if scene.campaign_state.current_scenario_id != WEISHUI_CAMPS_SCENARIO_ID:
|
||||
failures.append("Ma Chao Counterstroke choice bridge %s should advance to Weishui Camps, got %s" % [choice_id, scene.campaign_state.current_scenario_id])
|
||||
if not scene.state.load_battle(
|
||||
WEISHUI_CAMPS_SCENARIO_PATH,
|
||||
scene.campaign_state.get_roster_overrides(),
|
||||
scene.campaign_state.get_inventory_snapshot(),
|
||||
flags,
|
||||
scene.campaign_state.get_joined_officers_snapshot()
|
||||
):
|
||||
failures.append("Ma Chao Counterstroke choice bridge %s could not load Weishui Camps" % choice_id)
|
||||
scene.free()
|
||||
return
|
||||
if scene.state.get_unit("zhang_he_ch35").is_empty():
|
||||
failures.append("Ma Chao Counterstroke choice bridge %s should deploy Zhang He in Weishui Camps" % choice_id)
|
||||
elif not scene.state.is_required_deployment("zhang_he_ch35"):
|
||||
failures.append("Ma Chao Counterstroke choice bridge %s should require Zhang He in Weishui Camps" % choice_id)
|
||||
var briefing_lines: Array = scene.state.get_briefing().get("lines", [])
|
||||
if not _lines_contain_fragment(briefing_lines, expected_briefing_fragment):
|
||||
failures.append("Ma Chao Counterstroke choice bridge %s should expose Weishui briefing fragment `%s`" % [choice_id, expected_briefing_fragment])
|
||||
if not _battle_event_requires_flag(scene.state.battle_events, expected_event_id, expected_flag):
|
||||
failures.append("Ma Chao Counterstroke choice bridge %s should expose Weishui event %s gated by %s" % [choice_id, expected_event_id, expected_flag])
|
||||
var shop_items: Array = scene.state.get_shop_item_ids()
|
||||
if not shop_items.has(expected_shop_item_id):
|
||||
failures.append("Ma Chao Counterstroke choice bridge %s should expose shop item %s" % [choice_id, expected_shop_item_id])
|
||||
if shop_items.has(hidden_shop_item_id):
|
||||
failures.append("Ma Chao Counterstroke choice bridge %s should hide shop item %s" % [choice_id, hidden_shop_item_id])
|
||||
scene.free()
|
||||
|
||||
|
||||
func _lines_contain_fragment(lines: Array, fragment: String) -> bool:
|
||||
for line in lines:
|
||||
if str(line).contains(fragment):
|
||||
@@ -5228,6 +5340,236 @@ func _check_tong_pass_branch_camp_conversations(failures: Array[String]) -> void
|
||||
mobilized_scene.free()
|
||||
|
||||
|
||||
func _check_ma_chao_counterstroke_branch_camp_conversations(failures: Array[String]) -> void:
|
||||
var base_scene = _new_prebattle_scene_for(failures, "Ma Chao Counterstroke base camp", MA_CHAO_COUNTERSTROKE_SCENARIO_ID, MA_CHAO_COUNTERSTROKE_SCENARIO_PATH)
|
||||
if base_scene != null:
|
||||
if not base_scene.campaign_state.joined_officers.has("zhang_he"):
|
||||
base_scene.campaign_state.joined_officers.append("zhang_he")
|
||||
if not base_scene.state.load_battle(
|
||||
MA_CHAO_COUNTERSTROKE_SCENARIO_PATH,
|
||||
base_scene.campaign_state.get_roster_overrides(),
|
||||
base_scene.campaign_state.get_inventory_snapshot(),
|
||||
base_scene.campaign_state.get_flags_snapshot(),
|
||||
base_scene.campaign_state.get_joined_officers_snapshot()
|
||||
):
|
||||
failures.append("Ma Chao Counterstroke base camp should reload with Zhang He joined")
|
||||
else:
|
||||
if base_scene._camp_conversation_by_id("ma_chao_counterstroke_council").is_empty():
|
||||
failures.append("Ma Chao Counterstroke should expose the council conversation")
|
||||
if base_scene._camp_conversation_by_id("ma_chao_zhang_he_charge_line").is_empty():
|
||||
failures.append("Ma Chao Counterstroke should expose Zhang He's charge line conversation")
|
||||
if not base_scene._camp_conversation_by_id(MA_CHAO_COUNTERSTROKE_FORTIFIED_MEDICINE_CONVERSATION_ID).is_empty():
|
||||
failures.append("Ma Chao Counterstroke fortified medicine should be hidden without fortified Tong Pass flag")
|
||||
if not base_scene._camp_conversation_by_id(MA_CHAO_COUNTERSTROKE_PRESSED_BEANS_CONVERSATION_ID).is_empty():
|
||||
failures.append("Ma Chao Counterstroke pressed beans should be hidden without pressed vanguard flag")
|
||||
var merchant: Dictionary = base_scene.state.get_shop_merchant()
|
||||
if str(merchant.get("name", "")) != "Counterstroke Sutler":
|
||||
failures.append("Ma Chao Counterstroke shop merchant name should be present")
|
||||
var merchant_lines: Array = merchant.get("lines", [])
|
||||
if merchant_lines.size() < 2:
|
||||
failures.append("Ma Chao Counterstroke shop merchant should expose flavor lines")
|
||||
if base_scene._format_talk_status_text(base_scene._camp_conversation_entries()) != "Camp conversations | 2 topics":
|
||||
failures.append("Ma Chao Counterstroke base talk status should summarize two non-supply topics")
|
||||
base_scene.free()
|
||||
|
||||
var fortified_scene = _new_prebattle_scene_for(
|
||||
failures,
|
||||
"Ma Chao Counterstroke fortified camp",
|
||||
MA_CHAO_COUNTERSTROKE_SCENARIO_ID,
|
||||
MA_CHAO_COUNTERSTROKE_SCENARIO_PATH,
|
||||
{"fortified_tong_pass": true}
|
||||
)
|
||||
if fortified_scene != null:
|
||||
if not fortified_scene.campaign_state.joined_officers.has("zhang_he"):
|
||||
fortified_scene.campaign_state.joined_officers.append("zhang_he")
|
||||
if not fortified_scene.state.load_battle(
|
||||
MA_CHAO_COUNTERSTROKE_SCENARIO_PATH,
|
||||
fortified_scene.campaign_state.get_roster_overrides(),
|
||||
fortified_scene.campaign_state.get_inventory_snapshot(),
|
||||
fortified_scene.campaign_state.get_flags_snapshot(),
|
||||
fortified_scene.campaign_state.get_joined_officers_snapshot()
|
||||
):
|
||||
failures.append("Ma Chao Counterstroke fortified camp should reload with Zhang He joined")
|
||||
else:
|
||||
var fortified_medicine: Dictionary = fortified_scene._camp_conversation_by_id(MA_CHAO_COUNTERSTROKE_FORTIFIED_MEDICINE_CONVERSATION_ID)
|
||||
if fortified_medicine.is_empty():
|
||||
failures.append("fortified Tong Pass flag should expose Ma Chao Counterstroke medicine")
|
||||
if not fortified_scene._camp_conversation_by_id(MA_CHAO_COUNTERSTROKE_PRESSED_BEANS_CONVERSATION_ID).is_empty():
|
||||
failures.append("fortified Tong Pass flag should not expose Ma Chao Counterstroke pressed beans")
|
||||
if not fortified_medicine.is_empty():
|
||||
if fortified_scene._format_talk_status_text(fortified_scene._camp_conversation_entries()) != "Camp conversations | 3 topics | 1 supplies ready":
|
||||
failures.append("Ma Chao Counterstroke fortified talk status should show one ready supply")
|
||||
if not fortified_scene._format_camp_conversation_button_text(fortified_medicine).contains("보급 Panacea"):
|
||||
failures.append("Ma Chao Counterstroke fortified medicine button should show Panacea supply")
|
||||
var before_panacea := int(fortified_scene.campaign_state.get_inventory_snapshot().get("panacea", 0))
|
||||
fortified_scene._apply_camp_conversation_effects(fortified_medicine)
|
||||
if int(fortified_scene.campaign_state.get_inventory_snapshot().get("panacea", 0)) != before_panacea + 1:
|
||||
failures.append("Ma Chao Counterstroke fortified medicine should add Panacea to campaign inventory")
|
||||
if int(fortified_scene.state.get_inventory_snapshot().get("panacea", 0)) != before_panacea + 1:
|
||||
failures.append("Ma Chao Counterstroke fortified medicine should refresh battle Panacea inventory")
|
||||
if not fortified_scene.campaign_state.has_claimed_camp_conversation_effects(MA_CHAO_COUNTERSTROKE_SCENARIO_ID, MA_CHAO_COUNTERSTROKE_FORTIFIED_MEDICINE_CONVERSATION_ID):
|
||||
failures.append("Ma Chao Counterstroke fortified medicine claim should be saved")
|
||||
if fortified_scene._format_talk_status_text(fortified_scene._camp_conversation_entries()) != "Camp conversations | 3 topics | 1 claimed":
|
||||
failures.append("Ma Chao Counterstroke fortified talk status should show claimed supply after claim")
|
||||
fortified_scene.free()
|
||||
|
||||
var pressed_scene = _new_prebattle_scene_for(
|
||||
failures,
|
||||
"Ma Chao Counterstroke pressed vanguard camp",
|
||||
MA_CHAO_COUNTERSTROKE_SCENARIO_ID,
|
||||
MA_CHAO_COUNTERSTROKE_SCENARIO_PATH,
|
||||
{"pressed_ma_chao_vanguard": true}
|
||||
)
|
||||
if pressed_scene != null:
|
||||
if not pressed_scene.campaign_state.joined_officers.has("zhang_he"):
|
||||
pressed_scene.campaign_state.joined_officers.append("zhang_he")
|
||||
if not pressed_scene.state.load_battle(
|
||||
MA_CHAO_COUNTERSTROKE_SCENARIO_PATH,
|
||||
pressed_scene.campaign_state.get_roster_overrides(),
|
||||
pressed_scene.campaign_state.get_inventory_snapshot(),
|
||||
pressed_scene.campaign_state.get_flags_snapshot(),
|
||||
pressed_scene.campaign_state.get_joined_officers_snapshot()
|
||||
):
|
||||
failures.append("Ma Chao Counterstroke pressed vanguard camp should reload with Zhang He joined")
|
||||
else:
|
||||
var pressed_beans: Dictionary = pressed_scene._camp_conversation_by_id(MA_CHAO_COUNTERSTROKE_PRESSED_BEANS_CONVERSATION_ID)
|
||||
if pressed_beans.is_empty():
|
||||
failures.append("pressed Ma Chao vanguard flag should expose Ma Chao Counterstroke beans")
|
||||
if not pressed_scene._camp_conversation_by_id(MA_CHAO_COUNTERSTROKE_FORTIFIED_MEDICINE_CONVERSATION_ID).is_empty():
|
||||
failures.append("pressed Ma Chao vanguard flag should not expose Ma Chao Counterstroke medicine")
|
||||
if not pressed_beans.is_empty():
|
||||
if pressed_scene._format_talk_status_text(pressed_scene._camp_conversation_entries()) != "Camp conversations | 3 topics | 1 supplies ready":
|
||||
failures.append("Ma Chao Counterstroke pressed vanguard talk status should show one ready supply")
|
||||
if not pressed_scene._format_camp_conversation_button_text(pressed_beans).contains("보급 Bean"):
|
||||
failures.append("Ma Chao Counterstroke pressed beans button should show Bean supply")
|
||||
var before_bean := int(pressed_scene.campaign_state.get_inventory_snapshot().get("bean", 0))
|
||||
pressed_scene._apply_camp_conversation_effects(pressed_beans)
|
||||
if int(pressed_scene.campaign_state.get_inventory_snapshot().get("bean", 0)) != before_bean + 1:
|
||||
failures.append("Ma Chao Counterstroke pressed beans should add Bean to campaign inventory")
|
||||
if int(pressed_scene.state.get_inventory_snapshot().get("bean", 0)) != before_bean + 1:
|
||||
failures.append("Ma Chao Counterstroke pressed beans should refresh battle Bean inventory")
|
||||
if not pressed_scene.campaign_state.has_claimed_camp_conversation_effects(MA_CHAO_COUNTERSTROKE_SCENARIO_ID, MA_CHAO_COUNTERSTROKE_PRESSED_BEANS_CONVERSATION_ID):
|
||||
failures.append("Ma Chao Counterstroke pressed beans claim should be saved")
|
||||
if pressed_scene._format_talk_status_text(pressed_scene._camp_conversation_entries()) != "Camp conversations | 3 topics | 1 claimed":
|
||||
failures.append("Ma Chao Counterstroke pressed vanguard talk status should show claimed supply after claim")
|
||||
pressed_scene.free()
|
||||
|
||||
|
||||
func _check_weishui_camps_branch_camp_conversations(failures: Array[String]) -> void:
|
||||
var base_scene = _new_prebattle_scene_for(failures, "Weishui Camps base camp", WEISHUI_CAMPS_SCENARIO_ID, WEISHUI_CAMPS_SCENARIO_PATH)
|
||||
if base_scene != null:
|
||||
if not base_scene.campaign_state.joined_officers.has("zhang_he"):
|
||||
base_scene.campaign_state.joined_officers.append("zhang_he")
|
||||
if not base_scene.state.load_battle(
|
||||
WEISHUI_CAMPS_SCENARIO_PATH,
|
||||
base_scene.campaign_state.get_roster_overrides(),
|
||||
base_scene.campaign_state.get_inventory_snapshot(),
|
||||
base_scene.campaign_state.get_flags_snapshot(),
|
||||
base_scene.campaign_state.get_joined_officers_snapshot()
|
||||
):
|
||||
failures.append("Weishui Camps base camp should reload with Zhang He joined")
|
||||
else:
|
||||
if base_scene._camp_conversation_by_id("weishui_camps_council").is_empty():
|
||||
failures.append("Weishui Camps should expose the council conversation")
|
||||
if base_scene._camp_conversation_by_id("weishui_zhang_he_river_line").is_empty():
|
||||
failures.append("Weishui Camps should expose Zhang He's river line conversation")
|
||||
if not base_scene._camp_conversation_by_id(WEISHUI_CAMPS_ANCHOR_MEDICINE_CONVERSATION_ID).is_empty():
|
||||
failures.append("Weishui anchor medicine should be hidden without anchored camps flag")
|
||||
if not base_scene._camp_conversation_by_id(WEISHUI_CAMPS_DOUBT_RATIONS_CONVERSATION_ID).is_empty():
|
||||
failures.append("Weishui doubt rations should be hidden without Han Sui doubt flag")
|
||||
var merchant: Dictionary = base_scene.state.get_shop_merchant()
|
||||
if str(merchant.get("name", "")) != "Weishui Camp Sutler":
|
||||
failures.append("Weishui Camps shop merchant name should be present")
|
||||
var merchant_lines: Array = merchant.get("lines", [])
|
||||
if merchant_lines.size() < 2:
|
||||
failures.append("Weishui Camps shop merchant should expose flavor lines")
|
||||
if base_scene._format_talk_status_text(base_scene._camp_conversation_entries()) != "Camp conversations | 2 topics":
|
||||
failures.append("Weishui Camps base talk status should summarize two non-supply topics")
|
||||
base_scene.free()
|
||||
|
||||
var anchored_scene = _new_prebattle_scene_for(
|
||||
failures,
|
||||
"Weishui Camps anchored camp",
|
||||
WEISHUI_CAMPS_SCENARIO_ID,
|
||||
WEISHUI_CAMPS_SCENARIO_PATH,
|
||||
{"anchored_weishui_camps": true}
|
||||
)
|
||||
if anchored_scene != null:
|
||||
if not anchored_scene.campaign_state.joined_officers.has("zhang_he"):
|
||||
anchored_scene.campaign_state.joined_officers.append("zhang_he")
|
||||
if not anchored_scene.state.load_battle(
|
||||
WEISHUI_CAMPS_SCENARIO_PATH,
|
||||
anchored_scene.campaign_state.get_roster_overrides(),
|
||||
anchored_scene.campaign_state.get_inventory_snapshot(),
|
||||
anchored_scene.campaign_state.get_flags_snapshot(),
|
||||
anchored_scene.campaign_state.get_joined_officers_snapshot()
|
||||
):
|
||||
failures.append("Weishui Camps anchored camp should reload with Zhang He joined")
|
||||
else:
|
||||
var anchor_medicine: Dictionary = anchored_scene._camp_conversation_by_id(WEISHUI_CAMPS_ANCHOR_MEDICINE_CONVERSATION_ID)
|
||||
if anchor_medicine.is_empty():
|
||||
failures.append("anchored Weishui camps flag should expose Weishui anchor medicine")
|
||||
if not anchored_scene._camp_conversation_by_id(WEISHUI_CAMPS_DOUBT_RATIONS_CONVERSATION_ID).is_empty():
|
||||
failures.append("anchored Weishui camps flag should not expose Weishui doubt rations")
|
||||
if not anchor_medicine.is_empty():
|
||||
if anchored_scene._format_talk_status_text(anchored_scene._camp_conversation_entries()) != "Camp conversations | 3 topics | 1 supplies ready":
|
||||
failures.append("Weishui anchored talk status should show one ready supply")
|
||||
if not anchored_scene._format_camp_conversation_button_text(anchor_medicine).contains("보급 Panacea"):
|
||||
failures.append("Weishui anchor medicine button should show Panacea supply")
|
||||
var before_panacea := int(anchored_scene.campaign_state.get_inventory_snapshot().get("panacea", 0))
|
||||
anchored_scene._apply_camp_conversation_effects(anchor_medicine)
|
||||
if int(anchored_scene.campaign_state.get_inventory_snapshot().get("panacea", 0)) != before_panacea + 1:
|
||||
failures.append("Weishui anchor medicine should add Panacea to campaign inventory")
|
||||
if int(anchored_scene.state.get_inventory_snapshot().get("panacea", 0)) != before_panacea + 1:
|
||||
failures.append("Weishui anchor medicine should refresh battle Panacea inventory")
|
||||
if not anchored_scene.campaign_state.has_claimed_camp_conversation_effects(WEISHUI_CAMPS_SCENARIO_ID, WEISHUI_CAMPS_ANCHOR_MEDICINE_CONVERSATION_ID):
|
||||
failures.append("Weishui anchor medicine claim should be saved")
|
||||
if anchored_scene._format_talk_status_text(anchored_scene._camp_conversation_entries()) != "Camp conversations | 3 topics | 1 claimed":
|
||||
failures.append("Weishui anchored talk status should show claimed supply after claim")
|
||||
anchored_scene.free()
|
||||
|
||||
var doubt_scene = _new_prebattle_scene_for(
|
||||
failures,
|
||||
"Weishui Camps Han Sui doubt camp",
|
||||
WEISHUI_CAMPS_SCENARIO_ID,
|
||||
WEISHUI_CAMPS_SCENARIO_PATH,
|
||||
{"sowed_han_sui_doubt": true}
|
||||
)
|
||||
if doubt_scene != null:
|
||||
if not doubt_scene.campaign_state.joined_officers.has("zhang_he"):
|
||||
doubt_scene.campaign_state.joined_officers.append("zhang_he")
|
||||
if not doubt_scene.state.load_battle(
|
||||
WEISHUI_CAMPS_SCENARIO_PATH,
|
||||
doubt_scene.campaign_state.get_roster_overrides(),
|
||||
doubt_scene.campaign_state.get_inventory_snapshot(),
|
||||
doubt_scene.campaign_state.get_flags_snapshot(),
|
||||
doubt_scene.campaign_state.get_joined_officers_snapshot()
|
||||
):
|
||||
failures.append("Weishui Camps Han Sui doubt camp should reload with Zhang He joined")
|
||||
else:
|
||||
var doubt_rations: Dictionary = doubt_scene._camp_conversation_by_id(WEISHUI_CAMPS_DOUBT_RATIONS_CONVERSATION_ID)
|
||||
if doubt_rations.is_empty():
|
||||
failures.append("sowed Han Sui doubt flag should expose Weishui doubt rations")
|
||||
if not doubt_scene._camp_conversation_by_id(WEISHUI_CAMPS_ANCHOR_MEDICINE_CONVERSATION_ID).is_empty():
|
||||
failures.append("sowed Han Sui doubt flag should not expose Weishui anchor medicine")
|
||||
if not doubt_rations.is_empty():
|
||||
if doubt_scene._format_talk_status_text(doubt_scene._camp_conversation_entries()) != "Camp conversations | 3 topics | 1 supplies ready":
|
||||
failures.append("Weishui Han Sui doubt talk status should show one ready supply")
|
||||
if not doubt_scene._format_camp_conversation_button_text(doubt_rations).contains("보급 Bean"):
|
||||
failures.append("Weishui doubt rations button should show Bean supply")
|
||||
var before_bean := int(doubt_scene.campaign_state.get_inventory_snapshot().get("bean", 0))
|
||||
doubt_scene._apply_camp_conversation_effects(doubt_rations)
|
||||
if int(doubt_scene.campaign_state.get_inventory_snapshot().get("bean", 0)) != before_bean + 1:
|
||||
failures.append("Weishui doubt rations should add Bean to campaign inventory")
|
||||
if int(doubt_scene.state.get_inventory_snapshot().get("bean", 0)) != before_bean + 1:
|
||||
failures.append("Weishui doubt rations should refresh battle Bean inventory")
|
||||
if not doubt_scene.campaign_state.has_claimed_camp_conversation_effects(WEISHUI_CAMPS_SCENARIO_ID, WEISHUI_CAMPS_DOUBT_RATIONS_CONVERSATION_ID):
|
||||
failures.append("Weishui doubt rations claim should be saved")
|
||||
if doubt_scene._format_talk_status_text(doubt_scene._camp_conversation_entries()) != "Camp conversations | 3 topics | 1 claimed":
|
||||
failures.append("Weishui Han Sui doubt talk status should show claimed supply after claim")
|
||||
doubt_scene.free()
|
||||
|
||||
|
||||
func _check_talk_menu_closes_on_cancel_and_reload(failures: Array[String]) -> void:
|
||||
var scene = _new_prebattle_scene(failures, "talk menu close guards")
|
||||
if scene == null:
|
||||
|
||||
@@ -2307,6 +2307,17 @@ func _check_battle_visual_data(failures: Array[String]) -> void:
|
||||
failures.append("could not load Ma Chao Counterstroke data")
|
||||
else:
|
||||
_check_shop_items_unique(failures, ma_chao_counterstroke_state, "034 base")
|
||||
var ma_chao_conversations: Array = ma_chao_counterstroke_state.get_briefing().get("camp_conversations", [])
|
||||
if ma_chao_conversations.size() != 2:
|
||||
failures.append("034 base briefing should expose exactly two camp conversations")
|
||||
else:
|
||||
_check_camp_conversation(failures, _find_camp_conversation(ma_chao_conversations, "ma_chao_counterstroke_council"), "ma_chao_counterstroke_council", "topic", "")
|
||||
_check_camp_conversation(failures, _find_camp_conversation(ma_chao_conversations, "ma_chao_zhang_he_charge_line"), "ma_chao_zhang_he_charge_line", "officer", "zhang_he")
|
||||
var ma_chao_merchant := ma_chao_counterstroke_state.get_shop_merchant()
|
||||
if str(ma_chao_merchant.get("name", "")) != "Counterstroke Sutler":
|
||||
failures.append("034 shop should expose counterstroke merchant name")
|
||||
if (ma_chao_merchant.get("lines", []) as Array).size() < 2:
|
||||
failures.append("034 shop should expose merchant flavor lines")
|
||||
if ma_chao_counterstroke_state.get_unit("zhang_he_ch34").is_empty() or not ma_chao_counterstroke_state.is_required_deployment("zhang_he_ch34"):
|
||||
failures.append("034 should deploy Zhang He as a required officer")
|
||||
_check_shop_item_visibility(failures, ma_chao_counterstroke_state, "war_drum", false, "034 base")
|
||||
@@ -2317,6 +2328,19 @@ func _check_battle_visual_data(failures: Array[String]) -> void:
|
||||
failures.append("could not load Ma Chao Counterstroke fortified Tong Pass data")
|
||||
else:
|
||||
_check_shop_items_unique(failures, ma_chao_fortified_state, "034 fortified Tong Pass")
|
||||
var fortified_medicine: Dictionary = _find_camp_conversation(
|
||||
ma_chao_fortified_state.get_briefing().get("camp_conversations", []),
|
||||
"ma_chao_counterstroke_fortified_medicine"
|
||||
)
|
||||
if fortified_medicine.is_empty():
|
||||
failures.append("034 fortified Tong Pass should expose fortified medicine")
|
||||
else:
|
||||
_check_camp_conversation_effect(failures, fortified_medicine, "panacea", 1)
|
||||
if not _find_camp_conversation(
|
||||
ma_chao_fortified_state.get_briefing().get("camp_conversations", []),
|
||||
"ma_chao_counterstroke_pressed_beans"
|
||||
).is_empty():
|
||||
failures.append("034 fortified Tong Pass should not expose pressed beans")
|
||||
_check_shop_item_visibility(failures, ma_chao_fortified_state, "imperial_seal", true, "034 fortified Tong Pass")
|
||||
_check_shop_item_visibility(failures, ma_chao_fortified_state, "war_drum", false, "034 fortified Tong Pass")
|
||||
|
||||
@@ -2325,6 +2349,19 @@ func _check_battle_visual_data(failures: Array[String]) -> void:
|
||||
failures.append("could not load Ma Chao Counterstroke pressed vanguard data")
|
||||
else:
|
||||
_check_shop_items_unique(failures, ma_chao_pressed_state, "034 pressed Ma Chao vanguard")
|
||||
var pressed_beans: Dictionary = _find_camp_conversation(
|
||||
ma_chao_pressed_state.get_briefing().get("camp_conversations", []),
|
||||
"ma_chao_counterstroke_pressed_beans"
|
||||
)
|
||||
if pressed_beans.is_empty():
|
||||
failures.append("034 pressed Ma Chao vanguard should expose pressed beans")
|
||||
else:
|
||||
_check_camp_conversation_effect(failures, pressed_beans, "bean", 1)
|
||||
if not _find_camp_conversation(
|
||||
ma_chao_pressed_state.get_briefing().get("camp_conversations", []),
|
||||
"ma_chao_counterstroke_fortified_medicine"
|
||||
).is_empty():
|
||||
failures.append("034 pressed Ma Chao vanguard should not expose fortified medicine")
|
||||
_check_shop_item_visibility(failures, ma_chao_pressed_state, "war_drum", true, "034 pressed Ma Chao vanguard")
|
||||
_check_shop_item_visibility(failures, ma_chao_pressed_state, "imperial_seal", false, "034 pressed Ma Chao vanguard")
|
||||
|
||||
@@ -2335,6 +2372,97 @@ func _check_battle_visual_data(failures: Array[String]) -> void:
|
||||
_check_shop_items_unique(failures, ma_chao_old_flags_state, "034 old Tong Pass setup flags")
|
||||
_check_shop_item_visibility(failures, ma_chao_old_flags_state, "war_drum", false, "034 old Tong Pass setup flags")
|
||||
_check_shop_item_visibility(failures, ma_chao_old_flags_state, "imperial_seal", false, "034 old Tong Pass setup flags")
|
||||
if not _find_camp_conversation(
|
||||
ma_chao_old_flags_state.get_briefing().get("camp_conversations", []),
|
||||
"ma_chao_counterstroke_fortified_medicine"
|
||||
).is_empty():
|
||||
failures.append("034 old Tong Pass setup flags should not expose fortified medicine")
|
||||
if not _find_camp_conversation(
|
||||
ma_chao_old_flags_state.get_briefing().get("camp_conversations", []),
|
||||
"ma_chao_counterstroke_pressed_beans"
|
||||
).is_empty():
|
||||
failures.append("034 old Tong Pass setup flags should not expose pressed beans")
|
||||
|
||||
var weishui_camps_state = BattleStateScript.new()
|
||||
if not weishui_camps_state.load_battle("res://data/scenarios/035_weishui_camps.json", {}, {}, {}, ["zhang_he"]):
|
||||
failures.append("could not load Weishui Camps data")
|
||||
else:
|
||||
_check_shop_items_unique(failures, weishui_camps_state, "035 base")
|
||||
var weishui_conversations: Array = weishui_camps_state.get_briefing().get("camp_conversations", [])
|
||||
if weishui_conversations.size() != 2:
|
||||
failures.append("035 base briefing should expose exactly two camp conversations")
|
||||
else:
|
||||
_check_camp_conversation(failures, _find_camp_conversation(weishui_conversations, "weishui_camps_council"), "weishui_camps_council", "topic", "")
|
||||
_check_camp_conversation(failures, _find_camp_conversation(weishui_conversations, "weishui_zhang_he_river_line"), "weishui_zhang_he_river_line", "officer", "zhang_he")
|
||||
var weishui_merchant := weishui_camps_state.get_shop_merchant()
|
||||
if str(weishui_merchant.get("name", "")) != "Weishui Camp Sutler":
|
||||
failures.append("035 shop should expose Weishui Camp merchant name")
|
||||
if (weishui_merchant.get("lines", []) as Array).size() < 2:
|
||||
failures.append("035 shop should expose merchant flavor lines")
|
||||
if weishui_camps_state.get_unit("zhang_he_ch35").is_empty() or not weishui_camps_state.is_required_deployment("zhang_he_ch35"):
|
||||
failures.append("035 should deploy Zhang He as a required officer")
|
||||
_check_shop_item_visibility(failures, weishui_camps_state, "war_drum", false, "035 base")
|
||||
_check_shop_item_visibility(failures, weishui_camps_state, "imperial_seal", false, "035 base")
|
||||
|
||||
var weishui_anchored_state = BattleStateScript.new()
|
||||
if not weishui_anchored_state.load_battle("res://data/scenarios/035_weishui_camps.json", {}, {}, {"anchored_weishui_camps": true}, ["zhang_he"]):
|
||||
failures.append("could not load Weishui Camps anchored data")
|
||||
else:
|
||||
_check_shop_items_unique(failures, weishui_anchored_state, "035 anchored Weishui camps")
|
||||
var anchor_medicine: Dictionary = _find_camp_conversation(
|
||||
weishui_anchored_state.get_briefing().get("camp_conversations", []),
|
||||
"weishui_anchor_medicine"
|
||||
)
|
||||
if anchor_medicine.is_empty():
|
||||
failures.append("035 anchored Weishui camps should expose anchor medicine")
|
||||
else:
|
||||
_check_camp_conversation_effect(failures, anchor_medicine, "panacea", 1)
|
||||
if not _find_camp_conversation(
|
||||
weishui_anchored_state.get_briefing().get("camp_conversations", []),
|
||||
"weishui_doubt_rations"
|
||||
).is_empty():
|
||||
failures.append("035 anchored Weishui camps should not expose doubt rations")
|
||||
_check_shop_item_visibility(failures, weishui_anchored_state, "imperial_seal", true, "035 anchored Weishui camps")
|
||||
_check_shop_item_visibility(failures, weishui_anchored_state, "war_drum", false, "035 anchored Weishui camps")
|
||||
|
||||
var weishui_doubt_state = BattleStateScript.new()
|
||||
if not weishui_doubt_state.load_battle("res://data/scenarios/035_weishui_camps.json", {}, {}, {"sowed_han_sui_doubt": true}, ["zhang_he"]):
|
||||
failures.append("could not load Weishui Camps Han Sui doubt data")
|
||||
else:
|
||||
_check_shop_items_unique(failures, weishui_doubt_state, "035 sowed Han Sui doubt")
|
||||
var doubt_rations: Dictionary = _find_camp_conversation(
|
||||
weishui_doubt_state.get_briefing().get("camp_conversations", []),
|
||||
"weishui_doubt_rations"
|
||||
)
|
||||
if doubt_rations.is_empty():
|
||||
failures.append("035 sowed Han Sui doubt should expose doubt rations")
|
||||
else:
|
||||
_check_camp_conversation_effect(failures, doubt_rations, "bean", 1)
|
||||
if not _find_camp_conversation(
|
||||
weishui_doubt_state.get_briefing().get("camp_conversations", []),
|
||||
"weishui_anchor_medicine"
|
||||
).is_empty():
|
||||
failures.append("035 sowed Han Sui doubt should not expose anchor medicine")
|
||||
_check_shop_item_visibility(failures, weishui_doubt_state, "war_drum", true, "035 sowed Han Sui doubt")
|
||||
_check_shop_item_visibility(failures, weishui_doubt_state, "imperial_seal", false, "035 sowed Han Sui doubt")
|
||||
|
||||
var weishui_old_flags_state = BattleStateScript.new()
|
||||
if not weishui_old_flags_state.load_battle("res://data/scenarios/035_weishui_camps.json", {}, {}, {"fortified_tong_pass": true, "pressed_ma_chao_vanguard": true}, ["zhang_he"]):
|
||||
failures.append("could not load Weishui Camps old Counterstroke setup flag data")
|
||||
else:
|
||||
_check_shop_items_unique(failures, weishui_old_flags_state, "035 old Counterstroke setup flags")
|
||||
_check_shop_item_visibility(failures, weishui_old_flags_state, "war_drum", false, "035 old Counterstroke setup flags")
|
||||
_check_shop_item_visibility(failures, weishui_old_flags_state, "imperial_seal", false, "035 old Counterstroke setup flags")
|
||||
if not _find_camp_conversation(
|
||||
weishui_old_flags_state.get_briefing().get("camp_conversations", []),
|
||||
"weishui_anchor_medicine"
|
||||
).is_empty():
|
||||
failures.append("035 old Counterstroke setup flags should not expose anchor medicine")
|
||||
if not _find_camp_conversation(
|
||||
weishui_old_flags_state.get_briefing().get("camp_conversations", []),
|
||||
"weishui_doubt_rations"
|
||||
).is_empty():
|
||||
failures.append("035 old Counterstroke setup flags should not expose doubt rations")
|
||||
|
||||
for item_id in ["bronze_sword", "training_spear", "short_bow", "hand_axe", "iron_armor", "panacea"]:
|
||||
var item := state.get_item_def(item_id)
|
||||
@@ -2518,18 +2646,20 @@ func _check_ancient_ui_theme(failures: Array[String]) -> void:
|
||||
for expected in ["승리 조서", "패배 흉조", "전공 죽간", "흉조 징후"]:
|
||||
if not mission_text.contains(expected):
|
||||
failures.append("mission panel should use old campaign wording `%s`: %s" % [expected, mission_text])
|
||||
_check_panel_style_fill(failures, scene.briefing_panel, "briefing panel", Color(0.72, 0.60, 0.39, 0.995))
|
||||
_check_panel_style_frame(failures, scene.briefing_panel, "briefing panel", Color(0.035, 0.018, 0.012, 1.0), 6)
|
||||
_check_panel_style_fill(failures, scene.briefing_objective_panel, "briefing objective edict panel", Color(0.76, 0.63, 0.40, 0.995))
|
||||
_check_panel_style_frame(failures, scene.briefing_objective_panel, "briefing objective edict panel", Color(0.28, 0.020, 0.014, 1.0), 4)
|
||||
_check_panel_style_fill(failures, scene.dialogue_panel, "dialogue panel", Color(0.052, 0.022, 0.014, 0.995))
|
||||
_check_panel_style_frame(failures, scene.dialogue_panel, "dialogue panel", Color(0.12, 0.36, 0.25, 1.0), 6)
|
||||
_check_panel_style_fill(failures, scene.dialogue_portrait_panel, "dialogue portrait panel", Color(0.055, 0.025, 0.016, 1.0))
|
||||
_check_panel_style_fill(failures, scene.briefing_panel, "briefing panel", Color(0.74, 0.58, 0.32, 0.996))
|
||||
_check_panel_style_frame(failures, scene.briefing_panel, "briefing panel", Color(0.045, 0.026, 0.016, 1.0), 8)
|
||||
_check_panel_style_fill(failures, scene.briefing_objective_panel, "briefing objective edict panel", Color(0.55, 0.36, 0.15, 0.995))
|
||||
_check_panel_style_frame(failures, scene.briefing_objective_panel, "briefing objective edict panel", Color(0.10, 0.065, 0.040, 1.0), 5)
|
||||
_check_panel_style_fill(failures, scene.dialogue_panel, "dialogue panel", Color(0.036, 0.012, 0.006, 0.996))
|
||||
_check_panel_style_frame(failures, scene.dialogue_panel, "dialogue panel", Color(0.28, 0.020, 0.014, 1.0), 8)
|
||||
_check_panel_style_fill(failures, scene.dialogue_portrait_panel, "dialogue portrait panel", Color(0.035, 0.014, 0.008, 1.0))
|
||||
_check_panel_style_fill(failures, scene.dialogue_speaker_panel, "dialogue speaker seal panel", Color(0.28, 0.020, 0.014, 1.0))
|
||||
_check_panel_style_fill(failures, scene.dialogue_text_panel, "dialogue text scroll panel", Color(0.75, 0.62, 0.39, 0.995))
|
||||
_check_panel_style_fill(failures, scene.dialogue_text_panel, "dialogue text scroll panel", Color(0.67, 0.50, 0.27, 0.996))
|
||||
_check_seal_ribbon(failures, scene.briefing_seal_ribbon, "briefing seal ribbon")
|
||||
_check_seal_ribbon(failures, scene.dialogue_seal_ribbon, "dialogue seal ribbon")
|
||||
_check_seal_ribbon(failures, scene.result_seal_ribbon, "result seal ribbon")
|
||||
_check_bamboo_gutter_row(failures, scene.briefing_objective_panel, "briefing objective bamboo gutters")
|
||||
_check_bamboo_gutter_row(failures, scene.dialogue_text_panel, "dialogue scroll bamboo gutters")
|
||||
_check_dialogue_column_budget(failures, scene)
|
||||
if scene.dialogue_continue_button == null or scene.dialogue_continue_button.text != "다음 죽간":
|
||||
failures.append("dialogue continue button should use ancient slip text")
|
||||
@@ -2570,7 +2700,7 @@ func _check_ancient_ui_theme(failures: Array[String]) -> void:
|
||||
scene._update_briefing_camp_overview(scene.state.get_briefing(), false)
|
||||
if scene.briefing_camp_overview_fallback_label == null or scene.briefing_camp_overview_fallback_label.text != "비단 전장도":
|
||||
failures.append("briefing map fallback should read as an old campaign map")
|
||||
_check_panel_style_fill(failures, scene.result_panel, "result panel", Color(0.54, 0.43, 0.27, 0.992))
|
||||
_check_panel_style_fill(failures, scene.result_panel, "result panel", Color(0.48, 0.34, 0.17, 0.994))
|
||||
if not scene._format_victory_result_text().contains("승전 조서"):
|
||||
failures.append("victory result should read like a bronze proclamation")
|
||||
if not scene._format_defeat_result_text().contains("패전 비문"):
|
||||
@@ -2597,6 +2727,27 @@ func _check_seal_ribbon(failures: Array[String], ribbon: HBoxContainer, label: S
|
||||
failures.append("%s should include a three-seal center cluster" % label)
|
||||
|
||||
|
||||
func _check_bamboo_gutter_row(failures: Array[String], panel: PanelContainer, label: String) -> void:
|
||||
if panel == null or panel.get_child_count() <= 0:
|
||||
failures.append("%s missing row" % label)
|
||||
return
|
||||
var row := panel.get_child(0) as HBoxContainer
|
||||
if row == null or row.get_child_count() < 3:
|
||||
failures.append("%s should use a row with bamboo side gutters" % label)
|
||||
return
|
||||
_check_bamboo_gutter(failures, row.get_child(0), "%s left gutter" % label)
|
||||
_check_bamboo_gutter(failures, row.get_child(row.get_child_count() - 1), "%s right gutter" % label)
|
||||
|
||||
|
||||
func _check_bamboo_gutter(failures: Array[String], node: Node, label: String) -> void:
|
||||
var gutter := node as HBoxContainer
|
||||
if gutter == null:
|
||||
failures.append("%s should be a bamboo gutter container" % label)
|
||||
return
|
||||
if gutter.get_child_count() != 3:
|
||||
failures.append("%s should use three bamboo slips" % label)
|
||||
|
||||
|
||||
func _check_dialogue_column_budget(failures: Array[String], scene) -> void:
|
||||
if scene.dialogue_column == null:
|
||||
failures.append("dialogue column missing")
|
||||
|
||||
Reference in New Issue
Block a user