diff --git a/Mage.Sets/src/mage/cards/a/AwakenTheAncient.java b/Mage.Sets/src/mage/cards/a/AwakenTheAncient.java index 92c4091e8f0c..697499054cc6 100644 --- a/Mage.Sets/src/mage/cards/a/AwakenTheAncient.java +++ b/Mage.Sets/src/mage/cards/a/AwakenTheAncient.java @@ -1,6 +1,5 @@ package mage.cards.a; -import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.continuous.BecomesCreatureAttachedEffect; @@ -13,7 +12,7 @@ import mage.constants.Outcome; import mage.constants.SubType; import mage.filter.FilterPermanent; -import mage.game.permanent.token.TokenImpl; +import mage.game.permanent.token.custom.CreatureToken; import mage.target.TargetPermanent; import java.util.UUID; @@ -37,8 +36,12 @@ public AwakenTheAncient(UUID ownerId, CardSetInfo setInfo) { // Enchanted Mountain is a 7/7 red Giant creature with haste. It's still a land. this.addAbility(new SimpleStaticAbility(new BecomesCreatureAttachedEffect( - new GiantToken(), "Enchanted Mountain is a 7/7 red Giant creature with haste. It's still a land", - Duration.WhileOnBattlefield, BecomesCreatureAttachedEffect.LoseType.COLOR + new CreatureToken( + 7, 7, "7/7 red Giant creature with haste", SubType.GIANT + ).withAbility(HasteAbility.getInstance()), + "Enchanted Mountain is a 7/7 red Giant creature with haste. It's still a land", + Duration.WhileOnBattlefield, + BecomesCreatureAttachedEffect.LoseType.COLOR ))); } @@ -50,25 +53,4 @@ private AwakenTheAncient(final AwakenTheAncient card) { public AwakenTheAncient copy() { return new AwakenTheAncient(this); } - - private static class GiantToken extends TokenImpl { - - GiantToken() { - super("Giant", "7/7 red Giant creature with haste"); - cardType.add(CardType.CREATURE); - color.setRed(true); - subtype.add(SubType.GIANT); - power = new MageInt(7); - toughness = new MageInt(7); - this.addAbility(HasteAbility.getInstance()); - } - - private GiantToken(final GiantToken token) { - super(token); - } - - public GiantToken copy() { - return new GiantToken(this); - } - } } diff --git a/Mage.Sets/src/mage/cards/g/GargoyleCastle.java b/Mage.Sets/src/mage/cards/g/GargoyleCastle.java index 89383d17aaec..7cb9aaf02cae 100644 --- a/Mage.Sets/src/mage/cards/g/GargoyleCastle.java +++ b/Mage.Sets/src/mage/cards/g/GargoyleCastle.java @@ -12,7 +12,6 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.Zone; import mage.game.permanent.token.GargoyleToken; /** @@ -23,13 +22,12 @@ public final class GargoyleCastle extends CardImpl { public GargoyleCastle(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.LAND}, null); - // {T}: Add {C}. + // {T}: Add {C}. this.addAbility(new ColorlessManaAbility()); + // {T}, {5}, Sacrifice Gargoyle Castle: Put a 3/4 colorless Gargoyle artifact creature token with flying onto the battlefield. - Ability ability = new SimpleActivatedAbility( - new CreateTokenEffect(new GargoyleToken()), - new ManaCostsImpl<>("{5}")); + Ability ability = new SimpleActivatedAbility(new CreateTokenEffect(new GargoyleToken()), new ManaCostsImpl<>("{5}")); ability.addCost(new TapSourceCost()); ability.addCost(new SacrificeSourceCost()); this.addAbility(ability); @@ -43,5 +41,4 @@ private GargoyleCastle(final GargoyleCastle card) { public GargoyleCastle copy() { return new GargoyleCastle(this); } - } diff --git a/Mage.Sets/src/mage/cards/g/GhituEncampment.java b/Mage.Sets/src/mage/cards/g/GhituEncampment.java index 9ef92350721c..801f587e6171 100644 --- a/Mage.Sets/src/mage/cards/g/GhituEncampment.java +++ b/Mage.Sets/src/mage/cards/g/GhituEncampment.java @@ -2,7 +2,6 @@ package mage.cards.g; import java.util.UUID; -import mage.MageInt; import mage.abilities.common.EntersBattlefieldTappedAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; @@ -14,8 +13,7 @@ import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Duration; -import mage.constants.Zone; -import mage.game.permanent.token.TokenImpl; +import mage.game.permanent.token.custom.CreatureToken; /** * @@ -29,8 +27,15 @@ public GhituEncampment(UUID ownerId, CardSetInfo setInfo) { this.addAbility(new EntersBattlefieldTappedAbility()); this.addAbility(new RedManaAbility()); this.addAbility(new SimpleActivatedAbility( - new BecomesCreatureSourceEffect(new GhituEncampmentToken(), CardType.LAND, Duration.EndOfTurn), - new ManaCostsImpl<>("{1}{R}"))); + new BecomesCreatureSourceEffect( + new CreatureToken( + 2, 1, "2/1 red Warrior creature with first strike", SubType.WARRIOR + ).withColor("R").withAbility(FirstStrikeAbility.getInstance()), + CardType.LAND, + Duration.EndOfTurn + ), + new ManaCostsImpl<>("{1}{R}") + )); } private GhituEncampment(final GhituEncampment card) { @@ -42,25 +47,3 @@ public GhituEncampment copy() { return new GhituEncampment(this); } } - -class GhituEncampmentToken extends TokenImpl { - - public GhituEncampmentToken() { - super("Warrior", "2/1 red Warrior creature with first strike"); - cardType.add(CardType.CREATURE); - this.subtype.add(SubType.WARRIOR); - - this.color.setRed(true); - power = new MageInt(2); - toughness = new MageInt(1); - - this.addAbility(FirstStrikeAbility.getInstance()); - } - private GhituEncampmentToken(final GhituEncampmentToken token) { - super(token); - } - - public GhituEncampmentToken copy() { - return new GhituEncampmentToken(this); - } -} diff --git a/Mage.Sets/src/mage/cards/g/GideonAllyOfZendikar.java b/Mage.Sets/src/mage/cards/g/GideonAllyOfZendikar.java index 4f74bb14c6c9..23bf8a76cdeb 100644 --- a/Mage.Sets/src/mage/cards/g/GideonAllyOfZendikar.java +++ b/Mage.Sets/src/mage/cards/g/GideonAllyOfZendikar.java @@ -2,7 +2,6 @@ package mage.cards.g; import java.util.UUID; -import mage.MageInt; import mage.abilities.LoyaltyAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.CreateTokenEffect; @@ -18,7 +17,7 @@ import mage.constants.SuperType; import mage.game.command.emblems.GideonAllyOfZendikarEmblem; import mage.game.permanent.token.KnightAllyToken; -import mage.game.permanent.token.TokenImpl; +import mage.game.permanent.token.custom.CreatureToken; /** * @@ -34,7 +33,15 @@ public GideonAllyOfZendikar(UUID ownerId, CardSetInfo setInfo) { this.setStartingLoyalty(4); // +1: Until end of turn, Gideon, Ally of Zendikar becomes a 5/5 Human Soldier Ally creature with indestructible that's still a planeswalker. Prevent all damage that would be dealt to him this turn. - LoyaltyAbility ability = new LoyaltyAbility(new BecomesCreatureSourceEffect(new GideonAllyOfZendikarToken(), CardType.PLANESWALKER, Duration.EndOfTurn), 1); + LoyaltyAbility ability = new LoyaltyAbility( + new BecomesCreatureSourceEffect( + new CreatureToken(5, 5, "5/5 Human Soldier Ally creature with indestructible", SubType.HUMAN, SubType.SOLDIER, SubType.ALLY) + .withAbility(IndestructibleAbility.getInstance()), + CardType.PLANESWALKER, + Duration.EndOfTurn + ), + 1 + ); Effect effect = new PreventAllDamageToSourceEffect(Duration.EndOfTurn); effect.setText("Prevent all damage that would be dealt to him this turn"); ability.addEffect(effect); @@ -56,25 +63,3 @@ public GideonAllyOfZendikar copy() { return new GideonAllyOfZendikar(this); } } - -class GideonAllyOfZendikarToken extends TokenImpl { - - public GideonAllyOfZendikarToken() { - super("", "5/5 Human Soldier Ally creature with indestructible"); - cardType.add(CardType.CREATURE); - subtype.add(SubType.HUMAN); - subtype.add(SubType.SOLDIER); - subtype.add(SubType.ALLY); - power = new MageInt(5); - toughness = new MageInt(5); - - addAbility(IndestructibleAbility.getInstance()); - } - private GideonAllyOfZendikarToken(final GideonAllyOfZendikarToken token) { - super(token); - } - - public GideonAllyOfZendikarToken copy() { - return new GideonAllyOfZendikarToken(this); - } -} diff --git a/Mage.Sets/src/mage/cards/g/GideonBlackblade.java b/Mage.Sets/src/mage/cards/g/GideonBlackblade.java index 0e781cf7763a..6e020b009c8c 100644 --- a/Mage.Sets/src/mage/cards/g/GideonBlackblade.java +++ b/Mage.Sets/src/mage/cards/g/GideonBlackblade.java @@ -1,6 +1,5 @@ package mage.cards.g; -import mage.MageInt; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; import mage.abilities.common.SimpleStaticAbility; @@ -24,7 +23,7 @@ import mage.filter.FilterPermanent; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.mageobject.AnotherPredicate; -import mage.game.permanent.token.TokenImpl; +import mage.game.permanent.token.custom.CreatureToken; import mage.target.TargetPermanent; import mage.target.common.TargetNonlandPermanent; @@ -50,10 +49,16 @@ public GideonBlackblade(UUID ownerId, CardSetInfo setInfo) { // As long as it's your turn, Gideon Blackblade is a 4/4 Human Soldier creature with indestructible that's still a planeswalker. this.addAbility(new SimpleStaticAbility(new ConditionalContinuousEffect( - new BecomesCreatureSourceEffect( - new GideonBlackbladeToken(), CardType.PLANESWALKER, Duration.WhileOnBattlefield - ), MyTurnCondition.instance, "During your turn, " + - "{this} is a 4/4 Human Soldier creature with indestructible that's still a planeswalker." + new BecomesCreatureSourceEffect( + new CreatureToken( + 4, 4, + "4/4 Human Soldier creature with indestructible", + SubType.HUMAN, SubType.SOLDIER + ).withAbility(IndestructibleAbility.getInstance()), + CardType.PLANESWALKER, + Duration.WhileOnBattlefield + ), MyTurnCondition.instance, "During your turn, " + + "{this} is a 4/4 Human Soldier creature with indestructible that's still a planeswalker." )).addHint(MyTurnHint.instance)); // Prevent all damage that would be dealt to Gideon Blackblade during your turn. @@ -83,25 +88,3 @@ public GideonBlackblade copy() { return new GideonBlackblade(this); } } - -class GideonBlackbladeToken extends TokenImpl { - - GideonBlackbladeToken() { - super("", "4/4 Human Soldier creature"); - cardType.add(CardType.CREATURE); - subtype.add(SubType.HUMAN); - subtype.add(SubType.SOLDIER); - power = new MageInt(4); - toughness = new MageInt(4); - this.addAbility(IndestructibleAbility.getInstance()); - } - - private GideonBlackbladeToken(final GideonBlackbladeToken token) { - super(token); - } - - @Override - public GideonBlackbladeToken copy() { - return new GideonBlackbladeToken(this); - } -} diff --git a/Mage.Sets/src/mage/cards/g/GideonChampionOfJustice.java b/Mage.Sets/src/mage/cards/g/GideonChampionOfJustice.java index caf04273eb01..40305508fe7e 100644 --- a/Mage.Sets/src/mage/cards/g/GideonChampionOfJustice.java +++ b/Mage.Sets/src/mage/cards/g/GideonChampionOfJustice.java @@ -1,6 +1,5 @@ package mage.cards.g; -import mage.MageInt; import mage.MageObjectReference; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; @@ -21,7 +20,7 @@ import mage.filter.StaticFilters; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; -import mage.game.permanent.token.TokenImpl; +import mage.game.permanent.token.custom.CreatureToken; import mage.players.Player; import mage.target.common.TargetOpponent; @@ -42,15 +41,25 @@ public GideonChampionOfJustice(UUID ownerId, CardSetInfo setInfo) { // +1: Put a loyalty counter on Gideon, Champion of Justice for each creature target opponent controls. LoyaltyAbility ability1 = new LoyaltyAbility( - new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(0), new PermanentsTargetOpponentControlsCount(new FilterCreaturePermanent()), true), 1); + new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(0), new PermanentsTargetOpponentControlsCount(new FilterCreaturePermanent()), true), 1); ability1.addTarget(new TargetOpponent()); this.addAbility(ability1); // 0: Until end of turn, Gideon becomes an indestructible Human Soldier creature with power and toughness each equal to the number of loyalty counters on him. He's still a planeswalker. Prevent all damage that would be dealt to him this turn. LockedInDynamicValue loyaltyCount = new LockedInDynamicValue(new CountersSourceCount(CounterType.LOYALTY)); - LoyaltyAbility ability2 = new LoyaltyAbility(new BecomesCreatureSourceEffect( - new GideonChampionOfJusticeToken(), CardType.PLANESWALKER, Duration.EndOfTurn).withDynamicPT(loyaltyCount, loyaltyCount) - .setText("Until end of turn, {this} becomes a Human Soldier creature with power and toughness each equal to the number of loyalty counters on him and gains indestructible. He's still a planeswalker."), 0); + LoyaltyAbility ability2 = new LoyaltyAbility( + new BecomesCreatureSourceEffect( + new CreatureToken( + 0, 0, + "indestructible Human Soldier creature with power and toughness each equal to the number of loyalty counters on him", + SubType.HUMAN, SubType.SOLDIER + ).withAbility(IndestructibleAbility.getInstance()), + CardType.PLANESWALKER, + Duration.EndOfTurn + ).withDynamicPT(loyaltyCount, loyaltyCount) + .setText("Until end of turn, {this} becomes a Human Soldier creature with power and toughness each equal to the number of loyalty counters on him and gains indestructible. He's still a planeswalker."), + 0 + ); ability2.addEffect(new PreventAllDamageToSourceEffect(Duration.EndOfTurn).setText("prevent all damage that would be dealt to him this turn")); this.addAbility(ability2); @@ -93,36 +102,13 @@ public boolean apply(Game game, Ability source) { MageObjectReference mor = new MageObjectReference(source.getSourceObject(game), game); Cards cards = new CardsImpl(); game.getBattlefield() - .getActivePermanents( - StaticFilters.FILTER_PERMANENT, - source.getControllerId(), game - ).stream() - .filter(Objects::nonNull) - .filter(permanent -> !mor.refersTo(permanent, game)) - .forEach(cards::add); + .getActivePermanents( + StaticFilters.FILTER_PERMANENT, + source.getControllerId(), game + ).stream() + .filter(Objects::nonNull) + .filter(permanent -> !mor.refersTo(permanent, game)) + .forEach(cards::add); return player.moveCards(cards, Zone.EXILED, source, game); } } - -class GideonChampionOfJusticeToken extends TokenImpl { - - GideonChampionOfJusticeToken() { - super("", "indestructible Human Soldier creature with power and toughness each equal to the number of loyalty counters on him"); - cardType.add(CardType.CREATURE); - subtype.add(SubType.HUMAN); - subtype.add(SubType.SOLDIER); - power = new MageInt(0); - toughness = new MageInt(0); - - this.addAbility(IndestructibleAbility.getInstance()); - - } - - private GideonChampionOfJusticeToken(final GideonChampionOfJusticeToken token) { - super(token); - } - - public GideonChampionOfJusticeToken copy() { - return new GideonChampionOfJusticeToken(this); - } -} diff --git a/Mage.Sets/src/mage/cards/g/GideonJura.java b/Mage.Sets/src/mage/cards/g/GideonJura.java index b679e7c06f0b..5da83ae8c1f2 100644 --- a/Mage.Sets/src/mage/cards/g/GideonJura.java +++ b/Mage.Sets/src/mage/cards/g/GideonJura.java @@ -1,6 +1,5 @@ package mage.cards.g; -import mage.MageInt; import mage.MageObjectReference; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; @@ -16,9 +15,8 @@ import mage.filter.predicate.permanent.TappedPredicate; import mage.game.Game; import mage.game.permanent.Permanent; -import mage.game.permanent.token.TokenImpl; +import mage.game.permanent.token.custom.CreatureToken; import mage.target.TargetPermanent; -import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetOpponent; import java.util.UUID; @@ -52,9 +50,12 @@ public GideonJura(UUID ownerId, CardSetInfo setInfo) { this.addAbility(ability2); // 0: Until end of turn, Gideon Jura becomes a 6/6 Human Soldier creature that's still a planeswalker. Prevent all damage that would be dealt to him this turn. - LoyaltyAbility ability3 = new LoyaltyAbility(new BecomesCreatureSourceEffect(new GideonJuraToken(), CardType.PLANESWALKER, Duration.EndOfTurn), 0); - Effect effect = new PreventAllDamageToSourceEffect(Duration.EndOfTurn); - effect.setText("Prevent all damage that would be dealt to him this turn"); + LoyaltyAbility ability3 = new LoyaltyAbility(new BecomesCreatureSourceEffect( + new CreatureToken(6, 6, "6/6 Human Soldier creature", SubType.HUMAN, SubType.SOLDIER), + CardType.PLANESWALKER, + Duration.EndOfTurn + ), 0); + Effect effect = new PreventAllDamageToSourceEffect(Duration.EndOfTurn).setText("Prevent all damage that would be dealt to him this turn"); ability3.addEffect(effect); this.addAbility(ability3); } @@ -70,27 +71,6 @@ public GideonJura copy() { } -class GideonJuraToken extends TokenImpl { - - public GideonJuraToken() { - super("", "6/6 Human Soldier creature"); - cardType.add(CardType.CREATURE); - subtype.add(SubType.HUMAN); - subtype.add(SubType.SOLDIER); - power = new MageInt(6); - toughness = new MageInt(6); - } - - private GideonJuraToken(final GideonJuraToken token) { - super(token); - } - - @Override - public GideonJuraToken copy() { - return new GideonJuraToken(this); - } -} - class GideonJuraEffect extends RequirementEffect { protected MageObjectReference creatingPermanent; diff --git a/Mage.Sets/src/mage/cards/g/GideonMartialParagon.java b/Mage.Sets/src/mage/cards/g/GideonMartialParagon.java index ee10c321e5b7..50288b25ad80 100644 --- a/Mage.Sets/src/mage/cards/g/GideonMartialParagon.java +++ b/Mage.Sets/src/mage/cards/g/GideonMartialParagon.java @@ -1,7 +1,6 @@ package mage.cards.g; import java.util.UUID; -import mage.MageInt; import mage.abilities.LoyaltyAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.PreventAllDamageToSourceEffect; @@ -18,7 +17,7 @@ import mage.constants.SuperType; import mage.filter.StaticFilters; import mage.filter.common.FilterOpponentsCreaturePermanent; -import mage.game.permanent.token.TokenImpl; +import mage.game.permanent.token.custom.CreatureToken; /** * @@ -43,7 +42,12 @@ public GideonMartialParagon(UUID ownerId, CardSetInfo setInfo) { // 0: Until end of turn, Gideon, Martial Paragon, becomes a 5/5 Human Soldier creature with indestructible that's still a planeswalker. // Prevent all damage that would be dealt to him this turn. - ability = new LoyaltyAbility(new BecomesCreatureSourceEffect(new GideonMartialParagonToken(), CardType.PLANESWALKER, Duration.EndOfTurn), 0); + ability = new LoyaltyAbility(new BecomesCreatureSourceEffect( + new CreatureToken(5, 5, "5/5 Human Soldier creature with indestructible", SubType.HUMAN, SubType.SOLDIER) + .withAbility(IndestructibleAbility.getInstance()), + CardType.PLANESWALKER, + Duration.EndOfTurn + ), 0); effect = new PreventAllDamageToSourceEffect(Duration.EndOfTurn); effect.setText("Prevent all damage that would be dealt to him this turn"); ability.addEffect(effect); @@ -66,24 +70,3 @@ public GideonMartialParagon copy() { return new GideonMartialParagon(this); } } - -class GideonMartialParagonToken extends TokenImpl { - - public GideonMartialParagonToken() { - super("", "5/5 Human Soldier creature with indestructible"); - cardType.add(CardType.CREATURE); - subtype.add(SubType.HUMAN); - subtype.add(SubType.SOLDIER); - power = new MageInt(5); - toughness = new MageInt(5); - - addAbility(IndestructibleAbility.getInstance()); - } - private GideonMartialParagonToken(final GideonMartialParagonToken token) { - super(token); - } - - public GideonMartialParagonToken copy() { - return new GideonMartialParagonToken(this); - } -} diff --git a/Mage.Sets/src/mage/cards/g/GideonOfTheTrials.java b/Mage.Sets/src/mage/cards/g/GideonOfTheTrials.java index 9e94521681f4..8ba0a743651d 100644 --- a/Mage.Sets/src/mage/cards/g/GideonOfTheTrials.java +++ b/Mage.Sets/src/mage/cards/g/GideonOfTheTrials.java @@ -2,7 +2,6 @@ package mage.cards.g; import java.util.UUID; -import mage.MageInt; import mage.abilities.LoyaltyAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.GetEmblemEffect; @@ -17,7 +16,7 @@ import mage.constants.Duration; import mage.constants.SuperType; import mage.game.command.emblems.GideonOfTheTrialsEmblem; -import mage.game.permanent.token.TokenImpl; +import mage.game.permanent.token.custom.CreatureToken; import mage.target.TargetPermanent; /** @@ -42,7 +41,12 @@ public GideonOfTheTrials(UUID ownerId, CardSetInfo setInfo) { this.addAbility(ability); // 0: Until end of turn, Gideon of the Trials becomes a 4/4 Human Soldier creature with indestructible that's still a planeswalker. Prevent all damage that would be dealt to him this turn. - ability = new LoyaltyAbility(new BecomesCreatureSourceEffect(new GideonOfTheTrialsToken(), CardType.PLANESWALKER, Duration.EndOfTurn), 0); + ability = new LoyaltyAbility(new BecomesCreatureSourceEffect( + new CreatureToken(4, 4, "4/4 Human Soldier creature with indestructible", SubType.HUMAN, SubType.SOLDIER) + .withAbility(IndestructibleAbility.getInstance()), + CardType.PLANESWALKER, + Duration.EndOfTurn + ), 0); effect = new PreventAllDamageToSourceEffect(Duration.EndOfTurn); effect.setText("Prevent all damage that would be dealt to him this turn"); ability.addEffect(effect); @@ -50,7 +54,6 @@ public GideonOfTheTrials(UUID ownerId, CardSetInfo setInfo) { // 0: You get an emblem with "As long as you control a Gideon planeswalker, you can't lose the game and your opponent can't win the game." this.addAbility(new LoyaltyAbility(new GetEmblemEffect(new GideonOfTheTrialsEmblem()), 0)); - } private GideonOfTheTrials(final GideonOfTheTrials card) { @@ -62,23 +65,3 @@ public GideonOfTheTrials copy() { return new GideonOfTheTrials(this); } } - -class GideonOfTheTrialsToken extends TokenImpl { - - public GideonOfTheTrialsToken() { - super("", "4/4 Human Soldier creature with indestructible"); - cardType.add(CardType.CREATURE); - subtype.add(SubType.HUMAN); - subtype.add(SubType.SOLDIER); - power = new MageInt(4); - toughness = new MageInt(4); - this.addAbility(IndestructibleAbility.getInstance()); - } - private GideonOfTheTrialsToken(final GideonOfTheTrialsToken token) { - super(token); - } - - public GideonOfTheTrialsToken copy() { - return new GideonOfTheTrialsToken(this); - } -} diff --git a/Mage.Sets/src/mage/cards/g/GideonTheOathsworn.java b/Mage.Sets/src/mage/cards/g/GideonTheOathsworn.java index 4c5f347d4dbc..78381f206cc1 100644 --- a/Mage.Sets/src/mage/cards/g/GideonTheOathsworn.java +++ b/Mage.Sets/src/mage/cards/g/GideonTheOathsworn.java @@ -1,6 +1,5 @@ package mage.cards.g; -import mage.MageInt; import mage.MageObjectReference; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; @@ -18,7 +17,7 @@ import mage.game.Game; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; -import mage.game.permanent.token.TokenImpl; +import mage.game.permanent.token.custom.CreatureToken; import java.util.HashSet; import java.util.Set; @@ -41,7 +40,7 @@ public GideonTheOathsworn(UUID ownerId, CardSetInfo setInfo) { // +2: Until end of turn, Gideon, the Oathsworn becomes a 5/5 white Soldier creature that's still a planeswalker. Prevent all damage that would be dealt to him this turn. Ability ability = new LoyaltyAbility(new BecomesCreatureSourceEffect( - new GideonTheOathswornToken(), CardType.PLANESWALKER, Duration.EndOfTurn + new CreatureToken(5, 5, "5/5 white Soldier creature", SubType.SOLDIER).withColor("W"), CardType.PLANESWALKER, Duration.EndOfTurn ), 2); ability.addEffect(new PreventAllDamageToSourceEffect( Duration.EndOfTurn @@ -50,9 +49,8 @@ public GideonTheOathsworn(UUID ownerId, CardSetInfo setInfo) { // -9: Exile Gideon, the Oathsworn and each creature your opponents control. ability = new LoyaltyAbility(new ExileSourceEffect(), -9); - ability.addEffect(new ExileAllEffect( - StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURE - ).setText("and each creature your opponents control")); + ability.addEffect(new ExileAllEffect(StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURE) + .setText("and each creature your opponents control")); this.addAbility(ability); } @@ -144,23 +142,3 @@ public boolean apply(Game game, Ability source) { return true; } } - -class GideonTheOathswornToken extends TokenImpl { - - GideonTheOathswornToken() { - super("", "5/5 white Soldier creature"); - cardType.add(CardType.CREATURE); - subtype.add(SubType.SOLDIER); - power = new MageInt(5); - toughness = new MageInt(5); - } - - private GideonTheOathswornToken(final GideonTheOathswornToken token) { - super(token); - } - - @Override - public GideonTheOathswornToken copy() { - return new GideonTheOathswornToken(this); - } -} diff --git a/Mage.Sets/src/mage/cards/g/GlintHawkIdol.java b/Mage.Sets/src/mage/cards/g/GlintHawkIdol.java index 38a1dc6cc9f2..32daa1a566f0 100644 --- a/Mage.Sets/src/mage/cards/g/GlintHawkIdol.java +++ b/Mage.Sets/src/mage/cards/g/GlintHawkIdol.java @@ -3,7 +3,6 @@ package mage.cards.g; import java.util.UUID; -import mage.MageInt; import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ColoredManaCost; @@ -15,7 +14,7 @@ import mage.filter.FilterPermanent; import mage.filter.common.FilterArtifactPermanent; import mage.filter.predicate.mageobject.AnotherPredicate; -import mage.game.permanent.token.TokenImpl; +import mage.game.permanent.token.custom.CreatureToken; /** * @@ -31,13 +30,32 @@ public final class GlintHawkIdol extends CardImpl { public GlintHawkIdol (UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}"); - + // Whenever another artifact you control enters, you may have {this} become a 2/2 Bird artifact creature with flying until end of turn. this.addAbility(new EntersBattlefieldControlledTriggeredAbility( - Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new GlintHawkIdolToken(), CardType.ARTIFACT, Duration.EndOfTurn), filter, true)); + Zone.BATTLEFIELD, + new BecomesCreatureSourceEffect( + new CreatureToken( + 2, 2, "2/2 Bird artifact creature with flying", SubType.BIRD + ).withType(CardType.ARTIFACT).withAbility(FlyingAbility.getInstance()), + CardType.ARTIFACT, + Duration.EndOfTurn + ), + filter, + true + )); // {W}: Glint Hawk Idol becomes a 2/2 Bird artifact creature with flying until end of turn. - this.addAbility(new SimpleActivatedAbility(new BecomesCreatureSourceEffect(new GlintHawkIdolToken(), CardType.ARTIFACT, Duration.EndOfTurn), new ColoredManaCost(ColoredManaSymbol.W))); + this.addAbility(new SimpleActivatedAbility( + new BecomesCreatureSourceEffect( + new CreatureToken( + 2, 2, "2/2 Bird artifact creature with flying", SubType.BIRD + ).withType(CardType.ARTIFACT).withAbility(FlyingAbility.getInstance()), + CardType.ARTIFACT, + Duration.EndOfTurn + ), + new ColoredManaCost(ColoredManaSymbol.W) + )); } private GlintHawkIdol(final GlintHawkIdol card) { @@ -50,22 +68,3 @@ public GlintHawkIdol copy() { } } - -class GlintHawkIdolToken extends TokenImpl { - GlintHawkIdolToken() { - super("", "2/2 Bird artifact creature with flying"); - cardType.add(CardType.ARTIFACT); - cardType.add(CardType.CREATURE); - subtype.add(SubType.BIRD); - power = new MageInt(2); - toughness = new MageInt(2); - addAbility(FlyingAbility.getInstance()); - } - private GlintHawkIdolToken(final GlintHawkIdolToken token) { - super(token); - } - - public GlintHawkIdolToken copy() { - return new GlintHawkIdolToken(this); - } -} diff --git a/Mage.Sets/src/mage/cards/g/GolgariKeyrune.java b/Mage.Sets/src/mage/cards/g/GolgariKeyrune.java index d68d3085bc31..d4cabc8b5d86 100644 --- a/Mage.Sets/src/mage/cards/g/GolgariKeyrune.java +++ b/Mage.Sets/src/mage/cards/g/GolgariKeyrune.java @@ -2,7 +2,6 @@ package mage.cards.g; import java.util.UUID; -import mage.MageInt; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect; @@ -14,8 +13,7 @@ import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Duration; -import mage.constants.Zone; -import mage.game.permanent.token.TokenImpl; +import mage.game.permanent.token.custom.CreatureToken; /** * @author LevelX2 @@ -30,7 +28,15 @@ public GolgariKeyrune(UUID ownerId, CardSetInfo setInfo) { this.addAbility(new GreenManaAbility()); // {B}{G}: Golgari Keyrune becomes a 2/2 black and green Insect artifact creature with deathtouch until end of turn. - this.addAbility(new SimpleActivatedAbility(new BecomesCreatureSourceEffect(new GolgariKeyruneToken(), CardType.ARTIFACT, Duration.EndOfTurn), new ManaCostsImpl<>("{B}{G}"))); + this.addAbility(new SimpleActivatedAbility( + new BecomesCreatureSourceEffect( + new CreatureToken(2, 2, "2/2 black and green Insect artifact creature with deathtouch", SubType.INSECT) + .withColor("BG").withType(CardType.ARTIFACT).withAbility(DeathtouchAbility.getInstance()), + CardType.ARTIFACT, + Duration.EndOfTurn + ), + new ManaCostsImpl<>("{B}{G}") + )); } private GolgariKeyrune(final GolgariKeyrune card) { @@ -41,25 +47,4 @@ private GolgariKeyrune(final GolgariKeyrune card) { public GolgariKeyrune copy() { return new GolgariKeyrune(this); } - - private static class GolgariKeyruneToken extends TokenImpl { - GolgariKeyruneToken() { - super("", "2/2 black and green Insect artifact creature with deathtouch"); - cardType.add(CardType.ARTIFACT); - cardType.add(CardType.CREATURE); - color.setGreen(true); - color.setBlack(true); - this.subtype.add(SubType.INSECT); - power = new MageInt(2); - toughness = new MageInt(2); - this.addAbility(DeathtouchAbility.getInstance()); - } - private GolgariKeyruneToken(final GolgariKeyruneToken token) { - super(token); - } - - public GolgariKeyruneToken copy() { - return new GolgariKeyruneToken(this); - } - } } diff --git a/Mage.Sets/src/mage/cards/g/GruulKeyrune.java b/Mage.Sets/src/mage/cards/g/GruulKeyrune.java index 2e440518a8a2..545c6d944eab 100644 --- a/Mage.Sets/src/mage/cards/g/GruulKeyrune.java +++ b/Mage.Sets/src/mage/cards/g/GruulKeyrune.java @@ -2,7 +2,6 @@ package mage.cards.g; import java.util.UUID; -import mage.MageInt; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect; @@ -14,8 +13,7 @@ import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Duration; -import mage.constants.Zone; -import mage.game.permanent.token.TokenImpl; +import mage.game.permanent.token.custom.CreatureToken; /** * @@ -31,7 +29,15 @@ public GruulKeyrune(UUID ownerId, CardSetInfo setInfo) { this.addAbility(new GreenManaAbility()); // {R}{G}: Gruul Keyrune becomes a 3/2 red and green Beast artifact creature with trample until end of turn. - this.addAbility(new SimpleActivatedAbility(new BecomesCreatureSourceEffect(new GruulKeyruneToken(), CardType.ARTIFACT, Duration.EndOfTurn), new ManaCostsImpl<>("{R}{G}"))); + this.addAbility(new SimpleActivatedAbility( + new BecomesCreatureSourceEffect( + new CreatureToken(3, 2, "3/2 red and green Beast artifact creature with trample", SubType.BEAST) + .withColor("RG").withType(CardType.ARTIFACT).withAbility(TrampleAbility.getInstance()), + CardType.ARTIFACT, + Duration.EndOfTurn + ), + new ManaCostsImpl<>("{R}{G}") + )); } private GruulKeyrune(final GruulKeyrune card) { @@ -42,26 +48,4 @@ private GruulKeyrune(final GruulKeyrune card) { public GruulKeyrune copy() { return new GruulKeyrune(this); } - - private static class GruulKeyruneToken extends TokenImpl { - GruulKeyruneToken() { - super("Beast", "3/2 red and green Beast artifact creature with trample"); - cardType.add(CardType.ARTIFACT); - cardType.add(CardType.CREATURE); - color.setRed(true); - color.setGreen(true); - subtype.add(SubType.BEAST); - power = new MageInt(3); - toughness = new MageInt(2); - this.addAbility(TrampleAbility.getInstance()); - } - private GruulKeyruneToken(final GruulKeyruneToken token) { - super(token); - } - - public GruulKeyruneToken copy() { - return new GruulKeyruneToken(this); - } - - } } diff --git a/Mage.Sets/src/mage/cards/g/GruulWarPlow.java b/Mage.Sets/src/mage/cards/g/GruulWarPlow.java index 13193e46909d..06264ef8b4ec 100644 --- a/Mage.Sets/src/mage/cards/g/GruulWarPlow.java +++ b/Mage.Sets/src/mage/cards/g/GruulWarPlow.java @@ -1,8 +1,7 @@ - + package mage.cards.g; import java.util.UUID; -import mage.MageInt; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.ManaCostsImpl; @@ -14,9 +13,8 @@ import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Duration; -import mage.constants.Zone; import mage.filter.StaticFilters; -import mage.game.permanent.token.TokenImpl; +import mage.game.permanent.token.custom.CreatureToken; /** * @author Loki @@ -30,7 +28,15 @@ public GruulWarPlow(UUID ownerId, CardSetInfo setInfo) { this.addAbility(new SimpleStaticAbility(new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURES))); // {1}{R}{G}: Gruul War Plow becomes a 4/4 Juggernaut artifact creature until end of turn. - this.addAbility(new SimpleActivatedAbility(new BecomesCreatureSourceEffect(new GruulWarPlowToken(), CardType.ARTIFACT, Duration.EndOfTurn), new ManaCostsImpl<>("{1}{R}{G}"))); + this.addAbility(new SimpleActivatedAbility( + new BecomesCreatureSourceEffect( + new CreatureToken(4, 4, "4/4 Juggernaut artifact creature", SubType.JUGGERNAUT) + .withType(CardType.ARTIFACT), + CardType.ARTIFACT, + Duration.EndOfTurn + ), + new ManaCostsImpl<>("{1}{R}{G}") + )); } private GruulWarPlow(final GruulWarPlow card) { @@ -42,22 +48,3 @@ public GruulWarPlow copy() { return new GruulWarPlow(this); } } - -class GruulWarPlowToken extends TokenImpl { - - GruulWarPlowToken() { - super("Juggernaut", "4/4 Juggernaut artifact creature"); - cardType.add(CardType.ARTIFACT); - cardType.add(CardType.CREATURE); - subtype.add(SubType.JUGGERNAUT); - power = new MageInt(4); - toughness = new MageInt(4); - } - private GruulWarPlowToken(final GruulWarPlowToken token) { - super(token); - } - - public GruulWarPlowToken copy() { - return new GruulWarPlowToken(this); - } -} diff --git a/Mage.Sets/src/mage/cards/g/GuardianIdol.java b/Mage.Sets/src/mage/cards/g/GuardianIdol.java index 5bd1ef5e9861..f1fd6d074543 100644 --- a/Mage.Sets/src/mage/cards/g/GuardianIdol.java +++ b/Mage.Sets/src/mage/cards/g/GuardianIdol.java @@ -2,7 +2,6 @@ package mage.cards.g; import java.util.UUID; -import mage.MageInt; import mage.abilities.common.EntersBattlefieldTappedAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; @@ -13,8 +12,7 @@ import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Duration; -import mage.constants.Zone; -import mage.game.permanent.token.TokenImpl; +import mage.game.permanent.token.custom.CreatureToken; /** * @@ -30,7 +28,14 @@ public GuardianIdol(UUID ownerId, CardSetInfo setInfo) { // {tap}: Add {C}. this.addAbility(new ColorlessManaAbility()); // {2}: Guardian Idol becomes a 2/2 Golem artifact creature until end of turn. - this.addAbility(new SimpleActivatedAbility(new BecomesCreatureSourceEffect(new GuardianIdolGolemToken(), CardType.ARTIFACT, Duration.EndOfTurn), new ManaCostsImpl<>("{2}"))); + this.addAbility(new SimpleActivatedAbility( + new BecomesCreatureSourceEffect( + new CreatureToken(2, 2, "2/2 Golem artifact creature", SubType.GOLEM).withType(CardType.ARTIFACT), + CardType.ARTIFACT, + Duration.EndOfTurn + ), + new ManaCostsImpl<>("{2}") + )); } private GuardianIdol(final GuardianIdol card) { @@ -42,22 +47,3 @@ public GuardianIdol copy() { return new GuardianIdol(this); } } - -class GuardianIdolGolemToken extends TokenImpl { - - public GuardianIdolGolemToken() { - super("Golem", "2/2 Golem artifact creature"); - cardType.add(CardType.ARTIFACT); - cardType.add(CardType.CREATURE); - subtype.add(SubType.GOLEM); - power = new MageInt(2); - toughness = new MageInt(2); - } - private GuardianIdolGolemToken(final GuardianIdolGolemToken token) { - super(token); - } - - public GuardianIdolGolemToken copy() { - return new GuardianIdolGolemToken(this); - } -} diff --git a/Mage.Sets/src/mage/cards/g/GuardianZendikon.java b/Mage.Sets/src/mage/cards/g/GuardianZendikon.java index 2cf68154ce97..a01301d6c7ee 100644 --- a/Mage.Sets/src/mage/cards/g/GuardianZendikon.java +++ b/Mage.Sets/src/mage/cards/g/GuardianZendikon.java @@ -2,8 +2,6 @@ package mage.cards.g; import java.util.UUID; -import mage.MageInt; -import mage.abilities.Ability; import mage.abilities.common.DiesAttachedTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.AttachEffect; @@ -17,8 +15,7 @@ import mage.constants.SubType; import mage.constants.Duration; import mage.constants.Outcome; -import mage.constants.Zone; -import mage.game.permanent.token.TokenImpl; +import mage.game.permanent.token.custom.CreatureToken; import mage.target.TargetPermanent; import mage.target.common.TargetLandPermanent; @@ -32,23 +29,23 @@ public GuardianZendikon(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{W}"); this.subtype.add(SubType.AURA); - // Enchant land // Enchanted land is a 2/6 white Wall creature with defender. It's still a land. // When enchanted land dies, return that card to its owner's hand. - TargetPermanent auraTarget = new TargetLandPermanent(); this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Outcome.PutCreatureInPlay)); - Ability ability = new EnchantAbility(auraTarget); - this.addAbility(ability); + this.addAbility(new EnchantAbility(auraTarget)); - Ability ability2 = new SimpleStaticAbility(new BecomesCreatureAttachedEffect( - new GuardianZendikonWallToken(), "Enchanted land is a 2/6 white Wall creature with defender. It's still a land", Duration.WhileOnBattlefield, BecomesCreatureAttachedEffect.LoseType.COLOR)); - this.addAbility(ability2); + this.addAbility(new SimpleStaticAbility(new BecomesCreatureAttachedEffect( + new CreatureToken(2, 6, "2/6 white Wall creature with defender", SubType.WALL).withColor("W") + .withAbility(DefenderAbility.getInstance()), + "Enchanted land is a 2/6 white Wall creature with defender. It's still a land", + Duration.WhileOnBattlefield, + BecomesCreatureAttachedEffect.LoseType.COLOR + ))); - Ability ability3 = new DiesAttachedTriggeredAbility(new ReturnToHandAttachedEffect(), "enchanted land", false); - this.addAbility(ability3); + this.addAbility(new DiesAttachedTriggeredAbility(new ReturnToHandAttachedEffect(), "enchanted land", false)); } private GuardianZendikon(final GuardianZendikon card) { @@ -60,23 +57,3 @@ public GuardianZendikon copy() { return new GuardianZendikon(this); } } - -class GuardianZendikonWallToken extends TokenImpl { - - GuardianZendikonWallToken() { - super("", "2/6 white Wall creature with defender"); - cardType.add(CardType.CREATURE); - color.setWhite(true); - subtype.add(SubType.WALL); - power = new MageInt(2); - toughness = new MageInt(6); - this.addAbility(DefenderAbility.getInstance()); - } - private GuardianZendikonWallToken(final GuardianZendikonWallToken token) { - super(token); - } - - public GuardianZendikonWallToken copy() { - return new GuardianZendikonWallToken(this); - } -} diff --git a/Mage.Sets/src/mage/cards/w/WardenOfTheWall.java b/Mage.Sets/src/mage/cards/w/WardenOfTheWall.java index 63549eed066e..e2a662f3eb82 100644 --- a/Mage.Sets/src/mage/cards/w/WardenOfTheWall.java +++ b/Mage.Sets/src/mage/cards/w/WardenOfTheWall.java @@ -1,6 +1,5 @@ package mage.cards.w; -import mage.MageInt; import mage.abilities.common.EntersBattlefieldTappedAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.NotMyTurnCondition; @@ -14,7 +13,7 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.SubType; -import mage.game.permanent.token.TokenImpl; +import mage.game.permanent.token.custom.CreatureToken; import java.util.UUID; @@ -29,15 +28,21 @@ public WardenOfTheWall(UUID ownerId, CardSetInfo setInfo) { // Warden of the Wall enters the battlefield tapped. this.addAbility(new EntersBattlefieldTappedAbility()); - // {tap}: Add {C}. + // {T}: Add {C}. this.addAbility(new ColorlessManaAbility()); // As long as it's not your turn, Warden of the Wall is a 2/3 Gargoyle artifact creature with flying. this.addAbility(new SimpleStaticAbility(new ConditionalContinuousEffect( - new BecomesCreatureSourceEffect(new GargoyleToken(), CardType.ARTIFACT, Duration.WhileOnBattlefield), - NotMyTurnCondition.instance, - "During turns other than yours, {this} is a 2/3 Gargoyle artifact creature with flying")) - .addHint(NotMyTurnHint.instance)); + new BecomesCreatureSourceEffect( + new CreatureToken( + 2, 3, "2/3 Gargoyle artifact creature with flying", SubType.GARGOYLE + ).withType(CardType.ARTIFACT).withAbility(FlyingAbility.getInstance()), + CardType.ARTIFACT, + Duration.WhileOnBattlefield + ), + NotMyTurnCondition.instance, + "During turns other than yours, {this} is a 2/3 Gargoyle artifact creature with flying" + )).addHint(NotMyTurnHint.instance)); } private WardenOfTheWall(final WardenOfTheWall card) { @@ -49,25 +54,3 @@ public WardenOfTheWall copy() { return new WardenOfTheWall(this); } } - -class GargoyleToken extends TokenImpl { - - public GargoyleToken() { - super("", "2/3 Gargoyle artifact creature with flying"); - cardType.add(CardType.ARTIFACT); - cardType.add(CardType.CREATURE); - subtype.add(SubType.GARGOYLE); - power = new MageInt(2); - toughness = new MageInt(3); - addAbility(FlyingAbility.getInstance()); - } - - private GargoyleToken(final GargoyleToken token) { - super(token); - } - - public GargoyleToken copy() { - return new GargoyleToken(this); - } - -}