Improve opening battle pacing and objectives UI

This commit is contained in:
2026-06-19 13:32:05 +09:00
parent b9fb2dd79e
commit f69438e964
4 changed files with 352 additions and 56 deletions

View File

@@ -29,7 +29,13 @@ func _init() -> void:
failures,
"001 turn pressure risk",
_defeat_text("res://data/scenarios/001_yellow_turbans.json"),
"잔여 군령 15"
"잔여 군령 17"
)
_check_contains(
failures,
"001 late reserve gate",
_progress_text("res://data/scenarios/001_yellow_turbans.json", false),
"제9군령에 전공 갱신"
)
_check_contains(
failures,
@@ -69,6 +75,7 @@ func _init() -> void:
_check_objective_notice(failures)
_check_terrain_recovery(failures)
_check_briefing_battlefield_overview(failures)
_check_opening_battle_extended_pressure(failures)
_check_opening_board_avoids_side_panel(failures)
if failures.is_empty():
@@ -227,8 +234,14 @@ func _check_opening_battle_requires_castle_capture(failures: Array[String]) -> v
var cao_cao: Dictionary = state.get_unit("cao_cao")
cao_cao["pos"] = Vector2i(12, 1)
state._check_battle_status()
if str(state.battle_status) != BattleStateScript.STATUS_ACTIVE:
failures.append("opening battle should wait for late reserve before victory, got %s" % str(state.battle_status))
state._run_events("turn_start", BattleStateScript.TEAM_ENEMY, 9)
for enemy in state.get_living_units(BattleStateScript.TEAM_ENEMY):
enemy["alive"] = false
state._check_battle_status()
if str(state.battle_status) != BattleStateScript.STATUS_VICTORY:
failures.append("opening battle should end after enemies fall and castle is captured, got %s" % str(state.battle_status))
failures.append("opening battle should end after late reserve falls and castle is captured, got %s" % str(state.battle_status))
func _check_log_contains(failures: Array[String], logs: Array, expected: String) -> void:
@@ -264,13 +277,33 @@ func _check_briefing_battlefield_overview(failures: Array[String]) -> void:
return
var overview := scene._format_briefing_battlefield_overview_text()
_check_contains(failures, "001 briefing map size", overview, "14칸 x 10칸")
_check_contains(failures, "001 briefing enemy count", overview, "적세 8")
_check_contains(failures, "001 briefing enemy count", overview, "적세 12")
_check_contains(failures, "001 briefing enemy classes", overview, "보병")
_check_contains(failures, "001 briefing village recovery", overview, "마을 4칸 +6")
_check_contains(failures, "001 briefing castle recovery", overview, "성채 4칸 +8")
scene.free()
func _check_opening_battle_extended_pressure(failures: Array[String]) -> void:
var state = BattleStateScript.new()
if not state.load_battle("res://data/scenarios/001_yellow_turbans.json"):
failures.append("opening battle pressure smoke could not load scenario")
return
if state.get_turn_limit() != 17:
failures.append("opening battle should allow play through turn 17, got limit %d" % state.get_turn_limit())
if state.get_living_units(BattleStateScript.TEAM_ENEMY).size() != 12:
failures.append("opening battle should start with 12 enemies, got %d" % state.get_living_units(BattleStateScript.TEAM_ENEMY).size())
if state._condition_gate_open({"after_event": "turn_9_western_reserve"}):
failures.append("opening battle final defeat-all condition should be gated until turn 9 reserve")
state._run_events("turn_start", BattleStateScript.TEAM_ENEMY, 4)
state._run_events("turn_start", BattleStateScript.TEAM_ENEMY, 7)
state._run_events("turn_start", BattleStateScript.TEAM_ENEMY, 9)
if not state._condition_gate_open({"after_event": "turn_9_western_reserve"}):
failures.append("opening battle final gate should open after turn 9 reserve event")
if state.get_living_units(BattleStateScript.TEAM_ENEMY).size() != 19:
failures.append("opening battle should field 19 enemies after late reserve, got %d" % state.get_living_units(BattleStateScript.TEAM_ENEMY).size())
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"):
@@ -293,12 +326,12 @@ func _check_objective_notice(failures: Array[String]) -> void:
scene._on_objective_updated("Defeat the new vanguard.", "")
if scene.objective_notice_panel == null or not scene.objective_notice_panel.visible:
failures.append("objective notice panel should be visible after objective update")
elif not scene.objective_notice_label.text.contains("군령 갱신") or not scene.objective_notice_label.text.contains("목표Defeat the new vanguard."):
elif not scene.objective_notice_label.text.contains("군령 갱신") or not scene.objective_notice_label.text.contains("목표: Defeat the new vanguard."):
failures.append("objective notice label should use Korean order wording: %s" % scene.objective_notice_label.text)
scene._on_objective_updated("", "Supply train is lost.")
if scene.objective_notice_panel == null or not scene.objective_notice_panel.visible:
failures.append("objective notice panel should be visible after defeat update")
elif not scene.objective_notice_label.text.contains("군령 갱신") or not scene.objective_notice_label.text.contains("주의Supply train is lost."):
elif not scene.objective_notice_label.text.contains("군령 갱신") or not scene.objective_notice_label.text.contains("주의: Supply train is lost."):
failures.append("objective notice label should use Korean risk wording: %s" % scene.objective_notice_label.text)
if scene._format_log_entry_text("Objective updated: Defeat the new vanguard.") != "군령 갱신: Defeat the new vanguard.":
failures.append("objective log display should use Korean order wording")