From 6faf248273f6e72b40cbf661438a487cc4086396 Mon Sep 17 00:00:00 2001 From: Justin Godesky Date: Fri, 5 Jun 2015 08:53:28 -0400 Subject: [PATCH] Abstracted out FilterArtifactSpell, and changed implementations that depended on their own instance of it. Golem Foundry uses already implemented, generic Golem token - instead of its own duplicate one. --- .../mage/sets/antiquities/ArtifactBlast.java | 11 +---- .../mage/sets/mirrodin/VedalkenArchmage.java | 12 +---- .../mage/sets/mirrodinbesieged/MirranSpy.java | 7 ++- .../sets/mirrodinbesieged/SteelSabotage.java | 13 +---- .../mage/sets/scarsofmirrodin/Embersmith.java | 13 +---- .../sets/scarsofmirrodin/GolemFoundry.java | 28 ++--------- .../mage/sets/scarsofmirrodin/HaltOrder.java | 15 ++---- .../mage/sets/scarsofmirrodin/Lifesmith.java | 12 +---- .../mage/sets/scarsofmirrodin/Myrsmith.java | 13 +---- .../mage/sets/scarsofmirrodin/Painsmith.java | 10 +--- .../sets/scarsofmirrodin/PrecursorGolem.java | 2 +- .../sets/scarsofmirrodin/Riddlesmith.java | 13 ++--- .../filter/common/FilterArtifactSpell.java | 48 +++++++++++++++++++ 13 files changed, 77 insertions(+), 120 deletions(-) create mode 100644 Mage/src/mage/filter/common/FilterArtifactSpell.java diff --git a/Mage.Sets/src/mage/sets/antiquities/ArtifactBlast.java b/Mage.Sets/src/mage/sets/antiquities/ArtifactBlast.java index a8f0dfe5f13..56d1cc45fe1 100644 --- a/Mage.Sets/src/mage/sets/antiquities/ArtifactBlast.java +++ b/Mage.Sets/src/mage/sets/antiquities/ArtifactBlast.java @@ -32,27 +32,20 @@ import mage.abilities.effects.common.CounterTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.filter.FilterSpell; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetSpell; +import mage.filter.common.FilterArtifactSpell; /** * * @author Jgod */ public class ArtifactBlast extends CardImpl { - private static final FilterSpell filter = new FilterSpell("artifact spell"); - - static { - filter.add(new CardTypePredicate(CardType.ARTIFACT)); - } - public ArtifactBlast(UUID ownerId) { super(ownerId, 87, "Artifact Blast", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{R}"); this.expansionSetCode = "ATQ"; // Counter target artifact spell. - this.getSpellAbility().addTarget(new TargetSpell(filter)); + this.getSpellAbility().addTarget(new TargetSpell(new FilterArtifactSpell())); this.getSpellAbility().addEffect(new CounterTargetEffect()); } diff --git a/Mage.Sets/src/mage/sets/mirrodin/VedalkenArchmage.java b/Mage.Sets/src/mage/sets/mirrodin/VedalkenArchmage.java index d4eb18b145b..5589557fd24 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/VedalkenArchmage.java +++ b/Mage.Sets/src/mage/sets/mirrodin/VedalkenArchmage.java @@ -34,22 +34,13 @@ import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.filter.FilterSpell; -import mage.filter.common.FilterArtifactCard; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.common.FilterArtifactSpell; /** * * @author LevelX2 */ public class VedalkenArchmage extends CardImpl { - - private static final FilterSpell filter = new FilterSpell("an artifact spell"); - - static { - filter.add(new CardTypePredicate(CardType.ARTIFACT)); - } - public VedalkenArchmage(UUID ownerId) { super(ownerId, 55, "Vedalken Archmage", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{U}{U}"); this.expansionSetCode = "MRD"; @@ -60,6 +51,7 @@ public class VedalkenArchmage extends CardImpl { this.toughness = new MageInt(2); // Whenever you cast an artifact spell, draw a card. + FilterArtifactSpell filter = new FilterArtifactSpell("an artifact spell"); this.addAbility(new SpellCastControllerTriggeredAbility(new DrawCardSourceControllerEffect(1), filter, false)); } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/MirranSpy.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/MirranSpy.java index 8fb52da3e43..e2c07fb8cd4 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/MirranSpy.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/MirranSpy.java @@ -35,7 +35,7 @@ import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.filter.FilterSpell; +import mage.filter.common.FilterArtifactSpell; import mage.target.common.TargetCreaturePermanent; /** @@ -43,9 +43,7 @@ import mage.target.common.TargetCreaturePermanent; * @author North */ public class MirranSpy extends CardImpl { - - private static final FilterSpell filter = new FilterSpell("an artifact spell"); - + public MirranSpy(UUID ownerId) { super(ownerId, 26, "Mirran Spy", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{U}"); this.expansionSetCode = "MBS"; @@ -58,6 +56,7 @@ public class MirranSpy extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // Whenever you cast an artifact spell, you may untap target creature. + FilterArtifactSpell filter = new FilterArtifactSpell("an artifact spell"); SpellCastControllerTriggeredAbility ability = new SpellCastControllerTriggeredAbility(new UntapTargetEffect(), filter, true); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/SteelSabotage.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/SteelSabotage.java index 701966d1efa..f43bfe117fe 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/SteelSabotage.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/SteelSabotage.java @@ -34,31 +34,22 @@ import mage.abilities.Mode; import mage.abilities.effects.common.CounterTargetEffect; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.cards.CardImpl; -import mage.filter.FilterSpell; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetSpell; import mage.target.common.TargetArtifactPermanent; +import mage.filter.common.FilterArtifactSpell; /** * * @author North */ public class SteelSabotage extends CardImpl { - - private static final FilterSpell filter = new FilterSpell("artifact spell"); - - static { - filter.add(new CardTypePredicate(CardType.ARTIFACT)); - } - public SteelSabotage(UUID ownerId) { super(ownerId, 33, "Steel Sabotage", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}"); this.expansionSetCode = "MBS"; - // Choose one - Counter target artifact spell; or return target artifact to its owner's hand. this.getSpellAbility().addEffect(new CounterTargetEffect()); - this.getSpellAbility().addTarget(new TargetSpell(filter)); + this.getSpellAbility().addTarget(new TargetSpell(new FilterArtifactSpell())); Mode mode = new Mode(); mode.getEffects().add(new ReturnToHandTargetEffect()); mode.getTargets().add(new TargetArtifactPermanent()); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Embersmith.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Embersmith.java index 4982994c785..09d83f6f150 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Embersmith.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Embersmith.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.scarsofmirrodin; import java.util.UUID; @@ -40,8 +39,7 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; import mage.constants.Outcome; -import mage.filter.FilterSpell; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.common.FilterArtifactSpell; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -51,12 +49,6 @@ import mage.target.common.TargetCreatureOrPlayer; * @author Loki, North */ public class Embersmith extends CardImpl { - - private static final FilterSpell filter = new FilterSpell("an artifact spell"); - static { - filter.add(new CardTypePredicate(CardType.ARTIFACT)); - } - public Embersmith(UUID ownerId) { super(ownerId, 87, "Embersmith", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); this.expansionSetCode = "SOM"; @@ -66,6 +58,7 @@ public class Embersmith extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(1); + FilterArtifactSpell filter = new FilterArtifactSpell("an artifact spell"); SpellCastControllerTriggeredAbility ability = new SpellCastControllerTriggeredAbility(new EmbersmithEffect(), filter, false); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability); @@ -79,7 +72,6 @@ public class Embersmith extends CardImpl { public Embersmith copy() { return new Embersmith(this); } - } class EmbersmithEffect extends OneShotEffect { @@ -116,5 +108,4 @@ class EmbersmithEffect extends OneShotEffect { public EmbersmithEffect copy() { return new EmbersmithEffect(this); } - } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/GolemFoundry.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/GolemFoundry.java index 59bc3d0c7d2..13d866c247a 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/GolemFoundry.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/GolemFoundry.java @@ -25,14 +25,12 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.scarsofmirrodin; import java.util.UUID; import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.Zone; -import mage.MageInt; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.costs.common.RemoveCountersSourceCost; @@ -40,26 +38,22 @@ import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.counters.CounterType; -import mage.filter.FilterSpell; -import mage.filter.predicate.mageobject.CardTypePredicate; -import mage.game.permanent.token.Token; +import mage.filter.common.FilterArtifactSpell; +import mage.game.permanent.token.GolemToken; /** * * @author Loki, North */ public class GolemFoundry extends CardImpl { - - private static final FilterSpell filter = new FilterSpell("an artifact spell"); - static { - filter.add(new CardTypePredicate(CardType.ARTIFACT)); - } - public GolemFoundry (UUID ownerId) { super(ownerId, 160, "Golem Foundry", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{3}"); this.expansionSetCode = "SOM"; + // Whenever you cast an artifact spell, + FilterArtifactSpell filter = new FilterArtifactSpell("an artifact spell"); this.addAbility(new SpellCastControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.CHARGE.createInstance()), filter, true)); + // you may put a charge counter on Golem Foundry. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new GolemToken()), new RemoveCountersSourceCost(CounterType.CHARGE.createInstance(3)))); } @@ -71,16 +65,4 @@ public class GolemFoundry extends CardImpl { public GolemFoundry copy() { return new GolemFoundry(this); } - -} - -class GolemToken extends Token { - public GolemToken() { - super("Golem", "a 3/3 colorless Golem artifact creature token"); - cardType.add(CardType.ARTIFACT); - cardType.add(CardType.CREATURE); - subtype.add("Golem"); - power = new MageInt(3); - toughness = new MageInt(3); - } } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/HaltOrder.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/HaltOrder.java index 43863e366bd..3054ed9722b 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/HaltOrder.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/HaltOrder.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.scarsofmirrodin; import java.util.UUID; @@ -34,8 +33,7 @@ import mage.constants.Rarity; import mage.abilities.effects.common.CounterTargetEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.cards.CardImpl; -import mage.filter.FilterSpell; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.common.FilterArtifactSpell; import mage.target.TargetSpell; /** @@ -43,18 +41,12 @@ import mage.target.TargetSpell; * @author Loki */ public class HaltOrder extends CardImpl { - - private static final FilterSpell filter = new FilterSpell("artifact spell"); - - static { - filter.add(new CardTypePredicate(CardType.ARTIFACT)); - } - public HaltOrder (UUID ownerId) { super(ownerId, 34, "Halt Order", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{U}"); this.expansionSetCode = "SOM"; - this.getSpellAbility().addTarget(new TargetSpell(filter)); + // Counter target artifact spell. Draw a card. + this.getSpellAbility().addTarget(new TargetSpell(new FilterArtifactSpell())); this.getSpellAbility().addEffect(new CounterTargetEffect()); this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); } @@ -67,5 +59,4 @@ public class HaltOrder extends CardImpl { public HaltOrder copy() { return new HaltOrder(this); } - } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Lifesmith.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Lifesmith.java index 778fd03b286..ba2a2ca72e3 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Lifesmith.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Lifesmith.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.scarsofmirrodin; import java.util.UUID; @@ -40,8 +39,7 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; import mage.constants.Outcome; -import mage.filter.FilterSpell; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.common.FilterArtifactSpell; import mage.game.Game; import mage.players.Player; @@ -50,12 +48,6 @@ import mage.players.Player; * @author Loki */ public class Lifesmith extends CardImpl { - - private static final FilterSpell filter = new FilterSpell("an artifact spell"); - static { - filter.add(new CardTypePredicate(CardType.ARTIFACT)); - } - public Lifesmith (UUID ownerId) { super(ownerId, 124, "Lifesmith", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); this.expansionSetCode = "SOM"; @@ -65,6 +57,7 @@ public class Lifesmith extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(1); + FilterArtifactSpell filter = new FilterArtifactSpell("an artifact spell"); this.addAbility(new SpellCastControllerTriggeredAbility(new LifesmithEffect(), filter, false)); } @@ -106,5 +99,4 @@ class LifesmithEffect extends OneShotEffect { public LifesmithEffect copy() { return new LifesmithEffect(this); } - } \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Myrsmith.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Myrsmith.java index 29371f63ce1..7e1ebce026c 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Myrsmith.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Myrsmith.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.scarsofmirrodin; import java.util.UUID; @@ -40,8 +39,7 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; import mage.constants.Outcome; -import mage.filter.FilterSpell; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.common.FilterArtifactSpell; import mage.game.Game; import mage.game.permanent.token.MyrToken; @@ -50,12 +48,6 @@ import mage.game.permanent.token.MyrToken; * @author Loki, North */ public class Myrsmith extends CardImpl { - - private static final FilterSpell filter = new FilterSpell("an artifact spell"); - static { - filter.add(new CardTypePredicate(CardType.ARTIFACT)); - } - public Myrsmith (UUID ownerId) { super(ownerId, 16, "Myrsmith", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); this.expansionSetCode = "SOM"; @@ -65,6 +57,7 @@ public class Myrsmith extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(1); + FilterArtifactSpell filter = new FilterArtifactSpell("an artifact spell"); this.addAbility(new SpellCastControllerTriggeredAbility(new MyrsmithEffect(), filter, false)); } @@ -76,7 +69,6 @@ public class Myrsmith extends CardImpl { public Myrsmith copy() { return new Myrsmith(this); } - } class MyrsmithEffect extends OneShotEffect { @@ -103,5 +95,4 @@ class MyrsmithEffect extends OneShotEffect { public MyrsmithEffect copy() { return new MyrsmithEffect(this); } - } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Painsmith.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Painsmith.java index 1ef30490727..e8e24290811 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Painsmith.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Painsmith.java @@ -38,8 +38,7 @@ import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; import mage.abilities.keyword.DeathtouchAbility; import mage.cards.CardImpl; -import mage.filter.FilterSpell; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.common.FilterArtifactSpell; import mage.target.common.TargetCreaturePermanent; /** @@ -47,12 +46,6 @@ import mage.target.common.TargetCreaturePermanent; * @author Loki, North */ public class Painsmith extends CardImpl { - - private static final FilterSpell filter = new FilterSpell("an artifact spell"); - static { - filter.add(new CardTypePredicate(CardType.ARTIFACT)); - } - public Painsmith (UUID ownerId) { super(ownerId, 74, "Painsmith", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); this.expansionSetCode = "SOM"; @@ -62,6 +55,7 @@ public class Painsmith extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(1); + FilterArtifactSpell filter = new FilterArtifactSpell("an artifact spell"); SpellCastControllerTriggeredAbility ability = new SpellCastControllerTriggeredAbility(new BoostTargetEffect(2, 0, Duration.EndOfTurn), filter, true); ability.addEffect(new GainAbilityTargetEffect(DeathtouchAbility.getInstance(), Duration.EndOfTurn)); ability.addTarget(new TargetCreaturePermanent()); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/PrecursorGolem.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/PrecursorGolem.java index 8c00484bf91..0332d1c5eea 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/PrecursorGolem.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/PrecursorGolem.java @@ -46,6 +46,7 @@ import java.util.UUID; import mage.abilities.effects.common.CopySpellForEachItCouldTargetEffect; import mage.filter.FilterInPlay; import mage.filter.common.FilterCreaturePermanent; +import mage.game.permanent.token.GolemToken; import mage.util.TargetAddress; /** @@ -140,7 +141,6 @@ class PrecursorGolemCopyTriggeredAbility extends TriggeredAbilityImpl { } } - class PrecursorGolemCopySpellEffect extends CopySpellForEachItCouldTargetEffect { public PrecursorGolemCopySpellEffect() { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Riddlesmith.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Riddlesmith.java index 11588e86349..344653885b5 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Riddlesmith.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Riddlesmith.java @@ -35,20 +35,13 @@ import mage.MageInt; import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.effects.common.DrawDiscardControllerEffect; import mage.cards.CardImpl; -import mage.filter.FilterSpell; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.common.FilterArtifactSpell; /** * * @author Loki, North */ public class Riddlesmith extends CardImpl { - - private static final FilterSpell filter = new FilterSpell("an artifact spell"); - static { - filter.add(new CardTypePredicate(CardType.ARTIFACT)); - } - public Riddlesmith (UUID ownerId) { super(ownerId, 40, "Riddlesmith", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); this.expansionSetCode = "SOM"; @@ -58,7 +51,8 @@ public class Riddlesmith extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(1); - this.addAbility(new SpellCastControllerTriggeredAbility(new DrawDiscardControllerEffect(), filter, true)); + // Whenever you cast an artifact spell, you may draw a card. If you do, discard a card. + this.addAbility(new SpellCastControllerTriggeredAbility(new DrawDiscardControllerEffect(), new FilterArtifactSpell("an artifact spell"), true)); } public Riddlesmith (final Riddlesmith card) { @@ -69,5 +63,4 @@ public class Riddlesmith extends CardImpl { public Riddlesmith copy() { return new Riddlesmith(this); } - } diff --git a/Mage/src/mage/filter/common/FilterArtifactSpell.java b/Mage/src/mage/filter/common/FilterArtifactSpell.java new file mode 100644 index 00000000000..530c21d6a69 --- /dev/null +++ b/Mage/src/mage/filter/common/FilterArtifactSpell.java @@ -0,0 +1,48 @@ +/* + * 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.filter.common; + +import mage.constants.CardType; +import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.CardTypePredicate; + +/** + * + * @author Jgod + */ +public class FilterArtifactSpell extends FilterSpell { + + public FilterArtifactSpell() { + this("artifact spell"); + } + + public FilterArtifactSpell(String name) { + super(name); + this.add(new CardTypePredicate(CardType.ARTIFACT)); + } +}