From 242e717fb6c4ed80cda90f6ec6a62d4affed7022 Mon Sep 17 00:00:00 2001 From: Natalie Date: Wed, 10 Jun 2026 03:54:56 -0700 Subject: [PATCH] =?UTF-8?q?feat(@projects/@magic-civilization):=20?= =?UTF-8?q?=E2=9C=A8=20add=20bunker=20test=20improvements?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- public/games/age-of-dwarves/manifest.json | 1 + src/game/engine/scenes/tests/bunker_proof.gd | 27 ++++++++++++++------ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/public/games/age-of-dwarves/manifest.json b/public/games/age-of-dwarves/manifest.json index 1ed73a36..678fb8b2 100644 --- a/public/games/age-of-dwarves/manifest.json +++ b/public/games/age-of-dwarves/manifest.json @@ -562,6 +562,7 @@ ], "improvements": [ "beacon_tower", + "bunker", "deforestation", "drainage", "farm", diff --git a/src/game/engine/scenes/tests/bunker_proof.gd b/src/game/engine/scenes/tests/bunker_proof.gd index f2c0a54b..e73c4a6f 100644 --- a/src/game/engine/scenes/tests/bunker_proof.gd +++ b/src/game/engine/scenes/tests/bunker_proof.gd @@ -66,20 +66,25 @@ func _run_bunker_cycle() -> void: return _state = ClassDB.instantiate("GdGameState") as RefCounted - _state.call("create_grid", GRID_W, GRID_H) + + # Tile authoring lives on GdGridState (get/set_tile_dict); GdGameState + # adopts the finished grid via set_grid_from_gridstate. + var grid_seed: RefCounted = ClassDB.instantiate("GdGridState") as RefCounted + var grid: RefCounted = grid_seed.call("create", GRID_W, GRID_H) as RefCounted # Set the bunker tile to hills with a tier-7 deposit (quality = tier source), # and a separate river-course tile to exercise the build guard. - var bunker_tile: Dictionary = _state.call("get_tile_dict", BUNKER_COL, BUNKER_ROW) as Dictionary + var bunker_tile: Dictionary = grid.call("get_tile_dict", BUNKER_COL, BUNKER_ROW) as Dictionary bunker_tile["biome_id"] = "hills" bunker_tile["quality"] = DEPOSIT_TIER - _state.call("set_tile_dict", BUNKER_COL, BUNKER_ROW, bunker_tile) + grid.call("set_tile_dict", BUNKER_COL, BUNKER_ROW, bunker_tile) - var river_tile: Dictionary = _state.call("get_tile_dict", RIVER_COL, RIVER_ROW) as Dictionary + var river_tile: Dictionary = grid.call("get_tile_dict", RIVER_COL, RIVER_ROW) as Dictionary river_tile["biome_id"] = "hills" - # river_edges isn't in set_tile_dict; mark via a river course directly. river_tile["river_edges"] = [0, 3] - _state.call("set_tile_dict", RIVER_COL, RIVER_ROW, river_tile) + grid.call("set_tile_dict", RIVER_COL, RIVER_ROW, river_tile) + + _state.call("set_grid_from_gridstate", grid) # Build guard: river-course tile blocked, dry hills tile allowed. _river_gap_blocked = bool(_state.call("bunker_river_gap_blocked", RIVER_COL, RIVER_ROW)) @@ -171,8 +176,14 @@ func _check(font: Font, x: float, y: float, label: String, value: String, ok: bo var mark: String = "[PASS]" if ok else "[FAIL]" var mark_color: Color = Color(0.3, 0.95, 0.4) if ok else Color(1.0, 0.4, 0.4) draw_string(font, Vector2(x, y), mark, HORIZONTAL_ALIGNMENT_LEFT, -1, 15, mark_color) - draw_string(font, Vector2(x + 70, y), label, HORIZONTAL_ALIGNMENT_LEFT, -1, 15, Color(0.85, 0.85, 0.85)) - draw_string(font, Vector2(x + 540, y), value, HORIZONTAL_ALIGNMENT_LEFT, -1, 15, Color(0.75, 0.82, 0.55)) + draw_string( + font, Vector2(x + 70, y), label, + HORIZONTAL_ALIGNMENT_LEFT, -1, 15, Color(0.85, 0.85, 0.85) + ) + draw_string( + font, Vector2(x + 540, y), value, + HORIZONTAL_ALIGNMENT_LEFT, -1, 15, Color(0.75, 0.82, 0.55) + ) func _capture_and_quit() -> void: