mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 13:19:18 -08:00
[TDM] Implement Dusyut Earthcarver
This commit is contained in:
parent
9486b49aec
commit
9319c56b2b
4 changed files with 129 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.SpiritXXToken;
|
||||
import mage.players.Player;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public class EndureSourceEffect extends OneShotEffect {
|
||||
|
||||
private final int amount;
|
||||
|
||||
public EndureSourceEffect(int amount) {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "it endures " + amount;
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
private EndureSourceEffect(final EndureSourceEffect effect) {
|
||||
super(effect);
|
||||
this.amount = effect.amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EndureSourceEffect copy() {
|
||||
return new EndureSourceEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
Permanent permanent = source.getSourcePermanentIfItStillExists(game);
|
||||
if (permanent != null && player.chooseUse(
|
||||
Outcome.BoostCreature, "Put " + CardUtil.numberToText(amount, "a") + " +1/+1 counter" +
|
||||
(amount > 1 ? "s" : "") + " on " + permanent.getName() + " or create " +
|
||||
CardUtil.addArticle("" + amount) + ' ' + amount + '/' + amount + " Spirit token?",
|
||||
null, "Add counters", "Create token", source, game
|
||||
)) {
|
||||
return permanent.addCounters(CounterType.P1P1.createInstance(amount), source, game);
|
||||
}
|
||||
return new SpiritXXToken(amount).putOntoBattlefield(1, game, source);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package mage.game.permanent.token;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
|
||||
/**
|
||||
* @author nantuko
|
||||
*/
|
||||
public final class SpiritXXToken extends TokenImpl {
|
||||
|
||||
public SpiritXXToken() {
|
||||
this(0);
|
||||
}
|
||||
|
||||
public SpiritXXToken(int amount) {
|
||||
super("Spirit Token", amount + '/' + amount + " white Spirit creature token");
|
||||
cardType.add(CardType.CREATURE);
|
||||
subtype.add(SubType.SPIRIT);
|
||||
color.setWhite(true);
|
||||
power = new MageInt(amount);
|
||||
toughness = new MageInt(amount);
|
||||
}
|
||||
|
||||
private SpiritXXToken(final SpiritXXToken token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SpiritXXToken copy() {
|
||||
return new SpiritXXToken(this);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue