mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
- Improved AI using Guilty Conscience.
This commit is contained in:
@@ -394,8 +394,17 @@ public class AttachAi extends SpellAiLogic {
|
|||||||
if (!aiStuffies.isEmpty()) {
|
if (!aiStuffies.isEmpty()) {
|
||||||
chosen = aiStuffies.get(0);
|
chosen = aiStuffies.get(0);
|
||||||
} else {
|
} else {
|
||||||
// Improve this to include all Opponent creatures
|
List<Card> creatures = CardLists.filterControlledBy(list, ai.getOpponents());
|
||||||
final List<Card> creatures = CardLists.filterControlledBy(list, ai.getOpponents());
|
creatures = CardLists.filter(creatures, new Predicate<Card>() {
|
||||||
|
@Override
|
||||||
|
public boolean apply(final Card c) {
|
||||||
|
// Don't enchant creatures that can survive
|
||||||
|
if (c.hasKeyword("Indestructible") || c.getNetCombatDamage() < c.getNetDefense()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
chosen = CardFactoryUtil.getBestCreatureAI(creatures);
|
chosen = CardFactoryUtil.getBestCreatureAI(creatures);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user