Token refactor

This commit is contained in:
spjspj 2017-05-06 23:35:14 +10:00
parent a532368b84
commit e73e7d8600
20 changed files with 1449 additions and 744 deletions

View file

@ -38,7 +38,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.game.permanent.token.ThrullToken;
import mage.game.permanent.token.BreedingPitThrullToken;
/**
*
@ -53,7 +53,7 @@ public class BreedingPit extends CardImpl {
this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new SacrificeSourceUnlessPaysEffect(new ManaCostsImpl("{B}{B}")), TargetController.YOU, false));
// At the beginning of your end step, create a 0/1 black Thrull creature token.
this.addAbility(new BeginningOfYourEndStepTriggeredAbility(new CreateTokenEffect(new ThrullToken()), false));
this.addAbility(new BeginningOfYourEndStepTriggeredAbility(new CreateTokenEffect(new BreedingPitThrullToken()), false));
}
public BreedingPit(final BreedingPit card) {

View file

@ -36,7 +36,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TargetController;
import mage.game.permanent.token.DragonToken;
import mage.game.permanent.token.DragonBroodmotherDragonToken;
/**
*
@ -55,7 +55,7 @@ public class DragonBroodmother extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// At the beginning of each upkeep, create a 1/1 red and green Dragon creature token with flying and devour 2. (As the token enters the battlefield, you may sacrifice any number of creatures. It enters the battlefield with twice that many +1/+1 counters on it.)
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new CreateTokenEffect(new DragonToken()), TargetController.ANY, false));
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new CreateTokenEffect(new DragonBroodmotherDragonToken()), TargetController.ANY, false));
}
public DragonBroodmother(final DragonBroodmother card) {

View file

@ -35,7 +35,7 @@ import mage.abilities.keyword.DefenderAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.game.permanent.token.DragonToken;
import mage.game.permanent.token.DragonEggDragonToken;
/**
*
@ -54,7 +54,7 @@ public class DragonEgg extends CardImpl {
this.addAbility(DefenderAbility.getInstance());
// When Dragon Egg dies, create a 2/2 red Dragon creature token with flying. It has "{R}: This creature gets +1/+0 until end of turn".
this.addAbility(new DiesTriggeredAbility(new CreateTokenEffect(new DragonToken()), false));
this.addAbility(new DiesTriggeredAbility(new CreateTokenEffect(new DragonEggDragonToken()), false));
}

View file

@ -42,7 +42,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.permanent.token.Token;
import mage.game.permanent.token.HeliodGodOfTheSunToken;
import java.util.UUID;
@ -53,7 +53,7 @@ import java.util.UUID;
public class HeliodGodOfTheSun extends CardImpl {
public HeliodGodOfTheSun(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT,CardType.CREATURE},"{3}{W}");
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "{3}{W}");
addSuperType(SuperType.LEGENDARY);
this.subtype.add("God");
@ -85,19 +85,3 @@ public class HeliodGodOfTheSun extends CardImpl {
return new HeliodGodOfTheSun(this);
}
}
class HeliodGodOfTheSunToken extends Token {
public HeliodGodOfTheSunToken() {
super("Cleric", "2/1 white Cleric enchantment creature token");
this.cardType.add(CardType.CREATURE);
this.cardType.add(CardType.ENCHANTMENT);
this.subtype.add("Cleric");
this.color.setWhite(true);
this.power = new MageInt(2);
this.toughness = new MageInt(1);
}
}

View file

@ -36,7 +36,7 @@ import mage.abilities.effects.common.CreateTokenEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.game.permanent.token.OozeToken;
import mage.game.permanent.token.InexorableBlobOozeToken;
/**
*
@ -52,7 +52,7 @@ public class InexorableBlob extends CardImpl {
// <i>Delirium</i> &mdash; Whenever Inexorable Blob attacks and there are at least four card types among cards in your graveyard,
// create a 3/3 green Ooze creature token tapped and attacking.
this.addAbility(new ConditionalTriggeredAbility(new AttacksTriggeredAbility(new CreateTokenEffect(new OozeToken(3, 3), 1, true, true), false),
this.addAbility(new ConditionalTriggeredAbility(new AttacksTriggeredAbility(new CreateTokenEffect(new InexorableBlobOozeToken(), 1, true, true), false),
DeliriumCondition.instance,
"<i>Delirium</i> &mdash; Whenever {this} attacks and there are at least four card types among cards in your graveyard, "
+ "create a 3/3 green Ooze creature token tapped and attacking."));

View file

@ -39,7 +39,7 @@ import mage.constants.CardType;
import mage.constants.Outcome;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.RedHumanToken;
import mage.game.permanent.token.ThatcherHumanToken;
import mage.target.targetpointer.FixedTargets;
/**
@ -83,7 +83,7 @@ class ThatcherRevoltEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
RedHumanToken token = new RedHumanToken();
ThatcherHumanToken token = new ThatcherHumanToken();
token.putOntoBattlefield(3, game, source.getSourceId(), source.getControllerId());
ArrayList<Permanent> toSacrifice = new ArrayList<>();
for (UUID tokenId : token.getLastAddedTokenIds()) {