[MOC] Implement Excise the Imperfect

This commit is contained in:
theelk801 2023-04-09 09:11:27 -04:00
parent 9214f91a5c
commit 1d1996a670
2 changed files with 69 additions and 0 deletions

View file

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

View file

@ -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("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("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("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("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("Falkenrath Exterminator", 276, Rarity.UNCOMMON, mage.cards.f.FalkenrathExterminator.class));
cards.add(new SetCardInfo("Fallowsage", 223, Rarity.UNCOMMON, mage.cards.f.Fallowsage.class)); cards.add(new SetCardInfo("Fallowsage", 223, Rarity.UNCOMMON, mage.cards.f.Fallowsage.class));