feat(@projects/@magic-civilization): ✨ update auto-play logic for balanced warrior/building decisions
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
a8daeff9cd
commit
38ffefe290
1 changed files with 9 additions and 2 deletions
|
|
@ -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"],
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue