Expand opening battle map pressure
This commit is contained in:
@@ -29,7 +29,7 @@ func _init() -> void:
|
||||
failures,
|
||||
"001 turn pressure risk",
|
||||
_defeat_text("res://data/scenarios/001_yellow_turbans.json"),
|
||||
"잔여 군령 17"
|
||||
"잔여 군령 21"
|
||||
)
|
||||
_check_contains(
|
||||
failures,
|
||||
@@ -332,7 +332,7 @@ func _check_opening_battle_requires_castle_capture(failures: Array[String]) -> v
|
||||
failures.append("opening castle objective smoke could not load scenario")
|
||||
return
|
||||
var marker_cells := state.get_objective_cells()
|
||||
for castle_cell in [Vector2i(12, 0), Vector2i(13, 0), Vector2i(12, 1), Vector2i(13, 1)]:
|
||||
for castle_cell in [Vector2i(19, 0), Vector2i(20, 0), Vector2i(21, 0), Vector2i(19, 1), Vector2i(20, 1), Vector2i(21, 1), Vector2i(19, 2), Vector2i(20, 2), Vector2i(21, 2)]:
|
||||
if not marker_cells.has(castle_cell):
|
||||
failures.append("opening battle should mark castle capture cell %s: %s" % [str(castle_cell), str(marker_cells)])
|
||||
if state.get_objective_cell_label(castle_cell) != "성채 장악":
|
||||
@@ -343,7 +343,7 @@ func _check_opening_battle_requires_castle_capture(failures: Array[String]) -> v
|
||||
if str(state.battle_status) != BattleStateScript.STATUS_ACTIVE:
|
||||
failures.append("opening battle should not end before castle capture, got %s" % str(state.battle_status))
|
||||
var cao_cao: Dictionary = state.get_unit("cao_cao")
|
||||
cao_cao["pos"] = Vector2i(12, 1)
|
||||
cao_cao["pos"] = Vector2i(20, 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))
|
||||
@@ -393,11 +393,11 @@ func _check_briefing_battlefield_overview(failures: Array[String]) -> void:
|
||||
scene.free()
|
||||
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, "적세 12명")
|
||||
_check_contains(failures, "001 briefing map size", overview, "22칸 x 14칸")
|
||||
_check_contains(failures, "001 briefing enemy count", overview, "적세 16명")
|
||||
_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")
|
||||
_check_contains(failures, "001 briefing village recovery", overview, "마을 8칸 +6")
|
||||
_check_contains(failures, "001 briefing castle recovery", overview, "성채 9칸 +8")
|
||||
scene.free()
|
||||
|
||||
|
||||
@@ -406,25 +406,25 @@ func _check_opening_battle_extended_pressure(failures: Array[String]) -> void:
|
||||
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.get_turn_limit() != 21:
|
||||
failures.append("opening battle should allow play through turn 21, got limit %d" % state.get_turn_limit())
|
||||
if state.get_living_units(BattleStateScript.TEAM_ENEMY).size() != 16:
|
||||
failures.append("opening battle should start with 16 enemies, got %d" % state.get_living_units(BattleStateScript.TEAM_ENEMY).size())
|
||||
if state._condition_gate_open({"after_event": "turn_11_last_rally"}):
|
||||
failures.append("opening battle final defeat-all condition should be gated until turn 11 last rally")
|
||||
state._run_events("turn_start", BattleStateScript.TEAM_ENEMY, 4)
|
||||
if state.get_living_units(BattleStateScript.TEAM_ENEMY).size() != 14:
|
||||
failures.append("opening battle should field 14 enemies after turn 4 reserve, got %d" % state.get_living_units(BattleStateScript.TEAM_ENEMY).size())
|
||||
if state.get_living_units(BattleStateScript.TEAM_ENEMY).size() != 19:
|
||||
failures.append("opening battle should field 19 enemies after turn 4 reserve, got %d" % state.get_living_units(BattleStateScript.TEAM_ENEMY).size())
|
||||
if int(state.get_unit("xiahou_dun").get("ai_target_priority", 0)) < 9:
|
||||
failures.append("opening battle turn 4 reserve should pressure Xiahou Dun's vanguard")
|
||||
state._run_events("turn_start", BattleStateScript.TEAM_ENEMY, 7)
|
||||
if state.get_living_units(BattleStateScript.TEAM_ENEMY).size() != 16:
|
||||
failures.append("opening battle should field 16 enemies after turn 7 raiders, got %d" % state.get_living_units(BattleStateScript.TEAM_ENEMY).size())
|
||||
if state.get_living_units(BattleStateScript.TEAM_ENEMY).size() != 22:
|
||||
failures.append("opening battle should field 22 enemies after turn 7 raiders, got %d" % state.get_living_units(BattleStateScript.TEAM_ENEMY).size())
|
||||
if int(state.get_unit("cao_cao").get("ai_target_priority", 0)) < 11:
|
||||
failures.append("opening battle turn 7 raiders should pressure Cao Cao")
|
||||
state._run_events("turn_start", BattleStateScript.TEAM_ENEMY, 9)
|
||||
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())
|
||||
if state.get_living_units(BattleStateScript.TEAM_ENEMY).size() != 26:
|
||||
failures.append("opening battle should field 26 enemies after late reserve, got %d" % state.get_living_units(BattleStateScript.TEAM_ENEMY).size())
|
||||
if int(state.get_unit("cao_cao").get("ai_target_priority", 0)) < 12:
|
||||
failures.append("opening battle turn 9 reserve should keep pressure on Cao Cao")
|
||||
if state._condition_gate_open({"after_event": "turn_11_last_rally"}):
|
||||
@@ -432,8 +432,8 @@ func _check_opening_battle_extended_pressure(failures: Array[String]) -> void:
|
||||
state._run_events("turn_start", BattleStateScript.TEAM_ENEMY, 11)
|
||||
if not state._condition_gate_open({"after_event": "turn_11_last_rally"}):
|
||||
failures.append("opening battle final gate should open after turn 11 last rally event")
|
||||
if state.get_living_units(BattleStateScript.TEAM_ENEMY).size() != 22:
|
||||
failures.append("opening battle should field 22 enemies after final rally, got %d" % state.get_living_units(BattleStateScript.TEAM_ENEMY).size())
|
||||
if state.get_living_units(BattleStateScript.TEAM_ENEMY).size() != 30:
|
||||
failures.append("opening battle should field 30 enemies after final rally, got %d" % state.get_living_units(BattleStateScript.TEAM_ENEMY).size())
|
||||
if int(state.get_unit("cao_cao").get("ai_target_priority", 0)) < 13 or int(state.get_unit("xiahou_dun").get("ai_target_priority", 0)) < 13:
|
||||
failures.append("opening battle turn 11 last rally should pressure both Cao Cao and Xiahou Dun")
|
||||
|
||||
@@ -1176,19 +1176,22 @@ func _assert_required_unit(failures: Array[String], state, unit_id: String, labe
|
||||
|
||||
|
||||
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"):
|
||||
var scene = BattleSceneScript.new()
|
||||
if not scene.state.load_battle("res://data/scenarios/001_yellow_turbans.json"):
|
||||
failures.append("opening board layout smoke could not load scenario")
|
||||
scene.free()
|
||||
return
|
||||
var board_rect := Rect2(
|
||||
BattleSceneScript.BOARD_OFFSET,
|
||||
Vector2(state.get_map_size()) * BattleSceneScript.TILE_SIZE
|
||||
)
|
||||
var board_rect := scene._board_rect()
|
||||
var view_rect := scene._map_view_rect()
|
||||
var side_rect := Rect2(BattleSceneScript.SIDE_PANEL_POSITION, BattleSceneScript.SIDE_PANEL_SIZE)
|
||||
if board_rect.intersects(side_rect):
|
||||
failures.append("opening board should not overlap side HUD: board %s side %s" % [str(board_rect), str(side_rect)])
|
||||
if board_rect.end.y > 720.0:
|
||||
failures.append("opening board should fit within the default viewport height: %s" % str(board_rect))
|
||||
if view_rect.intersects(side_rect):
|
||||
failures.append("opening map view should not overlap side HUD: view %s side %s" % [str(view_rect), str(side_rect)])
|
||||
if board_rect.size.x <= view_rect.size.x or board_rect.size.y <= view_rect.size.y:
|
||||
failures.append("opening board should be larger than the visible map view to exercise scrolling: board %s view %s" % [str(board_rect), str(view_rect)])
|
||||
var far_offset := scene._clamped_board_scroll_offset(Vector2(-9999.0, -9999.0))
|
||||
if far_offset.x >= -0.01 or far_offset.y >= -0.01:
|
||||
failures.append("opening board should allow both horizontal and vertical scrolling: %s" % str(far_offset))
|
||||
scene.free()
|
||||
|
||||
|
||||
func _check_objective_notice(failures: Array[String]) -> void:
|
||||
|
||||
Reference in New Issue
Block a user