mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
Tweak AI to skip useless Enlisting (#2594)
This commit is contained in:
@@ -342,11 +342,16 @@ public class PlayerControllerAi extends PlayerController {
|
||||
@Override
|
||||
public List<Card> enlistAttackers(List<Card> attackers) {
|
||||
CardCollection cards = CostEnlist.getCardsForEnlisting(brains.getPlayer());
|
||||
ComputerUtilCard.sortByEvaluateCreature(new CardCollection(attackers));
|
||||
cards = CardLists.filter(cards, CardPredicates.hasGreaterPowerThan(0));
|
||||
CardCollection chosenAttackers = new CardCollection(attackers);
|
||||
ComputerUtilCard.sortByEvaluateCreature(chosenAttackers);
|
||||
|
||||
// do not enlist more than available payment choices (currently ignores multiple instances of Enlist, but can that even happen?)
|
||||
attackers = attackers.subList(0, cards.size());
|
||||
if (attackers.size() > cards.size()) {
|
||||
chosenAttackers = chosenAttackers.subList(0, cards.size());
|
||||
}
|
||||
// TODO check if not needed as defender
|
||||
return attackers;
|
||||
return chosenAttackers;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user