From 1d1996a670aa860cb0091355c7cdce44787953cc Mon Sep 17 00:00:00 2001 From: theelk801 Date: Sun, 9 Apr 2023 09:11:27 -0400 Subject: [PATCH] [MOC] Implement Excise the Imperfect --- .../src/mage/cards/e/ExciseTheImperfect.java | 68 +++++++++++++++++++ .../mage/sets/MarchOfTheMachineCommander.java | 1 + 2 files changed, 69 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/e/ExciseTheImperfect.java diff --git a/Mage.Sets/src/mage/cards/e/ExciseTheImperfect.java b/Mage.Sets/src/mage/cards/e/ExciseTheImperfect.java new file mode 100644 index 0000000000..1c284a5452 --- /dev/null +++ b/Mage.Sets/src/mage/cards/e/ExciseTheImperfect.java @@ -0,0 +1,68 @@ +package mage.cards.e; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.keyword.IncubateEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetNonlandPermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class ExciseTheImperfect extends CardImpl { + + public ExciseTheImperfect(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{W}{W}"); + + // Exile target nonland permanent. Its controller incubates X, where X is its mana value. + this.getSpellAbility().addEffect(new ExciseTheImperfectEffect()); + this.getSpellAbility().addTarget(new TargetNonlandPermanent()); + } + + private ExciseTheImperfect(final ExciseTheImperfect card) { + super(card); + } + + @Override + public ExciseTheImperfect copy() { + return new ExciseTheImperfect(this); + } +} + +class ExciseTheImperfectEffect extends OneShotEffect { + + ExciseTheImperfectEffect() { + super(Outcome.Benefit); + staticText = "exile target nonland permanent. Its controller incubates X, where X is its mana value"; + } + + private ExciseTheImperfectEffect(final ExciseTheImperfectEffect effect) { + super(effect); + } + + @Override + public ExciseTheImperfectEffect copy() { + return new ExciseTheImperfectEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); + if (player == null || permanent == null) { + return false; + } + player.moveCards(permanent, Zone.EXILED, source, game); + IncubateEffect.doIncubate(permanent.getManaValue(), permanent.getControllerId(), game, source); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/MarchOfTheMachineCommander.java b/Mage.Sets/src/mage/sets/MarchOfTheMachineCommander.java index ce6ddee84e..7bf76f40c0 100644 --- a/Mage.Sets/src/mage/sets/MarchOfTheMachineCommander.java +++ b/Mage.Sets/src/mage/sets/MarchOfTheMachineCommander.java @@ -95,6 +95,7 @@ public final class MarchOfTheMachineCommander extends ExpansionSet { cards.add(new SetCardInfo("Ethersworn Adjudicator", 222, Rarity.MYTHIC, mage.cards.e.EtherswornAdjudicator.class)); cards.add(new SetCardInfo("Everquill Phoenix", 275, Rarity.RARE, mage.cards.e.EverquillPhoenix.class)); cards.add(new SetCardInfo("Evolving Wilds", 397, Rarity.COMMON, mage.cards.e.EvolvingWilds.class)); + cards.add(new SetCardInfo("Excise the Imperfect", 14, Rarity.RARE, mage.cards.e.ExciseTheImperfect.class)); cards.add(new SetCardInfo("Exotic Orchard", 398, Rarity.RARE, mage.cards.e.ExoticOrchard.class)); cards.add(new SetCardInfo("Falkenrath Exterminator", 276, Rarity.UNCOMMON, mage.cards.f.FalkenrathExterminator.class)); cards.add(new SetCardInfo("Fallowsage", 223, Rarity.UNCOMMON, mage.cards.f.Fallowsage.class));