From 7e62010175c2715edada11ac1f4a7e4ca29c5e60 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Wed, 3 May 2023 07:09:44 -0400 Subject: [PATCH] [MAT] Implement Filter Out --- Mage.Sets/src/mage/cards/f/FilterOut.java | 39 +++++++++++++++++++ .../sets/MarchOfTheMachineTheAftermath.java | 1 + 2 files changed, 40 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/f/FilterOut.java diff --git a/Mage.Sets/src/mage/cards/f/FilterOut.java b/Mage.Sets/src/mage/cards/f/FilterOut.java new file mode 100644 index 0000000000..6b754f9938 --- /dev/null +++ b/Mage.Sets/src/mage/cards/f/FilterOut.java @@ -0,0 +1,39 @@ +package mage.cards.f; + +import mage.abilities.effects.common.ReturnToHandFromBattlefieldAllEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterNonlandPermanent; +import mage.filter.predicate.Predicates; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class FilterOut extends CardImpl { + + private static final FilterPermanent filter = new FilterNonlandPermanent("noncreature, nonland permanents"); + + static { + filter.add(Predicates.not(CardType.LAND.getPredicate())); + } + + public FilterOut(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}{U}"); + + // Return all noncreature, nonland permanents to their owners' hands. + this.getSpellAbility().addEffect(new ReturnToHandFromBattlefieldAllEffect(filter)); + } + + private FilterOut(final FilterOut card) { + super(card); + } + + @Override + public FilterOut copy() { + return new FilterOut(this); + } +} diff --git a/Mage.Sets/src/mage/sets/MarchOfTheMachineTheAftermath.java b/Mage.Sets/src/mage/sets/MarchOfTheMachineTheAftermath.java index 80826e61b0..f0c8de454a 100644 --- a/Mage.Sets/src/mage/sets/MarchOfTheMachineTheAftermath.java +++ b/Mage.Sets/src/mage/sets/MarchOfTheMachineTheAftermath.java @@ -21,6 +21,7 @@ public final class MarchOfTheMachineTheAftermath extends ExpansionSet { this.hasBasicLands = false; this.hasBoosters = false; // temporary + cards.add(new SetCardInfo("Filter Out", 7, Rarity.UNCOMMON, mage.cards.f.FilterOut.class)); cards.add(new SetCardInfo("Jolrael, Voice of Zhalfir", 33, Rarity.RARE, mage.cards.j.JolraelVoiceOfZhalfir.class)); cards.add(new SetCardInfo("Spark Rupture", 5, Rarity.RARE, mage.cards.s.SparkRupture.class)); cards.add(new SetCardInfo("The Kenriths' Royal Funeral", 34, Rarity.RARE, mage.cards.t.TheKenrithsRoyalFuneral.class));