From 4e5bcddd56e76f151d7d5a975cfeda07a7b15b46 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Sat, 26 Sep 2015 11:44:03 +0300 Subject: [PATCH] Add 5/5 Dragon token and use it for existing cards. --- .../mage/sets/commander/DeathByDragons.java | 20 +------ .../mage/sets/scourge/DayOfTheDragons.java | 25 +++------ .../mage/sets/tenthedition/DragonRoost.java | 22 ++------ .../sets/worldwake/DragonmasterOutcast.java | 18 +------ .../game/permanent/token/DragonToken2.java | 52 +++++++++++++++++++ 5 files changed, 66 insertions(+), 71 deletions(-) create mode 100644 Mage/src/mage/game/permanent/token/DragonToken2.java diff --git a/Mage.Sets/src/mage/sets/commander/DeathByDragons.java b/Mage.Sets/src/mage/sets/commander/DeathByDragons.java index b9498933341..60572acafe6 100644 --- a/Mage.Sets/src/mage/sets/commander/DeathByDragons.java +++ b/Mage.Sets/src/mage/sets/commander/DeathByDragons.java @@ -28,16 +28,15 @@ package mage.sets.commander; import java.util.UUID; -import mage.MageInt; import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; -import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Rarity; import mage.game.Game; +import mage.game.permanent.token.DragonToken2; import mage.game.permanent.token.Token; import mage.players.Player; import mage.target.TargetPlayer; @@ -90,7 +89,7 @@ class DeathByDragonsEffect extends OneShotEffect { if (controller != null) { for (UUID playerId : controller.getInRange()) { if (!playerId.equals(this.getTargetPointer().getFirst(game, source))) { - Token token = new DragonToken(); + Token token = new DragonToken2(); token.putOntoBattlefield(1, game, source.getSourceId(), playerId); } } @@ -99,18 +98,3 @@ class DeathByDragonsEffect extends OneShotEffect { return false; } } - -class DragonToken extends Token { - - public DragonToken() { - super("Dragon", "5/5 red Dragon creature token with flying"); - cardType.add(CardType.CREATURE); - color.setRed(true); - subtype.add("Dragon"); - power = new MageInt(5); - toughness = new MageInt(5); - addAbility(FlyingAbility.getInstance()); - // set a set with correct token image - this.setOriginalExpansionSetCode("WWK"); - } -} diff --git a/Mage.Sets/src/mage/sets/scourge/DayOfTheDragons.java b/Mage.Sets/src/mage/sets/scourge/DayOfTheDragons.java index 4c442ac3611..8ce01074263 100644 --- a/Mage.Sets/src/mage/sets/scourge/DayOfTheDragons.java +++ b/Mage.Sets/src/mage/sets/scourge/DayOfTheDragons.java @@ -28,17 +28,19 @@ package mage.sets.scourge; import java.util.UUID; - -import mage.constants.*; import mage.MageInt; import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.LeavesBattlefieldTriggeredAbility; import mage.abilities.effects.OneShotEffect; -import mage.abilities.keyword.FlyingAbility; import mage.cards.Card; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; import mage.filter.FilterPermanent; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate; @@ -46,7 +48,7 @@ import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.ExileZone; import mage.game.Game; import mage.game.permanent.Permanent; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.DragonToken2; /** * @@ -106,7 +108,7 @@ class DayOfTheDragonsEntersEffect extends OneShotEffect { } } } - DragonToken token = new DragonToken(); + DragonToken2 token = new DragonToken2(); token.putOntoBattlefield(creaturesExiled, game, source.getSourceId(), source.getControllerId()); return true; } @@ -163,16 +165,3 @@ class DayOfTheDragonsLeavesEffect extends OneShotEffect { return new DayOfTheDragonsLeavesEffect(this); } } - -class DragonToken extends Token { - - public DragonToken() { - super("Dragon", "5/5 red Dragon creature token with flying"); - cardType.add(CardType.CREATURE); - color.setRed(true); - subtype.add("Dragon"); - power = new MageInt(5); - toughness = new MageInt(5); - addAbility(FlyingAbility.getInstance()); - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/tenthedition/DragonRoost.java b/Mage.Sets/src/mage/sets/tenthedition/DragonRoost.java index 1fbc6d5c431..cdc462101ff 100644 --- a/Mage.Sets/src/mage/sets/tenthedition/DragonRoost.java +++ b/Mage.Sets/src/mage/sets/tenthedition/DragonRoost.java @@ -28,18 +28,15 @@ package mage.sets.tenthedition; import java.util.UUID; - -import mage.constants.CardType; -import mage.constants.Rarity; -import mage.MageInt; import mage.ObjectColor; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.CreateTokenEffect; -import mage.abilities.keyword.FlyingAbility; 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.DragonToken2; /** * @@ -63,16 +60,3 @@ public class DragonRoost extends CardImpl { return new DragonRoost(this); } } - -class DragonToken2 extends Token { - DragonToken2() { - super("Dragon", "5/5 red Dragon creature token with flying"); - cardType.add(CardType.CREATURE); - color.setRed(true); - subtype.add("Dragon"); - power = new MageInt(5); - toughness = new MageInt(5); - addAbility(FlyingAbility.getInstance()); - } -} - diff --git a/Mage.Sets/src/mage/sets/worldwake/DragonmasterOutcast.java b/Mage.Sets/src/mage/sets/worldwake/DragonmasterOutcast.java index e0c43a32e08..b92c0b32276 100644 --- a/Mage.Sets/src/mage/sets/worldwake/DragonmasterOutcast.java +++ b/Mage.Sets/src/mage/sets/worldwake/DragonmasterOutcast.java @@ -38,12 +38,11 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; import mage.abilities.decorator.ConditionalTriggeredAbility; import mage.abilities.effects.common.CreateTokenEffect; -import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.constants.TargetController; import mage.filter.FilterPermanent; import mage.filter.predicate.mageobject.CardTypePredicate; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.DragonToken2; /** * @@ -67,7 +66,7 @@ public class DragonmasterOutcast extends CardImpl { this.toughness = new MageInt(1); // At the beginning of your upkeep, if you control six or more lands, put a 5/5 red Dragon creature token with flying onto the battlefield. - TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new CreateTokenEffect(new DragonToken(), 1), TargetController.YOU, false); + TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new CreateTokenEffect(new DragonToken2(), 1), TargetController.YOU, false); this.addAbility(new ConditionalTriggeredAbility(ability, new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.MORE_THAN, 5), "At the beginning of your upkeep, if you control six or more lands, put a 5/5 red Dragon creature token with flying onto the battlefield.")); } @@ -80,16 +79,3 @@ public class DragonmasterOutcast extends CardImpl { return new DragonmasterOutcast(this); } } - -class DragonToken extends Token { - - public DragonToken() { - super("Dragon", "5/5 red Dragon creature token with flying"); - cardType.add(CardType.CREATURE); - color.setRed(true); - subtype.add("Dragon"); - power = new MageInt(5); - toughness = new MageInt(5); - addAbility(FlyingAbility.getInstance()); - } -} diff --git a/Mage/src/mage/game/permanent/token/DragonToken2.java b/Mage/src/mage/game/permanent/token/DragonToken2.java new file mode 100644 index 00000000000..5bf0ca7c0b1 --- /dev/null +++ b/Mage/src/mage/game/permanent/token/DragonToken2.java @@ -0,0 +1,52 @@ +/* +* 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; +import mage.abilities.keyword.FlyingAbility; + +/** + * + * @author LoneFox + */ +public class DragonToken2 extends Token { + + public DragonToken2() { + super("Dragon", "5/5 red Dragon creature token with flying"); + cardType.add(CardType.CREATURE); + color.setWhite(true); + subtype.add("Dragon"); + power = new MageInt(5); + toughness = new MageInt(5); + addAbility(FlyingAbility.getInstance()); + availableImageSetCodes.addAll(Arrays.asList("WWK", "10E")); + } +}