From 61b5609ae9c892fb33c39a7933246ed2ee7cd7d0 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 18 Jul 2015 10:06:41 +0200 Subject: [PATCH] Some more token image handling changes. --- .../mage/sets/magic2015/FeralIncarnation.java | 3 +- .../mage/sets/magic2015/SoulOfZendikar.java | 4 +- .../mage/game/permanent/token/BeastToken.java | 80 +++++++++---------- .../mage/game/permanent/token/ElfToken.java | 62 +++++++------- 4 files changed, 78 insertions(+), 71 deletions(-) diff --git a/Mage.Sets/src/mage/sets/magic2015/FeralIncarnation.java b/Mage.Sets/src/mage/sets/magic2015/FeralIncarnation.java index 0123ea48b26..2f4d8900e7f 100644 --- a/Mage.Sets/src/mage/sets/magic2015/FeralIncarnation.java +++ b/Mage.Sets/src/mage/sets/magic2015/FeralIncarnation.java @@ -45,11 +45,10 @@ public class FeralIncarnation extends CardImpl { super(ownerId, 174, "Feral Incarnation", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{8}{G}"); this.expansionSetCode = "M15"; - // Convoke this.addAbility(new ConvokeAbility()); // Put three 3/3 green Beast creature tokens onto the battlefield. - this.getSpellAbility().addEffect(new CreateTokenEffect(new BeastToken("M15", 1), 3)); + this.getSpellAbility().addEffect(new CreateTokenEffect(new BeastToken(), 3)); } public FeralIncarnation(final FeralIncarnation card) { diff --git a/Mage.Sets/src/mage/sets/magic2015/SoulOfZendikar.java b/Mage.Sets/src/mage/sets/magic2015/SoulOfZendikar.java index 7c09f0eb7c4..09593c16223 100644 --- a/Mage.Sets/src/mage/sets/magic2015/SoulOfZendikar.java +++ b/Mage.Sets/src/mage/sets/magic2015/SoulOfZendikar.java @@ -58,9 +58,9 @@ public class SoulOfZendikar extends CardImpl { // Reach this.addAbility(ReachAbility.getInstance()); // {3}{G}{G}: Put a 3/3 green Beast creature token onto the battlefield. - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new BeastToken("M15")), new ManaCostsImpl("{3}{G}{G}"))); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new BeastToken()), new ManaCostsImpl("{3}{G}{G}"))); // {3}{G}{G}, Exile Soul of Zendikar from your graveyard: Put a 3/3 green Beast creature token onto the battlefield. - Ability ability = new SimpleActivatedAbility(Zone.GRAVEYARD, new CreateTokenEffect(new BeastToken("M15")), new ManaCostsImpl("{3}{G}{G}")); + Ability ability = new SimpleActivatedAbility(Zone.GRAVEYARD, new CreateTokenEffect(new BeastToken()), new ManaCostsImpl("{3}{G}{G}")); ability.addCost(new ExileSourceFromGraveCost()); this.addAbility(ability); } diff --git a/Mage/src/mage/game/permanent/token/BeastToken.java b/Mage/src/mage/game/permanent/token/BeastToken.java index f5d9b98a546..761f5e03c78 100644 --- a/Mage/src/mage/game/permanent/token/BeastToken.java +++ b/Mage/src/mage/game/permanent/token/BeastToken.java @@ -1,35 +1,35 @@ /* -* 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. -*/ - + * 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 java.util.Random; import mage.MageInt; -import mage.ObjectColor; import mage.constants.CardType; /** @@ -39,24 +39,24 @@ import mage.constants.CardType; public class BeastToken extends Token { public BeastToken() { - this("LRW"); - } - public BeastToken(String setCode) { - this(setCode, Integer.MIN_VALUE); - } - - public BeastToken(String setCode, int tokenType) { super("Beast", "3/3 green Beast creature token"); - setOriginalExpansionSetCode(setCode); - if (tokenType != Integer.MIN_VALUE) { - setTokenType(tokenType); - } + availableImageSetCodes.addAll(Arrays.asList("C14", "LRW", "M15", "M14", "DDL", "M13", "M12")); cardType.add(CardType.CREATURE); color.setGreen(true); subtype.add("Beast"); power = new MageInt(3); toughness = new MageInt(3); - + } + @Override + public void setExpansionSetCodeForImage(String code) { + super.setExpansionSetCodeForImage(code); + if (getOriginalExpansionSetCode().equals("C14")) { + this.setTokenType(new Random().nextInt(2) + 1); + } + if (getOriginalExpansionSetCode().equals("M15")) { + this.setTokenType(2); + } + } } diff --git a/Mage/src/mage/game/permanent/token/ElfToken.java b/Mage/src/mage/game/permanent/token/ElfToken.java index 11807debd70..256c67e8cc9 100644 --- a/Mage/src/mage/game/permanent/token/ElfToken.java +++ b/Mage/src/mage/game/permanent/token/ElfToken.java @@ -1,33 +1,33 @@ /* -* 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. -*/ - + * 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.MageInt; import mage.constants.CardType; @@ -39,6 +39,7 @@ public class ElfToken extends Token { public ElfToken() { super("Elf Warrior", "1/1 green Elf Warrior creature token"); + availableImageSetCodes.addAll(Arrays.asList("C14", "SHM", "EVG", "LRW", "ORI")); cardType.add(CardType.CREATURE); color.setGreen(true); subtype.add("Elf"); @@ -47,4 +48,11 @@ public class ElfToken extends Token { toughness = new MageInt(1); } + @Override + public void setExpansionSetCodeForImage(String code) { + super.setExpansionSetCodeForImage(code); + if (getOriginalExpansionSetCode().equals("SHM")) { + this.setTokenType(1); + } + } }