foul-magics/Mage/src/main/java/mage/abilities/keyword/AfterlifeAbility.java
Susucre f75b1c9f0a
Code cleanup: protect all copy constructors (#10750)
* apply regex to change public copy constructors to protected
* cleanup code using now protected constructors
* fix manaBuilder weird casting of Mana into ConditionalMana
2023-08-04 19:34:58 -04:00

35 lines
1.1 KiB
Java

package mage.abilities.keyword;
import mage.abilities.common.DiesSourceTriggeredAbility;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.game.permanent.token.WhiteBlackSpiritToken;
import mage.util.CardUtil;
public class AfterlifeAbility extends DiesSourceTriggeredAbility {
private final int tokenCount;
public AfterlifeAbility(int tokenCount) {
super(new CreateTokenEffect(new WhiteBlackSpiritToken(), tokenCount), false);
this.tokenCount = tokenCount;
}
protected 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")
+ " 1/1 white and black Spirit creature token"
+ (tokenCount > 1 ? "s" : "")
+ " with flying.)</i>";
}
@Override
public AfterlifeAbility copy() {
return new AfterlifeAbility(this);
}
}