From 8b0bd22ce817a45a2671c78c7e6655edb6c47154 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 29 Nov 2014 13:12:50 +0100 Subject: [PATCH] [C14] Some changes for showing token images. --- .../sets/avacynrestored/MoonsilverSpear.java | 2 +- .../sets/commander2014/GhoulcallerGisa.java | 5 +++- .../commander2014/HallowedSpiritkeeper.java | 25 ++++++++++++++++--- .../commander2014/NahiriTheLithomancer.java | 1 + .../ObNixilisOfTheBlackOath.java | 1 + .../commander2014/OverseerOfTheDamned.java | 5 +++- .../sets/commander2014/PromiseOfPower.java | 11 ++++---- .../sets/commander2014/StitcherGeralf.java | 1 + .../riseoftheeldrazi/TuktukTheExplorer.java | 6 +++-- .../sets/scarsofmirrodin/WurmcoilEngine.java | 12 ++++++--- .../sets/vintagemasters/DecreeOfJustice.java | 2 +- Mage/src/mage/game/permanent/token/Token.java | 2 +- 12 files changed, 54 insertions(+), 19 deletions(-) diff --git a/Mage.Sets/src/mage/sets/avacynrestored/MoonsilverSpear.java b/Mage.Sets/src/mage/sets/avacynrestored/MoonsilverSpear.java index 82e2a2a092..5cd44592f1 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/MoonsilverSpear.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/MoonsilverSpear.java @@ -54,7 +54,7 @@ public class MoonsilverSpear extends CardImpl { // Equipped creature has first strike. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FirstStrikeAbility.getInstance(), AttachmentType.EQUIPMENT))); // Whenever equipped creature attacks, put a 4/4 white Angel creature token with flying onto the battlefield. - this.addAbility(new AttacksAttachedTriggeredAbility(new CreateTokenEffect(new AngelToken()))); + this.addAbility(new AttacksAttachedTriggeredAbility(new CreateTokenEffect(new AngelToken(expansionSetCode)))); // Equip {4} this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(4))); } diff --git a/Mage.Sets/src/mage/sets/commander2014/GhoulcallerGisa.java b/Mage.Sets/src/mage/sets/commander2014/GhoulcallerGisa.java index dc6156b765..dd4439d8ba 100644 --- a/Mage.Sets/src/mage/sets/commander2014/GhoulcallerGisa.java +++ b/Mage.Sets/src/mage/sets/commander2014/GhoulcallerGisa.java @@ -44,6 +44,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.permanent.AnotherPredicate; +import mage.game.permanent.token.Token; import mage.game.permanent.token.ZombieToken; import mage.target.common.TargetControlledCreaturePermanent; @@ -72,7 +73,9 @@ public class GhoulcallerGisa extends CardImpl { // {B}, {tap}, Sacrifice another creature: Put X 2/2 black Zombie creature tokens onto the battlefield, where X is the sacrificed creature's power. DynamicValue xValue = new SacrificeCostCreaturesPower(); - Effect effect = new CreateTokenEffect(new ZombieToken("C14"), xValue); + Token zombie = new ZombieToken("C14"); + zombie.setTokenType(2); + Effect effect = new CreateTokenEffect(zombie, xValue); effect.setText("Put X 2/2 black Zombie creature tokens onto the battlefield, where X is the sacrificed creature's power"); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{B}")); ability.addCost(new TapSourceCost()); diff --git a/Mage.Sets/src/mage/sets/commander2014/HallowedSpiritkeeper.java b/Mage.Sets/src/mage/sets/commander2014/HallowedSpiritkeeper.java index 87519f7efc..cb71a5eac0 100644 --- a/Mage.Sets/src/mage/sets/commander2014/HallowedSpiritkeeper.java +++ b/Mage.Sets/src/mage/sets/commander2014/HallowedSpiritkeeper.java @@ -31,13 +31,14 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.common.DiesTriggeredAbility; import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.VigilanceAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import static mage.filter.predicate.permanent.ControllerControlsIslandPredicate.filter; -import mage.game.permanent.token.SpiritToken; +import mage.game.permanent.token.Token; /** * @@ -58,7 +59,9 @@ public class HallowedSpiritkeeper extends CardImpl { this.addAbility(VigilanceAbility.getInstance()); // When Hallowed Spiritkeeper dies, put X 1/1 white Spirit creature tokens with flying onto the battlefield, where X is the number of creature cards in your graveyard. - this.addAbility(new DiesTriggeredAbility(new CreateTokenEffect(new SpiritToken(), new CardsInControllerGraveyardCount()), false)); + Effect effect = new CreateTokenEffect(new HallowedSpiritkeeperSpiritToken(), new CardsInControllerGraveyardCount()); + effect.setText("put X 1/1 white Spirit creature tokens with flying onto the battlefield, where X is the number of creature cards in your graveyard"); + this.addAbility(new DiesTriggeredAbility(effect, false)); } @@ -71,3 +74,19 @@ public class HallowedSpiritkeeper extends CardImpl { return new HallowedSpiritkeeper(this); } } + +class HallowedSpiritkeeperSpiritToken extends Token { + + public HallowedSpiritkeeperSpiritToken() { + super("Spirit", "1/1 white Spirit creature token with flying"); + setOriginalExpansionSetCode("C14"); + cardType.add(CardType.CREATURE); + color.setWhite(true); + subtype.add("Spirit"); + power = new MageInt(1); + toughness = new MageInt(1); + + addAbility(FlyingAbility.getInstance()); + + } +} diff --git a/Mage.Sets/src/mage/sets/commander2014/NahiriTheLithomancer.java b/Mage.Sets/src/mage/sets/commander2014/NahiriTheLithomancer.java index b141165bca..5a3c242fed 100644 --- a/Mage.Sets/src/mage/sets/commander2014/NahiriTheLithomancer.java +++ b/Mage.Sets/src/mage/sets/commander2014/NahiriTheLithomancer.java @@ -154,6 +154,7 @@ class NahiriTheLithomancerKorSoldierToken extends Token { NahiriTheLithomancerKorSoldierToken() { super("Kor Soldier", "1/1 white Kor Soldier creature token"); + setOriginalExpansionSetCode("C14"); cardType.add(CardType.CREATURE); color.setWhite(true); subtype.add("Kor"); diff --git a/Mage.Sets/src/mage/sets/commander2014/ObNixilisOfTheBlackOath.java b/Mage.Sets/src/mage/sets/commander2014/ObNixilisOfTheBlackOath.java index 9c20e81467..8ecef6e915 100644 --- a/Mage.Sets/src/mage/sets/commander2014/ObNixilisOfTheBlackOath.java +++ b/Mage.Sets/src/mage/sets/commander2014/ObNixilisOfTheBlackOath.java @@ -136,6 +136,7 @@ class ObNixilisDemonToken extends Token { ObNixilisDemonToken() { super("Demon", "5/5 black Demon creature token with flying"); + setTokenType(1); setOriginalExpansionSetCode("C14"); cardType.add(CardType.CREATURE); subtype.add("Demon"); diff --git a/Mage.Sets/src/mage/sets/commander2014/OverseerOfTheDamned.java b/Mage.Sets/src/mage/sets/commander2014/OverseerOfTheDamned.java index 39be8de561..09364ddf70 100644 --- a/Mage.Sets/src/mage/sets/commander2014/OverseerOfTheDamned.java +++ b/Mage.Sets/src/mage/sets/commander2014/OverseerOfTheDamned.java @@ -43,6 +43,7 @@ import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.permanent.ControllerPredicate; import mage.filter.predicate.permanent.TokenPredicate; +import mage.game.permanent.token.Token; import mage.game.permanent.token.ZombieToken; import mage.target.common.TargetCreaturePermanent; @@ -75,7 +76,9 @@ public class OverseerOfTheDamned extends CardImpl { ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); // Whenever a nontoken creature an opponent controls dies, put a 2/2 black Zombie creature token onto the battlefield tapped. - this.addAbility(new DiesCreatureTriggeredAbility(new CreateTokenEffect(new ZombieToken("C14"), 1, true, false), false, filter)); + Token zombie = new ZombieToken("C14"); + zombie.setTokenType(2); + this.addAbility(new DiesCreatureTriggeredAbility(new CreateTokenEffect(zombie, 1, true, false), false, filter)); } diff --git a/Mage.Sets/src/mage/sets/commander2014/PromiseOfPower.java b/Mage.Sets/src/mage/sets/commander2014/PromiseOfPower.java index c8741b7a69..9e70f424c6 100644 --- a/Mage.Sets/src/mage/sets/commander2014/PromiseOfPower.java +++ b/Mage.Sets/src/mage/sets/commander2014/PromiseOfPower.java @@ -105,7 +105,7 @@ class PromiseOfPowerEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - return new CreateTokenEffect(new PromiseOfPowerHorrorToken(controller.getHand().size())).apply(game, source); + return new CreateTokenEffect(new PromiseOfPowerDemonToken(controller.getHand().size())).apply(game, source); } return false; } @@ -116,14 +116,15 @@ class PromiseOfPowerEffect extends OneShotEffect { } } -class PromiseOfPowerHorrorToken extends Token { +class PromiseOfPowerDemonToken extends Token { - public PromiseOfPowerHorrorToken(int xValue) { - super("Horror", "X/X black Horror creature token with flying"); + public PromiseOfPowerDemonToken(int xValue) { + super("Demon", "X/X black Demon creature token with flying"); setOriginalExpansionSetCode("C14"); + setTokenType(2); cardType.add(CardType.CREATURE); color.setBlack(true); - subtype.add("Horror"); + subtype.add("Demon"); power = new MageInt(xValue); toughness = new MageInt(xValue); diff --git a/Mage.Sets/src/mage/sets/commander2014/StitcherGeralf.java b/Mage.Sets/src/mage/sets/commander2014/StitcherGeralf.java index 4e362c5f5f..8182ab71fd 100644 --- a/Mage.Sets/src/mage/sets/commander2014/StitcherGeralf.java +++ b/Mage.Sets/src/mage/sets/commander2014/StitcherGeralf.java @@ -136,6 +136,7 @@ class StitcherGeralfZombieToken extends Token { StitcherGeralfZombieToken(int xValue) { super("Zombie", "an X/X blue Zombie creature token"); setOriginalExpansionSetCode("C14"); + setTokenType(1); cardType.add(CardType.CREATURE); color.setBlue(true); subtype.add("Zombie"); diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/TuktukTheExplorer.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/TuktukTheExplorer.java index ce5f67a94a..1b3af29e2c 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/TuktukTheExplorer.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/TuktukTheExplorer.java @@ -53,7 +53,7 @@ public class TuktukTheExplorer extends CardImpl { this.power = new MageInt(1); this.toughness = new MageInt(1); this.addAbility(HasteAbility.getInstance()); - this.addAbility(new DiesTriggeredAbility(new CreateTokenEffect(new TuktukTheReturnedToken()))); + this.addAbility(new DiesTriggeredAbility(new CreateTokenEffect(new TuktukTheReturnedToken(expansionSetCode)))); } public TuktukTheExplorer (final TuktukTheExplorer card) { @@ -68,8 +68,10 @@ public class TuktukTheExplorer extends CardImpl { } class TuktukTheReturnedToken extends Token { - TuktukTheReturnedToken() { + + TuktukTheReturnedToken(String setCode) { super("Tuktuk the Returned", "a legendary 5/5 colorless Goblin Golem artifact creature token"); + setOriginalExpansionSetCode(setCode); cardType.add(CardType.ARTIFACT); cardType.add(CardType.CREATURE); supertype.add("Legendary"); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/WurmcoilEngine.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/WurmcoilEngine.java index 8e0850e004..6bdf90e980 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/WurmcoilEngine.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/WurmcoilEngine.java @@ -53,10 +53,12 @@ public class WurmcoilEngine extends CardImpl { this.subtype.add("Wurm"); this.power = new MageInt(6); this.toughness = new MageInt(6); + + this.addAbility(DeathtouchAbility.getInstance()); this.addAbility(LifelinkAbility.getInstance()); - Ability ability = new DiesTriggeredAbility(new CreateTokenEffect(new Wurm1Token()), false); - ability.addEffect(new CreateTokenEffect(new Wurm2Token())); + Ability ability = new DiesTriggeredAbility(new CreateTokenEffect(new Wurm1Token(expansionSetCode)), false); + ability.addEffect(new CreateTokenEffect(new Wurm2Token(expansionSetCode))); this.addAbility(ability); } @@ -72,8 +74,9 @@ public class WurmcoilEngine extends CardImpl { } class Wurm1Token extends Token { - public Wurm1Token() { + public Wurm1Token(String setCode) { super("Wurm", "a 3/3 colorless Wurm artifact creature token with deathtouch"); + setOriginalExpansionSetCode(setCode); cardType.add(CardType.ARTIFACT); cardType.add(CardType.CREATURE); subtype.add("Wurm"); @@ -84,8 +87,9 @@ class Wurm1Token extends Token { } class Wurm2Token extends Token { - public Wurm2Token() { + public Wurm2Token(String setCode) { super("Wurm", "a 3/3 colorless Wurm artifact creature token with lifelink"); + setOriginalExpansionSetCode(setCode); cardType.add(CardType.ARTIFACT); cardType.add(CardType.CREATURE); subtype.add("Wurm"); diff --git a/Mage.Sets/src/mage/sets/vintagemasters/DecreeOfJustice.java b/Mage.Sets/src/mage/sets/vintagemasters/DecreeOfJustice.java index aef5c2587d..0f01672e09 100644 --- a/Mage.Sets/src/mage/sets/vintagemasters/DecreeOfJustice.java +++ b/Mage.Sets/src/mage/sets/vintagemasters/DecreeOfJustice.java @@ -61,7 +61,7 @@ public class DecreeOfJustice extends CardImpl { this.color.setWhite(true); // Put X 4/4 white Angel creature tokens with flying onto the battlefield. - this.getSpellAbility().addEffect(new CreateTokenEffect(new AngelToken(), new ManacostVariableValue())); + this.getSpellAbility().addEffect(new CreateTokenEffect(new AngelToken("C14"), new ManacostVariableValue())); // Cycling {2}{W} this.addAbility(new CyclingAbility(new ManaCostsImpl<>("{2}{W}"))); diff --git a/Mage/src/mage/game/permanent/token/Token.java b/Mage/src/mage/game/permanent/token/Token.java index a3512aeeff..5be4264b9b 100644 --- a/Mage/src/mage/game/permanent/token/Token.java +++ b/Mage/src/mage/game/permanent/token/Token.java @@ -50,7 +50,7 @@ import mage.util.CardUtil; public class Token extends MageObjectImpl { protected String description; - private ArrayList lastAddedTokenIds = new ArrayList<>(); + private final ArrayList lastAddedTokenIds = new ArrayList<>(); private UUID lastAddedTokenId; private int tokenType; private int originalCardNumber;