mirror of
https://github.com/magefree/mage.git
synced 2026-01-09 12:22:10 -08:00
[MOM] Implement Merciless Repurposing
This commit is contained in:
parent
52d3423b3a
commit
df5f124966
4 changed files with 118 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue