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:
|
case Encode:
|
||||||
if (logic == null) {
|
if (logic == null) {
|
||||||
List<Card> attackers = CardLists.filter(options, new Predicate<Card>() {
|
final List<Card> attackers = CardLists.filter(options, new Predicate<Card>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(final Card c) {
|
public boolean apply(final Card c) {
|
||||||
return CombatUtil.canAttackNextTurn(c);
|
return CombatUtil.canAttackNextTurn(c);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (attackers.isEmpty()) {
|
final List<Card> unblockables = CardLists.filter(options, new Predicate<Card>() {
|
||||||
choice = ComputerUtilCard.getBestAI(options);
|
@Override
|
||||||
} else {
|
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);
|
choice = ComputerUtilCard.getBestAI(attackers);
|
||||||
|
} else {
|
||||||
|
choice = ComputerUtilCard.getBestAI(options);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return choice;
|
return choice;
|
||||||
|
|||||||
Reference in New Issue
Block a user