feat(ai): ✨ Update rush-buy defender logic to dynamically calculate production gaps and prioritize defensive unit purchases in SimpleHeuristicAI
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
7b8fd97c7a
commit
5f175a0a8d
1 changed files with 6 additions and 1 deletions
|
|
@ -291,7 +291,12 @@ static func _rush_buy_defenders(player: RefCounted, threat: Dictionary) -> void:
|
|||
maxi(2, int(threat.get("count", 0)) + 1) if imminent
|
||||
else maxi(2, int(threat.get("total_count", 0)))
|
||||
)
|
||||
var cap: int = player.cities.size() * 3
|
||||
# Cap: 3 per city baseline, but never below enemy count + 1 so rush-buy
|
||||
# can still close a parity gap when we're out-produced (p0 was reaching
|
||||
# mil=8 vs our cap=3 and seizing undefended capitals mid-T80s).
|
||||
var cap: int = maxi(
|
||||
player.cities.size() * 3, int(threat.get("total_count", 0)) + 1
|
||||
)
|
||||
while player.gold >= 50 and mil < target and mil < cap:
|
||||
var nu: RefCounted = UnitScript.new(
|
||||
"warrior", player.index, spawn_city.position
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue