From bd5439a68dbb774cad91c0a5dd4774e1ffd17a98 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Tue, 2 Nov 2021 09:35:06 -0400 Subject: [PATCH] [VOW] Implemented Retrieve --- Mage.Sets/src/mage/cards/r/Retrieve.java | 51 +++++++++++++++++++ .../src/mage/sets/InnistradCrimsonVow.java | 1 + 2 files changed, 52 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/r/Retrieve.java diff --git a/Mage.Sets/src/mage/cards/r/Retrieve.java b/Mage.Sets/src/mage/cards/r/Retrieve.java new file mode 100644 index 00000000000..dd35c9bd53a --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/Retrieve.java @@ -0,0 +1,51 @@ +package mage.cards.r; + +import mage.abilities.effects.common.ExileSpellEffect; +import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.FilterCard; +import mage.filter.StaticFilters; +import mage.filter.common.FilterPermanentCard; +import mage.filter.predicate.Predicates; +import mage.target.common.TargetCardInYourGraveyard; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class Retrieve extends CardImpl { + + private static final FilterCard filter = new FilterPermanentCard("noncreature permanent card"); + + static { + filter.add(Predicates.not(CardType.CREATURE.getPredicate())); + } + + public Retrieve(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{G}"); + + // Return up to one target creature card and up to one target noncreature permanent card from your graveyard to your hand. Exile Retrieve. + this.getSpellAbility().addEffect(new ReturnFromGraveyardToHandTargetEffect() + .setText("return up to one target creature card and up to one target " + + "noncreature permanent card from your graveyard to your hand")); + this.getSpellAbility().addEffect(new ExileSpellEffect()); + this.getSpellAbility().addTarget(new TargetCardInYourGraveyard( + 0, 1, StaticFilters.FILTER_CARD_CREATURE + )); + this.getSpellAbility().addTarget(new TargetCardInYourGraveyard( + 0, 1, filter + )); + } + + private Retrieve(final Retrieve card) { + super(card); + } + + @Override + public Retrieve copy() { + return new Retrieve(this); + } +} diff --git a/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java b/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java index 4674f6259b5..4ab30e42d64 100644 --- a/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java +++ b/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java @@ -84,6 +84,7 @@ public final class InnistradCrimsonVow extends ExpansionSet { cards.add(new SetCardInfo("Path of Peril", 124, Rarity.RARE, mage.cards.p.PathOfPeril.class)); cards.add(new SetCardInfo("Plains", 268, Rarity.LAND, mage.cards.basiclands.Plains.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("Rending Flame", 175, Rarity.UNCOMMON, mage.cards.r.RendingFlame.class)); + cards.add(new SetCardInfo("Retrieve", 215, Rarity.UNCOMMON, mage.cards.r.Retrieve.class)); cards.add(new SetCardInfo("Rot-Tide Gargantua", 129, Rarity.COMMON, mage.cards.r.RotTideGargantua.class)); cards.add(new SetCardInfo("Shattered Sanctum", 264, Rarity.RARE, mage.cards.s.ShatteredSanctum.class)); cards.add(new SetCardInfo("Sorin the Mirthless", 131, Rarity.MYTHIC, mage.cards.s.SorinTheMirthless.class));