Add Dingtao branch camp content
This commit is contained in:
@@ -243,6 +243,64 @@ func _check_battle_visual_data(failures: Array[String]) -> void:
|
||||
).is_empty():
|
||||
failures.append("005 regroup flag should not expose hardened vanguard conversation")
|
||||
|
||||
var dingtao_state = BattleStateScript.new()
|
||||
if not dingtao_state.load_battle("res://data/scenarios/006_dingtao_counterattack.json"):
|
||||
failures.append("could not load Dingtao Counterattack camp data")
|
||||
else:
|
||||
var dingtao_conversations: Array = dingtao_state.get_briefing().get("camp_conversations", [])
|
||||
if dingtao_conversations.size() != 2:
|
||||
failures.append("006 base briefing should expose exactly two camp conversations")
|
||||
else:
|
||||
_check_camp_conversation(failures, dingtao_conversations[0], "dingtao_countercharge_council", "officer", "cao_cao")
|
||||
_check_camp_conversation(failures, dingtao_conversations[1], "dingtao_dian_wei_roadblock", "officer", "dian_wei")
|
||||
var dingtao_merchant := dingtao_state.get_shop_merchant()
|
||||
if str(dingtao_merchant.get("name", "")) != "Dingtao Field Sutler":
|
||||
failures.append("006 shop should expose Dingtao merchant name")
|
||||
if (dingtao_merchant.get("lines", []) as Array).size() < 2:
|
||||
failures.append("006 shop should expose merchant flavor lines")
|
||||
_check_shop_item_visibility(failures, dingtao_state, "iron_armor", false, "006 base")
|
||||
_check_shop_item_visibility(failures, dingtao_state, "war_drum", false, "006 base")
|
||||
|
||||
var dingtao_fortified_state = BattleStateScript.new()
|
||||
if not dingtao_fortified_state.load_battle("res://data/scenarios/006_dingtao_counterattack.json", {}, {}, {"fortified_yan_province": true}):
|
||||
failures.append("could not load Dingtao fortified camp data")
|
||||
else:
|
||||
var fortified: Dictionary = _find_camp_conversation(
|
||||
dingtao_fortified_state.get_briefing().get("camp_conversations", []),
|
||||
"dingtao_fortified_reserves"
|
||||
)
|
||||
if fortified.is_empty():
|
||||
failures.append("006 fortified flag should expose fortified reserves conversation")
|
||||
else:
|
||||
_check_camp_conversation_effect(failures, fortified, "panacea", 1)
|
||||
if not _find_camp_conversation(
|
||||
dingtao_fortified_state.get_briefing().get("camp_conversations", []),
|
||||
"dingtao_pressed_vanguard"
|
||||
).is_empty():
|
||||
failures.append("006 fortified flag should not expose pressed vanguard conversation")
|
||||
_check_shop_item_visibility(failures, dingtao_fortified_state, "iron_armor", true, "006 fortified")
|
||||
_check_shop_item_visibility(failures, dingtao_fortified_state, "war_drum", false, "006 fortified")
|
||||
|
||||
var dingtao_pressed_state = BattleStateScript.new()
|
||||
if not dingtao_pressed_state.load_battle("res://data/scenarios/006_dingtao_counterattack.json", {}, {}, {"pressed_lu_bu": true}):
|
||||
failures.append("could not load Dingtao pressed camp data")
|
||||
else:
|
||||
var pressed: Dictionary = _find_camp_conversation(
|
||||
dingtao_pressed_state.get_briefing().get("camp_conversations", []),
|
||||
"dingtao_pressed_vanguard"
|
||||
)
|
||||
if pressed.is_empty():
|
||||
failures.append("006 pressed flag should expose pressed vanguard conversation")
|
||||
else:
|
||||
_check_camp_conversation_effect(failures, pressed, "wine", 1)
|
||||
if not _find_camp_conversation(
|
||||
dingtao_pressed_state.get_briefing().get("camp_conversations", []),
|
||||
"dingtao_fortified_reserves"
|
||||
).is_empty():
|
||||
failures.append("006 pressed flag should not expose fortified reserves conversation")
|
||||
_check_shop_item_visibility(failures, dingtao_pressed_state, "iron_armor", false, "006 pressed")
|
||||
_check_shop_item_visibility(failures, dingtao_pressed_state, "war_drum", true, "006 pressed")
|
||||
|
||||
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():
|
||||
@@ -835,6 +893,12 @@ func _find_camp_conversation(conversations: Array, conversation_id: String) -> D
|
||||
return {}
|
||||
|
||||
|
||||
func _check_shop_item_visibility(failures: Array[String], state, item_id: String, expected_visible: bool, context: String) -> void:
|
||||
var visible: bool = state.get_shop_item_ids().has(item_id)
|
||||
if visible != expected_visible:
|
||||
failures.append("%s shop visibility for %s should be %s" % [context, item_id, str(expected_visible)])
|
||||
|
||||
|
||||
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