mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
- Improved Cipher AI.
This commit is contained in:
@@ -671,16 +671,24 @@ public class AiController {
|
||||
|
||||
case Encode:
|
||||
if (logic == null) {
|
||||
List<Card> attackers = CardLists.filter(options, new Predicate<Card>() {
|
||||
final List<Card> attackers = CardLists.filter(options, new Predicate<Card>() {
|
||||
@Override
|
||||
public boolean apply(final Card c) {
|
||||
return CombatUtil.canAttackNextTurn(c);
|
||||
}
|
||||
});
|
||||
if (attackers.isEmpty()) {
|
||||
choice = ComputerUtilCard.getBestAI(options);
|
||||
} else {
|
||||
final List<Card> unblockables = CardLists.filter(options, new Predicate<Card>() {
|
||||
@Override
|
||||
public boolean apply(final Card c) {
|
||||
return CombatUtil.canBeBlocked(c);
|
||||
}
|
||||
});
|
||||
if (!unblockables.isEmpty()) {
|
||||
choice = ComputerUtilCard.getBestAI(unblockables);
|
||||
} else if (!attackers.isEmpty()) {
|
||||
choice = ComputerUtilCard.getBestAI(attackers);
|
||||
} else {
|
||||
choice = ComputerUtilCard.getBestAI(options);
|
||||
}
|
||||
}
|
||||
return choice;
|
||||
|
||||
Reference in New Issue
Block a user