diff --git a/Mage.Sets/src/mage/cards/a/AnimateLand.java b/Mage.Sets/src/mage/cards/a/AnimateLand.java index b3784a6493..4ffc36cb87 100644 --- a/Mage.Sets/src/mage/cards/a/AnimateLand.java +++ b/Mage.Sets/src/mage/cards/a/AnimateLand.java @@ -36,6 +36,7 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.game.permanent.token.TokenImpl; import mage.game.permanent.token.Token; +import mage.game.permanent.token.custom.CreatureToken; import mage.target.common.TargetLandPermanent; /** @@ -48,7 +49,7 @@ public class AnimateLand extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{G}"); // Until end of turn, target land becomes a 3/3 creature that's still a land. - this.getSpellAbility().addEffect(new BecomesCreatureTargetEffect(new AnimatedLand(), false, true, Duration.EndOfTurn)); + this.getSpellAbility().addEffect(new BecomesCreatureTargetEffect(new CreatureToken(3, 3), false, true, Duration.EndOfTurn)); this.getSpellAbility().addTarget(new TargetLandPermanent()); } @@ -60,21 +61,4 @@ public class AnimateLand extends CardImpl { public AnimateLand copy() { return new AnimateLand(this); } -} - -class AnimatedLand extends TokenImpl { - - public AnimatedLand() { - super("", "3/3 creature"); - this.cardType.add(CardType.CREATURE); - this.power = new MageInt(3); - this.toughness = new MageInt(3); - } - public AnimatedLand(final AnimatedLand token) { - super(token); - } - - public AnimatedLand copy() { - return new AnimatedLand(this); - } -} +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/cards/j/JolraelEmpressOfBeasts.java b/Mage.Sets/src/mage/cards/j/JolraelEmpressOfBeasts.java index bf3cf980d4..fbc5958cd4 100644 --- a/Mage.Sets/src/mage/cards/j/JolraelEmpressOfBeasts.java +++ b/Mage.Sets/src/mage/cards/j/JolraelEmpressOfBeasts.java @@ -46,6 +46,7 @@ import mage.filter.predicate.permanent.ControllerIdPredicate; import mage.game.Game; import mage.game.permanent.token.TokenImpl; import mage.game.permanent.token.Token; +import mage.game.permanent.token.custom.CreatureToken; import mage.players.Player; import mage.target.TargetPlayer; import mage.target.common.TargetCardInHand; @@ -104,26 +105,9 @@ class JolraelEmpressOfBeastsEffect extends OneShotEffect { if (targetPlayer != null) { FilterPermanent filter = new FilterLandPermanent(); filter.add(new ControllerIdPredicate(targetPlayer.getId())); - game.addEffect(new BecomesCreatureAllEffect(new JolraelLandsToken(), "lands", filter, Duration.EndOfTurn), source); + game.addEffect(new BecomesCreatureAllEffect(new CreatureToken(3, 3), "lands", filter, Duration.EndOfTurn), source); return true; } return false; } -} - -class JolraelLandsToken extends TokenImpl { - - public JolraelLandsToken() { - super("", "3/3 creature"); - cardType.add(CardType.CREATURE); - power = new MageInt(3); - toughness = new MageInt(3); - } - public JolraelLandsToken(final JolraelLandsToken token) { - super(token); - } - - public JolraelLandsToken copy() { - return new JolraelLandsToken(this); - } -} +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/cards/l/LifesparkSpellbomb.java b/Mage.Sets/src/mage/cards/l/LifesparkSpellbomb.java index 33fd4a6a15..f5482a23da 100644 --- a/Mage.Sets/src/mage/cards/l/LifesparkSpellbomb.java +++ b/Mage.Sets/src/mage/cards/l/LifesparkSpellbomb.java @@ -44,6 +44,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; import mage.target.common.TargetLandPermanent; /** @@ -56,7 +57,7 @@ public class LifesparkSpellbomb extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{1}"); // {G}, Sacrifice Lifespark Spellbomb: Until end of turn, target land becomes a 3/3 creature that's still a land. - Ability firstAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureTargetEffect(new LifesparkSpellbombToken(), false, true, Duration.EndOfTurn), new ColoredManaCost(ColoredManaSymbol.G)); + Ability firstAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureTargetEffect(new CreatureToken(3, 3), false, true, Duration.EndOfTurn), new ColoredManaCost(ColoredManaSymbol.G)); firstAbility.addCost(new SacrificeSourceCost()); firstAbility.addTarget(new TargetLandPermanent()); this.addAbility(firstAbility); @@ -76,22 +77,4 @@ public class LifesparkSpellbomb extends CardImpl { return new LifesparkSpellbomb(this); } -} - -class LifesparkSpellbombToken extends TokenImpl { - - public LifesparkSpellbombToken() { - super("", "3/3 creature"); - this.cardType.add(CardType.CREATURE); - - this.power = new MageInt(3); - this.toughness = new MageInt(3); - } - public LifesparkSpellbombToken(final LifesparkSpellbombToken token) { - super(token); - } - - public LifesparkSpellbombToken copy() { - return new LifesparkSpellbombToken(this); - } -} +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/cards/s/Soilshaper.java b/Mage.Sets/src/mage/cards/s/Soilshaper.java index 592e0a936b..8f0a127efd 100644 --- a/Mage.Sets/src/mage/cards/s/Soilshaper.java +++ b/Mage.Sets/src/mage/cards/s/Soilshaper.java @@ -41,6 +41,7 @@ import mage.constants.Duration; import mage.filter.StaticFilters; import mage.game.permanent.token.TokenImpl; import mage.game.permanent.token.Token; +import mage.game.permanent.token.custom.CreatureToken; import mage.target.common.TargetLandPermanent; /** @@ -57,7 +58,7 @@ public class Soilshaper extends CardImpl { this.toughness = new MageInt(1); // Whenever you cast a Spirit or Arcane spell, target land becomes a 3/3 creature until end of turn. It's still a land. - Ability ability = new SpellCastControllerTriggeredAbility(new BecomesCreatureTargetEffect(new SoilshaperToken(), false, true, Duration.EndOfTurn), StaticFilters.SPIRIT_OR_ARCANE_CARD, false); + Ability ability = new SpellCastControllerTriggeredAbility(new BecomesCreatureTargetEffect(new CreatureToken(3, 3), false, true, Duration.EndOfTurn), StaticFilters.SPIRIT_OR_ARCANE_CARD, false); ability.addTarget(new TargetLandPermanent()); this.addAbility(ability); } @@ -71,22 +72,4 @@ public class Soilshaper extends CardImpl { return new Soilshaper(this); } -} - -class SoilshaperToken extends TokenImpl { - - public SoilshaperToken() { - super("", "3/3 creature"); - this.cardType.add(CardType.CREATURE); - - this.power = new MageInt(3); - this.toughness = new MageInt(3); - } - public SoilshaperToken(final SoilshaperToken token) { - super(token); - } - - public SoilshaperToken copy() { - return new SoilshaperToken(this); - } -} +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/cards/v/Vivify.java b/Mage.Sets/src/mage/cards/v/Vivify.java index 0ee535ed74..0a5f206149 100644 --- a/Mage.Sets/src/mage/cards/v/Vivify.java +++ b/Mage.Sets/src/mage/cards/v/Vivify.java @@ -37,6 +37,7 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.game.permanent.token.TokenImpl; import mage.game.permanent.token.Token; +import mage.game.permanent.token.custom.CreatureToken; import mage.target.common.TargetLandPermanent; /** @@ -49,7 +50,7 @@ public class Vivify extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{G}"); // Target land becomes a 3/3 creature until end of turn. It's still a land. - this.getSpellAbility().addEffect(new BecomesCreatureTargetEffect(new AnimatedLand(), false, true, Duration.EndOfTurn)); + this.getSpellAbility().addEffect(new BecomesCreatureTargetEffect(new CreatureToken(3, 3), false, true, Duration.EndOfTurn)); this.getSpellAbility().addTarget(new TargetLandPermanent()); // Draw a card. this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); @@ -64,20 +65,3 @@ public class Vivify extends CardImpl { return new Vivify(this); } } - -class AnimatedLand extends TokenImpl { - - public AnimatedLand() { - super("", "3/3 creature"); - this.cardType.add(CardType.CREATURE); - this.power = new MageInt(3); - this.toughness = new MageInt(3); - } - public AnimatedLand(final AnimatedLand token) { - super(token); - } - - public AnimatedLand copy() { - return new AnimatedLand(this); - } -} diff --git a/Mage/src/main/java/mage/game/permanent/token/custom/CreatureToken.java b/Mage/src/main/java/mage/game/permanent/token/custom/CreatureToken.java new file mode 100644 index 0000000000..d7cd2e4527 --- /dev/null +++ b/Mage/src/main/java/mage/game/permanent/token/custom/CreatureToken.java @@ -0,0 +1,31 @@ +package mage.game.permanent.token.custom; + +import mage.MageInt; +import mage.constants.CardType; +import mage.game.permanent.token.TokenImpl; + +/** + * + * @author JayDi85 + */ +public class CreatureToken extends TokenImpl { + + public CreatureToken() { + this(0, 0); + } + + public CreatureToken(int power, int toughness) { + super("", String.format("%d/%d creature", power, toughness)); + this.cardType.add(CardType.CREATURE); + this.power = new MageInt(power); + this.toughness = new MageInt(toughness); + } + + public CreatureToken(final CreatureToken token) { + super(token); + } + + public CreatureToken copy() { + return new CreatureToken(this); + } +}