From 5fdd1aae495f96054791ee4b8eba032527799b2d Mon Sep 17 00:00:00 2001 From: LoneFox Date: Wed, 23 Sep 2015 12:34:28 +0300 Subject: [PATCH] Add Sliver token and use it for existing cards --- .../src/mage/sets/legions/BroodSliver.java | 20 ++------ .../mage/sets/magic2014/HiveStirrings.java | 15 +----- .../src/mage/sets/magic2015/SliverHive.java | 14 +----- .../src/mage/sets/stronghold/SliverQueen.java | 13 +---- .../game/permanent/token/SliverToken.java | 49 +++++++++++++++++++ 5 files changed, 56 insertions(+), 55 deletions(-) create mode 100644 Mage/src/mage/game/permanent/token/SliverToken.java diff --git a/Mage.Sets/src/mage/sets/legions/BroodSliver.java b/Mage.Sets/src/mage/sets/legions/BroodSliver.java index 48e856b3b7..86ea9e7ec7 100644 --- a/Mage.Sets/src/mage/sets/legions/BroodSliver.java +++ b/Mage.Sets/src/mage/sets/legions/BroodSliver.java @@ -37,7 +37,7 @@ import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.SetTargetPointer; import mage.filter.common.FilterCreaturePermanent; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.SliverToken; /** * @@ -53,12 +53,11 @@ public class BroodSliver extends CardImpl { this.power = new MageInt(3); this.toughness = new MageInt(3); - // Whenever a Sliver deals combat damage to a player, its controller may put a 1/1 colorless Sliver creature token onto the battlefield. + // Whenever a Sliver deals combat damage to a player, its controller may put a 1/1 colorless Sliver creature token onto the battlefield. Effect effect = new CreateTokenTargetEffect(new SliverToken()); effect.setText("its controller may put a 1/1 colorless Sliver creature token onto the battlefield"); - this.addAbility(new DealsDamageToAPlayerAllTriggeredAbility(effect, - new FilterCreaturePermanent("Sliver", "a Sliver"), - true, SetTargetPointer.PLAYER, true)); + this.addAbility(new DealsDamageToAPlayerAllTriggeredAbility(effect, + new FilterCreaturePermanent("Sliver", "a Sliver"), true, SetTargetPointer.PLAYER, true)); } public BroodSliver(final BroodSliver card) { @@ -70,14 +69,3 @@ public class BroodSliver extends CardImpl { return new BroodSliver(this); } } - -class SliverToken extends Token { - - public SliverToken() { - super("Sliver", "1/1 colorless Sliver creature token"); - cardType.add(CardType.CREATURE); - subtype.add("Sliver"); - power = new MageInt(1); - toughness = new MageInt(1); - } -} diff --git a/Mage.Sets/src/mage/sets/magic2014/HiveStirrings.java b/Mage.Sets/src/mage/sets/magic2014/HiveStirrings.java index 2d378cc516..9f9a6a6f02 100644 --- a/Mage.Sets/src/mage/sets/magic2014/HiveStirrings.java +++ b/Mage.Sets/src/mage/sets/magic2014/HiveStirrings.java @@ -28,12 +28,11 @@ package mage.sets.magic2014; import java.util.UUID; -import mage.MageInt; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.SliverToken; /** * @@ -45,10 +44,8 @@ public class HiveStirrings extends CardImpl { super(ownerId, 21, "Hive Stirrings", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{W}"); this.expansionSetCode = "M14"; - // Put two 1/1 colorless Sliver creature tokens onto the battlefield. this.getSpellAbility().addEffect(new CreateTokenEffect(new SliverToken(), 2)); - } public HiveStirrings(final HiveStirrings card) { @@ -60,13 +57,3 @@ public class HiveStirrings extends CardImpl { return new HiveStirrings(this); } } - -class SliverToken extends Token { - SliverToken() { - super("Sliver", "a 1/1 colorless Sliver creature token"); - cardType.add(CardType.CREATURE); - subtype.add("Sliver"); - power = new MageInt(1); - toughness = new MageInt(1); - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2015/SliverHive.java b/Mage.Sets/src/mage/sets/magic2015/SliverHive.java index f5c40cb43e..cfba0c9449 100644 --- a/Mage.Sets/src/mage/sets/magic2015/SliverHive.java +++ b/Mage.Sets/src/mage/sets/magic2015/SliverHive.java @@ -51,7 +51,7 @@ import mage.filter.FilterSpell; import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.SliverToken; /** * @@ -134,15 +134,3 @@ class SliverHiveManaCondition extends CreatureCastManaCondition { return false; } } - -class SliverToken extends Token { - - SliverToken() { - super("Sliver", "1/1 colorless Sliver creature token"); - setOriginalExpansionSetCode("M15"); - cardType.add(CardType.CREATURE); - subtype.add("Sliver"); - power = new MageInt(1); - toughness = new MageInt(1); - } -} diff --git a/Mage.Sets/src/mage/sets/stronghold/SliverQueen.java b/Mage.Sets/src/mage/sets/stronghold/SliverQueen.java index a7d7b7c727..c5218656fc 100644 --- a/Mage.Sets/src/mage/sets/stronghold/SliverQueen.java +++ b/Mage.Sets/src/mage/sets/stronghold/SliverQueen.java @@ -36,7 +36,7 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.Zone; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.SliverToken; /** * @@ -66,14 +66,3 @@ public class SliverQueen extends CardImpl { return new SliverQueen(this); } } - -class SliverToken extends Token { - - public SliverToken() { - super("Sliver", "1/1 colorless Sliver creature token"); - cardType.add(CardType.CREATURE); - subtype.add("Sliver"); - power = new MageInt(1); - toughness = new MageInt(1); - } -} \ No newline at end of file diff --git a/Mage/src/mage/game/permanent/token/SliverToken.java b/Mage/src/mage/game/permanent/token/SliverToken.java new file mode 100644 index 0000000000..38be6195be --- /dev/null +++ b/Mage/src/mage/game/permanent/token/SliverToken.java @@ -0,0 +1,49 @@ +/* +* 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 java.util.Arrays; +import mage.constants.CardType; +import mage.MageInt; + +/** + * + * @author LoneFox + */ +public class SliverToken extends Token { + + public SliverToken() { + super("Demon", "1/1 colorless Sliver creature token"); + cardType.add(CardType.CREATURE); + subtype.add("Sliver"); + power = new MageInt(1); + toughness = new MageInt(1); + availableImageSetCodes.addAll(Arrays.asList("M14", "M15")); + } +}