implemented Afterlife ability

This commit is contained in:
Evan Kranzler 2018-12-17 22:25:52 -05:00
parent 4d9caa4ee1
commit b5f383254c
7 changed files with 52 additions and 50 deletions

View file

@ -0,0 +1,34 @@
package mage.abilities.keyword;
import mage.abilities.common.DiesTriggeredAbility;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.game.permanent.token.WhiteBlackSpiritToken;
import mage.util.CardUtil;
public class AfterlifeAbility extends DiesTriggeredAbility {
private final int tokenCount;
public AfterlifeAbility(int tokenCount) {
super(new CreateTokenEffect(new WhiteBlackSpiritToken(), tokenCount), false);
this.tokenCount = tokenCount;
}
public AfterlifeAbility(final AfterlifeAbility ability) {
super(ability);
this.tokenCount = ability.tokenCount;
}
@Override
public String getRule() {
return "Afterlife " + tokenCount + " <i>(When this creature dies, create "
+ CardUtil.numberToText(tokenCount, "a")
+ " white and black Spirit creature token"
+ (tokenCount > 1 ? "s" : "")
+ " with flying)</i>";
}
@Override
public AfterlifeAbility copy() {
return new AfterlifeAbility(this);
}
}

View file

@ -1,34 +0,0 @@
package mage.game.permanent.token;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.MageInt;
import mage.abilities.keyword.FlyingAbility;
/**
*
* @author spjspj
*/
public final class BeckonApparitionToken extends TokenImpl {
public BeckonApparitionToken() {
super("Spirit", "1/1 white and black Spirit creature token with flying");
this.setOriginalExpansionSetCode("GTC");
cardType.add(CardType.CREATURE);
color.setWhite(true);
color.setBlack(true);
subtype.add(SubType.SPIRIT);
power = new MageInt(1);
toughness = new MageInt(1);
this.addAbility(FlyingAbility.getInstance());
}
public BeckonApparitionToken(final BeckonApparitionToken token) {
super(token);
}
public BeckonApparitionToken copy() {
return new BeckonApparitionToken(this);
}
}

View file

@ -1,18 +1,18 @@
package mage.game.permanent.token;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.MageInt;
import mage.abilities.keyword.FlyingAbility;
import mage.constants.CardType;
import mage.constants.SubType;
/**
*
* @author spjspj
*/
public final class TeysaEnvoyOfGhostsToken extends TokenImpl {
public final class WhiteBlackSpiritToken extends TokenImpl {
public TeysaEnvoyOfGhostsToken() {
public WhiteBlackSpiritToken() {
super("Spirit", "1/1 white and black Spirit creature token with flying");
cardType.add(CardType.CREATURE);
color.setWhite(true);
@ -23,11 +23,11 @@ public final class TeysaEnvoyOfGhostsToken extends TokenImpl {
this.addAbility(FlyingAbility.getInstance());
}
public TeysaEnvoyOfGhostsToken(final TeysaEnvoyOfGhostsToken token) {
public WhiteBlackSpiritToken(final WhiteBlackSpiritToken token) {
super(token);
}
public TeysaEnvoyOfGhostsToken copy() {
return new TeysaEnvoyOfGhostsToken(this);
public WhiteBlackSpiritToken copy() {
return new WhiteBlackSpiritToken(this);
}
}