From 9279d81c247e42a019dc46f1ba0057fa5a215264 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Wed, 23 Sep 2015 13:55:40 +0300 Subject: [PATCH] Add Human token and use it for existing cards --- .../avacynrestored/CommandersAuthority.java | 9 ++- .../avacynrestored/VoiceOfTheProvinces.java | 14 +---- .../darkascension/GatherTheTownsfolk.java | 17 +----- .../darkascension/IncreasingDevotion.java | 9 ++- .../sets/darkascension/ThrabenDoomsayer.java | 6 +- .../mage/game/permanent/token/HumanToken.java | 58 +++++++++++++++++++ 6 files changed, 76 insertions(+), 37 deletions(-) create mode 100644 Mage/src/mage/game/permanent/token/HumanToken.java diff --git a/Mage.Sets/src/mage/sets/avacynrestored/CommandersAuthority.java b/Mage.Sets/src/mage/sets/avacynrestored/CommandersAuthority.java index 7ec41d11da..a408d0b7fe 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/CommandersAuthority.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/CommandersAuthority.java @@ -28,8 +28,6 @@ package mage.sets.avacynrestored; import java.util.UUID; - -import mage.constants.*; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; @@ -38,6 +36,13 @@ import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.game.permanent.token.HumanToken; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; diff --git a/Mage.Sets/src/mage/sets/avacynrestored/VoiceOfTheProvinces.java b/Mage.Sets/src/mage/sets/avacynrestored/VoiceOfTheProvinces.java index 552e5d59c4..4cb50e37fe 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/VoiceOfTheProvinces.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/VoiceOfTheProvinces.java @@ -36,7 +36,7 @@ import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.HumanToken; /** * @@ -66,15 +66,3 @@ public class VoiceOfTheProvinces extends CardImpl { return new VoiceOfTheProvinces(this); } } - -class HumanToken extends Token { - public HumanToken() { - super("Human", "1/1 white Human creature token"); - cardType.add(CardType.CREATURE); - color.setWhite(true); - - subtype.add("Human"); - power = new MageInt(1); - toughness = new MageInt(1); - } -} diff --git a/Mage.Sets/src/mage/sets/darkascension/GatherTheTownsfolk.java b/Mage.Sets/src/mage/sets/darkascension/GatherTheTownsfolk.java index d734501cf7..15553884e1 100644 --- a/Mage.Sets/src/mage/sets/darkascension/GatherTheTownsfolk.java +++ b/Mage.Sets/src/mage/sets/darkascension/GatherTheTownsfolk.java @@ -30,13 +30,12 @@ package mage.sets.darkascension; import java.util.UUID; import mage.constants.CardType; import mage.constants.Rarity; -import mage.MageInt; import mage.ObjectColor; import mage.abilities.condition.common.FatefulHourCondition; import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.HumanToken; /** * @@ -64,17 +63,3 @@ public class GatherTheTownsfolk extends CardImpl { return new GatherTheTownsfolk(this); } } - -class HumanToken extends Token { - - public HumanToken() { - super("Human", "1/1 white Human creature token"); - cardType.add(CardType.CREATURE); - color.setWhite(true); - - subtype.add("Human"); - power = new MageInt(1); - toughness = new MageInt(1); - } - -} diff --git a/Mage.Sets/src/mage/sets/darkascension/IncreasingDevotion.java b/Mage.Sets/src/mage/sets/darkascension/IncreasingDevotion.java index e5405b471e..12f7f2fcd0 100644 --- a/Mage.Sets/src/mage/sets/darkascension/IncreasingDevotion.java +++ b/Mage.Sets/src/mage/sets/darkascension/IncreasingDevotion.java @@ -28,14 +28,18 @@ package mage.sets.darkascension; import java.util.UUID; - -import mage.constants.*; import mage.abilities.Ability; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.FlashbackAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TimingRule; +import mage.constants.Zone; import mage.game.Game; +import mage.game.permanent.token.HumanToken; import mage.game.stack.Spell; /** @@ -48,7 +52,6 @@ public class IncreasingDevotion extends CardImpl { super(ownerId, 11, "Increasing Devotion", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{W}{W}"); this.expansionSetCode = "DKA"; - // Put five 1/1 white Human creature tokens onto the battlefield. If Increasing Devotion was cast from a graveyard, put ten of those tokens onto the battlefield instead. this.getSpellAbility().addEffect(new IncreasingDevotionEffect()); diff --git a/Mage.Sets/src/mage/sets/darkascension/ThrabenDoomsayer.java b/Mage.Sets/src/mage/sets/darkascension/ThrabenDoomsayer.java index 5da2eef4b1..b5cb14cd29 100644 --- a/Mage.Sets/src/mage/sets/darkascension/ThrabenDoomsayer.java +++ b/Mage.Sets/src/mage/sets/darkascension/ThrabenDoomsayer.java @@ -28,9 +28,6 @@ package mage.sets.darkascension; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; import mage.MageInt; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleStaticAbility; @@ -40,8 +37,11 @@ import mage.abilities.decorator.ConditionalContinuousEffect; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.continuous.BoostControlledEffect; import mage.cards.CardImpl; +import mage.constants.CardType; import mage.constants.Duration; +import mage.constants.Rarity; import mage.constants.Zone; +import mage.game.permanent.token.HumanToken; /** * diff --git a/Mage/src/mage/game/permanent/token/HumanToken.java b/Mage/src/mage/game/permanent/token/HumanToken.java new file mode 100644 index 0000000000..9ca595ce97 --- /dev/null +++ b/Mage/src/mage/game/permanent/token/HumanToken.java @@ -0,0 +1,58 @@ +/* +* 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 HumanToken extends Token { + + public HumanToken() { + super("Human", "1/1 white Human creature token"); + cardType.add(CardType.CREATURE); + color.setWhite(true); + subtype.add("Human"); + power = new MageInt(1); + toughness = new MageInt(1); + availableImageSetCodes.addAll(Arrays.asList("DKA", "AVR", "FNMP")); + } + + @Override + public void setExpansionSetCodeForImage(String code) { + super.setExpansionSetCodeForImage(code); + if (getOriginalExpansionSetCode().equals("AVR")) { + this.setTokenType(1); + } + } +}