From 4d03deda12477d36c4ecc5446de44613b2a03896 Mon Sep 17 00:00:00 2001 From: xenohedron Date: Sat, 26 Aug 2023 17:28:09 -0400 Subject: [PATCH] Revert "[WOE] Implement The End (#10921)" (#11040) This reverts commit fe93d68b1c21c677bdba6fd8848c39c7ceebba78. --- Mage.Sets/src/mage/cards/t/TheEnd.java | 95 ------------------- Mage.Sets/src/mage/sets/WildsOfEldraine.java | 1 - ...dHandLibraryForCardNameAndExileEffect.java | 8 +- .../predicate/mageobject/NamePredicate.java | 2 +- 4 files changed, 5 insertions(+), 101 deletions(-) delete mode 100644 Mage.Sets/src/mage/cards/t/TheEnd.java diff --git a/Mage.Sets/src/mage/cards/t/TheEnd.java b/Mage.Sets/src/mage/cards/t/TheEnd.java deleted file mode 100644 index 86405f1f28a..00000000000 --- a/Mage.Sets/src/mage/cards/t/TheEnd.java +++ /dev/null @@ -1,95 +0,0 @@ -package mage.cards.t; - -import mage.abilities.Ability; -import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.condition.common.XorLessLifeCondition; -import mage.abilities.effects.common.cost.SpellCostReductionSourceEffect; -import mage.abilities.effects.common.search.SearchTargetGraveyardHandLibraryForCardNameAndExileEffect; -import mage.cards.CardImpl; -import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.constants.Zone; -import mage.filter.FilterCard; -import mage.filter.predicate.mageobject.NamePredicate; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; -import mage.target.common.TargetCreatureOrPlaneswalker; - -import java.util.UUID; - -/** - * - * @author Susucr - */ -public final class TheEnd extends CardImpl { - - public TheEnd(UUID ownerId, CardSetInfo setInfo) { - super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{B}{B}"); - - // This spell costs {2} less to cast if your life total is 5 or less. - this.addAbility(new SimpleStaticAbility( - Zone.ALL, - new SpellCostReductionSourceEffect( - 2, - new XorLessLifeCondition(XorLessLifeCondition.CheckType.CONTROLLER, 5) - ).setCanWorksOnStackOnly(true).setText("This spell costs {2} less to cast if your life total is 5 or less.") - ).setRuleAtTheTop(true)); - - // Exile target creature or planeswalker. Search its controller's graveyard, hand, and library for any number of cards with the same name as that permanent and exile them. That player shuffles, then draws card for each card exiled from their hand this way. - this.getSpellAbility().addEffect(new TheEndEffect()); - this.getSpellAbility().addTarget(new TargetCreatureOrPlaneswalker()); - } - - private TheEnd(final TheEnd card) { - super(card); - } - - @Override - public TheEnd copy() { - return new TheEnd(this); - } -} - -class TheEndEffect extends SearchTargetGraveyardHandLibraryForCardNameAndExileEffect { - - TheEndEffect() { - super(true, "its controller's", "any number of cards with the same name as that permanent"); - this.staticText = "Exile target creature or planeswalker. Search its controller's graveyard, hand, and library for any number of cards with the same name as that permanent and exile them. That player shuffles, then draws card for each card exiled from their hand this way"; - } - - private TheEndEffect(final TheEndEffect effect) { - super(effect); - } - - @Override - public TheEndEffect copy() { - return new TheEndEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getFirstTarget()); - if(permanent == null) { - return false; - } - String name = permanent.getName(); - Player player = game.getPlayer(permanent.getControllerId()); - if(player == null) { - return false; - } - - player.moveCards(permanent, Zone.EXILED, source, game); - - FilterCard filter = new FilterCard(); - filter.add(new NamePredicate(name)); - - int cardsInHandBefore = player.getHand().count(filter, game); - boolean result = super.applySearchAndExile(game, source, name, player.getId()); - int cardsExiled = cardsInHandBefore - player.getHand().count(filter, game); - if (cardsExiled > 0) { - player.drawCards(cardsExiled, source, game); - } - return result; - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/WildsOfEldraine.java b/Mage.Sets/src/mage/sets/WildsOfEldraine.java index b17956fdf60..790d7f91ff9 100644 --- a/Mage.Sets/src/mage/sets/WildsOfEldraine.java +++ b/Mage.Sets/src/mage/sets/WildsOfEldraine.java @@ -246,7 +246,6 @@ public final class WildsOfEldraine extends ExpansionSet { cards.add(new SetCardInfo("Tattered Ratter", 152, Rarity.UNCOMMON, mage.cards.t.TatteredRatter.class)); cards.add(new SetCardInfo("Tempest Hart", 238, Rarity.UNCOMMON, mage.cards.t.TempestHart.class)); cards.add(new SetCardInfo("Tenacious Tomeseeker", 74, Rarity.UNCOMMON, mage.cards.t.TenaciousTomeseeker.class)); - cards.add(new SetCardInfo("The End", 87, Rarity.RARE, mage.cards.t.TheEnd.class)); cards.add(new SetCardInfo("The Goose Mother", 204, Rarity.RARE, mage.cards.t.TheGooseMother.class)); cards.add(new SetCardInfo("The Huntsman's Redemption", 176, Rarity.RARE, mage.cards.t.TheHuntsmansRedemption.class)); cards.add(new SetCardInfo("The Irencrag", 248, Rarity.RARE, mage.cards.t.TheIrencrag.class)); diff --git a/Mage/src/main/java/mage/abilities/effects/common/search/SearchTargetGraveyardHandLibraryForCardNameAndExileEffect.java b/Mage/src/main/java/mage/abilities/effects/common/search/SearchTargetGraveyardHandLibraryForCardNameAndExileEffect.java index 9bace21a4fa..f2cc2ea6b30 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/search/SearchTargetGraveyardHandLibraryForCardNameAndExileEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/search/SearchTargetGraveyardHandLibraryForCardNameAndExileEffect.java @@ -60,11 +60,11 @@ public abstract class SearchTargetGraveyardHandLibraryForCardNameAndExileEffect if (cardName != null && controller != null) { Player targetPlayer = game.getPlayer(targetPlayerId); if (targetPlayer != null) { - FilterCard filter = new FilterCard("card named \"" + cardName + "\""); + FilterCard filter = new FilterCard("card named " + cardName); filter.add(new NamePredicate(cardName)); // cards in Graveyard - int cardsCount = targetPlayer.getGraveyard().count(filter, game); + int cardsCount = (cardName.isEmpty() ? 0 : targetPlayer.getGraveyard().count(filter, game)); if (cardsCount > 0) { filter.setMessage("card named " + cardName + " in the graveyard of " + targetPlayer.getName()); TargetCard target = new TargetCard((graveyardExileOptional ? 0 : cardsCount), cardsCount, Zone.GRAVEYARD, filter); @@ -74,7 +74,7 @@ public abstract class SearchTargetGraveyardHandLibraryForCardNameAndExileEffect } // cards in Hand - cardsCount = targetPlayer.getHand().count(filter, game); + cardsCount = (cardName.isEmpty() ? 0 : targetPlayer.getHand().count(filter, game)); filter.setMessage("card named " + cardName + " in the hand of " + targetPlayer.getName()); TargetCard target = new TargetCard(0, cardsCount, Zone.HAND, filter); if (controller.choose(Outcome.Exile, targetPlayer.getHand(), target, source, game)) { @@ -84,7 +84,7 @@ public abstract class SearchTargetGraveyardHandLibraryForCardNameAndExileEffect // cards in Library Cards cardsInLibrary = new CardsImpl(); cardsInLibrary.addAllCards(targetPlayer.getLibrary().getCards(game)); - cardsCount = cardsInLibrary.count(filter, game); + cardsCount = (cardName.isEmpty() ? 0 : cardsInLibrary.count(filter, game)); filter.setMessage("card named " + cardName + " in the library of " + targetPlayer.getLogName()); TargetCardInLibrary targetLib = new TargetCardInLibrary(0, cardsCount, filter); if (controller.choose(Outcome.Exile, cardsInLibrary, targetLib, source, game)) { diff --git a/Mage/src/main/java/mage/filter/predicate/mageobject/NamePredicate.java b/Mage/src/main/java/mage/filter/predicate/mageobject/NamePredicate.java index 1020ab344ff..e88d60bd304 100644 --- a/Mage/src/main/java/mage/filter/predicate/mageobject/NamePredicate.java +++ b/Mage/src/main/java/mage/filter/predicate/mageobject/NamePredicate.java @@ -28,7 +28,7 @@ public class NamePredicate implements Predicate { @Override public boolean apply(MageObject input, Game game) { - if (name == null || name.isEmpty()) { + if (name == null) { return false; } // If a player names a card, the player may name either half of a split card, but not both.