Refactoring: replace custom creature tokens with basic class (1 card);

Added blink test;
This commit is contained in:
Oleg Agafonov 2018-08-15 06:47:33 +04:00
parent 3da2f98eac
commit 593df43758
3 changed files with 41 additions and 25 deletions

View file

@ -17,6 +17,7 @@ import mage.constants.Duration;
import mage.constants.Zone;
import mage.game.permanent.token.TokenImpl;
import mage.game.permanent.token.Token;
import mage.game.permanent.token.custom.CreatureToken;
/**
*
@ -32,7 +33,12 @@ public final class DimirKeyrune extends CardImpl {
this.addAbility(new BlackManaAbility());
// {U}{B}: Dimir Keyrune becomes a 2/2 blue and black Horror and can't be blocked this turn
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new DimirKeyruneToken(), "", Duration.EndOfTurn), new ManaCostsImpl("{U}{B}")));
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(
new CreatureToken(2, 2, "2/2 blue and black Horror creature that can't be blocked")
.withColor("UB")
.withSubType(SubType.HORROR)
.withAbility(new CantBeBlockedSourceAbility()),
"", Duration.EndOfTurn), new ManaCostsImpl("{U}{B}")));
}
public DimirKeyrune(final DimirKeyrune card) {
@ -43,25 +49,4 @@ public final class DimirKeyrune extends CardImpl {
public DimirKeyrune copy() {
return new DimirKeyrune(this);
}
private static class DimirKeyruneToken extends TokenImpl {
DimirKeyruneToken() {
super("Horror", "2/2 blue and black Horror until end of turn and can't be blocked this turn");
cardType.add(CardType.ARTIFACT);
cardType.add(CardType.CREATURE);
color.setBlue(true);
color.setBlack(true);
subtype.add(SubType.HORROR);
power = new MageInt(2);
toughness = new MageInt(2);
this.addAbility(new CantBeBlockedSourceAbility());
}
public DimirKeyruneToken(final DimirKeyruneToken token) {
super(token);
}
public DimirKeyruneToken copy() {
return new DimirKeyruneToken(this);
}
}
}