- Added AILogic for mill ability of Liliana, the Last Hope

This commit is contained in:
excessum
2016-07-30 05:41:03 +00:00
parent f036d509f6
commit 2ac9949251
3 changed files with 11 additions and 11 deletions

View File

@@ -1,11 +1,15 @@
package forge.ai.ability;
import com.google.common.base.Predicates;
import forge.ai.ComputerUtil;
import forge.ai.ComputerUtilMana;
import forge.ai.SpellAbilityAi;
import forge.game.ability.AbilityUtils;
import forge.game.card.Card;
import forge.game.card.CardCollectionView;
import forge.game.card.CardLists;
import forge.game.card.CardPredicates;
import forge.game.phase.PhaseHandler;
import forge.game.phase.PhaseType;
import forge.game.player.Player;
@@ -23,6 +27,11 @@ public class MillAi extends SpellAbilityAi {
&& !ComputerUtil.castSpellInMain1(ai, sa)) {
return false;
}
} else if (aiLogic.equals("LilianaMill")) {
// Only mill if a "Raise Dead" target is available, in case of control decks with few creatures
if (CardLists.filter(ai.getCardsIn(ZoneType.Graveyard), CardPredicates.Presets.CREATURES).size() < 1) {
return false;
}
}
return true;
}