diff --git a/forge-ai/src/main/java/forge/ai/ability/DestroyAllAi.java b/forge-ai/src/main/java/forge/ai/ability/DestroyAllAi.java index 990db0b9757..effedf088ea 100644 --- a/forge-ai/src/main/java/forge/ai/ability/DestroyAllAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/DestroyAllAi.java @@ -66,7 +66,32 @@ public class DestroyAllAi extends SpellAbilityAi { if (ComputerUtil.preventRunAwayActivations(sa)) { return false; } - + + final String aiLogic = sa.getParamOrDefault("AILogic", ""); + + if ("FellTheMighty".equals(aiLogic)) { + CardCollection aiList = ai.getCreaturesInPlay(); + if (aiList.isEmpty()) { + return false; + } + CardLists.sortByPowerAsc(aiList); + Card lowest = aiList.get(0); + if (!sa.canTarget(lowest)) { + return false; + } + + CardCollection oppList = CardLists.filter(ai.getGame().getCardsIn(ZoneType.Battlefield), + CardPredicates.Presets.CREATURES, CardPredicates.isControlledByAnyOf(ai.getOpponents())); + + oppList = CardLists.filterPower(oppList, lowest.getNetPower() + 1); + if (ComputerUtilCard.evaluateCreatureList(oppList) > 200) { + sa.resetTargets(); + sa.getTargets().add(lowest); + return true; + } + return false; + } + return doMassRemovalLogic(ai, sa); } diff --git a/forge-ai/src/main/java/forge/ai/ability/PumpAi.java b/forge-ai/src/main/java/forge/ai/ability/PumpAi.java index 2c77d52af61..13bb19cdbe7 100644 --- a/forge-ai/src/main/java/forge/ai/ability/PumpAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/PumpAi.java @@ -36,16 +36,7 @@ public class PumpAi extends PumpAiBase { @Override protected boolean checkAiLogic(final Player ai, final SpellAbility sa, final String aiLogic) { - if ("FellTheMighty".equals(aiLogic)) { - CardCollection aiList = ai.getCreaturesInPlay(); - if (aiList.isEmpty()) { - return false; - } - CardLists.sortByPowerAsc(aiList); - if (!sa.canTarget(aiList.get(0))) { - return false; - } - } else if ("MoveCounter".equals(aiLogic)) { + if ("MoveCounter".equals(aiLogic)) { final Game game = ai.getGame(); List tgtCards = CardLists.filter(game.getCardsIn(ZoneType.Battlefield), CardPredicates.isTargetableBy(sa)); @@ -258,20 +249,6 @@ public class PumpAi extends PumpAiBase { } } - } else if ("FellTheMighty".equals(aiLogic)) { - CardCollection aiList = ai.getCreaturesInPlay(); - CardLists.sortByPowerAsc(aiList); - Card lowest = aiList.get(0); - - CardCollection oppList = CardLists.filter(game.getCardsIn(ZoneType.Battlefield), - CardPredicates.Presets.CREATURES, CardPredicates.isControlledByAnyOf(ai.getOpponents())); - - oppList = CardLists.filterPower(oppList, lowest.getNetPower() + 1); - if (ComputerUtilCard.evaluateCreatureList(oppList) > 200) { - sa.resetTargets(); - sa.getTargets().add(lowest); - return true; - } } else if (aiLogic.startsWith("Donate")) { // Donate step 1 - try to target an opponent, preferably one who does not have a donate target yet return SpecialCardAi.Donate.considerTargetingOpponent(ai, sa); diff --git a/forge-gui/res/cardsfolder/f/fell_the_mighty.txt b/forge-gui/res/cardsfolder/f/fell_the_mighty.txt index 8c2dd879193..adfa5b7153a 100644 --- a/forge-gui/res/cardsfolder/f/fell_the_mighty.txt +++ b/forge-gui/res/cardsfolder/f/fell_the_mighty.txt @@ -1,9 +1,8 @@ Name:Fell the Mighty ManaCost:4 W Types:Sorcery -A:SP$ Pump | Cost$ 4 W | ValidTgts$ Creature | StackDescription$ None | SubAbility$ DBDestroy | AILogic$ FellTheMighty | SpellDescription$ Destroy all creatures with power greater than target creature's power. -SVar:DBDestroy:DB$ DestroyAll | ValidCards$ Creature.powerGTX -SVar:X:ParentTargeted$CardPower +A:SP$ DestroyAll | ValidCards$ Creature.powerGTX | Cost$ 4 W | ValidTgts$ Creature | AILogic$ FellTheMighty | SpellDescription$ Destroy all creatures with power greater than target creature's power. +SVar:X:Targeted$CardPower AI:RemoveDeck:All SVar:Picture:http://www.wizards.com/global/images/magic/general/fell_the_mighty.jpg Oracle:Destroy all creatures with power greater than target creature's power.