From dc4283685a314e85f6e1d5ff1a0f159941da25b7 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 7 May 2017 14:07:21 +0200 Subject: [PATCH] * Added another StaticFilter. --- Mage.Sets/src/mage/cards/a/AbsoluteGrace.java | 14 ++++++-------- Mage.Sets/src/mage/cards/a/AbsoluteLaw.java | 14 ++++++-------- Mage.Sets/src/mage/cards/a/AerieMystics.java | 12 +++++------- Mage.Sets/src/mage/cards/a/AetherBurst.java | 16 ++++++---------- Mage.Sets/src/mage/cards/a/Asceticism.java | 12 +++++------- .../src/mage/cards/a/AvatarOfSlaughter.java | 11 +++++------ .../src/mage/cards/b/BarrageOfBoulders.java | 9 ++++----- .../src/mage/cards/b/BehindTheScenes.java | 11 +++++------ Mage.Sets/src/mage/cards/b/BreakingPoint.java | 9 ++++----- Mage.Sets/src/mage/cards/b/BubbleMatrix.java | 9 ++++----- Mage.Sets/src/mage/cards/c/ChasmGuide.java | 9 ++++----- Mage.Sets/src/mage/cards/c/CurtainsCall.java | 7 +++---- Mage.Sets/src/mage/cards/d/Damnation.java | 10 ++++------ .../src/mage/cards/d/DawnglareInvoker.java | 9 ++++----- .../mage/cards/d/DivergentTransformations.java | 7 +++---- .../src/mage/cards/d/DrogskolShieldmate.java | 9 ++++----- .../src/mage/cards/e/EmblemOfTheWarmind.java | 13 ++++++------- Mage.Sets/src/mage/cards/e/Ensnare.java | 18 +++++++++--------- Mage.Sets/src/mage/cards/e/EtherealHaze.java | 16 +++++++--------- Mage.Sets/src/mage/cards/e/Evacuation.java | 10 ++++------ Mage.Sets/src/mage/cards/f/Festival.java | 13 ++++++------- Mage.Sets/src/mage/cards/f/FiremantleMage.java | 9 ++++----- .../src/mage/cards/f/FlyingCraneTechnique.java | 15 ++++++--------- Mage.Sets/src/mage/cards/f/Forfend.java | 9 ++++----- .../src/mage/cards/g/GlimpseTheSunGod.java | 16 ++++++---------- Mage.Sets/src/mage/cards/g/GrandMelee.java | 11 +++++------ Mage.Sets/src/mage/cards/h/HolyMantle.java | 18 +++++++++--------- Mage.Sets/src/mage/cards/i/IntruderAlarm.java | 8 ++++---- .../mage/cards/k/KiraGreatGlassSpinner.java | 8 ++++---- .../mage/cards/k/KolaghanTheStormsFury.java | 15 ++++++++------- Mage.Sets/src/mage/cards/k/KorBladewhirl.java | 6 +++--- Mage.Sets/src/mage/cards/m/MasterOfPearls.java | 6 +++--- .../src/mage/cards/m/MercilessEviction.java | 9 ++++----- .../src/mage/cards/m/MillenniumFalcon.java | 9 ++++----- Mage.Sets/src/mage/cards/n/NayaCharm.java | 6 +++--- .../src/mage/cards/n/NephaliaMoondrakes.java | 8 ++++---- Mage.Sets/src/mage/cards/o/OnduChampion.java | 6 +++--- Mage.Sets/src/mage/cards/o/OrimsChant.java | 6 +++--- Mage.Sets/src/mage/cards/p/PendrellMists.java | 7 +++---- Mage.Sets/src/mage/cards/p/Plaxmanta.java | 10 +++++----- Mage.Sets/src/mage/cards/r/ReapWhatIsSown.java | 7 +++---- Mage.Sets/src/mage/cards/r/Rout.java | 8 ++++---- .../src/mage/cards/s/SublimeExhalation.java | 4 ++-- .../src/mage/cards/s/SunQuanLordOfWu.java | 8 ++++---- .../mage/cards/t/TamiyoFieldResearcher.java | 5 ++--- .../src/mage/cards/t/TeysaEnvoyOfGhosts.java | 4 ++-- .../mage/cards/u/UnquestionedAuthority.java | 10 ++++------ .../src/mage/cards/w/WarmongerHellkite.java | 6 +++--- Mage.Sets/src/mage/cards/w/WordOfBinding.java | 14 ++++++-------- Mage.Sets/src/mage/cards/w/WrathOfGod.java | 9 ++++----- .../main/java/mage/filter/StaticFilters.java | 1 + 51 files changed, 224 insertions(+), 272 deletions(-) diff --git a/Mage.Sets/src/mage/cards/a/AbsoluteGrace.java b/Mage.Sets/src/mage/cards/a/AbsoluteGrace.java index 96eb95c436..30f827e67c 100644 --- a/Mage.Sets/src/mage/cards/a/AbsoluteGrace.java +++ b/Mage.Sets/src/mage/cards/a/AbsoluteGrace.java @@ -24,10 +24,10 @@ * 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.cards.a; +import java.util.UUID; import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; @@ -38,9 +38,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Zone; -import mage.filter.common.FilterCreaturePermanent; - -import java.util.UUID; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; /** * @@ -49,10 +47,10 @@ import java.util.UUID; public class AbsoluteGrace extends CardImpl { public AbsoluteGrace(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); Ability ability = ProtectionAbility.from(ObjectColor.BLACK); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(ability, Duration.WhileOnBattlefield, new FilterCreaturePermanent("creatures"), false))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(ability, Duration.WhileOnBattlefield, FILTER_PERMANENT_CREATURES, false))); } public AbsoluteGrace(final AbsoluteGrace card) { @@ -64,4 +62,4 @@ public class AbsoluteGrace extends CardImpl { return new AbsoluteGrace(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/cards/a/AbsoluteLaw.java b/Mage.Sets/src/mage/cards/a/AbsoluteLaw.java index a30567d637..b7ce757c73 100644 --- a/Mage.Sets/src/mage/cards/a/AbsoluteLaw.java +++ b/Mage.Sets/src/mage/cards/a/AbsoluteLaw.java @@ -24,10 +24,10 @@ * 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.cards.a; +import java.util.UUID; import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; @@ -38,9 +38,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Zone; -import mage.filter.common.FilterCreaturePermanent; - -import java.util.UUID; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; /** * @@ -49,10 +47,10 @@ import java.util.UUID; public class AbsoluteLaw extends CardImpl { public AbsoluteLaw(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); Ability ability = ProtectionAbility.from(ObjectColor.RED); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(ability, Duration.WhileOnBattlefield, new FilterCreaturePermanent("creatures"), false))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(ability, Duration.WhileOnBattlefield, FILTER_PERMANENT_CREATURES, false))); } public AbsoluteLaw(final AbsoluteLaw card) { @@ -64,4 +62,4 @@ public class AbsoluteLaw extends CardImpl { return new AbsoluteLaw(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/cards/a/AerieMystics.java b/Mage.Sets/src/mage/cards/a/AerieMystics.java index ae180b510a..8ad9e98a4e 100644 --- a/Mage.Sets/src/mage/cards/a/AerieMystics.java +++ b/Mage.Sets/src/mage/cards/a/AerieMystics.java @@ -25,9 +25,9 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.cards.a; +import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; @@ -39,26 +39,24 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Zone; -import mage.filter.common.FilterCreaturePermanent; - -import java.util.UUID; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; /** * * @author Loki */ public class AerieMystics extends CardImpl { - private static FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures"); public AerieMystics(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{W}"); this.subtype.add("Bird"); this.subtype.add("Wizard"); this.power = new MageInt(3); this.toughness = new MageInt(3); this.addAbility(FlyingAbility.getInstance()); - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(ShroudAbility.getInstance(), Duration.EndOfTurn, filter), new ManaCostsImpl("{1}{G}{U}"))); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, + new GainAbilityControlledEffect(ShroudAbility.getInstance(), Duration.EndOfTurn, FILTER_PERMANENT_CREATURES), new ManaCostsImpl("{1}{G}{U}"))); } public AerieMystics(final AerieMystics card) { diff --git a/Mage.Sets/src/mage/cards/a/AetherBurst.java b/Mage.Sets/src/mage/cards/a/AetherBurst.java index ee68c96142..94c73e7079 100644 --- a/Mage.Sets/src/mage/cards/a/AetherBurst.java +++ b/Mage.Sets/src/mage/cards/a/AetherBurst.java @@ -27,6 +27,7 @@ */ package mage.cards.a; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.effects.common.ReturnToHandTargetEffect; @@ -34,15 +35,13 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.filter.FilterCard; -import mage.filter.common.FilterCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; import mage.filter.predicate.mageobject.NamePredicate; import mage.game.Game; import mage.players.Player; import mage.target.Target; import mage.target.TargetPermanent; -import java.util.UUID; - /** * * @author magenoxx_at_gmail.com @@ -56,8 +55,7 @@ public class AetherBurst extends CardImpl { } public AetherBurst(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{U}"); - + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}"); // Return up to X target creatures to their owners' hands, where X is one plus the number of cards named Aether Burst in all graveyards as you cast Aether Burst. this.getSpellAbility().addEffect(new DynamicReturnToHandTargetEffect()); @@ -78,7 +76,7 @@ public class AetherBurst extends CardImpl { } } } - ((DynamicTargetCreaturePermanent)target).setMaxNumberOfTargets(amount + 1); + ((DynamicTargetCreaturePermanent) target).setMaxNumberOfTargets(amount + 1); } } @@ -94,16 +92,15 @@ public class AetherBurst extends CardImpl { class DynamicTargetCreaturePermanent extends TargetPermanent { - private static final FilterCreaturePermanent filterCreature = new FilterCreaturePermanent("creatures"); - public DynamicTargetCreaturePermanent() { - super(filterCreature); + super(FILTER_PERMANENT_CREATURES); } public DynamicTargetCreaturePermanent(final DynamicTargetCreaturePermanent target) { super(target); } + @Override public void setMaxNumberOfTargets(int maxNumberOfTargets) { this.maxNumberOfTargets = maxNumberOfTargets; } @@ -139,4 +136,3 @@ class DynamicReturnToHandTargetEffect extends ReturnToHandTargetEffect { } } - diff --git a/Mage.Sets/src/mage/cards/a/Asceticism.java b/Mage.Sets/src/mage/cards/a/Asceticism.java index e2294f11c6..83d1197f8b 100644 --- a/Mage.Sets/src/mage/cards/a/Asceticism.java +++ b/Mage.Sets/src/mage/cards/a/Asceticism.java @@ -25,9 +25,9 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.cards.a; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleStaticAbility; @@ -40,22 +40,20 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Zone; -import mage.filter.common.FilterCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; import mage.target.common.TargetCreaturePermanent; -import java.util.UUID; - /** * @author ayratn */ public class Asceticism extends CardImpl { public Asceticism(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{G}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{G}{G}"); - // Creatures you control have hexproof. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(HexproofAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent("creatures")))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, + new GainAbilityControlledEffect(HexproofAbility.getInstance(), Duration.WhileOnBattlefield, FILTER_PERMANENT_CREATURES))); // {1}{G}: Regenerate target creature. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateTargetEffect(), new ManaCostsImpl("{1}{G}")); ability.addTarget(new TargetCreaturePermanent()); diff --git a/Mage.Sets/src/mage/cards/a/AvatarOfSlaughter.java b/Mage.Sets/src/mage/cards/a/AvatarOfSlaughter.java index c181cc67d5..10bd790284 100644 --- a/Mage.Sets/src/mage/cards/a/AvatarOfSlaughter.java +++ b/Mage.Sets/src/mage/cards/a/AvatarOfSlaughter.java @@ -27,6 +27,7 @@ */ package mage.cards.a; +import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; @@ -39,11 +40,9 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Zone; -import mage.filter.common.FilterCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; import mage.watchers.common.AttackedThisTurnWatcher; -import java.util.UUID; - /** * * @author fireshoes @@ -51,16 +50,16 @@ import java.util.UUID; public class AvatarOfSlaughter extends CardImpl { public AvatarOfSlaughter(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{6}{R}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{6}{R}{R}"); this.subtype.add("Avatar"); this.power = new MageInt(8); this.toughness = new MageInt(8); // All creatures have double strike and attack each turn if able. - Effect effect = new GainAbilityAllEffect(DoubleStrikeAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent("creatures")); + Effect effect = new GainAbilityAllEffect(DoubleStrikeAbility.getInstance(), Duration.WhileOnBattlefield, FILTER_PERMANENT_CREATURES); effect.setText("All creatures have double strike"); Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect); - effect = new AttacksIfAbleAllEffect(new FilterCreaturePermanent("creatures")); + effect = new AttacksIfAbleAllEffect(FILTER_PERMANENT_CREATURES); effect.setText("and attack each turn if able"); ability.addEffect(effect); this.addAbility(ability, new AttackedThisTurnWatcher()); diff --git a/Mage.Sets/src/mage/cards/b/BarrageOfBoulders.java b/Mage.Sets/src/mage/cards/b/BarrageOfBoulders.java index 2e4e6c1d15..ad99140ee0 100644 --- a/Mage.Sets/src/mage/cards/b/BarrageOfBoulders.java +++ b/Mage.Sets/src/mage/cards/b/BarrageOfBoulders.java @@ -27,6 +27,7 @@ */ package mage.cards.b; +import java.util.UUID; import mage.abilities.condition.LockedInCondition; import mage.abilities.condition.common.FerociousCondition; import mage.abilities.decorator.ConditionalRestrictionEffect; @@ -38,11 +39,10 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.TargetController; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.permanent.ControllerPredicate; -import java.util.UUID; - /** * * @author LevelX2 @@ -56,15 +56,14 @@ public class BarrageOfBoulders extends CardImpl { } public BarrageOfBoulders(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{R}"); - + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{R}"); // Barrage of Boulders deals 1 damage to each creature you don't control. this.getSpellAbility().addEffect(new DamageAllEffect(1, filter)); // Ferocious - If you control a creature with power 4 or greater, creatures can't block this turn Effect effect = new ConditionalRestrictionEffect( Duration.EndOfTurn, - new CantBlockAllEffect(new FilterCreaturePermanent("creatures"), Duration.EndOfTurn), + new CantBlockAllEffect(FILTER_PERMANENT_CREATURES, Duration.EndOfTurn), new LockedInCondition(FerociousCondition.instance), null); effect.setText("
Ferocious — If you control a creature with power 4 or greater, creatures can't block this turn"); this.getSpellAbility().addEffect(effect); diff --git a/Mage.Sets/src/mage/cards/b/BehindTheScenes.java b/Mage.Sets/src/mage/cards/b/BehindTheScenes.java index 7fde57f634..2433120f34 100644 --- a/Mage.Sets/src/mage/cards/b/BehindTheScenes.java +++ b/Mage.Sets/src/mage/cards/b/BehindTheScenes.java @@ -27,6 +27,7 @@ */ package mage.cards.b; +import java.util.UUID; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.ManaCostsImpl; @@ -38,9 +39,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Zone; -import mage.filter.common.FilterCreaturePermanent; - -import java.util.UUID; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; /** * @@ -49,15 +48,15 @@ import java.util.UUID; public class BehindTheScenes extends CardImpl { public BehindTheScenes(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}"); // Creatures you control have skulk. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, - new GainAbilityControlledEffect(new SkulkAbility(), Duration.WhileOnBattlefield, new FilterCreaturePermanent("creatures")))); + new GainAbilityControlledEffect(new SkulkAbility(), Duration.WhileOnBattlefield, FILTER_PERMANENT_CREATURES))); // {4}{W}: Creatures you control get +1/+1 until end of turn. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, - new BoostControlledEffect(1, 1, Duration.EndOfTurn, new FilterCreaturePermanent("creatures")), + new BoostControlledEffect(1, 1, Duration.EndOfTurn, FILTER_PERMANENT_CREATURES), new ManaCostsImpl("{4}{W}"))); } diff --git a/Mage.Sets/src/mage/cards/b/BreakingPoint.java b/Mage.Sets/src/mage/cards/b/BreakingPoint.java index 308bc5019b..acbd34b472 100644 --- a/Mage.Sets/src/mage/cards/b/BreakingPoint.java +++ b/Mage.Sets/src/mage/cards/b/BreakingPoint.java @@ -27,21 +27,20 @@ */ package mage.cards.b; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Outcome; -import mage.filter.common.FilterCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.stack.Spell; import mage.game.stack.StackObject; import mage.players.Player; -import java.util.UUID; - /** * * @author ilcartographer @@ -49,7 +48,7 @@ import java.util.UUID; public class BreakingPoint extends CardImpl { public BreakingPoint(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{R}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{R}{R}"); // Any player may have Breaking Point deal 6 damage to him or her. If no one does, destroy all creatures. Creatures destroyed this way can't be regenerated. this.getSpellAbility().addEffect(new BreakingPointDestroyEffect()); @@ -105,7 +104,7 @@ class BreakingPointDestroyEffect extends OneShotEffect { } } if (destroyCreatures) { - for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent("creatures"), source.getControllerId(), source.getSourceId(), game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(FILTER_PERMANENT_CREATURES, source.getControllerId(), source.getSourceId(), game)) { permanent.destroy(source.getSourceId(), game, true); } } diff --git a/Mage.Sets/src/mage/cards/b/BubbleMatrix.java b/Mage.Sets/src/mage/cards/b/BubbleMatrix.java index b99ced818f..a0727903e6 100644 --- a/Mage.Sets/src/mage/cards/b/BubbleMatrix.java +++ b/Mage.Sets/src/mage/cards/b/BubbleMatrix.java @@ -27,6 +27,7 @@ */ package mage.cards.b; +import java.util.UUID; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.PreventAllDamageToAllEffect; import mage.cards.CardImpl; @@ -34,9 +35,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Zone; -import mage.filter.common.FilterCreaturePermanent; - -import java.util.UUID; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; /** * @@ -45,10 +44,10 @@ import java.util.UUID; public class BubbleMatrix extends CardImpl { public BubbleMatrix(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{4}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{4}"); // Prevent all damage that would be dealt to creatures. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PreventAllDamageToAllEffect(Duration.WhileOnBattlefield, new FilterCreaturePermanent("creatures")))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PreventAllDamageToAllEffect(Duration.WhileOnBattlefield, FILTER_PERMANENT_CREATURES))); } public BubbleMatrix(final BubbleMatrix card) { diff --git a/Mage.Sets/src/mage/cards/c/ChasmGuide.java b/Mage.Sets/src/mage/cards/c/ChasmGuide.java index 69609bf340..9f534f69bd 100644 --- a/Mage.Sets/src/mage/cards/c/ChasmGuide.java +++ b/Mage.Sets/src/mage/cards/c/ChasmGuide.java @@ -27,6 +27,7 @@ */ package mage.cards.c; +import java.util.UUID; import mage.MageInt; import mage.abilities.common.AllyEntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; @@ -35,9 +36,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; -import mage.filter.common.FilterCreaturePermanent; - -import java.util.UUID; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; /** * @@ -46,7 +45,7 @@ import java.util.UUID; public class ChasmGuide extends CardImpl { public ChasmGuide(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}"); this.subtype.add("Goblin"); this.subtype.add("Scout"); this.subtype.add("Ally"); @@ -55,7 +54,7 @@ public class ChasmGuide extends CardImpl { // Rally — Whenever Chasm Guide or another Ally enters the battlefield under your control, creatures you control gain haste until end of turn. this.addAbility(new AllyEntersBattlefieldTriggeredAbility( - new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent("creatures")), false)); + new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.EndOfTurn, FILTER_PERMANENT_CREATURES), false)); } public ChasmGuide(final ChasmGuide card) { diff --git a/Mage.Sets/src/mage/cards/c/CurtainsCall.java b/Mage.Sets/src/mage/cards/c/CurtainsCall.java index 8e69221f5d..857b99d408 100644 --- a/Mage.Sets/src/mage/cards/c/CurtainsCall.java +++ b/Mage.Sets/src/mage/cards/c/CurtainsCall.java @@ -27,16 +27,15 @@ */ package mage.cards.c; +import java.util.UUID; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.keyword.UndauntedAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.common.FilterCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; import mage.target.common.TargetCreaturePermanent; -import java.util.UUID; - /** * * @author LevelX2 @@ -50,7 +49,7 @@ public class CurtainsCall extends CardImpl { this.addAbility(new UndauntedAbility()); // Destroy two target creatures. this.getSpellAbility().addEffect(new DestroyTargetEffect()); - this.getSpellAbility().addTarget(new TargetCreaturePermanent(2, 2, new FilterCreaturePermanent("creatures"), false)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(2, 2, FILTER_PERMANENT_CREATURES, false)); } public CurtainsCall(final CurtainsCall card) { diff --git a/Mage.Sets/src/mage/cards/d/Damnation.java b/Mage.Sets/src/mage/cards/d/Damnation.java index a6b72f2b2f..833e9b9577 100644 --- a/Mage.Sets/src/mage/cards/d/Damnation.java +++ b/Mage.Sets/src/mage/cards/d/Damnation.java @@ -27,13 +27,12 @@ */ package mage.cards.d; +import java.util.UUID; import mage.abilities.effects.common.DestroyAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.common.FilterCreaturePermanent; - -import java.util.UUID; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; /** * @@ -42,11 +41,10 @@ import java.util.UUID; public class Damnation extends CardImpl { public Damnation(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{B}{B}"); - + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{B}{B}"); // Destroy all creatures. They can't be regenerated. - this.getSpellAbility().addEffect(new DestroyAllEffect(new FilterCreaturePermanent("creatures"), true)); + this.getSpellAbility().addEffect(new DestroyAllEffect(FILTER_PERMANENT_CREATURES, true)); } public Damnation(final Damnation card) { diff --git a/Mage.Sets/src/mage/cards/d/DawnglareInvoker.java b/Mage.Sets/src/mage/cards/d/DawnglareInvoker.java index 3023094303..5c87a69b36 100644 --- a/Mage.Sets/src/mage/cards/d/DawnglareInvoker.java +++ b/Mage.Sets/src/mage/cards/d/DawnglareInvoker.java @@ -27,6 +27,7 @@ */ package mage.cards.d; +import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; @@ -36,11 +37,9 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Zone; -import mage.filter.common.FilterCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; import mage.target.TargetPlayer; -import java.util.UUID; - /** * * @author North @@ -48,7 +47,7 @@ import java.util.UUID; public class DawnglareInvoker extends CardImpl { public DawnglareInvoker(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}"); this.subtype.add("Kor"); this.subtype.add("Wizard"); @@ -57,7 +56,7 @@ public class DawnglareInvoker extends CardImpl { this.addAbility(FlyingAbility.getInstance()); SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, - new TapAllTargetPlayerControlsEffect(new FilterCreaturePermanent("creatures")), + new TapAllTargetPlayerControlsEffect(FILTER_PERMANENT_CREATURES), new ManaCostsImpl("{8}")); ability.addTarget(new TargetPlayer()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/d/DivergentTransformations.java b/Mage.Sets/src/mage/cards/d/DivergentTransformations.java index 8f47cc06fc..e915c36e1a 100644 --- a/Mage.Sets/src/mage/cards/d/DivergentTransformations.java +++ b/Mage.Sets/src/mage/cards/d/DivergentTransformations.java @@ -27,6 +27,7 @@ */ package mage.cards.d; +import java.util.*; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; @@ -35,14 +36,12 @@ import mage.cards.*; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Zone; -import mage.filter.common.FilterCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.common.TargetCreaturePermanent; -import java.util.*; - /** * * @author LevelX2 @@ -56,7 +55,7 @@ public class DivergentTransformations extends CardImpl { this.addAbility(new UndauntedAbility()); // Exile two target creatures. For each of those creatures, its controller reveals cards from the top of his or her library until he or she reveals a creature card, puts that card onto the battlefield, then shuffles the rest into his or her library. this.getSpellAbility().addEffect(new DivergentTransformationsEffect()); - this.getSpellAbility().addTarget(new TargetCreaturePermanent(2, 2, new FilterCreaturePermanent("creatures"), false)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(2, 2, FILTER_PERMANENT_CREATURES, false)); } diff --git a/Mage.Sets/src/mage/cards/d/DrogskolShieldmate.java b/Mage.Sets/src/mage/cards/d/DrogskolShieldmate.java index 7f43192495..0144f74a47 100644 --- a/Mage.Sets/src/mage/cards/d/DrogskolShieldmate.java +++ b/Mage.Sets/src/mage/cards/d/DrogskolShieldmate.java @@ -27,6 +27,7 @@ */ package mage.cards.d; +import java.util.UUID; import mage.MageInt; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.continuous.BoostControlledEffect; @@ -35,9 +36,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; -import mage.filter.common.FilterCreaturePermanent; - -import java.util.UUID; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; /** * @@ -46,7 +45,7 @@ import java.util.UUID; public class DrogskolShieldmate extends CardImpl { public DrogskolShieldmate(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}"); this.subtype.add("Spirit"); this.subtype.add("Soldier"); this.power = new MageInt(2); @@ -57,7 +56,7 @@ public class DrogskolShieldmate extends CardImpl { // When Drogskol Shieldmate enters the battlefield, other creatures you control get +0/+1 until end of turn. this.addAbility(new EntersBattlefieldTriggeredAbility( - new BoostControlledEffect(0, 1, Duration.EndOfTurn, new FilterCreaturePermanent("creatures"), true), false)); + new BoostControlledEffect(0, 1, Duration.EndOfTurn, FILTER_PERMANENT_CREATURES, true), false)); } public DrogskolShieldmate(final DrogskolShieldmate card) { diff --git a/Mage.Sets/src/mage/cards/e/EmblemOfTheWarmind.java b/Mage.Sets/src/mage/cards/e/EmblemOfTheWarmind.java index 43d5c522cc..a4ac56b7b8 100644 --- a/Mage.Sets/src/mage/cards/e/EmblemOfTheWarmind.java +++ b/Mage.Sets/src/mage/cards/e/EmblemOfTheWarmind.java @@ -27,6 +27,7 @@ */ package mage.cards.e; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.AttachEffect; @@ -39,12 +40,10 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.Zone; -import mage.filter.common.FilterCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; import mage.target.TargetPermanent; import mage.target.common.TargetControlledCreaturePermanent; -import java.util.UUID; - /** * * @author fireshoes @@ -52,7 +51,7 @@ import java.util.UUID; public class EmblemOfTheWarmind extends CardImpl { public EmblemOfTheWarmind(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}"); this.subtype.add("Aura"); // Enchant creature you control @@ -61,10 +60,10 @@ public class EmblemOfTheWarmind extends CardImpl { this.getSpellAbility().addEffect(new AttachEffect(Outcome.Benefit)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); - + // Creatures you control have haste. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, - new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent("creatures")))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, + new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield, FILTER_PERMANENT_CREATURES))); } public EmblemOfTheWarmind(final EmblemOfTheWarmind card) { diff --git a/Mage.Sets/src/mage/cards/e/Ensnare.java b/Mage.Sets/src/mage/cards/e/Ensnare.java index b57fd095b6..0a0f7e7e29 100644 --- a/Mage.Sets/src/mage/cards/e/Ensnare.java +++ b/Mage.Sets/src/mage/cards/e/Ensnare.java @@ -27,40 +27,40 @@ */ package mage.cards.e; +import java.util.UUID; import mage.abilities.costs.AlternativeCostSourceAbility; import mage.abilities.costs.common.ReturnToHandChosenControlledPermanentCost; import mage.abilities.effects.common.TapAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; import mage.filter.common.FilterControlledLandPermanent; -import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetControlledPermanent; -import java.util.UUID; - /** * * @author fireshoes */ public class Ensnare extends CardImpl { - + private static final FilterControlledLandPermanent filter = new FilterControlledLandPermanent("Islands"); - static{ + + static { filter.add(new SubtypePredicate("Island")); } public Ensnare(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{3}{U}"); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{U}"); // You may return two Islands you control to their owner's hand rather than pay Ensnare's mana cost. - AlternativeCostSourceAbility ability; + AlternativeCostSourceAbility ability; ability = new AlternativeCostSourceAbility(new ReturnToHandChosenControlledPermanentCost(new TargetControlledPermanent(2, 2, filter, true))); this.addAbility(ability); - + // Tap all creatures. - this.getSpellAbility().addEffect(new TapAllEffect(new FilterCreaturePermanent("creatures"))); + this.getSpellAbility().addEffect(new TapAllEffect(FILTER_PERMANENT_CREATURES)); } public Ensnare(final Ensnare card) { diff --git a/Mage.Sets/src/mage/cards/e/EtherealHaze.java b/Mage.Sets/src/mage/cards/e/EtherealHaze.java index d98ec25ca2..ba90d35600 100644 --- a/Mage.Sets/src/mage/cards/e/EtherealHaze.java +++ b/Mage.Sets/src/mage/cards/e/EtherealHaze.java @@ -25,17 +25,15 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.cards.e; +import java.util.UUID; import mage.abilities.effects.common.PreventAllDamageByAllPermanentsEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; -import mage.filter.common.FilterCreaturePermanent; - -import java.util.UUID; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; /** * @@ -43,16 +41,16 @@ import java.util.UUID; */ public class EtherealHaze extends CardImpl { - public EtherealHaze (UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{W}"); + public EtherealHaze(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{W}"); this.subtype.add("Arcane"); // Prevent all damage that would be dealt by creatures this turn. - this.getSpellAbility().addEffect(new PreventAllDamageByAllPermanentsEffect(new FilterCreaturePermanent("creatures"), Duration.EndOfTurn, false)); + this.getSpellAbility().addEffect(new PreventAllDamageByAllPermanentsEffect(FILTER_PERMANENT_CREATURES, Duration.EndOfTurn, false)); } - public EtherealHaze (final EtherealHaze card) { + public EtherealHaze(final EtherealHaze card) { super(card); } @@ -61,4 +59,4 @@ public class EtherealHaze extends CardImpl { return new EtherealHaze(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/cards/e/Evacuation.java b/Mage.Sets/src/mage/cards/e/Evacuation.java index aa105b7222..4524fe7cb4 100644 --- a/Mage.Sets/src/mage/cards/e/Evacuation.java +++ b/Mage.Sets/src/mage/cards/e/Evacuation.java @@ -27,13 +27,12 @@ */ package mage.cards.e; +import java.util.UUID; import mage.abilities.effects.common.ReturnToHandFromBattlefieldAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.common.FilterCreaturePermanent; - -import java.util.UUID; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; /** * @@ -42,11 +41,10 @@ import java.util.UUID; public class Evacuation extends CardImpl { public Evacuation(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{3}{U}{U}"); - + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{U}{U}"); // Return all creatures to their owners' hands. - this.getSpellAbility().addEffect(new ReturnToHandFromBattlefieldAllEffect(new FilterCreaturePermanent("creatures"))); + this.getSpellAbility().addEffect(new ReturnToHandFromBattlefieldAllEffect(FILTER_PERMANENT_CREATURES)); } public Evacuation(final Evacuation card) { diff --git a/Mage.Sets/src/mage/cards/f/Festival.java b/Mage.Sets/src/mage/cards/f/Festival.java index d86d3161cc..5684b79a58 100644 --- a/Mage.Sets/src/mage/cards/f/Festival.java +++ b/Mage.Sets/src/mage/cards/f/Festival.java @@ -27,6 +27,7 @@ */ package mage.cards.f; +import java.util.UUID; import mage.abilities.common.CastOnlyDuringPhaseStepSourceAbility; import mage.abilities.condition.common.OnOpponentsTurnCondition; import mage.abilities.effects.common.combat.CantAttackAnyPlayerAllEffect; @@ -35,9 +36,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.PhaseStep; -import mage.filter.common.FilterCreaturePermanent; - -import java.util.UUID; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; /** * @@ -46,15 +45,15 @@ import java.util.UUID; public class Festival extends CardImpl { public Festival(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{W}"); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{W}"); // Cast Festival only during an opponent's upkeep. this.addAbility(new CastOnlyDuringPhaseStepSourceAbility(null, PhaseStep.UPKEEP, OnOpponentsTurnCondition.instance, "Cast {this} only during an opponent's upkeep")); - + // Creatures can't attack this turn. - this.getSpellAbility().addEffect(new CantAttackAnyPlayerAllEffect(Duration.EndOfTurn, new FilterCreaturePermanent("creatures"))); - + this.getSpellAbility().addEffect(new CantAttackAnyPlayerAllEffect(Duration.EndOfTurn, FILTER_PERMANENT_CREATURES)); + } public Festival(final Festival card) { diff --git a/Mage.Sets/src/mage/cards/f/FiremantleMage.java b/Mage.Sets/src/mage/cards/f/FiremantleMage.java index 7857bd999a..e1f4d3fdd4 100644 --- a/Mage.Sets/src/mage/cards/f/FiremantleMage.java +++ b/Mage.Sets/src/mage/cards/f/FiremantleMage.java @@ -27,6 +27,7 @@ */ package mage.cards.f; +import java.util.UUID; import mage.MageInt; import mage.abilities.common.AllyEntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; @@ -35,9 +36,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; -import mage.filter.common.FilterCreaturePermanent; - -import java.util.UUID; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; /** * @@ -46,7 +45,7 @@ import java.util.UUID; public class FiremantleMage extends CardImpl { public FiremantleMage(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}"); this.subtype.add("Human"); this.subtype.add("Shaman"); this.subtype.add("Ally"); @@ -55,7 +54,7 @@ public class FiremantleMage extends CardImpl { // Rally — Whenver Firemantle Mage or another Ally enters the battlefield under your control, creatures you control gain menace until end of turn. this.addAbility(new AllyEntersBattlefieldTriggeredAbility( - new GainAbilityControlledEffect(new MenaceAbility(), Duration.EndOfTurn, new FilterCreaturePermanent("creatures")), false)); + new GainAbilityControlledEffect(new MenaceAbility(), Duration.EndOfTurn, FILTER_PERMANENT_CREATURES), false)); } public FiremantleMage(final FiremantleMage card) { diff --git a/Mage.Sets/src/mage/cards/f/FlyingCraneTechnique.java b/Mage.Sets/src/mage/cards/f/FlyingCraneTechnique.java index 767e108187..bd53d54d7c 100644 --- a/Mage.Sets/src/mage/cards/f/FlyingCraneTechnique.java +++ b/Mage.Sets/src/mage/cards/f/FlyingCraneTechnique.java @@ -27,6 +27,7 @@ */ package mage.cards.f; +import java.util.UUID; import mage.abilities.effects.Effect; import mage.abilities.effects.common.UntapAllControllerEffect; import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; @@ -36,9 +37,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; -import mage.filter.common.FilterCreaturePermanent; - -import java.util.UUID; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; /** * @@ -47,16 +46,14 @@ import java.util.UUID; public class FlyingCraneTechnique extends CardImpl { public FlyingCraneTechnique(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{3}{U}{R}{W}"); - + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{U}{R}{W}"); // Untap all creatures you control. They gain flying and double strike until end of turn. - FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures"); - this.getSpellAbility().addEffect(new UntapAllControllerEffect(filter)); - Effect effect = new GainAbilityControlledEffect(FlyingAbility.getInstance(), Duration.EndOfTurn, filter); + this.getSpellAbility().addEffect(new UntapAllControllerEffect(FILTER_PERMANENT_CREATURES)); + Effect effect = new GainAbilityControlledEffect(FlyingAbility.getInstance(), Duration.EndOfTurn, FILTER_PERMANENT_CREATURES); effect.setText("They gain flying"); this.getSpellAbility().addEffect(effect); - effect = new GainAbilityControlledEffect(DoubleStrikeAbility.getInstance(), Duration.EndOfTurn, filter); + effect = new GainAbilityControlledEffect(DoubleStrikeAbility.getInstance(), Duration.EndOfTurn, FILTER_PERMANENT_CREATURES); effect.setText("and double strike until end of turn"); this.getSpellAbility().addEffect(effect); } diff --git a/Mage.Sets/src/mage/cards/f/Forfend.java b/Mage.Sets/src/mage/cards/f/Forfend.java index 934d49eedb..a7a638e82b 100644 --- a/Mage.Sets/src/mage/cards/f/Forfend.java +++ b/Mage.Sets/src/mage/cards/f/Forfend.java @@ -27,14 +27,13 @@ */ package mage.cards.f; +import java.util.UUID; import mage.abilities.effects.common.PreventAllDamageToAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; -import mage.filter.common.FilterCreaturePermanent; - -import java.util.UUID; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; /** * @@ -43,10 +42,10 @@ import java.util.UUID; public class Forfend extends CardImpl { public Forfend(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{W}"); // Prevent all damage that would be dealt to creatures this turn. - this.getSpellAbility().addEffect(new PreventAllDamageToAllEffect(Duration.EndOfTurn, new FilterCreaturePermanent("creatures"))); + this.getSpellAbility().addEffect(new PreventAllDamageToAllEffect(Duration.EndOfTurn, FILTER_PERMANENT_CREATURES)); } public Forfend(final Forfend card) { diff --git a/Mage.Sets/src/mage/cards/g/GlimpseTheSunGod.java b/Mage.Sets/src/mage/cards/g/GlimpseTheSunGod.java index 82a19d1bce..1f976adacb 100644 --- a/Mage.Sets/src/mage/cards/g/GlimpseTheSunGod.java +++ b/Mage.Sets/src/mage/cards/g/GlimpseTheSunGod.java @@ -27,6 +27,7 @@ */ package mage.cards.g; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.SpellAbility; import mage.abilities.effects.common.TapTargetEffect; @@ -34,27 +35,22 @@ import mage.abilities.effects.keyword.ScryEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.common.FilterCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; import mage.game.Game; import mage.target.common.TargetCreaturePermanent; -import java.util.UUID; - /** * * @author LevelX2 */ public class GlimpseTheSunGod extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures"); - public GlimpseTheSunGod(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{X}{W}"); - + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{X}{W}"); // Tap X target creatures. Scry 1. this.getSpellAbility().addEffect(new TapTargetEffect("X target creatures")); - this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 1,filter, false)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 1, FILTER_PERMANENT_CREATURES, false)); this.getSpellAbility().addEffect(new ScryEffect(1)); } @@ -67,8 +63,8 @@ public class GlimpseTheSunGod extends CardImpl { if (ability instanceof SpellAbility) { ability.getTargets().clear(); int numberToTap = ability.getManaCostsToPay().getX(); - numberToTap = Math.min(game.getBattlefield().count(filter, ability.getSourceId(), ability.getControllerId(), game), numberToTap); - ability.addTarget(new TargetCreaturePermanent(numberToTap, numberToTap, filter, false)); + numberToTap = Math.min(game.getBattlefield().count(FILTER_PERMANENT_CREATURES, ability.getSourceId(), ability.getControllerId(), game), numberToTap); + ability.addTarget(new TargetCreaturePermanent(numberToTap, numberToTap, FILTER_PERMANENT_CREATURES, false)); } } diff --git a/Mage.Sets/src/mage/cards/g/GrandMelee.java b/Mage.Sets/src/mage/cards/g/GrandMelee.java index d9f73d49b5..b6cb8bff30 100644 --- a/Mage.Sets/src/mage/cards/g/GrandMelee.java +++ b/Mage.Sets/src/mage/cards/g/GrandMelee.java @@ -27,6 +27,7 @@ */ package mage.cards.g; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.combat.AttacksIfAbleAllEffect; @@ -35,11 +36,9 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Zone; -import mage.filter.common.FilterCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; import mage.watchers.common.AttackedThisTurnWatcher; -import java.util.UUID; - /** * * @author fenhl @@ -47,14 +46,14 @@ import java.util.UUID; public class GrandMelee extends CardImpl { public GrandMelee(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{R}"); // All creatures attack each turn if able. - Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new AttacksIfAbleAllEffect(new FilterCreaturePermanent("creatures"))); + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new AttacksIfAbleAllEffect(FILTER_PERMANENT_CREATURES)); this.addAbility(ability, new AttackedThisTurnWatcher()); // All creatures block each turn if able. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BlocksIfAbleAllEffect(new FilterCreaturePermanent("creatures")))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BlocksIfAbleAllEffect(FILTER_PERMANENT_CREATURES))); } public GrandMelee(final GrandMelee card) { diff --git a/Mage.Sets/src/mage/cards/h/HolyMantle.java b/Mage.Sets/src/mage/cards/h/HolyMantle.java index 21bf8340f3..8273414f7f 100644 --- a/Mage.Sets/src/mage/cards/h/HolyMantle.java +++ b/Mage.Sets/src/mage/cards/h/HolyMantle.java @@ -28,11 +28,6 @@ package mage.cards.h; import java.util.UUID; -import mage.constants.AttachmentType; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.AttachEffect; @@ -42,7 +37,12 @@ import mage.abilities.keyword.EnchantAbility; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.filter.common.FilterCreaturePermanent; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -53,7 +53,7 @@ import mage.target.common.TargetCreaturePermanent; public class HolyMantle extends CardImpl { public HolyMantle(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{W}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}{W}"); this.subtype.add("Aura"); @@ -65,8 +65,8 @@ public class HolyMantle extends CardImpl { this.addAbility(ability); // Enchanted creature gets +2/+2 and has protection from creatures. - ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2,2, Duration.WhileOnBattlefield)); - ability.addEffect(new GainAbilityAttachedEffect(new ProtectionAbility(new FilterCreaturePermanent("creatures")), AttachmentType.AURA, Duration.WhileOnBattlefield)); + ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 2, Duration.WhileOnBattlefield)); + ability.addEffect(new GainAbilityAttachedEffect(new ProtectionAbility(FILTER_PERMANENT_CREATURES), AttachmentType.AURA, Duration.WhileOnBattlefield)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/i/IntruderAlarm.java b/Mage.Sets/src/mage/cards/i/IntruderAlarm.java index 9eb6f5a9be..7be697c5d9 100644 --- a/Mage.Sets/src/mage/cards/i/IntruderAlarm.java +++ b/Mage.Sets/src/mage/cards/i/IntruderAlarm.java @@ -38,6 +38,7 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.TargetController; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; import mage.filter.common.FilterCreaturePermanent; /** @@ -47,13 +48,12 @@ import mage.filter.common.FilterCreaturePermanent; public class IntruderAlarm extends CardImpl { public IntruderAlarm(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{U}"); - + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}"); // Creatures don't untap during their controllers' untap steps. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DontUntapInControllersUntapStepAllEffect(Duration.WhileOnBattlefield, TargetController.ANY, new FilterCreaturePermanent("creatures")))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DontUntapInControllersUntapStepAllEffect(Duration.WhileOnBattlefield, TargetController.ANY, FILTER_PERMANENT_CREATURES))); // Whenever a creature enters the battlefield, untap all creatures. - this.addAbility(new EntersBattlefieldAllTriggeredAbility(new UntapAllEffect(new FilterCreaturePermanent("creatures")), new FilterCreaturePermanent("a creature"))); + this.addAbility(new EntersBattlefieldAllTriggeredAbility(new UntapAllEffect(FILTER_PERMANENT_CREATURES), new FilterCreaturePermanent("a creature"))); } public IntruderAlarm(final IntruderAlarm card) { diff --git a/Mage.Sets/src/mage/cards/k/KiraGreatGlassSpinner.java b/Mage.Sets/src/mage/cards/k/KiraGreatGlassSpinner.java index ea48e7c169..499f7c9861 100644 --- a/Mage.Sets/src/mage/cards/k/KiraGreatGlassSpinner.java +++ b/Mage.Sets/src/mage/cards/k/KiraGreatGlassSpinner.java @@ -38,7 +38,7 @@ import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; -import mage.filter.common.FilterCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -53,7 +53,7 @@ import mage.watchers.common.NumberOfTimesPermanentTargetedATurnWatcher; public class KiraGreatGlassSpinner extends CardImpl { public KiraGreatGlassSpinner(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{U}{U}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}{U}"); this.subtype.add("Spirit"); addSuperType(SuperType.LEGENDARY); @@ -68,7 +68,7 @@ public class KiraGreatGlassSpinner extends CardImpl { effect.setText("counter that spell or ability"); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(new KiraGreatGlassSpinnerAbility(effect), Duration.WhileOnBattlefield, - new FilterCreaturePermanent("creatures"))), + FILTER_PERMANENT_CREATURES)), new NumberOfTimesPermanentTargetedATurnWatcher()); } @@ -125,4 +125,4 @@ class KiraGreatGlassSpinnerAbility extends TriggeredAbilityImpl { return "Whenever this creature becomes the target of a spell or ability for the first time in a turn, counter that spell or ability."; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/cards/k/KolaghanTheStormsFury.java b/Mage.Sets/src/mage/cards/k/KolaghanTheStormsFury.java index 7f01ab5919..4e7df5acbf 100644 --- a/Mage.Sets/src/mage/cards/k/KolaghanTheStormsFury.java +++ b/Mage.Sets/src/mage/cards/k/KolaghanTheStormsFury.java @@ -36,6 +36,7 @@ import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.permanent.ControllerPredicate; @@ -47,14 +48,14 @@ import mage.filter.predicate.permanent.ControllerPredicate; public class KolaghanTheStormsFury extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Dragon you control"); - + static { filter.add(new SubtypePredicate("Dragon")); filter.add(new ControllerPredicate(TargetController.YOU)); } - + public KolaghanTheStormsFury(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{R}"); addSuperType(SuperType.LEGENDARY); this.subtype.add("Dragon"); this.power = new MageInt(4); @@ -62,12 +63,12 @@ public class KolaghanTheStormsFury extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); - - // Whenever a Dragon you control attacks, creatures you control get +1/+0 until end of turn. + + // Whenever a Dragon you control attacks, creatures you control get +1/+0 until end of turn. this.addAbility(new AttacksAllTriggeredAbility( - new BoostControlledEffect(1, 0, Duration.EndOfTurn, new FilterCreaturePermanent("creatures"), false), + new BoostControlledEffect(1, 0, Duration.EndOfTurn, FILTER_PERMANENT_CREATURES, false), false, filter, SetTargetPointer.NONE, false)); - + // Dash {3}{B}{R} this.addAbility(new DashAbility(this, "{3}{B}{R}")); } diff --git a/Mage.Sets/src/mage/cards/k/KorBladewhirl.java b/Mage.Sets/src/mage/cards/k/KorBladewhirl.java index a3fe86ff2b..c162f63f81 100644 --- a/Mage.Sets/src/mage/cards/k/KorBladewhirl.java +++ b/Mage.Sets/src/mage/cards/k/KorBladewhirl.java @@ -36,7 +36,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; -import mage.filter.common.FilterCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; /** * @@ -45,7 +45,7 @@ import mage.filter.common.FilterCreaturePermanent; public class KorBladewhirl extends CardImpl { public KorBladewhirl(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}"); this.subtype.add("Kor"); this.subtype.add("Soldier"); this.subtype.add("Ally"); @@ -54,7 +54,7 @@ public class KorBladewhirl extends CardImpl { // Rally — Whenever Kor Bladewhirl or another Ally enters the battlefield under your control, creatures you control gain first strike until end of turn. this.addAbility(new AllyEntersBattlefieldTriggeredAbility( - new GainAbilityControlledEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent("creatures")), false)); + new GainAbilityControlledEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn, FILTER_PERMANENT_CREATURES), false)); } public KorBladewhirl(final KorBladewhirl card) { diff --git a/Mage.Sets/src/mage/cards/m/MasterOfPearls.java b/Mage.Sets/src/mage/cards/m/MasterOfPearls.java index c12937cf70..a3d5e9e154 100644 --- a/Mage.Sets/src/mage/cards/m/MasterOfPearls.java +++ b/Mage.Sets/src/mage/cards/m/MasterOfPearls.java @@ -37,7 +37,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; -import mage.filter.common.FilterCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; /** * @@ -46,7 +46,7 @@ import mage.filter.common.FilterCreaturePermanent; public class MasterOfPearls extends CardImpl { public MasterOfPearls(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}"); this.subtype.add("Human"); this.subtype.add("Monk"); @@ -56,7 +56,7 @@ public class MasterOfPearls extends CardImpl { // Morph {3}{W}{W} this.addAbility(new MorphAbility(this, new ManaCostsImpl("{3}{W}{W}"))); // When Master of Pearls is turned face up, creatures you control get +2/+2 until end of turn. - this.addAbility(new TurnedFaceUpSourceTriggeredAbility(new BoostControlledEffect(2,2, Duration.EndOfTurn, new FilterCreaturePermanent("creatures")))); + this.addAbility(new TurnedFaceUpSourceTriggeredAbility(new BoostControlledEffect(2, 2, Duration.EndOfTurn, FILTER_PERMANENT_CREATURES))); } public MasterOfPearls(final MasterOfPearls card) { diff --git a/Mage.Sets/src/mage/cards/m/MercilessEviction.java b/Mage.Sets/src/mage/cards/m/MercilessEviction.java index d8e02e2868..bedb27519b 100644 --- a/Mage.Sets/src/mage/cards/m/MercilessEviction.java +++ b/Mage.Sets/src/mage/cards/m/MercilessEviction.java @@ -28,13 +28,13 @@ package mage.cards.m; import java.util.UUID; -import mage.constants.CardType; import mage.abilities.Mode; import mage.abilities.effects.common.ExileAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; +import mage.constants.CardType; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; import mage.filter.common.FilterArtifactPermanent; -import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterEnchantmentPermanent; import mage.filter.common.FilterPlaneswalkerPermanent; @@ -45,14 +45,13 @@ import mage.filter.common.FilterPlaneswalkerPermanent; public class MercilessEviction extends CardImpl { public MercilessEviction(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{4}{W}{B}"); - + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{W}{B}"); // Choose one - Exile all artifacts this.getSpellAbility().addEffect(new ExileAllEffect(new FilterArtifactPermanent("artifacts"))); // or exile all creatures Mode mode = new Mode(); - mode.getEffects().add(new ExileAllEffect(new FilterCreaturePermanent("creatures"))); + mode.getEffects().add(new ExileAllEffect(FILTER_PERMANENT_CREATURES)); this.getSpellAbility().addMode(mode); // or exile all enchantments Mode mode2 = new Mode(); diff --git a/Mage.Sets/src/mage/cards/m/MillenniumFalcon.java b/Mage.Sets/src/mage/cards/m/MillenniumFalcon.java index 80eb3a39c1..377502bcf1 100644 --- a/Mage.Sets/src/mage/cards/m/MillenniumFalcon.java +++ b/Mage.Sets/src/mage/cards/m/MillenniumFalcon.java @@ -27,6 +27,7 @@ */ package mage.cards.m; +import java.util.UUID; import mage.MageInt; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; @@ -38,9 +39,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.SuperType; -import mage.filter.common.FilterCreaturePermanent; - -import java.util.UUID; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; /** * @@ -49,7 +48,7 @@ import java.util.UUID; public class MillenniumFalcon extends CardImpl { public MillenniumFalcon(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT,CardType.CREATURE},"{3}{G}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}{G}{G}"); addSuperType(SuperType.LEGENDARY); this.subtype.add("Starship"); this.power = new MageInt(5); @@ -62,7 +61,7 @@ public class MillenniumFalcon extends CardImpl { this.addAbility(SpaceflightAbility.getInstance()); // When Millennium Falcon enters the battlefield, creatures you control gain hexproof until end of turn. - this.addAbility(new EntersBattlefieldTriggeredAbility(new GainAbilityControlledEffect(HexproofAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent("creatures")))); + this.addAbility(new EntersBattlefieldTriggeredAbility(new GainAbilityControlledEffect(HexproofAbility.getInstance(), Duration.EndOfTurn, FILTER_PERMANENT_CREATURES))); } public MillenniumFalcon(final MillenniumFalcon card) { diff --git a/Mage.Sets/src/mage/cards/n/NayaCharm.java b/Mage.Sets/src/mage/cards/n/NayaCharm.java index a91a6c56cf..d71fca7125 100644 --- a/Mage.Sets/src/mage/cards/n/NayaCharm.java +++ b/Mage.Sets/src/mage/cards/n/NayaCharm.java @@ -35,7 +35,7 @@ import mage.abilities.effects.common.TapAllTargetPlayerControlsEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.common.FilterCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; import mage.target.TargetPlayer; import mage.target.common.TargetCardInGraveyard; import mage.target.common.TargetCreaturePermanent; @@ -47,7 +47,7 @@ import mage.target.common.TargetCreaturePermanent; public class NayaCharm extends CardImpl { public NayaCharm(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{R}{G}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{R}{G}{W}"); // Choose one - Naya Charm deals 3 damage to target creature; this.getSpellAbility().addEffect(new DamageTargetEffect(3)); @@ -59,7 +59,7 @@ public class NayaCharm extends CardImpl { this.getSpellAbility().addMode(mode); // or tap all creatures target player controls. mode = new Mode(); - mode.getEffects().add(new TapAllTargetPlayerControlsEffect(new FilterCreaturePermanent("creatures"))); + mode.getEffects().add(new TapAllTargetPlayerControlsEffect(FILTER_PERMANENT_CREATURES)); mode.getTargets().add(new TargetPlayer()); this.getSpellAbility().addMode(mode); } diff --git a/Mage.Sets/src/mage/cards/n/NephaliaMoondrakes.java b/Mage.Sets/src/mage/cards/n/NephaliaMoondrakes.java index c361452e0f..91dfe1edf8 100644 --- a/Mage.Sets/src/mage/cards/n/NephaliaMoondrakes.java +++ b/Mage.Sets/src/mage/cards/n/NephaliaMoondrakes.java @@ -42,7 +42,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Zone; -import mage.filter.common.FilterCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; import mage.target.common.TargetCreaturePermanent; /** @@ -50,9 +50,9 @@ import mage.target.common.TargetCreaturePermanent; * @author fireshoes */ public class NephaliaMoondrakes extends CardImpl { - + public NephaliaMoondrakes(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{U}{U}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{U}{U}"); this.subtype.add("Drake"); this.power = new MageInt(5); this.toughness = new MageInt(5); @@ -66,7 +66,7 @@ public class NephaliaMoondrakes extends CardImpl { this.addAbility(ability); // {4}{U}{U}, Exile Nephalia Moondrakes from your graveyard: Creatures you control gain flying until end of turn. - ability = new SimpleActivatedAbility(Zone.GRAVEYARD, new GainAbilityControlledEffect(FlyingAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent("creatures")), new ManaCostsImpl("{4}{U}{U}")); + ability = new SimpleActivatedAbility(Zone.GRAVEYARD, new GainAbilityControlledEffect(FlyingAbility.getInstance(), Duration.EndOfTurn, FILTER_PERMANENT_CREATURES), new ManaCostsImpl("{4}{U}{U}")); ability.addCost(new ExileSourceFromGraveCost()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/o/OnduChampion.java b/Mage.Sets/src/mage/cards/o/OnduChampion.java index 79a8e366a2..8ed1c4a243 100644 --- a/Mage.Sets/src/mage/cards/o/OnduChampion.java +++ b/Mage.Sets/src/mage/cards/o/OnduChampion.java @@ -36,7 +36,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; -import mage.filter.common.FilterCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; /** * @@ -45,7 +45,7 @@ import mage.filter.common.FilterCreaturePermanent; public class OnduChampion extends CardImpl { public OnduChampion(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}{R}"); this.subtype.add("Minotaur"); this.subtype.add("Warrior"); this.subtype.add("Ally"); @@ -54,7 +54,7 @@ public class OnduChampion extends CardImpl { // Rally — Whenever Ondu Champion or another Ally enters the battlefield under your control, creatures you control gain trample until end of turn. this.addAbility(new AllyEntersBattlefieldTriggeredAbility( - new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent("creatures")), false)); + new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.EndOfTurn, FILTER_PERMANENT_CREATURES), false)); } public OnduChampion(final OnduChampion card) { diff --git a/Mage.Sets/src/mage/cards/o/OrimsChant.java b/Mage.Sets/src/mage/cards/o/OrimsChant.java index fa13e3ef13..ed01de995d 100644 --- a/Mage.Sets/src/mage/cards/o/OrimsChant.java +++ b/Mage.Sets/src/mage/cards/o/OrimsChant.java @@ -39,7 +39,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; -import mage.filter.common.FilterCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; import mage.game.Game; import mage.game.events.GameEvent; import mage.players.Player; @@ -52,7 +52,7 @@ import mage.target.TargetPlayer; public class OrimsChant extends CardImpl { public OrimsChant(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{W}"); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{W}"); // Kicker {W} (You may pay an additional {W} as you cast this spell.) this.addAbility(new KickerAbility("{W}")); @@ -123,7 +123,7 @@ class OrimsChantEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null && KickedCondition.instance.apply(game, source)) { - game.addEffect(new CantAttackAnyPlayerAllEffect(Duration.EndOfTurn, new FilterCreaturePermanent("creatures")), source); + game.addEffect(new CantAttackAnyPlayerAllEffect(Duration.EndOfTurn, FILTER_PERMANENT_CREATURES), source); return true; } return false; diff --git a/Mage.Sets/src/mage/cards/p/PendrellMists.java b/Mage.Sets/src/mage/cards/p/PendrellMists.java index f8daa4bc55..e52173a217 100644 --- a/Mage.Sets/src/mage/cards/p/PendrellMists.java +++ b/Mage.Sets/src/mage/cards/p/PendrellMists.java @@ -40,7 +40,7 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.TargetController; import mage.constants.Zone; -import mage.filter.common.FilterCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; /** * @@ -49,12 +49,11 @@ import mage.filter.common.FilterCreaturePermanent; public class PendrellMists extends CardImpl { public PendrellMists(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{U}"); - + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}"); // All creatures have "At the beginning of your upkeep, sacrifice this creature unless you pay {1}." Ability gainedAbility = new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new GenericManaCost(1)), TargetController.YOU, false); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(gainedAbility, Duration.WhileOnBattlefield, new FilterCreaturePermanent("creatures"), + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(gainedAbility, Duration.WhileOnBattlefield, FILTER_PERMANENT_CREATURES, "All creatures have \"At the beginning of your upkeep, sacrifice this creature unless you pay {1}"))); } diff --git a/Mage.Sets/src/mage/cards/p/Plaxmanta.java b/Mage.Sets/src/mage/cards/p/Plaxmanta.java index 482b32e575..fe148f7521 100644 --- a/Mage.Sets/src/mage/cards/p/Plaxmanta.java +++ b/Mage.Sets/src/mage/cards/p/Plaxmanta.java @@ -40,7 +40,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.ColoredManaSymbol; import mage.constants.Duration; -import mage.filter.common.FilterCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; import mage.watchers.common.ManaSpentToCastWatcher; /** @@ -50,18 +50,18 @@ import mage.watchers.common.ManaSpentToCastWatcher; public class Plaxmanta extends CardImpl { public Plaxmanta(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{U}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}"); this.subtype.add("Beast"); this.power = new MageInt(2); this.toughness = new MageInt(2); // Flash this.addAbility(FlashAbility.getInstance()); - + // When Plaxmanta enters the battlefield, creatures you control gain shroud until end of turn. this.addAbility(new EntersBattlefieldTriggeredAbility( - new GainAbilityControlledEffect(ShroudAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent("creatures")))); - + new GainAbilityControlledEffect(ShroudAbility.getInstance(), Duration.EndOfTurn, FILTER_PERMANENT_CREATURES))); + // When Plaxmanta enters the battlefield, sacrifice it unless {G} was spent to cast it. this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessConditionEffect(new ManaWasSpentCondition(ColoredManaSymbol.G)), false), new ManaSpentToCastWatcher()); } diff --git a/Mage.Sets/src/mage/cards/r/ReapWhatIsSown.java b/Mage.Sets/src/mage/cards/r/ReapWhatIsSown.java index a6d661edec..efeafe5122 100644 --- a/Mage.Sets/src/mage/cards/r/ReapWhatIsSown.java +++ b/Mage.Sets/src/mage/cards/r/ReapWhatIsSown.java @@ -34,7 +34,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.counters.CounterType; -import mage.filter.common.FilterCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; import mage.target.common.TargetCreaturePermanent; /** @@ -44,14 +44,13 @@ import mage.target.common.TargetCreaturePermanent; public class ReapWhatIsSown extends CardImpl { public ReapWhatIsSown(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{G}{W}"); - + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{G}{W}"); // Put a +1/+1 counter on each of up to three target creatures. Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance()); effect.setText("Put a +1/+1 counter on each of up to three target creatures"); this.getSpellAbility().addEffect(effect); - this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 3, new FilterCreaturePermanent("creatures"), false)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 3, FILTER_PERMANENT_CREATURES, false)); } public ReapWhatIsSown(final ReapWhatIsSown card) { diff --git a/Mage.Sets/src/mage/cards/r/Rout.java b/Mage.Sets/src/mage/cards/r/Rout.java index ea4fb2fbf2..1a7dd5d971 100644 --- a/Mage.Sets/src/mage/cards/r/Rout.java +++ b/Mage.Sets/src/mage/cards/r/Rout.java @@ -36,19 +36,19 @@ import mage.abilities.effects.common.DestroyAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.common.FilterCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; /** * * @author LoneFox - + * */ public class Rout extends CardImpl { public Rout(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{W}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{W}{W}"); - Effect effect = new DestroyAllEffect(new FilterCreaturePermanent("creatures"), true); + Effect effect = new DestroyAllEffect(FILTER_PERMANENT_CREATURES, true); // You may cast Rout as though it had flash if you pay {2} more to cast it. Ability ability = new PayMoreToCastAsThoughtItHadFlashAbility(this, new ManaCostsImpl("{2}")); ability.addEffect(effect); diff --git a/Mage.Sets/src/mage/cards/s/SublimeExhalation.java b/Mage.Sets/src/mage/cards/s/SublimeExhalation.java index 6e77752015..676713cfef 100644 --- a/Mage.Sets/src/mage/cards/s/SublimeExhalation.java +++ b/Mage.Sets/src/mage/cards/s/SublimeExhalation.java @@ -33,7 +33,7 @@ import mage.abilities.keyword.UndauntedAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.common.FilterCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; /** * @@ -48,7 +48,7 @@ public class SublimeExhalation extends CardImpl { this.addAbility(new UndauntedAbility()); // Destroy all creatures. - getSpellAbility().addEffect(new DestroyAllEffect(new FilterCreaturePermanent("creatures"))); + getSpellAbility().addEffect(new DestroyAllEffect(FILTER_PERMANENT_CREATURES)); } public SublimeExhalation(final SublimeExhalation card) { diff --git a/Mage.Sets/src/mage/cards/s/SunQuanLordOfWu.java b/Mage.Sets/src/mage/cards/s/SunQuanLordOfWu.java index a30e27c2d7..13f1206b83 100644 --- a/Mage.Sets/src/mage/cards/s/SunQuanLordOfWu.java +++ b/Mage.Sets/src/mage/cards/s/SunQuanLordOfWu.java @@ -38,7 +38,7 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.SuperType; import mage.constants.Zone; -import mage.filter.common.FilterCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; /** * @@ -47,7 +47,7 @@ import mage.filter.common.FilterCreaturePermanent; public class SunQuanLordOfWu extends CardImpl { public SunQuanLordOfWu(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{U}{U}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{U}{U}"); addSuperType(SuperType.LEGENDARY); this.subtype.add("Human"); this.subtype.add("Soldier"); @@ -56,8 +56,8 @@ public class SunQuanLordOfWu extends CardImpl { this.toughness = new MageInt(4); // Creatures you control have horsemanship. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(HorsemanshipAbility.getInstance(), - Duration.WhileOnBattlefield, new FilterCreaturePermanent("creatures")))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(HorsemanshipAbility.getInstance(), + Duration.WhileOnBattlefield, FILTER_PERMANENT_CREATURES))); } public SunQuanLordOfWu(final SunQuanLordOfWu card) { diff --git a/Mage.Sets/src/mage/cards/t/TamiyoFieldResearcher.java b/Mage.Sets/src/mage/cards/t/TamiyoFieldResearcher.java index 3c673bf04c..b4960aaaa0 100644 --- a/Mage.Sets/src/mage/cards/t/TamiyoFieldResearcher.java +++ b/Mage.Sets/src/mage/cards/t/TamiyoFieldResearcher.java @@ -49,7 +49,7 @@ import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.Zone; import mage.filter.FilterPermanent; -import mage.filter.common.FilterCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; @@ -81,7 +81,7 @@ public class TamiyoFieldResearcher extends CardImpl { // +1: Choose up to two target creatures. Until your next turn, whenever either of those creatures deals combat damage, you draw a card. Ability ability = new LoyaltyAbility(new TamiyoFieldResearcherEffect1(), 1); - ability.addTarget(new TargetCreaturePermanent(0, 2, new FilterCreaturePermanent("creatures"), false)); + ability.addTarget(new TargetCreaturePermanent(0, 2, FILTER_PERMANENT_CREATURES, false)); this.addAbility(ability); // -2: Tap up to two target nonland permanents. They don't untap during their controller's next untap step. @@ -199,4 +199,3 @@ class TamiyoFieldResearcherEmblem extends Emblem { this.getAbilities().add(new SimpleStaticAbility(Zone.COMMAND, new CastFromHandWithoutPayingManaCostEffect())); } } - diff --git a/Mage.Sets/src/mage/cards/t/TeysaEnvoyOfGhosts.java b/Mage.Sets/src/mage/cards/t/TeysaEnvoyOfGhosts.java index 6875e52268..475c825af1 100644 --- a/Mage.Sets/src/mage/cards/t/TeysaEnvoyOfGhosts.java +++ b/Mage.Sets/src/mage/cards/t/TeysaEnvoyOfGhosts.java @@ -39,7 +39,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SuperType; import mage.constants.Zone; -import mage.filter.common.FilterCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; @@ -65,7 +65,7 @@ public class TeysaEnvoyOfGhosts extends CardImpl { // Vigilance this.addAbility(VigilanceAbility.getInstance()); // protection from creatures - this.addAbility(new ProtectionAbility(new FilterCreaturePermanent("creatures"))); + this.addAbility(new ProtectionAbility(FILTER_PERMANENT_CREATURES)); // Whenever a creature deals combat damage to you, destroy that creature. Create a 1/1 white and black Spirit creature token with flying. this.addAbility(new TeysaEnvoyOfGhostsTriggeredAbility()); diff --git a/Mage.Sets/src/mage/cards/u/UnquestionedAuthority.java b/Mage.Sets/src/mage/cards/u/UnquestionedAuthority.java index 321319ac0d..ada9351e22 100644 --- a/Mage.Sets/src/mage/cards/u/UnquestionedAuthority.java +++ b/Mage.Sets/src/mage/cards/u/UnquestionedAuthority.java @@ -42,7 +42,7 @@ import mage.constants.AttachmentType; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Zone; -import mage.filter.common.FilterCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -52,13 +52,10 @@ import mage.target.common.TargetCreaturePermanent; */ public class UnquestionedAuthority extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures"); - public UnquestionedAuthority(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}"); this.subtype.add("Aura"); - // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); @@ -69,7 +66,8 @@ public class UnquestionedAuthority extends CardImpl { // When Unquestioned Authority enters the battlefield, draw a card. this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1))); // Enchanted creature has protection from creatures. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(new ProtectionAbility(filter), AttachmentType.AURA))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, + new GainAbilityAttachedEffect(new ProtectionAbility(FILTER_PERMANENT_CREATURES), AttachmentType.AURA))); } public UnquestionedAuthority(final UnquestionedAuthority card) { diff --git a/Mage.Sets/src/mage/cards/w/WarmongerHellkite.java b/Mage.Sets/src/mage/cards/w/WarmongerHellkite.java index 2b22d11f0c..493e6917a1 100644 --- a/Mage.Sets/src/mage/cards/w/WarmongerHellkite.java +++ b/Mage.Sets/src/mage/cards/w/WarmongerHellkite.java @@ -41,8 +41,8 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Zone; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; import mage.filter.common.FilterAttackingCreature; -import mage.filter.common.FilterCreaturePermanent; /** * @@ -51,7 +51,7 @@ import mage.filter.common.FilterCreaturePermanent; public class WarmongerHellkite extends CardImpl { public WarmongerHellkite(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{R}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{R}{R}"); this.subtype.add("Dragon"); this.power = new MageInt(5); @@ -61,7 +61,7 @@ public class WarmongerHellkite extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // All creatures attack each combat if able. - Effect effect = new AttacksIfAbleAllEffect(new FilterCreaturePermanent("creatures"), Duration.WhileOnBattlefield, true); + Effect effect = new AttacksIfAbleAllEffect(FILTER_PERMANENT_CREATURES, Duration.WhileOnBattlefield, true); effect.setText("All creatures attack each combat if able"); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); diff --git a/Mage.Sets/src/mage/cards/w/WordOfBinding.java b/Mage.Sets/src/mage/cards/w/WordOfBinding.java index 3b0ceaa510..41d6192521 100644 --- a/Mage.Sets/src/mage/cards/w/WordOfBinding.java +++ b/Mage.Sets/src/mage/cards/w/WordOfBinding.java @@ -34,7 +34,7 @@ import mage.abilities.effects.common.TapTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.common.FilterCreaturePermanent; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; import mage.game.Game; import mage.target.common.TargetCreaturePermanent; @@ -43,15 +43,13 @@ import mage.target.common.TargetCreaturePermanent; * @author fireshoes */ public class WordOfBinding extends CardImpl { - - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures"); public WordOfBinding(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{B}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{B}{B}"); // Tap X target creatures. this.getSpellAbility().addEffect(new TapTargetEffect("X target creatures")); - this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 1,filter, false)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 1, FILTER_PERMANENT_CREATURES, false)); } public WordOfBinding(final WordOfBinding card) { @@ -63,11 +61,11 @@ public class WordOfBinding extends CardImpl { if (ability instanceof SpellAbility) { ability.getTargets().clear(); int numberToTap = ability.getManaCostsToPay().getX(); - numberToTap = Math.min(game.getBattlefield().count(filter, ability.getSourceId(), ability.getControllerId(), game), numberToTap); - ability.addTarget(new TargetCreaturePermanent(numberToTap, numberToTap, filter, false)); + numberToTap = Math.min(game.getBattlefield().count(FILTER_PERMANENT_CREATURES, ability.getSourceId(), ability.getControllerId(), game), numberToTap); + ability.addTarget(new TargetCreaturePermanent(numberToTap, numberToTap, FILTER_PERMANENT_CREATURES, false)); } } - + @Override public WordOfBinding copy() { return new WordOfBinding(this); diff --git a/Mage.Sets/src/mage/cards/w/WrathOfGod.java b/Mage.Sets/src/mage/cards/w/WrathOfGod.java index a52c85976c..63add16e29 100644 --- a/Mage.Sets/src/mage/cards/w/WrathOfGod.java +++ b/Mage.Sets/src/mage/cards/w/WrathOfGod.java @@ -28,11 +28,11 @@ package mage.cards.w; import java.util.UUID; -import mage.constants.CardType; import mage.abilities.effects.common.DestroyAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.filter.common.FilterCreaturePermanent; +import mage.constants.CardType; +import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES; /** * @@ -41,11 +41,10 @@ import mage.filter.common.FilterCreaturePermanent; public class WrathOfGod extends CardImpl { public WrathOfGod(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{W}{W}"); - + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{W}{W}"); // Destroy all creatures. They can't be regenerated. - this.getSpellAbility().addEffect(new DestroyAllEffect(new FilterCreaturePermanent("creatures"), true)); + this.getSpellAbility().addEffect(new DestroyAllEffect(FILTER_PERMANENT_CREATURES, true)); } public WrathOfGod(final WrathOfGod card) { diff --git a/Mage/src/main/java/mage/filter/StaticFilters.java b/Mage/src/main/java/mage/filter/StaticFilters.java index cd00c03bd6..b244ca4801 100644 --- a/Mage/src/main/java/mage/filter/StaticFilters.java +++ b/Mage/src/main/java/mage/filter/StaticFilters.java @@ -35,6 +35,7 @@ public final class StaticFilters { public static final FilterCard FILTER_CARD_ARTIFACT_OR_CREATURE = new FilterCard("artifact or creature card"); public static final FilterCreaturePermanent FILTER_PERMANENT_CREATURE = new FilterCreaturePermanent(); + public static final FilterCreaturePermanent FILTER_PERMANENT_CREATURES = new FilterCreaturePermanent("creatures"); public static final FilterCreaturePermanent FILTER_PERMANENT_CREATURE_GOBLINS = new FilterCreaturePermanent("Goblin", "Goblin creatures"); public static final FilterCreaturePermanent FILTER_PERMANENT_CREATURE_SLIVERS = new FilterCreaturePermanent("Sliver", "Sliver creatures");