Merge branch 'pumping' into 'master'

Rework Fell the Mighty without Pump

See merge request core-developers/forge!5817
This commit is contained in:
Michael Kamensky
2021-11-13 04:15:16 +00:00
3 changed files with 29 additions and 28 deletions

View File

@@ -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);
}

View File

@@ -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<Card> 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);

View File

@@ -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.