From c366f3ed61a925adbb248ee913f96065c49b03bc Mon Sep 17 00:00:00 2001 From: North Date: Wed, 21 Sep 2011 23:10:50 +0300 Subject: [PATCH] Added GoblinToken and refactored cards using it --- .../sets/magic2010/SiegeGangCommander.java | 13 +---- .../sets/scarsofmirrodin/KuldothaRebirth.java | 17 +------ .../game/permanent/token/GoblinToken.java | 49 +++++++++++++++++++ 3 files changed, 52 insertions(+), 27 deletions(-) create mode 100644 Mage/src/mage/game/permanent/token/GoblinToken.java diff --git a/Mage.Sets/src/mage/sets/magic2010/SiegeGangCommander.java b/Mage.Sets/src/mage/sets/magic2010/SiegeGangCommander.java index 051e1a1b1e0..66b610fd78e 100644 --- a/Mage.Sets/src/mage/sets/magic2010/SiegeGangCommander.java +++ b/Mage.Sets/src/mage/sets/magic2010/SiegeGangCommander.java @@ -43,7 +43,7 @@ import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; import mage.filter.Filter; import mage.filter.common.FilterControlledCreaturePermanent; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.GoblinToken; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreatureOrPlayer; @@ -83,14 +83,3 @@ public class SiegeGangCommander extends CardImpl { return new SiegeGangCommander(this); } } - -class GoblinToken extends Token { - public GoblinToken() { - super("Goblin", "1/1 red Goblin creature token"); - cardType.add(CardType.CREATURE); - color.setRed(true); - subtype.add("Goblin"); - power = new MageInt(1); - toughness = new MageInt(1); - } -} diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/KuldothaRebirth.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/KuldothaRebirth.java index 95b9e9468a1..9648c6ff3cb 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/KuldothaRebirth.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/KuldothaRebirth.java @@ -30,14 +30,12 @@ package mage.sets.scarsofmirrodin; import mage.Constants.CardType; import mage.Constants.Rarity; -import mage.MageInt; -import mage.ObjectColor; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.GoblinToken; import mage.target.common.TargetControlledPermanent; import java.util.UUID; @@ -47,7 +45,7 @@ import java.util.UUID; * @author Loki */ public class KuldothaRebirth extends CardImpl { - private static FilterControlledPermanent filter = new FilterControlledPermanent("an artifact"); + private static final FilterControlledPermanent filter = new FilterControlledPermanent("an artifact"); static { filter.getCardType().add(CardType.ARTIFACT); @@ -71,15 +69,4 @@ public class KuldothaRebirth extends CardImpl { return new KuldothaRebirth(this); } -} - -class GoblinToken extends Token { - public GoblinToken() { - super("Goblin", "1/1 red Goblin creature token"); - cardType.add(CardType.CREATURE); - color = ObjectColor.RED; - subtype.add("Goblin"); - power = new MageInt(1); - toughness = new MageInt(1); - } } \ No newline at end of file diff --git a/Mage/src/mage/game/permanent/token/GoblinToken.java b/Mage/src/mage/game/permanent/token/GoblinToken.java new file mode 100644 index 00000000000..eb3349d7085 --- /dev/null +++ b/Mage/src/mage/game/permanent/token/GoblinToken.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 mage.Constants.CardType; +import mage.MageInt; +import mage.ObjectColor; + +/** + * + * @author North + */ +public class GoblinToken extends Token { + + public GoblinToken() { + super("Goblin", "1/1 red Goblin creature token"); + cardType.add(CardType.CREATURE); + subtype.add("Goblin"); + + color = ObjectColor.RED; + power = new MageInt(1); + toughness = new MageInt(1); + } +} \ No newline at end of file