From 38ffefe290548724ac16bb58bbdb94d09e18b7aa Mon Sep 17 00:00:00 2001 From: Natalie Date: Mon, 13 Apr 2026 06:28:49 -0700 Subject: [PATCH] =?UTF-8?q?feat(@projects/@magic-civilization):=20?= =?UTF-8?q?=E2=9C=A8=20update=20auto-play=20logic=20for=20balanced=20warri?= =?UTF-8?q?or/building=20decisions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- src/game/engine/scenes/tests/auto_play.gd | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/game/engine/scenes/tests/auto_play.gd b/src/game/engine/scenes/tests/auto_play.gd index fb554b34..87fc3e16 100644 --- a/src/game/engine/scenes/tests/auto_play.gd +++ b/src/game/engine/scenes/tests/auto_play.gd @@ -1001,12 +1001,19 @@ func _next_building(city: Variant, player: Variant, city_count: int, has_settler for u: Variant in player.units: if u.is_alive() and u.get("can_found_city") != true: military += 1 - if military == 0: + # Maintain military: at least 1 warrior per city + if military < city_count: return "" # build warrior # Expand to 3 cities if city_count < 3 and not has_settler: return "settler" - # Remaining economic buildings + # Alternate: build next available building, then warrior, repeat + # Check how many buildings this city has vs warriors the player has + var city_buildings: int = city.buildings.size() + # If we have more buildings than warriors, build a warrior + if military <= city_buildings and military < city_count * 3: + return "" # build warrior + # Otherwise build next available building var econ_buildings: Array[Array] = [ ["brewery", "brewing"], ["library", "scholarship"],