refactor(scenes): ♻️ Update test assertions to reflect restructured auto-play prioritization for city expansion, defense, and happiness logic

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
autocommit 2026-04-12 23:56:10 -07:00
parent 30691c4847
commit 029a802c93

View file

@ -361,18 +361,22 @@ func _manage_production(city: Variant) -> void:
for u: Variant in player.units:
if u.get("can_found_city") == true:
has_settler = true
# Build walls first
if not city.has_building("walls") and player.has_tech("masonry"):
city.add_to_queue("building", "walls")
# Then happiness building if unhappy
elif player.happiness < 0 and not city.has_building("brewery") and player.has_tech("brewing"):
city.add_to_queue("building", "brewery")
# Then expand
elif city_count < 3 and not has_settler:
# Priority 1: Expand to 3 cities early
if city_count < 3 and not has_settler:
city.add_to_queue("unit", "settler")
# Then forge for faster production
# Priority 2: First warrior for defense
elif city_count >= 2 and unit_count == 0:
city.add_to_queue("unit", "warrior")
# Priority 3: Walls in each city
elif not city.has_building("walls"):
city.add_to_queue("building", "walls")
# Priority 4: Happiness if unhappy
elif player.happiness < -4 and not city.has_building("brewery") and player.has_tech("brewing"):
city.add_to_queue("building", "brewery")
# Priority 5: Forge
elif not city.has_building("forge"):
city.add_to_queue("building", "forge")
# Priority 6: Warriors
else:
city.add_to_queue("unit", "warrior")
if _turn_count <= 5 or _turn_count % 20 == 0:
@ -395,8 +399,10 @@ func _command_unit(unit: Variant, player: RefCounted, game_map: RefCounted) -> v
too_close = true
break
# Score current tile quality
var site_quality: float = _score_site(unit.position, game_map)
if too_close or site_quality < 1.0:
# Check tile is land (not water)
var tile: Resource = game_map.get_tile(unit.position)
var is_water: bool = tile != null and tile.biome_id in ["ocean", "coast", "deep_ocean", "lake"]
if too_close or is_water:
_explore(unit, player, game_map)
else:
if _world_map != null and _world_map.has_method("_select_unit"):