Add Yan Ford pursuit camp content
This commit is contained in:
@@ -537,6 +537,18 @@ func _check_battle_visual_data(failures: Array[String]) -> void:
|
||||
if not yan_ford_state.load_battle("res://data/scenarios/011_yan_ford_pursuit.json"):
|
||||
failures.append("could not load Yan Ford Pursuit shop data")
|
||||
else:
|
||||
_check_shop_items_unique(failures, yan_ford_state, "011 base")
|
||||
var yan_ford_conversations: Array = yan_ford_state.get_briefing().get("camp_conversations", [])
|
||||
if yan_ford_conversations.size() != 2:
|
||||
failures.append("011 base briefing should expose exactly two camp conversations")
|
||||
else:
|
||||
_check_camp_conversation(failures, yan_ford_conversations[0], "yan_ford_pursuit_council", "officer", "guo_jia")
|
||||
_check_camp_conversation(failures, yan_ford_conversations[1], "yan_ford_xiahou_yuan_banks", "officer", "xiahou_yuan")
|
||||
var yan_ford_merchant := yan_ford_state.get_shop_merchant()
|
||||
if str(yan_ford_merchant.get("name", "")) != "Yan Ford Bank Sutler":
|
||||
failures.append("011 shop should expose Yan Ford merchant name")
|
||||
if (yan_ford_merchant.get("lines", []) as Array).size() < 2:
|
||||
failures.append("011 shop should expose merchant flavor lines")
|
||||
_check_shop_item_visibility(failures, yan_ford_state, "imperial_seal", false, "011 base")
|
||||
_check_shop_item_visibility(failures, yan_ford_state, "war_axe", false, "011 base")
|
||||
|
||||
@@ -544,6 +556,20 @@ func _check_battle_visual_data(failures: Array[String]) -> void:
|
||||
if not yan_ford_fortified_state.load_battle("res://data/scenarios/011_yan_ford_pursuit.json", {}, {}, {"fortified_white_horse": true}):
|
||||
failures.append("could not load Yan Ford fortified White Horse shop data")
|
||||
else:
|
||||
_check_shop_items_unique(failures, yan_ford_fortified_state, "011 fortified White Horse")
|
||||
var crossing_medicine: Dictionary = _find_camp_conversation(
|
||||
yan_ford_fortified_state.get_briefing().get("camp_conversations", []),
|
||||
"yan_ford_fortified_crossing_medicine"
|
||||
)
|
||||
if crossing_medicine.is_empty():
|
||||
failures.append("011 fortified White Horse flag should expose crossing medicine conversation")
|
||||
else:
|
||||
_check_camp_conversation_effect(failures, crossing_medicine, "panacea", 1)
|
||||
if not _find_camp_conversation(
|
||||
yan_ford_fortified_state.get_briefing().get("camp_conversations", []),
|
||||
"yan_ford_raided_supply_beans"
|
||||
).is_empty():
|
||||
failures.append("011 fortified White Horse flag should not expose raided supply beans conversation")
|
||||
_check_shop_item_visibility(failures, yan_ford_fortified_state, "imperial_seal", true, "011 fortified White Horse")
|
||||
_check_shop_item_visibility(failures, yan_ford_fortified_state, "war_axe", false, "011 fortified White Horse")
|
||||
|
||||
@@ -551,9 +577,47 @@ func _check_battle_visual_data(failures: Array[String]) -> void:
|
||||
if not yan_ford_raided_state.load_battle("res://data/scenarios/011_yan_ford_pursuit.json", {}, {}, {"raided_yuan_supplies": true}):
|
||||
failures.append("could not load Yan Ford raided Yuan supplies shop data")
|
||||
else:
|
||||
_check_shop_items_unique(failures, yan_ford_raided_state, "011 raided Yuan supplies")
|
||||
var supply_beans: Dictionary = _find_camp_conversation(
|
||||
yan_ford_raided_state.get_briefing().get("camp_conversations", []),
|
||||
"yan_ford_raided_supply_beans"
|
||||
)
|
||||
if supply_beans.is_empty():
|
||||
failures.append("011 raided Yuan supplies flag should expose raided supply beans conversation")
|
||||
else:
|
||||
_check_camp_conversation_effect(failures, supply_beans, "bean", 1)
|
||||
if not _find_camp_conversation(
|
||||
yan_ford_raided_state.get_briefing().get("camp_conversations", []),
|
||||
"yan_ford_fortified_crossing_medicine"
|
||||
).is_empty():
|
||||
failures.append("011 raided Yuan supplies flag should not expose crossing medicine conversation")
|
||||
_check_shop_item_visibility(failures, yan_ford_raided_state, "imperial_seal", false, "011 raided Yuan supplies")
|
||||
_check_shop_item_visibility(failures, yan_ford_raided_state, "war_axe", true, "011 raided Yuan supplies")
|
||||
|
||||
var guandu_state = BattleStateScript.new()
|
||||
if not guandu_state.load_battle("res://data/scenarios/012_guandu_showdown.json"):
|
||||
failures.append("could not load Guandu Showdown shop data")
|
||||
else:
|
||||
_check_shop_items_unique(failures, guandu_state, "012 base")
|
||||
_check_shop_item_visibility(failures, guandu_state, "imperial_seal", false, "012 base")
|
||||
_check_shop_item_visibility(failures, guandu_state, "war_drum", false, "012 base")
|
||||
|
||||
var guandu_secured_state = BattleStateScript.new()
|
||||
if not guandu_secured_state.load_battle("res://data/scenarios/012_guandu_showdown.json", {}, {}, {"secured_guandu_line": true}):
|
||||
failures.append("could not load Guandu secured line shop data")
|
||||
else:
|
||||
_check_shop_items_unique(failures, guandu_secured_state, "012 secured Guandu line")
|
||||
_check_shop_item_visibility(failures, guandu_secured_state, "imperial_seal", true, "012 secured Guandu line")
|
||||
_check_shop_item_visibility(failures, guandu_secured_state, "war_drum", false, "012 secured Guandu line")
|
||||
|
||||
var guandu_scouted_state = BattleStateScript.new()
|
||||
if not guandu_scouted_state.load_battle("res://data/scenarios/012_guandu_showdown.json", {}, {}, {"scouted_wuchao_depots": true}):
|
||||
failures.append("could not load Guandu scouted Wuchao shop data")
|
||||
else:
|
||||
_check_shop_items_unique(failures, guandu_scouted_state, "012 scouted Wuchao")
|
||||
_check_shop_item_visibility(failures, guandu_scouted_state, "imperial_seal", false, "012 scouted Wuchao")
|
||||
_check_shop_item_visibility(failures, guandu_scouted_state, "war_drum", true, "012 scouted Wuchao")
|
||||
|
||||
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():
|
||||
@@ -1152,6 +1216,15 @@ func _check_shop_item_visibility(failures: Array[String], state, item_id: String
|
||||
failures.append("%s shop visibility for %s should be %s" % [context, item_id, str(expected_visible)])
|
||||
|
||||
|
||||
func _check_shop_items_unique(failures: Array[String], state, context: String) -> void:
|
||||
var seen := {}
|
||||
for item_id in state.get_shop_item_ids():
|
||||
var key := str(item_id)
|
||||
if seen.has(key):
|
||||
failures.append("%s shop should not expose duplicate item id: %s" % [context, key])
|
||||
seen[key] = true
|
||||
|
||||
|
||||
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():
|
||||
|
||||
Reference in New Issue
Block a user