mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
[MOM] Implement Merciless Repurposing
This commit is contained in:
parent
52d3423b3a
commit
df5f124966
4 changed files with 118 additions and 0 deletions
34
Mage.Sets/src/mage/cards/m/MercilessRepurposing.java
Normal file
34
Mage.Sets/src/mage/cards/m/MercilessRepurposing.java
Normal file
|
@ -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);
|
||||
}
|
||||
}
|
|
@ -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));
|
||||
|
|
|
@ -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 + " <i>(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.)</i>";
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue