Improve Dingtao counterattack battle pacing
This commit is contained in:
@@ -91,6 +91,18 @@ func _init() -> void:
|
||||
_progress_text("res://data/scenarios/005_puyang_raid.json", false),
|
||||
"군영 장악"
|
||||
)
|
||||
_check_contains(
|
||||
failures,
|
||||
"006 gated victory progress",
|
||||
_progress_text("res://data/scenarios/006_dingtao_counterattack.json", false),
|
||||
"제9군령에 전공 갱신"
|
||||
)
|
||||
_check_contains(
|
||||
failures,
|
||||
"006 center line progress",
|
||||
_progress_text("res://data/scenarios/006_dingtao_counterattack.json", false),
|
||||
"중앙 방진"
|
||||
)
|
||||
_check_contains(
|
||||
failures,
|
||||
"007 destination progress",
|
||||
@@ -117,6 +129,7 @@ func _init() -> void:
|
||||
_check_xingyang_ambush_extended_pressure(failures)
|
||||
_check_qingzhou_campaign_extended_pressure(failures)
|
||||
_check_puyang_raid_extended_pressure(failures)
|
||||
_check_dingtao_counterattack_extended_pressure(failures)
|
||||
_check_objective_update(failures)
|
||||
_check_objective_notice(failures)
|
||||
_check_terrain_recovery(failures)
|
||||
@@ -573,6 +586,87 @@ func _check_puyang_raid_extended_pressure(failures: Array[String]) -> void:
|
||||
scene.free()
|
||||
|
||||
|
||||
func _check_dingtao_counterattack_extended_pressure(failures: Array[String]) -> void:
|
||||
var state = BattleStateScript.new()
|
||||
if not state.load_battle("res://data/scenarios/006_dingtao_counterattack.json"):
|
||||
failures.append("Dingtao Counterattack pressure smoke could not load scenario")
|
||||
return
|
||||
if state.get_turn_limit() != 17:
|
||||
failures.append("Dingtao Counterattack should allow play through turn 17, got limit %d" % state.get_turn_limit())
|
||||
if state.get_living_units(BattleStateScript.TEAM_ENEMY).size() != 8:
|
||||
failures.append("Dingtao Counterattack should start with 8 enemies, got %d" % state.get_living_units(BattleStateScript.TEAM_ENEMY).size())
|
||||
if state._condition_gate_open({"after_event": "turn_9_lu_bu_second_charge"}):
|
||||
failures.append("Dingtao Counterattack final defeat-all condition should be gated until turn 9 second charge")
|
||||
var marker_cells := state.get_objective_cells()
|
||||
for center_cell in [Vector2i(8, 3), Vector2i(9, 3), Vector2i(8, 5), Vector2i(9, 5)]:
|
||||
if not marker_cells.has(center_cell):
|
||||
failures.append("Dingtao Counterattack should mark center line cell %s: %s" % [str(center_cell), str(marker_cells)])
|
||||
if state.get_objective_cell_label(center_cell) != "중앙 방진":
|
||||
failures.append("Dingtao Counterattack center marker should expose label at %s" % str(center_cell))
|
||||
var recovery_summaries := state.get_recovery_terrain_summaries()
|
||||
var has_center_recovery := false
|
||||
var has_supply_recovery := false
|
||||
for summary in recovery_summaries:
|
||||
if str(summary.get("name", "")) == "성채" and int(summary.get("count", 0)) == 4 and int(summary.get("heal", 0)) == 8:
|
||||
has_center_recovery = true
|
||||
if str(summary.get("name", "")) == "마을" and int(summary.get("count", 0)) == 4 and int(summary.get("heal", 0)) == 6:
|
||||
has_supply_recovery = true
|
||||
if not has_center_recovery:
|
||||
failures.append("Dingtao Counterattack should expose center recovery terrain: %s" % str(recovery_summaries))
|
||||
if not has_supply_recovery:
|
||||
failures.append("Dingtao Counterattack should expose supply recovery terrain: %s" % str(recovery_summaries))
|
||||
state._run_events("turn_start", BattleStateScript.TEAM_ENEMY, 3)
|
||||
state._run_events("turn_start", BattleStateScript.TEAM_ENEMY, 6)
|
||||
state._run_events("turn_start", BattleStateScript.TEAM_ENEMY, 9)
|
||||
if not state._condition_gate_open({"after_event": "turn_9_lu_bu_second_charge"}):
|
||||
failures.append("Dingtao Counterattack final gate should open after turn 9 second charge event")
|
||||
if state.get_living_units(BattleStateScript.TEAM_ENEMY).size() != 14:
|
||||
failures.append("Dingtao Counterattack base branch should field 14 enemies after second charge, got %d" % state.get_living_units(BattleStateScript.TEAM_ENEMY).size())
|
||||
if int(state.get_unit("xiahou_dun_ch6").get("ai_target_priority", 0)) != 8:
|
||||
failures.append("Dingtao Counterattack turn 6 flank pressure should target Xiahou Dun")
|
||||
if int(state.get_unit("cao_cao_ch6").get("ai_target_priority", 0)) != 12:
|
||||
failures.append("Dingtao Counterattack turn 9 second charge should target Cao Cao")
|
||||
for enemy in state.get_living_units(BattleStateScript.TEAM_ENEMY):
|
||||
enemy["alive"] = false
|
||||
state._check_battle_status()
|
||||
if str(state.battle_status) != BattleStateScript.STATUS_ACTIVE:
|
||||
failures.append("Dingtao Counterattack should not end before center line is held, got %s" % str(state.battle_status))
|
||||
var cao_cao: Dictionary = state.get_unit("cao_cao_ch6")
|
||||
cao_cao["pos"] = Vector2i(8, 3)
|
||||
state._check_battle_status()
|
||||
if str(state.battle_status) != BattleStateScript.STATUS_VICTORY:
|
||||
failures.append("Dingtao Counterattack should end after second charge falls and center line is held, got %s" % str(state.battle_status))
|
||||
var fortified_state = BattleStateScript.new()
|
||||
if not fortified_state.load_battle("res://data/scenarios/006_dingtao_counterattack.json", {}, {}, {"fortified_yan_province": true}):
|
||||
failures.append("Dingtao Counterattack fortified branch smoke could not load scenario")
|
||||
return
|
||||
fortified_state._run_events("turn_start", BattleStateScript.TEAM_ENEMY, 3)
|
||||
fortified_state._run_events("turn_start", BattleStateScript.TEAM_ENEMY, 6)
|
||||
fortified_state._run_events("turn_start", BattleStateScript.TEAM_ENEMY, 9)
|
||||
if fortified_state.get_living_units(BattleStateScript.TEAM_ENEMY).size() != 16:
|
||||
failures.append("Dingtao Counterattack fortified branch should field 16 enemies after second charge, got %d" % fortified_state.get_living_units(BattleStateScript.TEAM_ENEMY).size())
|
||||
var pressed_state = BattleStateScript.new()
|
||||
if not pressed_state.load_battle("res://data/scenarios/006_dingtao_counterattack.json", {}, {}, {"pressed_lu_bu": true}):
|
||||
failures.append("Dingtao Counterattack pressed branch smoke could not load scenario")
|
||||
return
|
||||
pressed_state._run_events("turn_start", BattleStateScript.TEAM_ENEMY, 3)
|
||||
pressed_state._run_events("turn_start", BattleStateScript.TEAM_ENEMY, 6)
|
||||
pressed_state._run_events("turn_start", BattleStateScript.TEAM_ENEMY, 9)
|
||||
if pressed_state.get_living_units(BattleStateScript.TEAM_ENEMY).size() != 17:
|
||||
failures.append("Dingtao Counterattack pressed branch should field 17 enemies after second charge, got %d" % pressed_state.get_living_units(BattleStateScript.TEAM_ENEMY).size())
|
||||
var scene = BattleSceneScript.new()
|
||||
if not scene.state.load_battle("res://data/scenarios/006_dingtao_counterattack.json"):
|
||||
failures.append("Dingtao Counterattack briefing smoke could not load scenario")
|
||||
scene.free()
|
||||
return
|
||||
var overview := scene._format_briefing_battlefield_overview_text()
|
||||
_check_contains(failures, "006 briefing map size", overview, "14칸 x 10칸")
|
||||
_check_contains(failures, "006 briefing enemy count", overview, "적세 8명")
|
||||
_check_contains(failures, "006 briefing village recovery", overview, "마을 4칸 +6")
|
||||
_check_contains(failures, "006 briefing center recovery", overview, "성채 4칸 +8")
|
||||
scene.free()
|
||||
|
||||
|
||||
func _check_opening_board_avoids_side_panel(failures: Array[String]) -> void:
|
||||
var state = BattleStateScript.new()
|
||||
if not state.load_battle("res://data/scenarios/001_yellow_turbans.json"):
|
||||
|
||||
Reference in New Issue
Block a user