Improve Xian emperor escort battle pacing
This commit is contained in:
@@ -103,11 +103,17 @@ func _init() -> void:
|
||||
_progress_text("res://data/scenarios/006_dingtao_counterattack.json", false),
|
||||
"중앙 방진"
|
||||
)
|
||||
_check_contains(
|
||||
failures,
|
||||
"007 gated victory progress",
|
||||
_progress_text("res://data/scenarios/007_xian_emperor_escort.json", false),
|
||||
"제9군령에 전공 갱신"
|
||||
)
|
||||
_check_contains(
|
||||
failures,
|
||||
"007 destination progress",
|
||||
_progress_text("res://data/scenarios/007_xian_emperor_escort.json", false),
|
||||
"전장 표식 (14, 5) · 미도달"
|
||||
"동도 호송로 (13, 5), (14, 5) · 미도달"
|
||||
)
|
||||
_check_contains(
|
||||
failures,
|
||||
@@ -130,6 +136,7 @@ func _init() -> void:
|
||||
_check_qingzhou_campaign_extended_pressure(failures)
|
||||
_check_puyang_raid_extended_pressure(failures)
|
||||
_check_dingtao_counterattack_extended_pressure(failures)
|
||||
_check_xian_emperor_escort_extended_pressure(failures)
|
||||
_check_objective_update(failures)
|
||||
_check_objective_notice(failures)
|
||||
_check_terrain_recovery(failures)
|
||||
@@ -667,6 +674,83 @@ func _check_dingtao_counterattack_extended_pressure(failures: Array[String]) ->
|
||||
scene.free()
|
||||
|
||||
|
||||
func _check_xian_emperor_escort_extended_pressure(failures: Array[String]) -> void:
|
||||
var state = BattleStateScript.new()
|
||||
if not state.load_battle("res://data/scenarios/007_xian_emperor_escort.json"):
|
||||
failures.append("Xian Emperor Escort pressure smoke could not load scenario")
|
||||
return
|
||||
if state.get_turn_limit() != 17:
|
||||
failures.append("Xian Emperor Escort 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("Xian Emperor Escort should start with 8 enemies, got %d" % state.get_living_units(BattleStateScript.TEAM_ENEMY).size())
|
||||
if state._condition_gate_open({"after_event": "turn_9_final_escort_pressure"}):
|
||||
failures.append("Xian Emperor Escort final defeat-all condition should be gated until turn 9 final pressure")
|
||||
var marker_cells := state.get_objective_cells()
|
||||
for road_cell in [Vector2i(12, 4), Vector2i(13, 4)]:
|
||||
if not marker_cells.has(road_cell):
|
||||
failures.append("Xian Emperor Escort should mark east road cell %s: %s" % [str(road_cell), str(marker_cells)])
|
||||
if state.get_objective_cell_label(road_cell) != "동도 호송로":
|
||||
failures.append("Xian Emperor Escort road marker should expose label at %s" % str(road_cell))
|
||||
var recovery_summaries := state.get_recovery_terrain_summaries()
|
||||
var has_road_recovery := false
|
||||
var has_village_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_road_recovery = true
|
||||
if str(summary.get("name", "")) == "마을" and int(summary.get("count", 0)) == 4 and int(summary.get("heal", 0)) == 6:
|
||||
has_village_recovery = true
|
||||
if not has_road_recovery:
|
||||
failures.append("Xian Emperor Escort should expose road recovery terrain: %s" % str(recovery_summaries))
|
||||
if not has_village_recovery:
|
||||
failures.append("Xian Emperor Escort should expose village recovery terrain: %s" % str(recovery_summaries))
|
||||
state._run_events("turn_start", BattleStateScript.TEAM_ENEMY, 3)
|
||||
var cao_cao: Dictionary = state.get_unit("cao_cao_ch7")
|
||||
cao_cao["pos"] = Vector2i(7, 4)
|
||||
state._run_events("unit_reaches_tile", BattleStateScript.TEAM_PLAYER, 1, cao_cao)
|
||||
state._run_events("turn_start", BattleStateScript.TEAM_ENEMY, 6)
|
||||
if int(state.get_unit("imperial_envoy_ch7").get("ai_target_priority", 0)) != 10:
|
||||
failures.append("Xian Emperor Escort turn 6 pressure should target the imperial envoy")
|
||||
state._run_events("turn_start", BattleStateScript.TEAM_ENEMY, 9)
|
||||
if not state._condition_gate_open({"after_event": "turn_9_final_escort_pressure"}):
|
||||
failures.append("Xian Emperor Escort final gate should open after turn 9 pressure event")
|
||||
if state.get_living_units(BattleStateScript.TEAM_ENEMY).size() != 18:
|
||||
failures.append("Xian Emperor Escort should field 18 enemies after ambush and final pressure, got %d" % state.get_living_units(BattleStateScript.TEAM_ENEMY).size())
|
||||
if int(state.get_unit("cao_cao_ch7").get("ai_target_priority", 0)) != 12:
|
||||
failures.append("Xian Emperor Escort turn 9 final pressure should target Cao Cao")
|
||||
if int(state.get_unit("imperial_envoy_ch7").get("ai_target_priority", 0)) != 12:
|
||||
failures.append("Xian Emperor Escort turn 9 final pressure should keep targeting the imperial envoy")
|
||||
for enemy in state.get_living_units(BattleStateScript.TEAM_ENEMY):
|
||||
enemy["alive"] = false
|
||||
cao_cao["pos"] = Vector2i(11, 4)
|
||||
state._check_battle_status()
|
||||
if str(state.battle_status) != BattleStateScript.STATUS_ACTIVE:
|
||||
failures.append("Xian Emperor Escort should not end before the east road is secured, got %s" % str(state.battle_status))
|
||||
cao_cao["pos"] = Vector2i(12, 4)
|
||||
state._check_battle_status()
|
||||
if str(state.battle_status) != BattleStateScript.STATUS_VICTORY:
|
||||
failures.append("Xian Emperor Escort should end after final pressure falls and the east road is secured, got %s" % str(state.battle_status))
|
||||
var no_ambush_state = BattleStateScript.new()
|
||||
if not no_ambush_state.load_battle("res://data/scenarios/007_xian_emperor_escort.json"):
|
||||
failures.append("Xian Emperor Escort no-ambush smoke could not load scenario")
|
||||
return
|
||||
no_ambush_state._run_events("turn_start", BattleStateScript.TEAM_ENEMY, 3)
|
||||
no_ambush_state._run_events("turn_start", BattleStateScript.TEAM_ENEMY, 6)
|
||||
no_ambush_state._run_events("turn_start", BattleStateScript.TEAM_ENEMY, 9)
|
||||
if no_ambush_state.get_living_units(BattleStateScript.TEAM_ENEMY).size() != 16:
|
||||
failures.append("Xian Emperor Escort should field 16 enemies without the road ambush, got %d" % no_ambush_state.get_living_units(BattleStateScript.TEAM_ENEMY).size())
|
||||
var scene = BattleSceneScript.new()
|
||||
if not scene.state.load_battle("res://data/scenarios/007_xian_emperor_escort.json"):
|
||||
failures.append("Xian Emperor Escort briefing smoke could not load scenario")
|
||||
scene.free()
|
||||
return
|
||||
var overview := scene._format_briefing_battlefield_overview_text()
|
||||
_check_contains(failures, "007 briefing map size", overview, "15칸 x 10칸")
|
||||
_check_contains(failures, "007 briefing enemy count", overview, "적세 8명")
|
||||
_check_contains(failures, "007 briefing village recovery", overview, "마을 4칸 +6")
|
||||
_check_contains(failures, "007 briefing road 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