Improve opening battle layout and scouting brief
This commit is contained in:
@@ -68,6 +68,8 @@ func _init() -> void:
|
||||
_check_objective_update(failures)
|
||||
_check_objective_notice(failures)
|
||||
_check_terrain_recovery(failures)
|
||||
_check_briefing_battlefield_overview(failures)
|
||||
_check_opening_board_avoids_side_panel(failures)
|
||||
|
||||
if failures.is_empty():
|
||||
print("objective progress smoke ok")
|
||||
@@ -254,6 +256,37 @@ func _check_terrain_recovery(failures: Array[String]) -> void:
|
||||
failures.append("castle terrain should recover 8 hp at phase start, got %d" % int(boss.get("hp", 0)))
|
||||
|
||||
|
||||
func _check_briefing_battlefield_overview(failures: Array[String]) -> void:
|
||||
var scene = BattleSceneScript.new()
|
||||
if not scene.state.load_battle("res://data/scenarios/001_yellow_turbans.json"):
|
||||
failures.append("briefing battlefield overview smoke could not load scenario")
|
||||
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, "적세 8명")
|
||||
_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_board_avoids_side_panel(failures: Array[String]) -> void:
|
||||
var state = BattleStateScript.new()
|
||||
if not state.load_battle("res://data/scenarios/001_yellow_turbans.json"):
|
||||
failures.append("opening board layout smoke could not load scenario")
|
||||
return
|
||||
var board_rect := Rect2(
|
||||
BattleSceneScript.BOARD_OFFSET,
|
||||
Vector2(state.get_map_size()) * BattleSceneScript.TILE_SIZE
|
||||
)
|
||||
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))
|
||||
|
||||
|
||||
func _check_objective_notice(failures: Array[String]) -> void:
|
||||
var scene = BattleSceneScript.new()
|
||||
scene._create_hud()
|
||||
|
||||
Reference in New Issue
Block a user