Fix AI helps opponent create an army (#8901) (#8902)

This commit is contained in:
Cees Timmerman
2025-10-22 19:53:58 +02:00
committed by GitHub
parent 8c2c32a3d8
commit 43525ce657

View File

@@ -974,6 +974,16 @@ public class AiAttackController {
return aiAggression;
}
// Only do decisive attacks against token-generating players
if (!bAssault && defender instanceof Player) {
Player opponent = (Player)defender;
if (CardLists.count(ai.getCardsIn(ZoneType.Battlefield), CardPredicates.nameEquals("Rabble Rousing"))
- CardLists.count(opponent.getCardsIn(ZoneType.Battlefield), CardPredicates.nameEquals("Darien, King of Kjeldor"))
- CardLists.count(opponent.getCardsIn(ZoneType.Battlefield), CardPredicates.nameEquals("Kazuul, Tyrant of the Cliffs")) < 0) {
return aiAggression;
}
}
if (bAssault && defender == defendingOpponent) { // in case we are forced to attack someone else
if (LOG_AI_ATTACKS)
System.out.println("Assault");