feat(ai): Adjust AI heuristic logic to support the new 'founder' unit, modifying selection and targeting rules in simple_heuristic_ai.gd

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
autocommit 2026-04-15 19:23:52 -07:00
parent 720ff2f31c
commit 123775a284

View file

@ -355,12 +355,12 @@ static func _decide_production(
city_index: int, player: RefCounted
) -> Dictionary:
var military_count: int = 0
var settler_count: int = 0
var founder_count: int = 0
for u: Variant in player.units:
if u == null or not u.is_alive():
continue
if u.get("can_found_city") == true:
settler_count += 1
founder_count += 1
elif u.unit_type in MILITARY_COMBAT_TYPES:
military_count += 1
@ -379,9 +379,9 @@ static func _decide_production(
if not hb_id.is_empty():
return _prod_building(city_index, hb_id)
# Priority 3: Expand — build settler if fewer than 3 cities and no settler in progress
if city_count < 3 and settler_count == 0 and city_index == 0:
return _prod_unit(city_index, "settler")
# Priority 3: Expand — build founder if fewer than 3 cities and none in progress
if city_count < 3 and founder_count == 0 and city_index == 0:
return _prod_unit(city_index, "founder")
# Priority 4: Military — maintain 2 warriors per city
var want_military: bool = military_count < maxi(2, city_count * 2)