From 54acb445db12390b0fae634382ca927a61687428 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Sat, 26 Sep 2015 11:18:15 +0300 Subject: [PATCH] Add Goblin token with haste and use it for existing cards. Add missing images for Goblin token. --- .../mage/sets/khansoftarkir/Goblinslide.java | 20 +-------- .../sets/magic2015/GoblinRabblemaster.java | 20 +-------- .../newphyrexia/ChancellorOfTheForge.java | 19 ++------ .../sets/shardsofalara/GoblinAssault.java | 20 +-------- .../game/permanent/token/GoblinToken.java | 3 +- .../permanent/token/GoblinTokenWithHaste.java | 45 +++++++++++++++++++ 6 files changed, 56 insertions(+), 71 deletions(-) create mode 100644 Mage/src/mage/game/permanent/token/GoblinTokenWithHaste.java diff --git a/Mage.Sets/src/mage/sets/khansoftarkir/Goblinslide.java b/Mage.Sets/src/mage/sets/khansoftarkir/Goblinslide.java index 1effee12c3..75db169ba2 100644 --- a/Mage.Sets/src/mage/sets/khansoftarkir/Goblinslide.java +++ b/Mage.Sets/src/mage/sets/khansoftarkir/Goblinslide.java @@ -28,7 +28,6 @@ package mage.sets.khansoftarkir; import java.util.UUID; -import mage.MageInt; import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.CreateTokenEffect; @@ -40,7 +39,7 @@ import mage.constants.Rarity; import mage.filter.FilterSpell; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.GoblinTokenWithHaste; /** * @@ -58,9 +57,8 @@ public class Goblinslide extends CardImpl { super(ownerId, 109, "Goblinslide", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}"); this.expansionSetCode = "KTK"; - // Whenever you cast a noncreature spell, you may pay {1}. If you do, put a 1/1 red Goblin creature token with haste onto the battlefield. - this.addAbility(new SpellCastControllerTriggeredAbility(new DoIfCostPaid(new CreateTokenEffect(new GoblinslideGoblinToken()), new GenericManaCost(1)), filter, false)); + this.addAbility(new SpellCastControllerTriggeredAbility(new DoIfCostPaid(new CreateTokenEffect(new GoblinTokenWithHaste()), new GenericManaCost(1)), filter, false)); } public Goblinslide(final Goblinslide card) { @@ -72,17 +70,3 @@ public class Goblinslide extends CardImpl { return new Goblinslide(this); } } - -class GoblinslideGoblinToken extends Token { - - GoblinslideGoblinToken() { - super("Goblin", "1/1 red Goblin creature token with haste"); - this.setOriginalExpansionSetCode("KTK"); - cardType.add(CardType.CREATURE); - subtype.add("Goblin"); - color.setRed(true); - power = new MageInt(1); - toughness = new MageInt(1); - addAbility(HasteAbility.getInstance()); - } -} diff --git a/Mage.Sets/src/mage/sets/magic2015/GoblinRabblemaster.java b/Mage.Sets/src/mage/sets/magic2015/GoblinRabblemaster.java index cf2df4c91f..44d241e528 100644 --- a/Mage.Sets/src/mage/sets/magic2015/GoblinRabblemaster.java +++ b/Mage.Sets/src/mage/sets/magic2015/GoblinRabblemaster.java @@ -38,7 +38,6 @@ import mage.abilities.effects.Effect; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.combat.AttacksIfAbleAllEffect; import mage.abilities.effects.common.continuous.BoostSourceEffect; -import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; @@ -49,7 +48,7 @@ import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.permanent.AnotherPredicate; import mage.filter.predicate.permanent.AttackingPredicate; import mage.filter.predicate.permanent.ControllerPredicate; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.GoblinTokenWithHaste; import mage.watchers.common.AttackedThisTurnWatcher; /** @@ -83,7 +82,7 @@ public class GoblinRabblemaster extends CardImpl { this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect), new AttackedThisTurnWatcher()); // At the beginning of combat on your turn, put a 1/1 red Goblin creature token with haste onto the battlefield. - this.addAbility(new BeginningOfCombatTriggeredAbility(new CreateTokenEffect(new GoblinToken()), TargetController.YOU, false)); + this.addAbility(new BeginningOfCombatTriggeredAbility(new CreateTokenEffect(new GoblinTokenWithHaste()), TargetController.YOU, false)); // When Goblin Rabblemaster attacks, it gets +1/+0 until end of turn for each other attacking Goblin. this.addAbility(new AttacksTriggeredAbility(new BoostSourceEffect(new PermanentsOnBattlefieldCount(attackingFilter), new StaticValue(0), Duration.EndOfTurn, true), false)); @@ -98,18 +97,3 @@ public class GoblinRabblemaster extends CardImpl { return new GoblinRabblemaster(this); } } - -class GoblinToken extends Token { - - public GoblinToken() { - super("Goblin", "1/1 red Goblin creature token with haste"); - this.setOriginalExpansionSetCode("M15"); - cardType.add(CardType.CREATURE); - subtype.add("Goblin"); - color.setRed(true); - power = new MageInt(1); - toughness = new MageInt(1); - addAbility(HasteAbility.getInstance()); - } - -} diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheForge.java b/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheForge.java index 581d267015..bda2d542c8 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheForge.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheForge.java @@ -35,7 +35,6 @@ import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.CreateTokenEffect; -import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; @@ -45,7 +44,7 @@ import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.GoblinTokenWithHaste; /** * @@ -73,7 +72,7 @@ public class ChancellorOfTheForge extends CardImpl { // When Chancellor of the Forge enters the battlefield, put X 1/1 red Goblin creature tokens with haste onto the battlefield, where X is the number of creatures you control. DynamicValue value = new PermanentsOnBattlefieldCount(filter); - this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new GoblinToken(), value), false)); + this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new GoblinTokenWithHaste(), value), false)); } public ChancellorOfTheForge(final ChancellorOfTheForge card) { @@ -89,7 +88,7 @@ public class ChancellorOfTheForge extends CardImpl { class ChancellorOfTheForgeDelayedTriggeredAbility extends DelayedTriggeredAbility { ChancellorOfTheForgeDelayedTriggeredAbility () { - super(new CreateTokenEffect(new GoblinToken())); + super(new CreateTokenEffect(new GoblinTokenWithHaste())); } ChancellorOfTheForgeDelayedTriggeredAbility(ChancellorOfTheForgeDelayedTriggeredAbility ability) { @@ -110,15 +109,3 @@ class ChancellorOfTheForgeDelayedTriggeredAbility extends DelayedTriggeredAbilit return new ChancellorOfTheForgeDelayedTriggeredAbility(this); } } - -class GoblinToken extends Token { - public GoblinToken() { - super("Goblin", "1/1 red Goblin creature token with haste"); - cardType.add(CardType.CREATURE); - color.setRed(true); - subtype.add("Goblin"); - power = new MageInt(1); - toughness = new MageInt(1); - addAbility(HasteAbility.getInstance()); - } -} diff --git a/Mage.Sets/src/mage/sets/shardsofalara/GoblinAssault.java b/Mage.Sets/src/mage/sets/shardsofalara/GoblinAssault.java index 7877a087dc..9cd15845e5 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/GoblinAssault.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/GoblinAssault.java @@ -28,12 +28,10 @@ package mage.sets.shardsofalara; import java.util.UUID; -import mage.MageInt; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.combat.AttacksIfAbleAllEffect; -import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; @@ -42,7 +40,7 @@ import mage.constants.TargetController; import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.SubtypePredicate; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.GoblinTokenWithHaste; import mage.watchers.common.AttackedThisTurnWatcher; /** @@ -62,7 +60,7 @@ public class GoblinAssault extends CardImpl { this.expansionSetCode = "ALA"; // At the beginning of your upkeep, put a 1/1 red Goblin creature token with haste onto the battlefield. - this.addAbility(new BeginningOfUpkeepTriggeredAbility(new CreateTokenEffect(new GoblinAssaultToken()), TargetController.YOU, false)); + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new CreateTokenEffect(new GoblinTokenWithHaste()), TargetController.YOU, false)); // Goblin creatures attack each turn if able. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AttacksIfAbleAllEffect(filter, Duration.WhileOnBattlefield)), new AttackedThisTurnWatcher()); @@ -77,17 +75,3 @@ public class GoblinAssault extends CardImpl { return new GoblinAssault(this); } } - -class GoblinAssaultToken extends Token { - - public GoblinAssaultToken() { - super("Goblin", "1/1 red Goblin creature token with haste"); - cardType.add(CardType.CREATURE); - subtype.add("Goblin"); - - color.setRed(true); - power = new MageInt(1); - toughness = new MageInt(1); - this.addAbility(HasteAbility.getInstance()); - } -} diff --git a/Mage/src/mage/game/permanent/token/GoblinToken.java b/Mage/src/mage/game/permanent/token/GoblinToken.java index 7b2dfd151f..798fdae0f8 100644 --- a/Mage/src/mage/game/permanent/token/GoblinToken.java +++ b/Mage/src/mage/game/permanent/token/GoblinToken.java @@ -39,7 +39,8 @@ public class GoblinToken extends Token { public GoblinToken() { super("Goblin", "1/1 red Goblin creature token"); - availableImageSetCodes.addAll(Arrays.asList("SOM", "M10", "C14", "KTK", "EVG", "DTK", "ORI", "DDG")); + availableImageSetCodes.addAll(Arrays.asList("10E", "ALA", "SOM", "M10", "NPH", "M13", "RTR", + "MMA", "M15", "C14", "KTK", "EVG", "DTK", "ORI", "DDG", "DDN")); cardType.add(CardType.CREATURE); subtype.add("Goblin"); diff --git a/Mage/src/mage/game/permanent/token/GoblinTokenWithHaste.java b/Mage/src/mage/game/permanent/token/GoblinTokenWithHaste.java new file mode 100644 index 0000000000..2e77c7a344 --- /dev/null +++ b/Mage/src/mage/game/permanent/token/GoblinTokenWithHaste.java @@ -0,0 +1,45 @@ +/* +* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. +* +* Redistribution and use in source and binary forms, with or without modification, are +* permitted provided that the following conditions are met: +* +* 1. Redistributions of source code must retain the above copyright notice, this list of +* conditions and the following disclaimer. +* +* 2. Redistributions in binary form must reproduce the above copyright notice, this list +* of conditions and the following disclaimer in the documentation and/or other materials +* provided with the distribution. +* +* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED +* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR +* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +* The views and conclusions contained in the software and documentation are those of the +* authors and should not be interpreted as representing official policies, either expressed +* or implied, of BetaSteward_at_googlemail.com. +*/ + +package mage.game.permanent.token; + +import mage.abilities.keyword.HasteAbility; + +/** + * + * @author LoneFox + */ + +// Currently there are no separate images for this, let's use the same ones as the regular Goblin token. +public class GoblinTokenWithHaste extends GoblinToken { + + public GoblinTokenWithHaste() { + super(); + addAbility(HasteAbility.getInstance()); + } +}