Improve Xingyang ambush battle pacing

This commit is contained in:
2026-06-19 13:50:18 +09:00
parent 1cdb59aa1e
commit 0451550234
3 changed files with 217 additions and 13 deletions

View File

@@ -55,6 +55,18 @@ func _init() -> void:
_progress_text("res://data/scenarios/002_sishui_gate.json", false),
"관문 장악"
)
_check_contains(
failures,
"003 gated victory progress",
_progress_text("res://data/scenarios/003_xingyang_ambush.json", false),
"제9군령에 전공 갱신"
)
_check_contains(
failures,
"003 road capture progress",
_progress_text("res://data/scenarios/003_xingyang_ambush.json", false),
"동쪽 길목"
)
_check_contains(
failures,
"007 destination progress",
@@ -78,6 +90,7 @@ func _init() -> void:
_check_turn_gated_objective_does_not_create_marker(failures)
_check_opening_battle_requires_castle_capture(failures)
_check_sishui_gate_extended_pressure(failures)
_check_xingyang_ambush_extended_pressure(failures)
_check_objective_update(failures)
_check_objective_notice(failures)
_check_terrain_recovery(failures)
@@ -360,6 +373,68 @@ func _check_sishui_gate_extended_pressure(failures: Array[String]) -> void:
scene.free()
func _check_xingyang_ambush_extended_pressure(failures: Array[String]) -> void:
var state = BattleStateScript.new()
if not state.load_battle("res://data/scenarios/003_xingyang_ambush.json", {}, {}, {"pursued_dong_zhuo": true}):
failures.append("Xingyang Ambush pressure smoke could not load scenario")
return
if state.get_turn_limit() != 16:
failures.append("Xingyang Ambush should allow play through turn 16, got limit %d" % state.get_turn_limit())
if state.get_living_units(BattleStateScript.TEAM_ENEMY).size() != 6:
failures.append("Xingyang Ambush should start with 6 enemies, got %d" % state.get_living_units(BattleStateScript.TEAM_ENEMY).size())
if state._condition_gate_open({"after_event": "turn_9_forest_blockade"}):
failures.append("Xingyang Ambush final defeat-all condition should be gated until turn 9 blockade")
var marker_cells := state.get_objective_cells()
for road_cell in [Vector2i(10, 3), Vector2i(11, 3), Vector2i(10, 4), Vector2i(11, 4)]:
if not marker_cells.has(road_cell):
failures.append("Xingyang Ambush should mark road capture cell %s: %s" % [str(road_cell), str(marker_cells)])
if state.get_objective_cell_label(road_cell) != "동쪽 길목":
failures.append("Xingyang Ambush road marker should expose label at %s" % str(road_cell))
var recovery_summaries := state.get_recovery_terrain_summaries()
var has_waystation_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)) == 6:
has_waystation_recovery = true
if not has_waystation_recovery:
failures.append("Xingyang Ambush should expose roadside 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_forest_blockade"}):
failures.append("Xingyang Ambush final gate should open after turn 9 blockade event")
if state.get_living_units(BattleStateScript.TEAM_ENEMY).size() != 15:
failures.append("Xingyang Ambush pursuit branch should field 15 enemies after blockade, got %d" % state.get_living_units(BattleStateScript.TEAM_ENEMY).size())
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("Xingyang Ambush should not end before east road capture, got %s" % str(state.battle_status))
var cao_cao: Dictionary = state.get_unit("cao_cao_ch3")
cao_cao["pos"] = Vector2i(10, 3)
state._check_battle_status()
if str(state.battle_status) != BattleStateScript.STATUS_VICTORY:
failures.append("Xingyang Ambush should end after blockade falls and east road is captured, got %s" % str(state.battle_status))
var regroup_state = BattleStateScript.new()
if not regroup_state.load_battle("res://data/scenarios/003_xingyang_ambush.json", {}, {}, {"regrouped_after_sishui": true}):
failures.append("Xingyang Ambush regroup pressure smoke could not load scenario")
return
regroup_state._run_events("turn_start", BattleStateScript.TEAM_ENEMY, 3)
regroup_state._run_events("turn_start", BattleStateScript.TEAM_ENEMY, 6)
regroup_state._run_events("turn_start", BattleStateScript.TEAM_ENEMY, 9)
if regroup_state.get_living_units(BattleStateScript.TEAM_ENEMY).size() != 14:
failures.append("Xingyang Ambush regroup branch should field 14 enemies after blockade, got %d" % regroup_state.get_living_units(BattleStateScript.TEAM_ENEMY).size())
var scene = BattleSceneScript.new()
if not scene.state.load_battle("res://data/scenarios/003_xingyang_ambush.json"):
failures.append("Xingyang Ambush briefing smoke could not load scenario")
scene.free()
return
var overview := scene._format_briefing_battlefield_overview_text()
_check_contains(failures, "003 briefing map size", overview, "12칸 x 9칸")
_check_contains(failures, "003 briefing enemy count", overview, "적세 6명")
_check_contains(failures, "003 briefing village recovery", overview, "마을 4칸 +6")
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"):