From dd6f0f86a00fc25e79e431993630876cc42d1168 Mon Sep 17 00:00:00 2001 From: fireshoes Date: Sun, 9 Aug 2015 23:46:17 -0500 Subject: [PATCH] Added Furnace Dragon. Fixed duplicate verse type in CounterType. --- .../mage/sets/darksteel/FurnaceDragon.java | 107 ++++++++++++++++++ Mage/src/mage/counters/CounterType.java | 1 - 2 files changed, 107 insertions(+), 1 deletion(-) create mode 100644 Mage.Sets/src/mage/sets/darksteel/FurnaceDragon.java diff --git a/Mage.Sets/src/mage/sets/darksteel/FurnaceDragon.java b/Mage.Sets/src/mage/sets/darksteel/FurnaceDragon.java new file mode 100644 index 0000000000..8c7f749d57 --- /dev/null +++ b/Mage.Sets/src/mage/sets/darksteel/FurnaceDragon.java @@ -0,0 +1,107 @@ +/* + * 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.sets.darksteel; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.condition.Condition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.common.ExileAllEffect; +import mage.abilities.keyword.AffinityForArtifactsAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.watchers.Watcher; +import mage.watchers.common.CastFromHandWatcher; + +/** + * + * @author fireshoes + */ +public class FurnaceDragon extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("artifacts"); + + static { + filter.add(new CardTypePredicate(CardType.ARTIFACT)); + } + + public FurnaceDragon(UUID ownerId) { + super(ownerId, 62, "Furnace Dragon", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{6}{R}{R}{R}"); + this.expansionSetCode = "DST"; + this.subtype.add("Dragon"); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // Affinity for artifacts + this.addAbility(new AffinityForArtifactsAbility()); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // When Furnace Dragon enters the battlefield, if you cast it from your hand, exile all artifacts. + this.addAbility(new EntersBattlefieldTriggeredAbility(new ConditionalOneShotEffect(new ExileAllEffect(filter), new FurnaceDragonCondition()), false), new CastFromHandWatcher()); + } + + public FurnaceDragon(final FurnaceDragon card) { + super(card); + } + + @Override + public FurnaceDragon copy() { + return new FurnaceDragon(this); + } +} + +class FurnaceDragonCondition implements Condition { + + @Override + public boolean apply(Game game, Ability source) { + boolean applies = false; + Permanent permanent = game.getPermanent(source.getSourceId()); + if (permanent != null) { + Watcher watcher = game.getState().getWatchers().get("CastFromHand", source.getSourceId()); + if (watcher != null && watcher.conditionMet()) { + applies = true; + } + } + return applies; + } + + @Override + public String toString() { + return "you cast it from your hand"; + } +} diff --git a/Mage/src/mage/counters/CounterType.java b/Mage/src/mage/counters/CounterType.java index 6800755563..b41502df69 100644 --- a/Mage/src/mage/counters/CounterType.java +++ b/Mage/src/mage/counters/CounterType.java @@ -87,7 +87,6 @@ public enum CounterType { VELOCITY("velocity"), VERSE("verse"), VILE("vile"), - VERSE("verse"), WISH("wish"); private final String name;