diff --git a/Mage.Sets/src/mage/cards/m/MercilessRepurposing.java b/Mage.Sets/src/mage/cards/m/MercilessRepurposing.java new file mode 100644 index 0000000000..0745d99b67 --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/MercilessRepurposing.java @@ -0,0 +1,34 @@ +package mage.cards.m; + +import mage.abilities.effects.common.ExileTargetEffect; +import mage.abilities.effects.keyword.IncubateEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.target.common.TargetCreaturePermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class MercilessRepurposing extends CardImpl { + + public MercilessRepurposing(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{4}{B}{B}"); + + // Exile target creature. Incubate 3. + this.getSpellAbility().addEffect(new ExileTargetEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect(new IncubateEffect(3)); + } + + private MercilessRepurposing(final MercilessRepurposing card) { + super(card); + } + + @Override + public MercilessRepurposing copy() { + return new MercilessRepurposing(this); + } +} diff --git a/Mage.Sets/src/mage/sets/MarchOfTheMachine.java b/Mage.Sets/src/mage/sets/MarchOfTheMachine.java index 3612641d42..4229c7447a 100644 --- a/Mage.Sets/src/mage/sets/MarchOfTheMachine.java +++ b/Mage.Sets/src/mage/sets/MarchOfTheMachine.java @@ -59,6 +59,7 @@ public final class MarchOfTheMachine extends ExpansionSet { cards.add(new SetCardInfo("Into the Fire", 144, Rarity.RARE, mage.cards.i.IntoTheFire.class)); cards.add(new SetCardInfo("Island", 278, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Jungle Hollow", 270, Rarity.COMMON, mage.cards.j.JungleHollow.class)); + cards.add(new SetCardInfo("Merciless Repurposing", 117, Rarity.UNCOMMON, mage.cards.m.MercilessRepurposing.class)); cards.add(new SetCardInfo("Monastery Mentor", 28, Rarity.MYTHIC, mage.cards.m.MonasteryMentor.class)); cards.add(new SetCardInfo("Mountain", 280, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Mutagen Connoisseur", 248, Rarity.UNCOMMON, mage.cards.m.MutagenConnoisseur.class)); diff --git a/Mage/src/main/java/mage/abilities/effects/keyword/IncubateEffect.java b/Mage/src/main/java/mage/abilities/effects/keyword/IncubateEffect.java new file mode 100644 index 0000000000..2d8379f0e4 --- /dev/null +++ b/Mage/src/main/java/mage/abilities/effects/keyword/IncubateEffect.java @@ -0,0 +1,53 @@ +package mage.abilities.effects.keyword; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.constants.Outcome; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.permanent.token.IncubatorToken; +import mage.game.permanent.token.Token; +import mage.util.CardUtil; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public class IncubateEffect extends OneShotEffect { + + private final int amount; + + public IncubateEffect(int amount) { + super(Outcome.Detriment); + this.amount = amount; + staticText = "incubate " + amount + " (Create an Incubator artifact token with " + + CardUtil.numberToText(amount, "a") + " +1/+1 counter" + (amount > 1 ? "s" : "") + + " on it and \"{2}: Transform this artifact.\" It transforms into a 0/0 Phyrexian artifact creature.)"; + } + + public IncubateEffect(final IncubateEffect effect) { + super(effect); + this.amount = effect.amount; + } + + @Override + public IncubateEffect copy() { + return new IncubateEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Token token = new IncubatorToken(); + token.putOntoBattlefield(1, game, source); + for (UUID tokenId : token.getLastAddedTokenIds()) { + Permanent permanent = game.getPermanent(tokenId); + if (permanent == null) { + continue; + } + permanent.addCounters(CounterType.P1P1.createInstance(amount), source.getControllerId(), source, game); + } + return true; + } +} diff --git a/Mage/src/main/java/mage/game/permanent/token/IncubatorToken.java b/Mage/src/main/java/mage/game/permanent/token/IncubatorToken.java new file mode 100644 index 0000000000..dcec1fd142 --- /dev/null +++ b/Mage/src/main/java/mage/game/permanent/token/IncubatorToken.java @@ -0,0 +1,30 @@ +package mage.game.permanent.token; + +import mage.constants.CardType; +import mage.constants.SubType; + +import java.util.Arrays; + +/** + * @author TheElk801 + */ +public final class IncubatorToken extends TokenImpl { + + public IncubatorToken() { + super("Incubator Token", "Incubator artifact token with \"{2}: Transform this artifact.\""); + cardType.add(CardType.ARTIFACT); + subtype.add(SubType.INCUBATOR); + + // TODO: Implement this correctly + + availableImageSetCodes = Arrays.asList("MOM"); + } + + public IncubatorToken(final IncubatorToken token) { + super(token); + } + + public IncubatorToken copy() { + return new IncubatorToken(this); + } +}