From 0a8a9ed00de5dbd82a001c005402d1735ff9feb9 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Fri, 20 Dec 2019 23:50:01 +0100 Subject: [PATCH] * Replaced some filters by StaticFilters instances. --- .../mage/cards/a/AjaniValiantProtector.java | 5 +- Mage.Sets/src/mage/cards/a/AltarOfBone.java | 5 +- .../src/mage/cards/a/AnimalMagnetism.java | 7 +- Mage.Sets/src/mage/cards/a/AvatarOfWoe.java | 15 +- Mage.Sets/src/mage/cards/b/BalduvianDead.java | 5 +- .../src/mage/cards/b/BlossomingWreath.java | 7 +- .../src/mage/cards/b/BoldwyrHeavyweights.java | 7 +- Mage.Sets/src/mage/cards/b/Bonehoard.java | 5 +- Mage.Sets/src/mage/cards/b/BoneyardWurm.java | 8 +- .../src/mage/cards/b/BreakingEntering.java | 5 +- Mage.Sets/src/mage/cards/b/BuriedAlive.java | 17 +- Mage.Sets/src/mage/cards/c/CauldronDance.java | 4 +- .../mage/cards/c/ChainerNightmareAdept.java | 13 +- .../src/mage/cards/c/ChordOfCalling.java | 5 +- .../src/mage/cards/c/CorpseConnoisseur.java | 14 +- .../src/mage/cards/c/CryptIncursion.java | 16 +- .../src/mage/cards/d/DarigaazsCharm.java | 9 +- Mage.Sets/src/mage/cards/d/DeathOrGlory.java | 7 +- Mage.Sets/src/mage/cards/d/Deathrender.java | 9 +- .../src/mage/cards/d/DefenseOfTheHeart.java | 4 +- .../src/mage/cards/d/DrakestownForgotten.java | 13 +- Mage.Sets/src/mage/cards/d/DralnusPet.java | 7 +- .../src/mage/cards/d/DubiousChallenge.java | 12 +- .../src/mage/cards/e/EaterOfTheDead.java | 10 +- .../src/mage/cards/e/EnshrinedMemories.java | 5 +- .../src/mage/cards/e/ErebossEmissary.java | 7 +- .../src/mage/cards/e/EvolutionaryLeap.java | 5 +- .../src/mage/cards/e/ExoskeletalArmor.java | 7 +- .../src/mage/cards/e/ExtractFromDarkness.java | 7 +- Mage.Sets/src/mage/cards/f/FaunaShaman.java | 12 +- Mage.Sets/src/mage/cards/f/FerozsBan.java | 9 +- Mage.Sets/src/mage/cards/f/Flash.java | 5 +- Mage.Sets/src/mage/cards/f/FleshBlood.java | 5 +- .../src/mage/cards/f/FoldIntoAether.java | 7 +- .../src/mage/cards/f/FootstepsOfTheGoryo.java | 10 +- Mage.Sets/src/mage/cards/f/Foster.java | 16 +- Mage.Sets/src/mage/cards/g/Gamekeeper.java | 5 +- .../src/mage/cards/g/GarrukTheVeilCursed.java | 8 +- Mage.Sets/src/mage/cards/g/GarruksHorde.java | 7 +- .../src/mage/cards/g/GateToTheAfterlife.java | 5 +- Mage.Sets/src/mage/cards/g/GatherThePack.java | 6 +- .../src/mage/cards/g/GhastlyConscription.java | 10 +- Mage.Sets/src/mage/cards/g/GnawToTheBone.java | 8 +- Mage.Sets/src/mage/cards/g/GoblinTutor.java | 19 +- .../src/mage/cards/g/GolgariGraveTroll.java | 17 +- Mage.Sets/src/mage/cards/g/GraveStrength.java | 7 +- Mage.Sets/src/mage/cards/g/GraveUpheaval.java | 5 +- .../src/mage/cards/g/GravebladeMarauder.java | 9 +- Mage.Sets/src/mage/cards/g/GrimFlowering.java | 8 +- Mage.Sets/src/mage/cards/g/GuidedPassage.java | 8 +- .../src/mage/cards/h/HauntedFengraf.java | 7 +- .../src/mage/cards/h/HauntingMisery.java | 5 +- .../src/mage/cards/h/HonorTheFallen.java | 10 +- .../src/mage/cards/i/ImmortalServitude.java | 5 +- .../src/mage/cards/i/InvigoratingFalls.java | 7 +- .../mage/cards/j/JaradGolgariLichLord.java | 4 +- .../src/mage/cards/k/KamahlsSummons.java | 17 +- .../mage/cards/k/KaradorGhostChieftain.java | 24 +-- .../src/mage/cards/k/KessigCagebreakers.java | 7 +- Mage.Sets/src/mage/cards/k/KheruLichLord.java | 5 +- Mage.Sets/src/mage/cards/k/KraulForagers.java | 4 +- Mage.Sets/src/mage/cards/l/Lhurgoyf.java | 9 +- Mage.Sets/src/mage/cards/l/LilianaVess.java | 14 +- Mage.Sets/src/mage/cards/l/LilianasElite.java | 9 +- .../src/mage/cards/l/LilianasIndignation.java | 7 +- Mage.Sets/src/mage/cards/l/LivingDeath.java | 15 +- Mage.Sets/src/mage/cards/l/LivingEnd.java | 4 +- Mage.Sets/src/mage/cards/l/LordOfTheVoid.java | 6 +- .../src/mage/cards/m/MagisterOfWorth.java | 9 +- Mage.Sets/src/mage/cards/m/MindMaggots.java | 176 +++++++++--------- .../mage/cards/m/MomirVigSimicVisionary.java | 7 +- Mage.Sets/src/mage/cards/m/MorgueTheft.java | 12 +- Mage.Sets/src/mage/cards/m/MortalCombat.java | 13 +- .../mage/cards/n/NecromancersCovenant.java | 7 +- .../mage/cards/n/NecromancersStockpile.java | 9 +- .../src/mage/cards/n/NemesisOfMortals.java | 7 +- Mage.Sets/src/mage/cards/n/NetherSpirit.java | 7 +- Mage.Sets/src/mage/cards/n/Nighthowler.java | 9 +- .../src/mage/cards/o/OversoldCemetery.java | 4 +- Mage.Sets/src/mage/cards/p/PalaceSiege.java | 22 +-- Mage.Sets/src/mage/cards/p/Paleoloth.java | 17 +- .../src/mage/cards/p/PatternOfRebirth.java | 7 +- Mage.Sets/src/mage/cards/p/PitKeeper.java | 4 +- Mage.Sets/src/mage/cards/p/PrimalCommand.java | 19 +- Mage.Sets/src/mage/cards/r/RagMan.java | 10 +- Mage.Sets/src/mage/cards/r/Repopulate.java | 11 +- .../src/mage/cards/r/RitualOfTheReturned.java | 5 +- Mage.Sets/src/mage/cards/s/Seance.java | 7 +- Mage.Sets/src/mage/cards/s/SeedGuardian.java | 7 +- .../src/mage/cards/s/ShadowbornDemon.java | 4 +- .../src/mage/cards/s/ShadowsOfThePast.java | 7 +- .../src/mage/cards/s/SignalTheClans.java | 28 ++- .../src/mage/cards/s/SistersOfStoneDeath.java | 9 +- Mage.Sets/src/mage/cards/s/SithMagic.java | 7 +- .../src/mage/cards/s/SkyshroudVampire.java | 15 +- Mage.Sets/src/mage/cards/s/SneakAttack.java | 7 +- Mage.Sets/src/mage/cards/s/SongOfBlood.java | 5 +- .../src/mage/cards/s/SongsOfTheDamned.java | 7 +- .../src/mage/cards/s/SpiderSpawning.java | 5 +- Mage.Sets/src/mage/cards/s/SylvanTutor.java | 8 +- .../mage/cards/t/TarielReckonerOfSouls.java | 7 +- .../mage/cards/t/TemptWithImmortality.java | 6 +- Mage.Sets/src/mage/cards/t/TheMimeoplasm.java | 4 +- .../src/mage/cards/t/ThicketElemental.java | 5 +- .../src/mage/cards/t/ThroughTheBreach.java | 9 +- .../src/mage/cards/t/TombstoneStairwell.java | 17 +- Mage.Sets/src/mage/cards/t/ToothAndNail.java | 6 +- .../src/mage/cards/t/TorturedExistence.java | 4 +- .../src/mage/cards/t/TreacherousUrge.java | 11 +- .../mage/cards/u/UndergrowthScavenger.java | 9 +- .../mage/cards/u/UrzaAcademyHeadmaster.java | 5 +- Mage.Sets/src/mage/cards/v/VampireHounds.java | 13 +- Mage.Sets/src/mage/cards/v/VigorMortis.java | 5 +- .../src/mage/cards/v/VolrathTheFallen.java | 19 +- Mage.Sets/src/mage/cards/w/WeirdHarvest.java | 7 +- .../src/mage/cards/w/WindingCanyons.java | 5 +- .../src/mage/cards/w/WoodlandSleuth.java | 9 +- Mage.Sets/src/mage/cards/w/WorldlyTutor.java | 8 +- .../src/mage/cards/w/WreathOfGeists.java | 10 +- .../src/mage/cards/y/YoreTillerNephilim.java | 5 +- Mage.Sets/src/mage/cards/z/ZamWesell.java | 5 +- .../main/java/mage/filter/StaticFilters.java | 3 +- 122 files changed, 518 insertions(+), 710 deletions(-) diff --git a/Mage.Sets/src/mage/cards/a/AjaniValiantProtector.java b/Mage.Sets/src/mage/cards/a/AjaniValiantProtector.java index 7bec5ea3f3..146fe5af3e 100644 --- a/Mage.Sets/src/mage/cards/a/AjaniValiantProtector.java +++ b/Mage.Sets/src/mage/cards/a/AjaniValiantProtector.java @@ -1,4 +1,3 @@ - package mage.cards.a; import java.util.UUID; @@ -19,7 +18,7 @@ import mage.constants.SubType; import mage.constants.SuperType; import mage.constants.Zone; import mage.counters.CounterType; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.target.common.TargetCreaturePermanent; /** @@ -41,7 +40,7 @@ public final class AjaniValiantProtector extends CardImpl { this.addAbility(ability); // +1: Reveal cards from the top of your library until you reveal a creature card. Put that card into your hand and the rest on the bottom of your library in a random order. - this.addAbility(new LoyaltyAbility(new RevealCardsFromLibraryUntilEffect(new FilterCreatureCard(), Zone.HAND, Zone.LIBRARY), 1)); + this.addAbility(new LoyaltyAbility(new RevealCardsFromLibraryUntilEffect(StaticFilters.FILTER_CARD_CREATURE, Zone.HAND, Zone.LIBRARY), 1)); // -11: Put X +1/+1 counters on target creature, where X is your life total. That creature gains trample until end of turn. Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance(), ControllerLifeCount.instance); diff --git a/Mage.Sets/src/mage/cards/a/AltarOfBone.java b/Mage.Sets/src/mage/cards/a/AltarOfBone.java index ec907a76de..cbfd837b18 100644 --- a/Mage.Sets/src/mage/cards/a/AltarOfBone.java +++ b/Mage.Sets/src/mage/cards/a/AltarOfBone.java @@ -1,4 +1,3 @@ - package mage.cards.a; import java.util.UUID; @@ -7,8 +6,8 @@ import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; +import mage.filter.StaticFilters; import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; -import mage.filter.common.FilterCreatureCard; import mage.target.common.TargetCardInLibrary; import mage.target.common.TargetControlledCreaturePermanent; @@ -24,7 +23,7 @@ public final class AltarOfBone extends CardImpl { // As an additional cost to cast Altar of Bone, sacrifice a creature. this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); // Search your library for a creature card, reveal that card, and put it into your hand. Then shuffle your library. - this.getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(new FilterCreatureCard()), true)); + this.getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(StaticFilters.FILTER_CARD_CREATURE), true)); } public AltarOfBone(final AltarOfBone card) { diff --git a/Mage.Sets/src/mage/cards/a/AnimalMagnetism.java b/Mage.Sets/src/mage/cards/a/AnimalMagnetism.java index c5a369e1a8..58f04dd0a6 100644 --- a/Mage.Sets/src/mage/cards/a/AnimalMagnetism.java +++ b/Mage.Sets/src/mage/cards/a/AnimalMagnetism.java @@ -1,4 +1,3 @@ - package mage.cards.a; import java.util.Set; @@ -10,7 +9,7 @@ import mage.cards.*; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; import mage.target.Target; @@ -24,7 +23,7 @@ import mage.target.common.TargetOpponent; public final class AnimalMagnetism extends CardImpl { public AnimalMagnetism(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{4}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{G}"); // Reveal the top five cards of your library. An opponent chooses a creature card from among them. Put that card onto the battlefield and the rest into your graveyard. this.getSpellAbility().addEffect(new AnimalMagnetismEffect()); @@ -76,7 +75,7 @@ class AnimalMagnetismEffect extends OneShotEffect { controller.chooseTarget(Outcome.Detriment, target, source, game); opponent = game.getPlayer(target.getFirstTarget()); } - TargetCard target = new TargetCard(1, Zone.LIBRARY, new FilterCreatureCard()); + TargetCard target = new TargetCard(1, Zone.LIBRARY, StaticFilters.FILTER_CARD_CREATURE); opponent.chooseTarget(outcome, cards, target, source, game); cardToBattlefield = game.getCard(target.getFirstTarget()); } diff --git a/Mage.Sets/src/mage/cards/a/AvatarOfWoe.java b/Mage.Sets/src/mage/cards/a/AvatarOfWoe.java index b3e5e9516c..a8f9ca1893 100644 --- a/Mage.Sets/src/mage/cards/a/AvatarOfWoe.java +++ b/Mage.Sets/src/mage/cards/a/AvatarOfWoe.java @@ -1,4 +1,3 @@ - package mage.cards.a; import java.util.UUID; @@ -16,7 +15,7 @@ import mage.abilities.keyword.FearAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.target.common.TargetCreaturePermanent; @@ -27,17 +26,17 @@ import mage.target.common.TargetCreaturePermanent; public final class AvatarOfWoe extends CardImpl { public AvatarOfWoe(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{6}{B}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{6}{B}{B}"); this.subtype.add(SubType.AVATAR); this.power = new MageInt(6); this.toughness = new MageInt(5); // If there are ten or more creature cards total in all graveyards, Avatar of Woe costs {6} less to cast. this.addAbility(new SimpleStaticAbility(Zone.STACK, new AvatarOfWoeCostReductionEffect())); - + // Fear this.addAbility(FearAbility.getInstance()); - + // {tap}: Destroy target creature. It can't be regenerated. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(true), new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent()); @@ -83,9 +82,9 @@ class AvatarOfWoeCostReductionEffect extends CostModificationEffectImpl { @Override public boolean applies(Ability abilityToModify, Ability source, Game game) { - return abilityToModify.getSourceId().equals(source.getSourceId()) - && (abilityToModify instanceof SpellAbility) - && new CardsInAllGraveyardsCount(new FilterCreatureCard()).calculate(game, source, this) >= 10; + return abilityToModify.getSourceId().equals(source.getSourceId()) + && (abilityToModify instanceof SpellAbility) + && new CardsInAllGraveyardsCount(StaticFilters.FILTER_CARD_CREATURE).calculate(game, source, this) >= 10; } @Override diff --git a/Mage.Sets/src/mage/cards/b/BalduvianDead.java b/Mage.Sets/src/mage/cards/b/BalduvianDead.java index 4b5c00f242..c22274e13a 100644 --- a/Mage.Sets/src/mage/cards/b/BalduvianDead.java +++ b/Mage.Sets/src/mage/cards/b/BalduvianDead.java @@ -1,4 +1,3 @@ - package mage.cards.b; import java.util.UUID; @@ -18,7 +17,7 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.permanent.token.BalduvianToken; @@ -39,7 +38,7 @@ public final class BalduvianDead extends CardImpl { // {2}{R}, Exile a creature card from your graveyard: Create a 3/1 black and red Graveborn creature token with haste. Sacrifice it at the beginning of the next end step. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BalduvianDeadEffect(), new ManaCostsImpl("{2}{R}")); - TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(new FilterCreatureCard()); + TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE); ability.addCost(new ExileFromGraveCost(target)); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/b/BlossomingWreath.java b/Mage.Sets/src/mage/cards/b/BlossomingWreath.java index 6c2267a97b..ccd0d2970a 100644 --- a/Mage.Sets/src/mage/cards/b/BlossomingWreath.java +++ b/Mage.Sets/src/mage/cards/b/BlossomingWreath.java @@ -1,4 +1,3 @@ - package mage.cards.b; import java.util.UUID; @@ -8,7 +7,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Outcome; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; @@ -19,7 +18,7 @@ import mage.players.Player; public final class BlossomingWreath extends CardImpl { public BlossomingWreath(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{G}"); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{G}"); // You gain life equal to the number of creature cards in your graveyard. this.getSpellAbility().addEffect(new BlossomingWreathEffect()); @@ -54,7 +53,7 @@ public final class BlossomingWreath extends CardImpl { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - controller.gainLife(controller.getGraveyard().count(new FilterCreatureCard(), game), game, source); + controller.gainLife(controller.getGraveyard().count(StaticFilters.FILTER_CARD_CREATURE, game), game, source); return true; } return false; diff --git a/Mage.Sets/src/mage/cards/b/BoldwyrHeavyweights.java b/Mage.Sets/src/mage/cards/b/BoldwyrHeavyweights.java index f86567ffc2..3a0cc593f7 100644 --- a/Mage.Sets/src/mage/cards/b/BoldwyrHeavyweights.java +++ b/Mage.Sets/src/mage/cards/b/BoldwyrHeavyweights.java @@ -1,4 +1,3 @@ - package mage.cards.b; import java.util.HashSet; @@ -16,7 +15,7 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; import mage.target.common.TargetCardInLibrary; @@ -28,7 +27,7 @@ import mage.target.common.TargetCardInLibrary; public final class BoldwyrHeavyweights extends CardImpl { public BoldwyrHeavyweights(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(SubType.GIANT, SubType.WARRIOR); this.power = new MageInt(8); this.toughness = new MageInt(8); @@ -72,7 +71,7 @@ class BoldwyrHeavyweightsEffect extends OneShotEffect { for (UUID opponentId : game.getOpponents(source.getControllerId())) { Player opponent = game.getPlayer(opponentId); if (opponent != null && opponent.chooseUse(Outcome.PutCreatureInPlay, "Search your library for a creature card and put it onto the battlefield?", source, game)) { - TargetCardInLibrary target = new TargetCardInLibrary(new FilterCreatureCard()); + TargetCardInLibrary target = new TargetCardInLibrary(StaticFilters.FILTER_CARD_CREATURE); if (opponent.searchLibrary(target, source, game)) { Card targetCard = opponent.getLibrary().getCard(target.getFirstTarget(), game); if (targetCard != null) { diff --git a/Mage.Sets/src/mage/cards/b/Bonehoard.java b/Mage.Sets/src/mage/cards/b/Bonehoard.java index 5ff585c7e2..db147be0cd 100644 --- a/Mage.Sets/src/mage/cards/b/Bonehoard.java +++ b/Mage.Sets/src/mage/cards/b/Bonehoard.java @@ -1,4 +1,3 @@ - package mage.cards.b; import java.util.UUID; @@ -15,7 +14,7 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; /** * @author North @@ -30,7 +29,7 @@ public final class Bonehoard extends CardImpl { this.addAbility(new LivingWeaponAbility()); // Equipped creature gets +X/+X, where X is the number of creature cards in all graveyards. - CardsInAllGraveyardsCount value = new CardsInAllGraveyardsCount(new FilterCreatureCard()); + CardsInAllGraveyardsCount value = new CardsInAllGraveyardsCount(StaticFilters.FILTER_CARD_CREATURE); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(value, value))); // Equip {2} diff --git a/Mage.Sets/src/mage/cards/b/BoneyardWurm.java b/Mage.Sets/src/mage/cards/b/BoneyardWurm.java index 224c6eb2b3..42a921d771 100644 --- a/Mage.Sets/src/mage/cards/b/BoneyardWurm.java +++ b/Mage.Sets/src/mage/cards/b/BoneyardWurm.java @@ -1,4 +1,3 @@ - package mage.cards.b; import java.util.UUID; @@ -12,7 +11,7 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; /** * @author nantuko @@ -20,12 +19,11 @@ import mage.filter.common.FilterCreatureCard; public final class BoneyardWurm extends CardImpl { public BoneyardWurm(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}"); this.subtype.add(SubType.WURM); - // Boneyard Wurm's power and toughness are each equal to the number of creature cards in your graveyard. - DynamicValue value = new CardsInControllerGraveyardCount(new FilterCreatureCard()); + DynamicValue value = new CardsInControllerGraveyardCount(StaticFilters.FILTER_CARD_CREATURE); this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(value, Duration.EndOfGame))); } diff --git a/Mage.Sets/src/mage/cards/b/BreakingEntering.java b/Mage.Sets/src/mage/cards/b/BreakingEntering.java index eb51034f63..4c96f12ae4 100644 --- a/Mage.Sets/src/mage/cards/b/BreakingEntering.java +++ b/Mage.Sets/src/mage/cards/b/BreakingEntering.java @@ -1,4 +1,3 @@ - package mage.cards.b; import java.util.UUID; @@ -16,7 +15,7 @@ import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.SpellAbilityType; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; import mage.target.Target; @@ -70,7 +69,7 @@ class EnteringReturnFromGraveyardToBattlefieldEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - Target target = new TargetCardInGraveyard(new FilterCreatureCard()); + Target target = new TargetCardInGraveyard(StaticFilters.FILTER_CARD_CREATURE); target.setNotTarget(true); if (target.canChoose(source.getSourceId(), source.getControllerId(), game) && controller.chooseTarget(outcome, target, source, game)) { diff --git a/Mage.Sets/src/mage/cards/b/BuriedAlive.java b/Mage.Sets/src/mage/cards/b/BuriedAlive.java index ca43d18192..7b8e350a62 100644 --- a/Mage.Sets/src/mage/cards/b/BuriedAlive.java +++ b/Mage.Sets/src/mage/cards/b/BuriedAlive.java @@ -1,4 +1,3 @@ - package mage.cards.b; import java.util.UUID; @@ -10,7 +9,7 @@ import mage.cards.CardsImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; import mage.target.common.TargetCardInLibrary; @@ -21,14 +20,12 @@ import mage.target.common.TargetCardInLibrary; */ public final class BuriedAlive extends CardImpl { - public BuriedAlive(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{B}"); - + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{B}"); // Search your library for up to three creature cards and put them into your graveyard. Then shuffle your library. - this.getSpellAbility().addEffect(new BuriedAliveEffect()); - + this.getSpellAbility().addEffect(new BuriedAliveEffect()); + } public BuriedAlive(final BuriedAlive card) { @@ -43,8 +40,8 @@ public final class BuriedAlive extends CardImpl { class BuriedAliveEffect extends SearchEffect { - public BuriedAliveEffect() { - super(new TargetCardInLibrary(0, 3, new FilterCreatureCard()), Outcome.Detriment); + public BuriedAliveEffect() { + super(new TargetCardInLibrary(0, 3, StaticFilters.FILTER_CARD_CREATURE), Outcome.Detriment); staticText = "Search your library for up to three creature cards and put them into your graveyard. Then shuffle your library"; } @@ -69,5 +66,5 @@ class BuriedAliveEffect extends SearchEffect { } return false; } - + } diff --git a/Mage.Sets/src/mage/cards/c/CauldronDance.java b/Mage.Sets/src/mage/cards/c/CauldronDance.java index 3931ee4511..5bf9e334e3 100644 --- a/Mage.Sets/src/mage/cards/c/CauldronDance.java +++ b/Mage.Sets/src/mage/cards/c/CauldronDance.java @@ -1,4 +1,3 @@ - package mage.cards.c; import java.util.UUID; @@ -17,7 +16,6 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; import mage.filter.StaticFilters; -import mage.filter.common.FilterCreatureCard; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -120,7 +118,7 @@ class CauldronDancePutCreatureFromHandOntoBattlefieldEffect extends OneShotEffec Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { if (controller.chooseUse(Outcome.PutCreatureInPlay, CHOICE_TEXT, source, game)) { - TargetCardInHand target = new TargetCardInHand(new FilterCreatureCard()); + TargetCardInHand target = new TargetCardInHand(StaticFilters.FILTER_CARD_CREATURE); if (controller.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) { Card card = game.getCard(target.getFirstTarget()); if (card != null) { diff --git a/Mage.Sets/src/mage/cards/c/ChainerNightmareAdept.java b/Mage.Sets/src/mage/cards/c/ChainerNightmareAdept.java index 3925c361f6..c13928044b 100644 --- a/Mage.Sets/src/mage/cards/c/ChainerNightmareAdept.java +++ b/Mage.Sets/src/mage/cards/c/ChainerNightmareAdept.java @@ -1,5 +1,6 @@ package mage.cards.c; +import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldAllTriggeredAbility; @@ -14,8 +15,8 @@ import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; +import mage.filter.StaticFilters; import mage.filter.common.FilterControlledCreaturePermanent; -import mage.filter.common.FilterCreatureCard; import mage.filter.predicate.Predicates; import mage.filter.predicate.permanent.AnotherPredicate; import mage.filter.predicate.permanent.ControllerPredicate; @@ -28,8 +29,6 @@ import mage.target.targetpointer.FixedTarget; import mage.watchers.Watcher; import mage.watchers.common.CastFromHandWatcher; -import java.util.UUID; - /** * @author goesta */ @@ -86,7 +85,7 @@ class ChainerNightmareAdeptContinuousEffect extends ContinuousEffectImpl { return false; } - for (Card card : player.getGraveyard().getCards(new FilterCreatureCard(), game)) { + for (Card card : player.getGraveyard().getCards(StaticFilters.FILTER_CARD_CREATURE, game)) { ContinuousEffect effect = new ChainerNightmareAdeptCastFromGraveyardEffect(); effect.setTargetPointer(new FixedTarget(card.getId())); game.addEffect(effect, source); @@ -174,8 +173,8 @@ class ChainerNightmareAdeptWatcher extends Watcher { class ChainerNightmareAdeptTriggeredAbility extends EntersBattlefieldAllTriggeredAbility { - private final static String abilityText = "Whenever a nontoken creature enters the battlefield under your control, " + - "if you didn't cast it from your hand, it gains haste until your next turn."; + private final static String abilityText = "Whenever a nontoken creature enters the battlefield under your control, " + + "if you didn't cast it from your hand, it gains haste until your next turn."; private final static ContinuousEffect gainHasteUntilNextTurnEffect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.UntilYourNextTurn); private final static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("another nontoken creature"); @@ -198,4 +197,4 @@ class ChainerNightmareAdeptTriggeredAbility extends EntersBattlefieldAllTriggere CastFromHandWatcher watcher = game.getState().getWatcher(CastFromHandWatcher.class); return watcher != null && !watcher.spellWasCastFromHand(event.getSourceId()); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/cards/c/ChordOfCalling.java b/Mage.Sets/src/mage/cards/c/ChordOfCalling.java index 951c0a11b2..19ee96ddc8 100644 --- a/Mage.Sets/src/mage/cards/c/ChordOfCalling.java +++ b/Mage.Sets/src/mage/cards/c/ChordOfCalling.java @@ -1,4 +1,3 @@ - package mage.cards.c; import java.util.UUID; @@ -7,7 +6,7 @@ import mage.abilities.keyword.ConvokeAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; /** * @@ -22,7 +21,7 @@ public final class ChordOfCalling extends CardImpl { this.addAbility(new ConvokeAbility()); // Search your library for a creature card with converted mana cost X or less and put it onto the battlefield. Then shuffle your library. - this.getSpellAbility().addEffect(new SearchLibraryWithLessCMCPutInPlayEffect(new FilterCreatureCard())); + this.getSpellAbility().addEffect(new SearchLibraryWithLessCMCPutInPlayEffect(StaticFilters.FILTER_CARD_CREATURE)); } public ChordOfCalling(final ChordOfCalling card) { diff --git a/Mage.Sets/src/mage/cards/c/CorpseConnoisseur.java b/Mage.Sets/src/mage/cards/c/CorpseConnoisseur.java index d134fd60ac..98ddf5d9a4 100644 --- a/Mage.Sets/src/mage/cards/c/CorpseConnoisseur.java +++ b/Mage.Sets/src/mage/cards/c/CorpseConnoisseur.java @@ -1,4 +1,3 @@ - package mage.cards.c; import java.util.UUID; @@ -12,10 +11,10 @@ import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Outcome; +import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; import mage.target.common.TargetCardInLibrary; @@ -27,7 +26,7 @@ import mage.target.common.TargetCardInLibrary; public final class CorpseConnoisseur extends CardImpl { public CorpseConnoisseur(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}"); this.subtype.add(SubType.ZOMBIE); this.subtype.add(SubType.WIZARD); @@ -52,8 +51,8 @@ public final class CorpseConnoisseur extends CardImpl { class SearchLibraryPutInGraveyard extends SearchEffect { - public SearchLibraryPutInGraveyard() { - super(new TargetCardInLibrary(new FilterCreatureCard()), Outcome.Neutral); + public SearchLibraryPutInGraveyard() { + super(new TargetCardInLibrary(StaticFilters.FILTER_CARD_CREATURE), Outcome.Neutral); staticText = "search your library for a card and put that card into your graveyard. Then shuffle your library"; } @@ -80,9 +79,8 @@ class SearchLibraryPutInGraveyard extends SearchEffect { } controller.shuffleLibrary(source, game); return true; - } + } return false; } - } diff --git a/Mage.Sets/src/mage/cards/c/CryptIncursion.java b/Mage.Sets/src/mage/cards/c/CryptIncursion.java index b9ea02c562..81a8ce6eec 100644 --- a/Mage.Sets/src/mage/cards/c/CryptIncursion.java +++ b/Mage.Sets/src/mage/cards/c/CryptIncursion.java @@ -1,5 +1,3 @@ - - package mage.cards.c; import java.util.UUID; @@ -10,7 +8,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Outcome; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; import mage.target.TargetPlayer; @@ -19,19 +17,15 @@ import mage.target.TargetPlayer; * * @author LevelX2 */ - - public final class CryptIncursion extends CardImpl { public CryptIncursion(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{B}"); - + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{B}"); // Exile all creature cards from target player's graveyard. You gain 3 life for each card exiled this way. this.getSpellAbility().addTarget(new TargetPlayer()); this.getSpellAbility().addEffect(new CryptIncursionEffect()); - } public CryptIncursion(final CryptIncursion card) { @@ -47,8 +41,6 @@ public final class CryptIncursion extends CardImpl { class CryptIncursionEffect extends OneShotEffect { - private static final FilterCreatureCard filter = new FilterCreatureCard(); - public CryptIncursionEffect() { super(Outcome.Detriment); staticText = "Exile all creature cards from target player's graveyard. You gain 3 life for each card exiled this way"; @@ -64,8 +56,8 @@ class CryptIncursionEffect extends OneShotEffect { Player targetPlayer = game.getPlayer(source.getFirstTarget()); if (player != null && targetPlayer != null) { int exiledCards = 0; - for (Card card: targetPlayer.getGraveyard().getCards(game)) { - if (filter.match(card, game)) { + for (Card card : targetPlayer.getGraveyard().getCards(game)) { + if (StaticFilters.FILTER_CARD_CREATURE.match(card, game)) { if (card.moveToExile(null, "", source.getSourceId(), game)) { exiledCards++; } diff --git a/Mage.Sets/src/mage/cards/d/DarigaazsCharm.java b/Mage.Sets/src/mage/cards/d/DarigaazsCharm.java index 68bc745628..3524db97de 100644 --- a/Mage.Sets/src/mage/cards/d/DarigaazsCharm.java +++ b/Mage.Sets/src/mage/cards/d/DarigaazsCharm.java @@ -1,4 +1,3 @@ - package mage.cards.d; import java.util.UUID; @@ -11,9 +10,9 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; -import mage.filter.common.FilterCreatureCard; -import mage.target.common.TargetCardInYourGraveyard; +import mage.filter.StaticFilters; import mage.target.common.TargetAnyTarget; +import mage.target.common.TargetCardInYourGraveyard; import mage.target.common.TargetCreaturePermanent; /** @@ -23,13 +22,13 @@ import mage.target.common.TargetCreaturePermanent; public final class DarigaazsCharm extends CardImpl { public DarigaazsCharm(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{B}{R}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{B}{R}{G}"); // Choose one - Return target creature card from your graveyard to your hand; Effect effect = new ReturnToHandTargetEffect(); effect.setText("Return target creature card from your graveyard to your hand"); this.getSpellAbility().addEffect(effect); - this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard())); + this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE)); // or Darigaaz's Charm deals 3 damage to any target; Mode mode = new Mode(); diff --git a/Mage.Sets/src/mage/cards/d/DeathOrGlory.java b/Mage.Sets/src/mage/cards/d/DeathOrGlory.java index e6d24d8126..47ef739d61 100644 --- a/Mage.Sets/src/mage/cards/d/DeathOrGlory.java +++ b/Mage.Sets/src/mage/cards/d/DeathOrGlory.java @@ -1,4 +1,3 @@ - package mage.cards.d; import java.util.ArrayList; @@ -18,7 +17,7 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Zone; import mage.filter.FilterCard; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; import mage.target.Target; @@ -68,7 +67,7 @@ class DeathOrGloryEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - Cards cards = new CardsImpl(controller.getGraveyard().getCards(new FilterCreatureCard(), game)); + Cards cards = new CardsImpl(controller.getGraveyard().getCards(StaticFilters.FILTER_CARD_CREATURE, game)); if (!cards.isEmpty()) { TargetCard targetCards = new TargetCard(0, cards.size(), Zone.EXILED, new FilterCard("cards to put in the first pile")); List pile1 = new ArrayList<>(); @@ -88,7 +87,7 @@ class DeathOrGloryEffect extends OneShotEffect { StringBuilder sb = new StringBuilder("First pile of ").append(controller.getLogName()).append(": "); sb.append(pile1.stream().map(Card::getLogName).collect(Collectors.joining(", "))); game.informPlayers(sb.toString()); - + sb = new StringBuilder("Second pile of ").append(controller.getLogName()).append(": "); sb.append(pile2.stream().map(Card::getLogName).collect(Collectors.joining(", "))); game.informPlayers(sb.toString()); diff --git a/Mage.Sets/src/mage/cards/d/Deathrender.java b/Mage.Sets/src/mage/cards/d/Deathrender.java index 66c57afbc8..dec0fe1678 100644 --- a/Mage.Sets/src/mage/cards/d/Deathrender.java +++ b/Mage.Sets/src/mage/cards/d/Deathrender.java @@ -1,4 +1,3 @@ - package mage.cards.d; import java.util.UUID; @@ -16,8 +15,7 @@ import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Outcome; import mage.constants.Zone; -import mage.filter.FilterCard; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -30,7 +28,7 @@ import mage.target.common.TargetCardInHand; public final class Deathrender extends CardImpl { public Deathrender(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{4}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{4}"); this.subtype.add(SubType.EQUIPMENT); // Equipped creature gets +2/+2. @@ -72,8 +70,7 @@ class DeathrenderEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); Permanent sourcePermanent = game.getPermanent(source.getSourceId()); if (controller != null && sourcePermanent != null) { - FilterCard filter = new FilterCreatureCard(); - TargetCardInHand target = new TargetCardInHand(0, 1, filter); + TargetCardInHand target = new TargetCardInHand(0, 1, StaticFilters.FILTER_CARD_CREATURE); if (controller.choose(Outcome.PutCardInPlay, target, source.getSourceId(), game)) { Card creatureInHand = game.getCard(target.getFirstTarget()); if (creatureInHand != null) { diff --git a/Mage.Sets/src/mage/cards/d/DefenseOfTheHeart.java b/Mage.Sets/src/mage/cards/d/DefenseOfTheHeart.java index f703fa2169..eb7a12f629 100644 --- a/Mage.Sets/src/mage/cards/d/DefenseOfTheHeart.java +++ b/Mage.Sets/src/mage/cards/d/DefenseOfTheHeart.java @@ -1,4 +1,3 @@ - package mage.cards.d; import java.util.Set; @@ -17,7 +16,6 @@ import mage.constants.Outcome; import mage.constants.TargetController; import mage.constants.Zone; import mage.filter.StaticFilters; -import mage.filter.common.FilterCreatureCard; import mage.game.Game; import mage.target.common.TargetCardInLibrary; @@ -32,7 +30,7 @@ public final class DefenseOfTheHeart extends CardImpl { // At the beginning of your upkeep, if an opponent controls three or more creatures, sacrifice Defense of the Heart, search your library for up to two creature cards, and put those cards onto the battlefield. Then shuffle your library. TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new SacrificeSourceEffect(), TargetController.YOU, false); - ability.addEffect(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(0, 2, new FilterCreatureCard()), false, Outcome.PutLandInPlay)); + ability.addEffect(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(0, 2, StaticFilters.FILTER_CARD_CREATURE), false, Outcome.PutLandInPlay)); DefenseOfTheHeartCondition contition = new DefenseOfTheHeartCondition(); this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, contition, "At the beginning of your upkeep, if an opponent controls three or more creatures, sacrifice {this}, search your library for up to two creature cards, and put those cards onto the battlefield. Then shuffle your library")); diff --git a/Mage.Sets/src/mage/cards/d/DrakestownForgotten.java b/Mage.Sets/src/mage/cards/d/DrakestownForgotten.java index ad3078c87e..5123e53da7 100644 --- a/Mage.Sets/src/mage/cards/d/DrakestownForgotten.java +++ b/Mage.Sets/src/mage/cards/d/DrakestownForgotten.java @@ -1,4 +1,3 @@ - package mage.cards.d; import java.util.UUID; @@ -14,11 +13,11 @@ import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Duration; +import mage.constants.SubType; import mage.constants.Zone; import mage.counters.CounterType; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.target.common.TargetCreaturePermanent; /** @@ -28,7 +27,7 @@ import mage.target.common.TargetCreaturePermanent; public final class DrakestownForgotten extends CardImpl { public DrakestownForgotten(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}"); this.subtype.add(SubType.ZOMBIE); this.power = new MageInt(0); this.toughness = new MageInt(0); @@ -36,11 +35,11 @@ public final class DrakestownForgotten extends CardImpl { // Drakestown Forgotten enters the battlefield with X +1/+1 counters on it, where X is the number of creature cards in all graveyards. this.addAbility(new EntersBattlefieldAbility( new AddCountersSourceEffect( - CounterType.P1P1.createInstance(), - new CardsInAllGraveyardsCount(new FilterCreatureCard()), + CounterType.P1P1.createInstance(), + new CardsInAllGraveyardsCount(StaticFilters.FILTER_CARD_CREATURE), false), "with X +1/+1 counters on it, where X is the number of creature cards in all graveyards")); - + // {2}{B}, Remove a +1/+1 counter from Drakestown Forgotten: Target creature gets -1/-1 until end of turn. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(-1, -1, Duration.EndOfTurn), new ManaCostsImpl<>("{2}{B}")); ability.addCost(new RemoveCountersSourceCost(CounterType.P1P1.createInstance())); diff --git a/Mage.Sets/src/mage/cards/d/DralnusPet.java b/Mage.Sets/src/mage/cards/d/DralnusPet.java index 5bc6d64742..f5b527f137 100644 --- a/Mage.Sets/src/mage/cards/d/DralnusPet.java +++ b/Mage.Sets/src/mage/cards/d/DralnusPet.java @@ -1,4 +1,3 @@ - package mage.cards.d; import java.util.UUID; @@ -22,11 +21,11 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.AbilityType; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Duration; import mage.constants.Outcome; +import mage.constants.SubType; import mage.counters.CounterType; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -47,7 +46,7 @@ public final class DralnusPet extends CardImpl { // Kicker-{2}{B}, Discard a creature card. Costs kickerCosts = new CostsImpl<>(); kickerCosts.add(new ManaCostsImpl<>("{2}{B}")); - kickerCosts.add(new DiscardCardCost(new FilterCreatureCard())); + kickerCosts.add(new DiscardCardCost(StaticFilters.FILTER_CARD_CREATURE)); this.addAbility(new KickerAbility(kickerCosts)); // If Dralnu's Pet was kicked, it enters the battlefield with flying and with X +1/+1 counters on it, where X is the discarded card's converted mana cost. Ability ability = new EntersBattlefieldAbility(new DralnusPetEffect(), KickedCondition.instance, diff --git a/Mage.Sets/src/mage/cards/d/DubiousChallenge.java b/Mage.Sets/src/mage/cards/d/DubiousChallenge.java index 3bc9362d28..5eed94c46c 100644 --- a/Mage.Sets/src/mage/cards/d/DubiousChallenge.java +++ b/Mage.Sets/src/mage/cards/d/DubiousChallenge.java @@ -1,4 +1,3 @@ - package mage.cards.d; import java.util.UUID; @@ -9,7 +8,7 @@ import mage.cards.*; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; import mage.target.TargetCard; @@ -22,7 +21,7 @@ import mage.target.common.TargetOpponent; public final class DubiousChallenge extends CardImpl { public DubiousChallenge(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{G}"); // Look at the top ten cards of your library, exile up to two creature cards from among them, then shuffle your library. Target opponent may choose one of the exiled cards and put it onto the battlefield under their control. Put the rest onto the battlefield under your control. getSpellAbility().addEffect(new DubiousChallengeEffect()); @@ -65,7 +64,7 @@ class DubiousChallengeEffect extends OneShotEffect { Cards topCards = new CardsImpl(); topCards.addAll(controller.getLibrary().getTopCards(game, 10)); controller.lookAtCards(sourceObject.getIdName(), topCards, game); - TargetCard targetCreatures = new TargetCard(0, 2, Zone.LIBRARY, new FilterCreatureCard()); + TargetCard targetCreatures = new TargetCard(0, 2, Zone.LIBRARY, StaticFilters.FILTER_CARD_CREATURE); controller.choose(outcome, topCards, targetCreatures, game); Cards exiledCards = new CardsImpl(targetCreatures.getTargets()); if (!exiledCards.isEmpty()) { @@ -73,7 +72,7 @@ class DubiousChallengeEffect extends OneShotEffect { controller.shuffleLibrary(source, game); Player opponent = game.getPlayer(getTargetPointer().getFirst(game, source)); if (opponent != null) { - TargetCard targetOpponentCreature = new TargetCard(0, 1, Zone.EXILED, new FilterCreatureCard()); + TargetCard targetOpponentCreature = new TargetCard(0, 1, Zone.EXILED, StaticFilters.FILTER_CARD_CREATURE); DubiousChallengeMoveToBattlefieldEffect opponentEffect = (DubiousChallengeMoveToBattlefieldEffect) source.getEffects().get(1); DubiousChallengeMoveToBattlefieldEffect controllerEffect = (DubiousChallengeMoveToBattlefieldEffect) source.getEffects().get(2); if (opponent.choose(outcome, exiledCards, targetOpponentCreature, game)) { @@ -111,8 +110,7 @@ class DubiousChallengeMoveToBattlefieldEffect extends OneShotEffect { return new DubiousChallengeMoveToBattlefieldEffect(this); } - public void setPlayerAndCards(Player targetPlayer, Cards targetCards) - { + public void setPlayerAndCards(Player targetPlayer, Cards targetCards) { this.player = targetPlayer; this.cards = targetCards; } diff --git a/Mage.Sets/src/mage/cards/e/EaterOfTheDead.java b/Mage.Sets/src/mage/cards/e/EaterOfTheDead.java index 982ab47c2f..f70c7d8dd3 100644 --- a/Mage.Sets/src/mage/cards/e/EaterOfTheDead.java +++ b/Mage.Sets/src/mage/cards/e/EaterOfTheDead.java @@ -1,4 +1,3 @@ - package mage.cards.e; import java.util.UUID; @@ -11,10 +10,10 @@ import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Outcome; +import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.common.TargetCardInGraveyard; @@ -26,14 +25,14 @@ import mage.target.common.TargetCardInGraveyard; public final class EaterOfTheDead extends CardImpl { public EaterOfTheDead(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}"); this.subtype.add(SubType.HORROR); this.power = new MageInt(3); this.toughness = new MageInt(4); // {0}: If Eater of the Dead is tapped, exile target creature card from a graveyard and untap Eater of the Dead. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new EaterOfTheDeadEffect(), new GenericManaCost(0)); - ability.addTarget(new TargetCardInGraveyard(new FilterCreatureCard())); + ability.addTarget(new TargetCardInGraveyard(StaticFilters.FILTER_CARD_CREATURE)); this.addAbility(ability); } @@ -48,6 +47,7 @@ public final class EaterOfTheDead extends CardImpl { } class EaterOfTheDeadEffect extends OneShotEffect { + EaterOfTheDeadEffect() { super(Outcome.DestroyPermanent); staticText = "If {this} is tapped, exile target creature card from a graveyard and untap {this}"; diff --git a/Mage.Sets/src/mage/cards/e/EnshrinedMemories.java b/Mage.Sets/src/mage/cards/e/EnshrinedMemories.java index 9dbaf7728b..5a34b58033 100644 --- a/Mage.Sets/src/mage/cards/e/EnshrinedMemories.java +++ b/Mage.Sets/src/mage/cards/e/EnshrinedMemories.java @@ -1,4 +1,3 @@ - package mage.cards.e; import java.util.UUID; @@ -8,7 +7,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; /** * @@ -20,7 +19,7 @@ public final class EnshrinedMemories extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{G}"); // Reveal the top X cards of your library. Put all creature cards revealed this way into your hand and the rest on the bottom of your library in any order. - this.getSpellAbility().addEffect(new RevealLibraryPutIntoHandEffect(ManacostVariableValue.instance, new FilterCreatureCard(), Zone.LIBRARY, true)); + this.getSpellAbility().addEffect(new RevealLibraryPutIntoHandEffect(ManacostVariableValue.instance, StaticFilters.FILTER_CARD_CREATURE, Zone.LIBRARY, true)); } public EnshrinedMemories(final EnshrinedMemories card) { diff --git a/Mage.Sets/src/mage/cards/e/ErebossEmissary.java b/Mage.Sets/src/mage/cards/e/ErebossEmissary.java index 2684d3a91b..9b5fb1ffe5 100644 --- a/Mage.Sets/src/mage/cards/e/ErebossEmissary.java +++ b/Mage.Sets/src/mage/cards/e/ErebossEmissary.java @@ -1,4 +1,3 @@ - package mage.cards.e; import java.util.UUID; @@ -17,7 +16,7 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.target.common.TargetCardInHand; /** @@ -27,7 +26,7 @@ import mage.target.common.TargetCardInHand; public final class ErebossEmissary extends CardImpl { public ErebossEmissary(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT,CardType.CREATURE},"{3}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "{3}{B}"); this.subtype.add(SubType.SNAKE); this.power = new MageInt(3); this.toughness = new MageInt(3); @@ -41,7 +40,7 @@ public final class ErebossEmissary extends CardImpl { new BoostSourceEffect(2, 2, Duration.EndOfTurn), new SourceHasSubtypeCondition(SubType.AURA), "{this} gets +2/+2 until end of turn. If Erebos's Emissary is an Aura, enchanted creature gets +2/+2 until end of turn instead"), - new DiscardTargetCost(new TargetCardInHand(new FilterCreatureCard())))); + new DiscardTargetCost(new TargetCardInHand(StaticFilters.FILTER_CARD_CREATURE)))); // Enchanted creature gets +3/+3 this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(3, 3, Duration.WhileOnBattlefield))); diff --git a/Mage.Sets/src/mage/cards/e/EvolutionaryLeap.java b/Mage.Sets/src/mage/cards/e/EvolutionaryLeap.java index 38e0090f8f..8e28963273 100644 --- a/Mage.Sets/src/mage/cards/e/EvolutionaryLeap.java +++ b/Mage.Sets/src/mage/cards/e/EvolutionaryLeap.java @@ -1,4 +1,3 @@ - package mage.cards.e; import java.util.UUID; @@ -11,8 +10,8 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Zone; +import mage.filter.StaticFilters; import static mage.filter.StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT; -import mage.filter.common.FilterCreatureCard; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -25,7 +24,7 @@ public final class EvolutionaryLeap extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}"); // {G}, Sacrifice a creature: Reveal cards from the top of your library until you reveal a creature card. Put that card into your hand and the rest on the bottom of your library in a random order. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RevealCardsFromLibraryUntilEffect(new FilterCreatureCard(), Zone.HAND, Zone.LIBRARY), new ManaCostsImpl("{G}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RevealCardsFromLibraryUntilEffect(StaticFilters.FILTER_CARD_CREATURE, Zone.HAND, Zone.LIBRARY), new ManaCostsImpl("{G}")); ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/e/ExoskeletalArmor.java b/Mage.Sets/src/mage/cards/e/ExoskeletalArmor.java index 34ac37bfd0..b888563904 100644 --- a/Mage.Sets/src/mage/cards/e/ExoskeletalArmor.java +++ b/Mage.Sets/src/mage/cards/e/ExoskeletalArmor.java @@ -1,4 +1,3 @@ - package mage.cards.e; import java.util.UUID; @@ -16,7 +15,7 @@ import mage.constants.SubType; import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -27,7 +26,7 @@ import mage.target.common.TargetCreaturePermanent; public final class ExoskeletalArmor extends CardImpl { public ExoskeletalArmor(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}"); this.subtype.add(SubType.AURA); // Enchant creature @@ -37,7 +36,7 @@ public final class ExoskeletalArmor extends CardImpl { Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); // Enchanted creature gets +X/+X, where X is the number of creature cards in all graveyards. - CardsInAllGraveyardsCount count = new CardsInAllGraveyardsCount(new FilterCreatureCard()); + CardsInAllGraveyardsCount count = new CardsInAllGraveyardsCount(StaticFilters.FILTER_CARD_CREATURE); Effect effect = new BoostEnchantedEffect(count, count, Duration.WhileOnBattlefield); effect.setText("Enchanted creature gets +X/+X, where X is the number of creature cards in all graveyards"); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); diff --git a/Mage.Sets/src/mage/cards/e/ExtractFromDarkness.java b/Mage.Sets/src/mage/cards/e/ExtractFromDarkness.java index d27b267117..60fa0cc682 100644 --- a/Mage.Sets/src/mage/cards/e/ExtractFromDarkness.java +++ b/Mage.Sets/src/mage/cards/e/ExtractFromDarkness.java @@ -1,4 +1,3 @@ - package mage.cards.e; import java.util.UUID; @@ -9,7 +8,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; import mage.target.Target; @@ -22,7 +21,7 @@ import mage.target.common.TargetCardInGraveyard; public final class ExtractFromDarkness extends CardImpl { public ExtractFromDarkness(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{U}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{U}{B}"); // Each player puts the top two cards of their library into their graveyard. this.getSpellAbility().addEffect(new ExtractFromDarknessMillEffect()); @@ -88,7 +87,7 @@ class ExtractFromDarknessReturnFromGraveyardToBattlefieldEffect extends OneShotE public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - Target target = new TargetCardInGraveyard(new FilterCreatureCard()); + Target target = new TargetCardInGraveyard(StaticFilters.FILTER_CARD_CREATURE); target.setNotTarget(true); if (target.canChoose(source.getSourceId(), source.getControllerId(), game) && controller.chooseTarget(outcome, target, source, game)) { diff --git a/Mage.Sets/src/mage/cards/f/FaunaShaman.java b/Mage.Sets/src/mage/cards/f/FaunaShaman.java index d82b833664..10791cce5d 100644 --- a/Mage.Sets/src/mage/cards/f/FaunaShaman.java +++ b/Mage.Sets/src/mage/cards/f/FaunaShaman.java @@ -1,5 +1,3 @@ - - package mage.cards.f; import java.util.UUID; @@ -13,10 +11,10 @@ import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.ColoredManaSymbol; +import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.target.common.TargetCardInHand; import mage.target.common.TargetCardInLibrary; @@ -27,7 +25,7 @@ import mage.target.common.TargetCardInLibrary; public final class FaunaShaman extends CardImpl { public FaunaShaman(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}"); this.subtype.add(SubType.ELF); this.subtype.add(SubType.SHAMAN); @@ -36,10 +34,10 @@ public final class FaunaShaman extends CardImpl { // {G}, {tap}, Discard a creature card: Search your library for a creature card, reveal it, and put it into your hand. Then shuffle your library. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, - new SearchLibraryPutInHandEffect(new TargetCardInLibrary(new FilterCreatureCard()), true), + new SearchLibraryPutInHandEffect(new TargetCardInLibrary(StaticFilters.FILTER_CARD_CREATURE), true), new ColoredManaCost(ColoredManaSymbol.G)); ability.addCost(new TapSourceCost()); - ability.addCost(new DiscardTargetCost(new TargetCardInHand(new FilterCreatureCard()))); + ability.addCost(new DiscardTargetCost(new TargetCardInHand(StaticFilters.FILTER_CARD_CREATURE))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/f/FerozsBan.java b/Mage.Sets/src/mage/cards/f/FerozsBan.java index 55afde6661..bda78ea60a 100644 --- a/Mage.Sets/src/mage/cards/f/FerozsBan.java +++ b/Mage.Sets/src/mage/cards/f/FerozsBan.java @@ -1,4 +1,3 @@ - package mage.cards.f; import java.util.UUID; @@ -9,20 +8,20 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; /** * * @author LoneFox - + * */ public final class FerozsBan extends CardImpl { public FerozsBan(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{6}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{6}"); // Creature spells cost {2} more to cast. - Effect effect = new SpellsCostIncreasementAllEffect(new FilterCreatureCard(), 2); + Effect effect = new SpellsCostIncreasementAllEffect(StaticFilters.FILTER_CARD_CREATURE, 2); effect.setText("Creature spells cost {2} more to cast."); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); } diff --git a/Mage.Sets/src/mage/cards/f/Flash.java b/Mage.Sets/src/mage/cards/f/Flash.java index 5e4bba759d..7d0628f1f7 100644 --- a/Mage.Sets/src/mage/cards/f/Flash.java +++ b/Mage.Sets/src/mage/cards/f/Flash.java @@ -1,4 +1,3 @@ - package mage.cards.f; import java.util.UUID; @@ -12,7 +11,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -67,7 +66,7 @@ class FlashEffect extends OneShotEffect { return false; } - TargetCardInHand target = new TargetCardInHand(new FilterCreatureCard()); + TargetCardInHand target = new TargetCardInHand(StaticFilters.FILTER_CARD_CREATURE); if (controller.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) { Card card = game.getCard(target.getFirstTarget()); if (card != null) { diff --git a/Mage.Sets/src/mage/cards/f/FleshBlood.java b/Mage.Sets/src/mage/cards/f/FleshBlood.java index 8a0945ef6d..ba5e5ce89b 100644 --- a/Mage.Sets/src/mage/cards/f/FleshBlood.java +++ b/Mage.Sets/src/mage/cards/f/FleshBlood.java @@ -1,4 +1,3 @@ - package mage.cards.f; import java.util.UUID; @@ -12,7 +11,7 @@ import mage.constants.Outcome; import mage.constants.SpellAbilityType; import mage.constants.Zone; import mage.counters.CounterType; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -29,7 +28,7 @@ public final class FleshBlood extends SplitCard { // Flesh // Exile target creature card from a graveyard. Put X +1/+1 counters on target creature, where X is the power of the card you exiled. - Target target = new TargetCardInGraveyard(new FilterCreatureCard()); + Target target = new TargetCardInGraveyard(StaticFilters.FILTER_CARD_CREATURE); getLeftHalfCard().getSpellAbility().addTarget(target); getLeftHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent()); getLeftHalfCard().getSpellAbility().addEffect(new FleshEffect()); diff --git a/Mage.Sets/src/mage/cards/f/FoldIntoAether.java b/Mage.Sets/src/mage/cards/f/FoldIntoAether.java index bd6f476ca2..bff45dca28 100644 --- a/Mage.Sets/src/mage/cards/f/FoldIntoAether.java +++ b/Mage.Sets/src/mage/cards/f/FoldIntoAether.java @@ -1,4 +1,3 @@ - package mage.cards.f; import java.util.UUID; @@ -10,7 +9,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.stack.StackObject; import mage.players.Player; @@ -24,7 +23,7 @@ import mage.target.common.TargetCardInHand; public final class FoldIntoAether extends CardImpl { public FoldIntoAether(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{U}{U}"); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{U}{U}"); // Counter target spell. If that spell is countered this way, its controller may put a creature card from their hand onto the battlefield. this.getSpellAbility().addEffect(new FoldIntoAetherEffect()); @@ -66,7 +65,7 @@ class FoldIntoAetherEffect extends OneShotEffect { spellController = game.getPlayer(stackObject.getControllerId()); } if (game.getStack().counter(targetId, source.getSourceId(), game)) { - TargetCardInHand target = new TargetCardInHand(new FilterCreatureCard()); + TargetCardInHand target = new TargetCardInHand(StaticFilters.FILTER_CARD_CREATURE); if (spellController != null && target.canChoose(source.getSourceId(), spellController.getId(), game) && spellController.chooseUse(Outcome.Neutral, "Put a creature card from your hand in play?", source, game) diff --git a/Mage.Sets/src/mage/cards/f/FootstepsOfTheGoryo.java b/Mage.Sets/src/mage/cards/f/FootstepsOfTheGoryo.java index dbc5896b33..8f55ff1072 100644 --- a/Mage.Sets/src/mage/cards/f/FootstepsOfTheGoryo.java +++ b/Mage.Sets/src/mage/cards/f/FootstepsOfTheGoryo.java @@ -1,6 +1,6 @@ - package mage.cards.f; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; @@ -14,15 +14,13 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.common.TargetCardInYourGraveyard; import mage.target.targetpointer.FixedTarget; -import java.util.UUID; - /** * * @author dustinconrad @@ -30,12 +28,12 @@ import java.util.UUID; public final class FootstepsOfTheGoryo extends CardImpl { public FootstepsOfTheGoryo(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{B}"); this.subtype.add(SubType.ARCANE); // Return target creature card from your graveyard to the battlefield. Sacrifice that creature at the beginning of the next end step. this.getSpellAbility().addEffect(new FootstepsOfTheGoryoEffect()); - this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard())); + this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE)); } public FootstepsOfTheGoryo(final FootstepsOfTheGoryo card) { diff --git a/Mage.Sets/src/mage/cards/f/Foster.java b/Mage.Sets/src/mage/cards/f/Foster.java index 25c43c743d..eb9d42cd26 100644 --- a/Mage.Sets/src/mage/cards/f/Foster.java +++ b/Mage.Sets/src/mage/cards/f/Foster.java @@ -1,4 +1,3 @@ - package mage.cards.f; import java.util.UUID; @@ -10,11 +9,8 @@ import mage.abilities.effects.common.RevealCardsFromLibraryUntilEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.TargetController; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; -import mage.filter.common.FilterCreaturePermanent; -import mage.filter.predicate.permanent.ControllerPredicate; +import mage.filter.StaticFilters; /** * @@ -22,19 +18,13 @@ import mage.filter.predicate.permanent.ControllerPredicate; */ public final class Foster extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("a creature you control"); - - static { - filter.add(new ControllerPredicate(TargetController.YOU)); - } - public Foster(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}{G}"); // Whenever a creature you control dies, you may pay {1}. If you do, reveal cards from the top of your library until you reveal a creature card. Put that card into your hand and the rest into your graveyard. Ability ability = new DiesCreatureTriggeredAbility( - new DoIfCostPaid(new RevealCardsFromLibraryUntilEffect(new FilterCreatureCard(), Zone.HAND, Zone.GRAVEYARD), new GenericManaCost(1)), - false, filter); + new DoIfCostPaid(new RevealCardsFromLibraryUntilEffect(StaticFilters.FILTER_CARD_CREATURE, Zone.HAND, Zone.GRAVEYARD), new GenericManaCost(1)), + false, StaticFilters.FILTER_CONTROLLED_A_CREATURE); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/g/Gamekeeper.java b/Mage.Sets/src/mage/cards/g/Gamekeeper.java index 9882f0b320..d3e3ef3ab0 100644 --- a/Mage.Sets/src/mage/cards/g/Gamekeeper.java +++ b/Mage.Sets/src/mage/cards/g/Gamekeeper.java @@ -1,4 +1,3 @@ - package mage.cards.g; import java.util.UUID; @@ -13,7 +12,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; /** * @@ -28,7 +27,7 @@ public final class Gamekeeper extends CardImpl { this.toughness = new MageInt(2); // When Gamekeeper dies, you may exile it. If you do, reveal cards from the top of your library until you reveal a creature card. Put that card onto the battlefield and put all other cards revealed this way into your graveyard. - Ability ability = new DiesTriggeredAbility(new DoIfCostPaid(new RevealCardsFromLibraryUntilEffect(new FilterCreatureCard(), Zone.BATTLEFIELD, Zone.GRAVEYARD), new ExileSourceFromGraveCost(), "Exile to reveal cards from the top of your library until you reveal a creature card?"), false); + Ability ability = new DiesTriggeredAbility(new DoIfCostPaid(new RevealCardsFromLibraryUntilEffect(StaticFilters.FILTER_CARD_CREATURE, Zone.BATTLEFIELD, Zone.GRAVEYARD), new ExileSourceFromGraveCost(), "Exile to reveal cards from the top of your library until you reveal a creature card?"), false); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/g/GarrukTheVeilCursed.java b/Mage.Sets/src/mage/cards/g/GarrukTheVeilCursed.java index 26c6b633b1..8a0cb276cd 100644 --- a/Mage.Sets/src/mage/cards/g/GarrukTheVeilCursed.java +++ b/Mage.Sets/src/mage/cards/g/GarrukTheVeilCursed.java @@ -1,4 +1,3 @@ - package mage.cards.g; import java.util.UUID; @@ -19,8 +18,8 @@ import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.SuperType; import mage.constants.Zone; +import mage.filter.StaticFilters; import mage.filter.common.FilterControlledCreaturePermanent; -import mage.filter.common.FilterCreatureCard; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.permanent.Permanent; @@ -82,7 +81,7 @@ class GarrukTheVeilCursedValue implements DynamicValue { public int calculate(Game game, Ability sourceAbility, Effect effect) { Player player = game.getPlayer(sourceAbility.getControllerId()); if (player != null) { - return player.getGraveyard().getCards(new FilterCreatureCard(), game).size(); + return player.getGraveyard().getCards(StaticFilters.FILTER_CARD_CREATURE, game).size(); } return 0; } @@ -142,8 +141,7 @@ class GarrukTheVeilCursedEffect extends OneShotEffect { if (sacrificed) { // search - FilterCreatureCard filter = new FilterCreatureCard(); - TargetCardInLibrary targetInLibrary = new TargetCardInLibrary(filter); + TargetCardInLibrary targetInLibrary = new TargetCardInLibrary(StaticFilters.FILTER_CARD_CREATURE); Cards cards = new CardsImpl(); if (controller.searchLibrary(targetInLibrary, source, game)) { for (UUID cardId : targetInLibrary.getTargets()) { diff --git a/Mage.Sets/src/mage/cards/g/GarruksHorde.java b/Mage.Sets/src/mage/cards/g/GarruksHorde.java index 5d1c085bbb..7ac147eb18 100644 --- a/Mage.Sets/src/mage/cards/g/GarruksHorde.java +++ b/Mage.Sets/src/mage/cards/g/GarruksHorde.java @@ -1,4 +1,3 @@ - package mage.cards.g; import java.util.UUID; @@ -13,7 +12,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; /** * @author nantuko @@ -21,7 +20,7 @@ import mage.filter.common.FilterCreatureCard; public final class GarruksHorde extends CardImpl { public GarruksHorde(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{G}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{G}{G}"); this.subtype.add(SubType.BEAST); this.power = new MageInt(7); @@ -31,7 +30,7 @@ public final class GarruksHorde extends CardImpl { // Play with the top card of your library revealed. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PlayWithTheTopCardRevealedEffect())); // You may cast the top card of your library if it's a creature card. - Effect effect = new PlayTheTopCardEffect(new FilterCreatureCard()); + Effect effect = new PlayTheTopCardEffect(StaticFilters.FILTER_CARD_CREATURE); effect.setText("You may cast the top card of your library if it's a creature card"); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); } diff --git a/Mage.Sets/src/mage/cards/g/GateToTheAfterlife.java b/Mage.Sets/src/mage/cards/g/GateToTheAfterlife.java index cd375ad4f5..b8c64ac3bd 100644 --- a/Mage.Sets/src/mage/cards/g/GateToTheAfterlife.java +++ b/Mage.Sets/src/mage/cards/g/GateToTheAfterlife.java @@ -1,4 +1,3 @@ - package mage.cards.g; import java.util.UUID; @@ -21,7 +20,7 @@ import mage.constants.Outcome; import mage.constants.TargetController; import mage.constants.Zone; import mage.filter.FilterCard; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.NamePredicate; @@ -58,7 +57,7 @@ public final class GateToTheAfterlife extends CardImpl { // {2}, {T}, Sacrifice Gate to the Afterlife: Search your graveyard, hand, and/or library for a card named God-Pharaoh's Gift and put it onto the battlefield. If you seearch your library this way, shuffle it. Activate this ability only if there are six or more creature cards in your graveyard. ability = new ConditionalActivatedAbility( Zone.BATTLEFIELD, new GateToTheAfterlifeEffect(), new GenericManaCost(2), - new CardsInControllerGraveCondition(6, new FilterCreatureCard()) + new CardsInControllerGraveCondition(6, StaticFilters.FILTER_CARD_CREATURE) ); ability.addCost(new TapSourceCost()); ability.addCost(new SacrificeSourceCost()); diff --git a/Mage.Sets/src/mage/cards/g/GatherThePack.java b/Mage.Sets/src/mage/cards/g/GatherThePack.java index 7f51389ac7..41a8000244 100644 --- a/Mage.Sets/src/mage/cards/g/GatherThePack.java +++ b/Mage.Sets/src/mage/cards/g/GatherThePack.java @@ -1,4 +1,3 @@ - package mage.cards.g; import java.util.UUID; @@ -13,6 +12,7 @@ import mage.cards.CardsImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Zone; +import mage.filter.StaticFilters; import mage.filter.common.FilterCreatureCard; import mage.game.Game; import mage.players.Player; @@ -25,7 +25,7 @@ import mage.target.TargetCard; public final class GatherThePack extends CardImpl { public GatherThePack(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{G}"); // Reveal the top five cards of your library. You may put a creature card from among them into your hand. Put the rest into your graveyard. // Spell mastery — If there are two or more instant and/or sorcery cards in your graveyard, put up to two creature cards from among the revealed cards into your hand instead of one. @@ -64,7 +64,7 @@ class GatherThePackEffect extends OneShotEffect { Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, 5)); if (!cards.isEmpty()) { controller.revealCards(sourceObject.getIdName(), cards, game); - int creatures = cards.count(new FilterCreatureCard(), source.getSourceId(), source.getControllerId(), game); + int creatures = cards.count(StaticFilters.FILTER_CARD_CREATURE, source.getSourceId(), source.getControllerId(), game); if (creatures > 0) { int max = 1; if (SpellMasteryCondition.instance.apply(game, source) && creatures > 1) { diff --git a/Mage.Sets/src/mage/cards/g/GhastlyConscription.java b/Mage.Sets/src/mage/cards/g/GhastlyConscription.java index 848d02483e..bee1b65f55 100644 --- a/Mage.Sets/src/mage/cards/g/GhastlyConscription.java +++ b/Mage.Sets/src/mage/cards/g/GhastlyConscription.java @@ -1,6 +1,6 @@ - package mage.cards.g; +import java.util.*; import mage.MageObjectReference; import mage.abilities.Ability; import mage.abilities.costs.mana.ManaCosts; @@ -15,13 +15,11 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; import mage.target.TargetPlayer; -import java.util.*; - /** * * @author LevelX2 @@ -29,7 +27,7 @@ import java.util.*; public final class GhastlyConscription extends CardImpl { public GhastlyConscription(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{5}{B}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{5}{B}{B}"); // Exile all creature cards from target player's graveyard in a face-down pile, shuffle that pile, then manifest those cards. (To manifest a card, put it onto the battlefield face down as a 2/2 creature. Turn it face up at any time for its mana cost if it's a creature card.) this.getSpellAbility().addEffect(new GhastlyConscriptionEffect()); @@ -68,7 +66,7 @@ class GhastlyConscriptionEffect extends OneShotEffect { Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source)); if (controller != null && targetPlayer != null) { List cardsToManifest = new ArrayList<>(); - for (Card card : targetPlayer.getGraveyard().getCards(new FilterCreatureCard(), game)) { + for (Card card : targetPlayer.getGraveyard().getCards(StaticFilters.FILTER_CARD_CREATURE, game)) { cardsToManifest.add(card); controller.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, Zone.GRAVEYARD, true); } diff --git a/Mage.Sets/src/mage/cards/g/GnawToTheBone.java b/Mage.Sets/src/mage/cards/g/GnawToTheBone.java index 2a381e8dc0..104095026b 100644 --- a/Mage.Sets/src/mage/cards/g/GnawToTheBone.java +++ b/Mage.Sets/src/mage/cards/g/GnawToTheBone.java @@ -1,4 +1,3 @@ - package mage.cards.g; import java.util.UUID; @@ -11,7 +10,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.TimingRule; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; /** * @@ -20,11 +19,10 @@ import mage.filter.common.FilterCreatureCard; public final class GnawToTheBone extends CardImpl { public GnawToTheBone(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{G}"); - + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{G}"); // You gain 2 life for each creature card in your graveyard. - DynamicValue value = new CardsInControllerGraveyardCount(new FilterCreatureCard(), 2); + DynamicValue value = new CardsInControllerGraveyardCount(StaticFilters.FILTER_CARD_CREATURE, 2); this.getSpellAbility().addEffect(new GainLifeEffect(value)); // Flashback {2}{G} diff --git a/Mage.Sets/src/mage/cards/g/GoblinTutor.java b/Mage.Sets/src/mage/cards/g/GoblinTutor.java index 9a65b040e3..9a01d83b64 100644 --- a/Mage.Sets/src/mage/cards/g/GoblinTutor.java +++ b/Mage.Sets/src/mage/cards/g/GoblinTutor.java @@ -1,4 +1,3 @@ - package mage.cards.g; import java.util.UUID; @@ -11,9 +10,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Outcome; import mage.filter.FilterCard; -import mage.filter.common.FilterArtifactCard; -import mage.filter.common.FilterCreatureCard; -import mage.filter.common.FilterEnchantmentCard; +import mage.filter.StaticFilters; import mage.filter.common.FilterInstantOrSorceryCard; import mage.filter.predicate.mageobject.NamePredicate; import mage.game.Game; @@ -72,19 +69,19 @@ class GoblinTutorEffect extends OneShotEffect { int amount = controller.rollDice(game, 6); Effect effect = null; - // 2 - A card named Goblin Tutor - // 3 - An enchantment card - // 4 - An artifact card - // 5 - A creature card + // 2 - A card named Goblin Tutor + // 3 - An enchantment card + // 4 - An artifact card + // 5 - A creature card // 6 - An instant or sorcery card if (amount == 2) { effect = new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 1, filter), true); } else if (amount == 3) { - effect = new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 1, new FilterEnchantmentCard()), true); + effect = new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 1, StaticFilters.FILTER_CARD_ENTCHANTMENT), true); } else if (amount == 4) { - effect = new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 1, new FilterArtifactCard()), true); + effect = new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 1, StaticFilters.FILTER_CARD_ARTIFACT), true); } else if (amount == 5) { - effect = new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 1, new FilterCreatureCard()), true); + effect = new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 1, StaticFilters.FILTER_CARD_CREATURE), true); } else if (amount == 6) { effect = new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 1, new FilterInstantOrSorceryCard()), true); } diff --git a/Mage.Sets/src/mage/cards/g/GolgariGraveTroll.java b/Mage.Sets/src/mage/cards/g/GolgariGraveTroll.java index 5d3083a257..f886d07399 100644 --- a/Mage.Sets/src/mage/cards/g/GolgariGraveTroll.java +++ b/Mage.Sets/src/mage/cards/g/GolgariGraveTroll.java @@ -1,4 +1,3 @@ - package mage.cards.g; import java.util.UUID; @@ -14,12 +13,11 @@ import mage.abilities.keyword.DredgeAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Outcome; +import mage.constants.SubType; import mage.constants.Zone; import mage.counters.CounterType; -import mage.filter.common.FilterCreatureCard; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -31,7 +29,7 @@ import mage.players.Player; public final class GolgariGraveTroll extends CardImpl { public GolgariGraveTroll(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{G}"); this.subtype.add(SubType.TROLL); this.subtype.add(SubType.SKELETON); @@ -60,13 +58,6 @@ public final class GolgariGraveTroll extends CardImpl { class GolgariGraveTrollEffect extends OneShotEffect { - private static final FilterCreatureCard filter = new FilterCreatureCard(); - - static { - - filter.add(new CardTypePredicate(CardType.CREATURE)); - } - public GolgariGraveTrollEffect() { super(Outcome.BoostCreature); } @@ -80,7 +71,7 @@ class GolgariGraveTrollEffect extends OneShotEffect { Player player = game.getPlayer(source.getControllerId()); Permanent permanent = game.getPermanentEntering(source.getSourceId()); if (permanent != null && player != null) { - int amount = player.getGraveyard().count(filter, game); + int amount = player.getGraveyard().count(StaticFilters.FILTER_CARD_CREATURE, game); if (amount > 0) { permanent.addCounters(CounterType.P1P1.createInstance(amount), source, game); } diff --git a/Mage.Sets/src/mage/cards/g/GraveStrength.java b/Mage.Sets/src/mage/cards/g/GraveStrength.java index cc9108b39b..229eef94cb 100644 --- a/Mage.Sets/src/mage/cards/g/GraveStrength.java +++ b/Mage.Sets/src/mage/cards/g/GraveStrength.java @@ -1,4 +1,3 @@ - package mage.cards.g; import java.util.UUID; @@ -10,7 +9,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.counters.CounterType; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.target.common.TargetCreaturePermanent; /** @@ -20,14 +19,14 @@ import mage.target.common.TargetCreaturePermanent; public final class GraveStrength extends CardImpl { public GraveStrength(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{B}"); // Choose target creature. Put the top three cards of your library into your graveyard, then put a +1/+1 counter on that creature for each creature card in your graveyard. this.getSpellAbility().addTarget(new TargetCreaturePermanent()); Effect effect = new PutTopCardOfLibraryIntoGraveControllerEffect(3); effect.setText("Choose target creature. Put the top three cards of your library into your graveyard"); this.getSpellAbility().addEffect(effect); - effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance(0), new CardsInControllerGraveyardCount(new FilterCreatureCard())); + effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance(0), new CardsInControllerGraveyardCount(StaticFilters.FILTER_CARD_CREATURE)); effect.setText(", then put a +1/+1 counter on that creature for each creature card in your graveyard"); this.getSpellAbility().addEffect(effect); diff --git a/Mage.Sets/src/mage/cards/g/GraveUpheaval.java b/Mage.Sets/src/mage/cards/g/GraveUpheaval.java index 94f5205e52..f75d9f3789 100644 --- a/Mage.Sets/src/mage/cards/g/GraveUpheaval.java +++ b/Mage.Sets/src/mage/cards/g/GraveUpheaval.java @@ -1,4 +1,3 @@ - package mage.cards.g; import java.util.UUID; @@ -16,7 +15,7 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -34,7 +33,7 @@ public final class GraveUpheaval extends CardImpl { // Put target creature card from a graveyard onto the battlefield under your control. It gains haste. this.getSpellAbility().addEffect(new GraveUpheavalEffect()); - this.getSpellAbility().addTarget(new TargetCardInGraveyard(new FilterCreatureCard())); + this.getSpellAbility().addTarget(new TargetCardInGraveyard(StaticFilters.FILTER_CARD_CREATURE)); // Basic landcycling {2} this.addAbility(new BasicLandcyclingAbility(new ManaCostsImpl("{2}"))); diff --git a/Mage.Sets/src/mage/cards/g/GravebladeMarauder.java b/Mage.Sets/src/mage/cards/g/GravebladeMarauder.java index 463f635dac..1c901e6206 100644 --- a/Mage.Sets/src/mage/cards/g/GravebladeMarauder.java +++ b/Mage.Sets/src/mage/cards/g/GravebladeMarauder.java @@ -1,4 +1,3 @@ - package mage.cards.g; import java.util.UUID; @@ -10,9 +9,9 @@ import mage.abilities.keyword.DeathtouchAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Outcome; -import mage.filter.common.FilterCreatureCard; +import mage.constants.SubType; +import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; @@ -23,7 +22,7 @@ import mage.players.Player; public final class GravebladeMarauder extends CardImpl { public GravebladeMarauder(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.WARRIOR); this.power = new MageInt(1); @@ -67,7 +66,7 @@ class GravebladeMarauderEffect extends OneShotEffect { Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source)); Player controller = game.getPlayer(source.getControllerId()); if (targetPlayer != null && controller != null) { - targetPlayer.loseLife(controller.getGraveyard().count(new FilterCreatureCard(), game), game, false); + targetPlayer.loseLife(controller.getGraveyard().count(StaticFilters.FILTER_CARD_CREATURE, game), game, false); return true; } return false; diff --git a/Mage.Sets/src/mage/cards/g/GrimFlowering.java b/Mage.Sets/src/mage/cards/g/GrimFlowering.java index c8f8d46be0..236c10fe23 100644 --- a/Mage.Sets/src/mage/cards/g/GrimFlowering.java +++ b/Mage.Sets/src/mage/cards/g/GrimFlowering.java @@ -1,4 +1,3 @@ - package mage.cards.g; import java.util.UUID; @@ -7,7 +6,7 @@ import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; /** * @@ -16,11 +15,10 @@ import mage.filter.common.FilterCreatureCard; public final class GrimFlowering extends CardImpl { public GrimFlowering(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{5}{G}"); - + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{5}{G}"); // Draw a card for each creature card in your graveyard. - this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(new CardsInControllerGraveyardCount(new FilterCreatureCard()))); + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(new CardsInControllerGraveyardCount(StaticFilters.FILTER_CARD_CREATURE))); } public GrimFlowering(final GrimFlowering card) { diff --git a/Mage.Sets/src/mage/cards/g/GuidedPassage.java b/Mage.Sets/src/mage/cards/g/GuidedPassage.java index 0e5998cbf8..e5b4f41263 100644 --- a/Mage.Sets/src/mage/cards/g/GuidedPassage.java +++ b/Mage.Sets/src/mage/cards/g/GuidedPassage.java @@ -1,4 +1,3 @@ - package mage.cards.g; import java.util.Set; @@ -15,8 +14,7 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Zone; import mage.filter.FilterCard; -import mage.filter.common.FilterCreatureCard; -import mage.filter.common.FilterLandCard; +import mage.filter.StaticFilters; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; @@ -96,8 +94,8 @@ class GuidedPassageEffect extends OneShotEffect { controller.chooseTarget(Outcome.Detriment, target, source, game); opponent = game.getPlayer(target.getFirstTarget()); } - TargetCard target1 = new TargetCard(1, Zone.LIBRARY, new FilterCreatureCard()); - TargetCard target2 = new TargetCard(1, Zone.LIBRARY, new FilterLandCard()); + TargetCard target1 = new TargetCard(1, Zone.LIBRARY, StaticFilters.FILTER_CARD_CREATURE); + TargetCard target2 = new TargetCard(1, Zone.LIBRARY, StaticFilters.FILTER_CARD_LAND); TargetCard target3 = new TargetCard(1, Zone.LIBRARY, new FilterCard(filter)); opponent.chooseTarget(Outcome.Detriment, cards, target1, source, game); opponent.chooseTarget(Outcome.Detriment, cards, target2, source, game); diff --git a/Mage.Sets/src/mage/cards/h/HauntedFengraf.java b/Mage.Sets/src/mage/cards/h/HauntedFengraf.java index 6631acd1ee..527fa63fa8 100644 --- a/Mage.Sets/src/mage/cards/h/HauntedFengraf.java +++ b/Mage.Sets/src/mage/cards/h/HauntedFengraf.java @@ -1,4 +1,3 @@ - package mage.cards.h; import java.util.UUID; @@ -15,7 +14,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; import mage.util.RandomUtil; @@ -27,7 +26,7 @@ import mage.util.RandomUtil; public final class HauntedFengraf extends CardImpl { public HauntedFengraf(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.LAND},""); + super(ownerId, setInfo, new CardType[]{CardType.LAND}, ""); // {tap}: Add {C}. this.addAbility(new ColorlessManaAbility()); @@ -68,7 +67,7 @@ class HauntedFengrafEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { - Card[] cards = player.getGraveyard().getCards(new FilterCreatureCard(), game).toArray(new Card[0]); + Card[] cards = player.getGraveyard().getCards(StaticFilters.FILTER_CARD_CREATURE, game).toArray(new Card[0]); if (cards.length > 0) { Card card = cards[RandomUtil.nextInt(cards.length)]; card.moveToZone(Zone.HAND, source.getSourceId(), game, true); diff --git a/Mage.Sets/src/mage/cards/h/HauntingMisery.java b/Mage.Sets/src/mage/cards/h/HauntingMisery.java index a6a2d25197..e7a0726f7c 100644 --- a/Mage.Sets/src/mage/cards/h/HauntingMisery.java +++ b/Mage.Sets/src/mage/cards/h/HauntingMisery.java @@ -1,4 +1,3 @@ - package mage.cards.h; import java.util.UUID; @@ -8,7 +7,7 @@ import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.target.common.TargetPlayerOrPlaneswalker; /** @@ -21,7 +20,7 @@ public final class HauntingMisery extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{B}{B}"); // As an additional cost to cast Haunting Misery, exile X creature cards from your graveyard. - this.getSpellAbility().addCost(new ExileXFromYourGraveCost(new FilterCreatureCard())); + this.getSpellAbility().addCost(new ExileXFromYourGraveCost(StaticFilters.FILTER_CARD_CREATURE)); // Haunting Misery deals X damage to target player. this.getSpellAbility().addTarget(new TargetPlayerOrPlaneswalker()); this.getSpellAbility().addEffect(new DamageTargetEffect(GetXValue.instance)); diff --git a/Mage.Sets/src/mage/cards/h/HonorTheFallen.java b/Mage.Sets/src/mage/cards/h/HonorTheFallen.java index 1a66ba9890..afffbdb2ec 100644 --- a/Mage.Sets/src/mage/cards/h/HonorTheFallen.java +++ b/Mage.Sets/src/mage/cards/h/HonorTheFallen.java @@ -1,5 +1,3 @@ - - package mage.cards.h; import java.util.UUID; @@ -10,6 +8,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Outcome; +import mage.filter.StaticFilters; import mage.filter.common.FilterCreatureCard; import mage.game.Game; import mage.players.Player; @@ -18,11 +17,10 @@ import mage.players.Player; * * @author L_J */ - public final class HonorTheFallen extends CardImpl { public HonorTheFallen(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{W}"); // Exile all creature cards from all graveyards. You gain 1 life for each card exiled this way. this.getSpellAbility().addEffect(new HonorTheFallenEffect()); @@ -60,8 +58,8 @@ class HonorTheFallenEffect extends OneShotEffect { for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { - for (Card card: player.getGraveyard().getCards(game)) { - if (filter.match(card, game)) { + for (Card card : player.getGraveyard().getCards(game)) { + if (StaticFilters.FILTER_CARD_CREATURE.match(card, source.getSourceId(), controller.getId(), game)) { if (card.moveToExile(null, "", source.getSourceId(), game)) { exiledCards++; } diff --git a/Mage.Sets/src/mage/cards/i/ImmortalServitude.java b/Mage.Sets/src/mage/cards/i/ImmortalServitude.java index 80b4e97c1f..448f825cf6 100644 --- a/Mage.Sets/src/mage/cards/i/ImmortalServitude.java +++ b/Mage.Sets/src/mage/cards/i/ImmortalServitude.java @@ -1,4 +1,3 @@ - package mage.cards.i; import java.util.Set; @@ -11,7 +10,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; @@ -58,7 +57,7 @@ class ImmortalServitudeEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player you = game.getPlayer(source.getControllerId()); int count = source.getManaCostsToPay().getX(); - Set cards = you.getGraveyard().getCards(new FilterCreatureCard(), game); + Set cards = you.getGraveyard().getCards(StaticFilters.FILTER_CARD_CREATURE, game); for (Card card : cards) { if (card != null && card.getConvertedManaCost() == count) { card.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, false); diff --git a/Mage.Sets/src/mage/cards/i/InvigoratingFalls.java b/Mage.Sets/src/mage/cards/i/InvigoratingFalls.java index 4e7747a861..0b0bd79d2c 100644 --- a/Mage.Sets/src/mage/cards/i/InvigoratingFalls.java +++ b/Mage.Sets/src/mage/cards/i/InvigoratingFalls.java @@ -1,4 +1,3 @@ - package mage.cards.i; import java.util.UUID; @@ -8,7 +7,7 @@ import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; /** * @@ -17,10 +16,10 @@ import mage.filter.common.FilterCreatureCard; public final class InvigoratingFalls extends CardImpl { public InvigoratingFalls(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{G}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{G}{G}"); // You gain life equal to the number of creature cards in all graveyards. - Effect effect = new GainLifeEffect(new CardsInAllGraveyardsCount(new FilterCreatureCard())); + Effect effect = new GainLifeEffect(new CardsInAllGraveyardsCount(StaticFilters.FILTER_CARD_CREATURE)); effect.setText("You gain life equal to the number of creature cards in all graveyards."); this.getSpellAbility().addEffect(effect); } diff --git a/Mage.Sets/src/mage/cards/j/JaradGolgariLichLord.java b/Mage.Sets/src/mage/cards/j/JaradGolgariLichLord.java index e895731ea5..761115fe64 100644 --- a/Mage.Sets/src/mage/cards/j/JaradGolgariLichLord.java +++ b/Mage.Sets/src/mage/cards/j/JaradGolgariLichLord.java @@ -1,4 +1,3 @@ - package mage.cards.j; import java.util.UUID; @@ -19,7 +18,6 @@ import mage.cards.CardSetInfo; import mage.constants.*; import mage.filter.StaticFilters; import mage.filter.common.FilterControlledPermanent; -import mage.filter.common.FilterCreatureCard; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetControlledPermanent; @@ -48,7 +46,7 @@ public final class JaradGolgariLichLord extends CardImpl { this.toughness = new MageInt(2); // Jarad, Golgari Lich Lord gets +1/+1 for each creature card in your graveyard. - DynamicValue amount = new CardsInControllerGraveyardCount(new FilterCreatureCard()); + DynamicValue amount = new CardsInControllerGraveyardCount(StaticFilters.FILTER_CARD_CREATURE); Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(amount, amount, Duration.WhileOnBattlefield)); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/k/KamahlsSummons.java b/Mage.Sets/src/mage/cards/k/KamahlsSummons.java index 4c6ef4a406..7c85006217 100644 --- a/Mage.Sets/src/mage/cards/k/KamahlsSummons.java +++ b/Mage.Sets/src/mage/cards/k/KamahlsSummons.java @@ -1,4 +1,3 @@ - package mage.cards.k; import java.util.HashMap; @@ -13,11 +12,9 @@ import mage.cards.Cards; import mage.cards.CardsImpl; import mage.constants.CardType; import mage.constants.Outcome; -import mage.filter.FilterCard; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.permanent.token.BearToken; -import mage.game.permanent.token.TokenImpl; import mage.game.permanent.token.Token; import mage.players.Player; import mage.target.common.TargetCardInHand; @@ -29,7 +26,7 @@ import mage.target.common.TargetCardInHand; public final class KamahlsSummons extends CardImpl { public KamahlsSummons(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{G}"); // Each player may reveal any number of creature cards from their hand. Then each player creates a 2/2 green Bear creature token for each card they revealed this way. getSpellAbility().addEffect(new KamahlsSummonsEffect()); @@ -47,8 +44,6 @@ public final class KamahlsSummons extends CardImpl { class KamahlsSummonsEffect extends OneShotEffect { - private static final FilterCard filter = new FilterCreatureCard(); - public KamahlsSummonsEffect() { super(Outcome.Benefit); this.staticText = "Each player may reveal any number of creature cards from their hand. Then each player creates a 2/2 green Bear creature token for each card they revealed this way"; @@ -68,12 +63,12 @@ class KamahlsSummonsEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = game.getObject(source.getSourceId()); if (controller != null && sourceObject != null) { - Map revealedCards = new HashMap<>(); + Map revealedCards = new HashMap<>(); for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { - if (player.getHand().count(filter, game) > 0) { - TargetCardInHand target = new TargetCardInHand(0, Integer.MAX_VALUE, filter); + if (player.getHand().count(StaticFilters.FILTER_CARD_CREATURE, game) > 0) { + TargetCardInHand target = new TargetCardInHand(0, Integer.MAX_VALUE, StaticFilters.FILTER_CARD_CREATURE); if (player.choose(outcome, target, source.getSourceId(), game)) { Cards cards = new CardsImpl(target.getTargets()); controller.revealCards(sourceObject.getIdName(), cards, game); @@ -83,7 +78,7 @@ class KamahlsSummonsEffect extends OneShotEffect { } } Token token = new BearToken(); - for (Map.Entry revealedCardsByPlayer: revealedCards.entrySet()) { + for (Map.Entry revealedCardsByPlayer : revealedCards.entrySet()) { int value = revealedCardsByPlayer.getValue(); if (value > 0) { token.putOntoBattlefield(value, game, source.getSourceId(), revealedCardsByPlayer.getKey()); diff --git a/Mage.Sets/src/mage/cards/k/KaradorGhostChieftain.java b/Mage.Sets/src/mage/cards/k/KaradorGhostChieftain.java index 1ea6ab2fe6..d9dff8edaa 100644 --- a/Mage.Sets/src/mage/cards/k/KaradorGhostChieftain.java +++ b/Mage.Sets/src/mage/cards/k/KaradorGhostChieftain.java @@ -13,7 +13,7 @@ import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.stack.Spell; @@ -38,12 +38,12 @@ public final class KaradorGhostChieftain extends CardImpl { this.toughness = new MageInt(4); // Karador, Ghost Chieftain costs {1} less to cast for each creature card in your graveyard. - this.addAbility(new SimpleStaticAbility(Zone.STACK, + this.addAbility(new SimpleStaticAbility(Zone.STACK, new KaradorGhostChieftainCostReductionEffect())); // During each of your turns, you may cast one creature card from your graveyard. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, - new KaradorGhostChieftainContinuousEffect()), + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, + new KaradorGhostChieftainContinuousEffect()), new KaradorGhostChieftainWatcher()); } @@ -72,7 +72,7 @@ class KaradorGhostChieftainCostReductionEffect extends CostModificationEffectImp public boolean apply(Game game, Ability source, Ability abilityToModify) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { - int reductionAmount = player.getGraveyard().count(new FilterCreatureCard(), game); + int reductionAmount = player.getGraveyard().count(StaticFilters.FILTER_CARD_CREATURE, game); CardUtil.reduceCost(abilityToModify, reductionAmount); return true; } @@ -81,7 +81,7 @@ class KaradorGhostChieftainCostReductionEffect extends CostModificationEffectImp @Override public boolean applies(Ability abilityToModify, Ability source, Game game) { - if ((abilityToModify instanceof SpellAbility) + if ((abilityToModify instanceof SpellAbility) && abilityToModify.getSourceId().equals(source.getSourceId())) { return game.getCard(abilityToModify.getSourceId()) != null; } @@ -114,11 +114,11 @@ class KaradorGhostChieftainContinuousEffect extends ContinuousEffectImpl { public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { - if (game.getActivePlayerId() == null + if (game.getActivePlayerId() == null || !game.isActivePlayer(player.getId())) { return false; } - for (Card card : player.getGraveyard().getCards(new FilterCreatureCard(), game)) { + for (Card card : player.getGraveyard().getCards(StaticFilters.FILTER_CARD_CREATURE, game)) { ContinuousEffect effect = new KaradorGhostChieftainCastFromGraveyardEffect(); effect.setTargetPointer(new FixedTarget(card.getId())); game.addEffect(effect, source); @@ -160,9 +160,9 @@ class KaradorGhostChieftainCastFromGraveyardEffect extends AsThoughEffectImpl { && affectedControllerId != null && objectCard.getSpellAbility().spellCanBeActivatedRegularlyNow(affectedControllerId, game)) { if (affectedControllerId.equals(source.getControllerId())) { - KaradorGhostChieftainWatcher watcher = - game.getState().getWatcher(KaradorGhostChieftainWatcher.class, source.getSourceId()); - return watcher != null + KaradorGhostChieftainWatcher watcher + = game.getState().getWatcher(KaradorGhostChieftainWatcher.class, source.getSourceId()); + return watcher != null && !watcher.isAbilityUsed(); } } @@ -185,7 +185,7 @@ class KaradorGhostChieftainWatcher extends Watcher { @Override public void watch(GameEvent event, Game game) { - if (event.getType() == GameEvent.EventType.SPELL_CAST + if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getZone() == Zone.GRAVEYARD) { Spell spell = (Spell) game.getObject(event.getTargetId()); if (spell.isCreature()) { diff --git a/Mage.Sets/src/mage/cards/k/KessigCagebreakers.java b/Mage.Sets/src/mage/cards/k/KessigCagebreakers.java index 24e80dff94..0bfd9735b0 100644 --- a/Mage.Sets/src/mage/cards/k/KessigCagebreakers.java +++ b/Mage.Sets/src/mage/cards/k/KessigCagebreakers.java @@ -1,4 +1,3 @@ - package mage.cards.k; import java.util.UUID; @@ -11,7 +10,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Outcome; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.permanent.token.WolfToken; import mage.players.Player; @@ -23,7 +22,7 @@ import mage.players.Player; public final class KessigCagebreakers extends CardImpl { public KessigCagebreakers(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{G}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.ROGUE); @@ -65,7 +64,7 @@ class KessigCagebreakersEffect extends OneShotEffect { Player player = game.getPlayer(source.getControllerId()); if (player != null) { WolfToken token = new WolfToken(); - int count = player.getGraveyard().count(new FilterCreatureCard(), game); + int count = player.getGraveyard().count(StaticFilters.FILTER_CARD_CREATURE, game); for (int i = 0; i < count; i++) { token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId(), true, true); } diff --git a/Mage.Sets/src/mage/cards/k/KheruLichLord.java b/Mage.Sets/src/mage/cards/k/KheruLichLord.java index b0c9890804..9bfbf9de11 100644 --- a/Mage.Sets/src/mage/cards/k/KheruLichLord.java +++ b/Mage.Sets/src/mage/cards/k/KheruLichLord.java @@ -1,4 +1,3 @@ - package mage.cards.k; import java.util.UUID; @@ -28,7 +27,7 @@ import mage.constants.Outcome; import mage.constants.SubType; import mage.constants.TargetController; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.ZoneChangeEvent; @@ -85,7 +84,7 @@ class KheruLichLordEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - Cards cards = new CardsImpl(controller.getGraveyard().getCards(new FilterCreatureCard(), source.getSourceId(), source.getControllerId(), game)); + Cards cards = new CardsImpl(controller.getGraveyard().getCards(StaticFilters.FILTER_CARD_CREATURE, source.getSourceId(), source.getControllerId(), game)); Card card = cards.getRandom(game); if (card != null) { controller.moveCards(card, Zone.BATTLEFIELD, source, game); diff --git a/Mage.Sets/src/mage/cards/k/KraulForagers.java b/Mage.Sets/src/mage/cards/k/KraulForagers.java index 46f375ee32..2675053a0f 100644 --- a/Mage.Sets/src/mage/cards/k/KraulForagers.java +++ b/Mage.Sets/src/mage/cards/k/KraulForagers.java @@ -9,7 +9,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; /** * @@ -27,7 +27,7 @@ public final class KraulForagers extends CardImpl { // Undergrowth — When Kraul Foragers enters the battlefield, you gain 1 life for each creature card in your graveyard. this.addAbility(new EntersBattlefieldTriggeredAbility( - new GainLifeEffect(new CardsInControllerGraveyardCount(new FilterCreatureCard())), + new GainLifeEffect(new CardsInControllerGraveyardCount(StaticFilters.FILTER_CARD_CREATURE)), false, "Undergrowth — " )); } diff --git a/Mage.Sets/src/mage/cards/l/Lhurgoyf.java b/Mage.Sets/src/mage/cards/l/Lhurgoyf.java index 4d6594f74d..3318925f48 100644 --- a/Mage.Sets/src/mage/cards/l/Lhurgoyf.java +++ b/Mage.Sets/src/mage/cards/l/Lhurgoyf.java @@ -1,4 +1,3 @@ - package mage.cards.l; import java.util.UUID; @@ -10,13 +9,13 @@ import mage.abilities.effects.ContinuousEffectImpl; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Duration; import mage.constants.Layer; import mage.constants.Outcome; import mage.constants.SubLayer; +import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; @@ -27,7 +26,7 @@ import mage.players.Player; public final class Lhurgoyf extends CardImpl { public Lhurgoyf(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}{G}"); this.subtype.add(SubType.LHURGOYF); this.power = new MageInt(0); @@ -73,7 +72,7 @@ class LhurgoyfEffect extends ContinuousEffectImpl { for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { - number += player.getGraveyard().count(new FilterCreatureCard(), game); + number += player.getGraveyard().count(StaticFilters.FILTER_CARD_CREATURE, game); } } diff --git a/Mage.Sets/src/mage/cards/l/LilianaVess.java b/Mage.Sets/src/mage/cards/l/LilianaVess.java index 63f4bf5d78..0e1c914e2c 100644 --- a/Mage.Sets/src/mage/cards/l/LilianaVess.java +++ b/Mage.Sets/src/mage/cards/l/LilianaVess.java @@ -1,6 +1,8 @@ - package mage.cards.l; +import java.util.LinkedHashSet; +import java.util.Set; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; @@ -11,20 +13,16 @@ import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Outcome; +import mage.constants.SubType; import mage.constants.SuperType; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; import mage.target.TargetPlayer; import mage.target.common.TargetCardInLibrary; -import java.util.LinkedHashSet; -import java.util.Set; -import java.util.UUID; - /** * * @author BetaSteward_at_googlemail.com @@ -80,7 +78,7 @@ class LilianaVessEffect extends OneShotEffect { for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { - creatureCards.addAll(player.getGraveyard().getCards(new FilterCreatureCard(), game)); + creatureCards.addAll(player.getGraveyard().getCards(StaticFilters.FILTER_CARD_CREATURE, game)); } } controller.moveCards(creatureCards, Zone.BATTLEFIELD, source, game, false, false, false, null); diff --git a/Mage.Sets/src/mage/cards/l/LilianasElite.java b/Mage.Sets/src/mage/cards/l/LilianasElite.java index 48e7008950..7d21313f2a 100644 --- a/Mage.Sets/src/mage/cards/l/LilianasElite.java +++ b/Mage.Sets/src/mage/cards/l/LilianasElite.java @@ -1,4 +1,3 @@ - package mage.cards.l; import java.util.UUID; @@ -11,10 +10,10 @@ import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Duration; +import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; /** * @@ -23,13 +22,13 @@ import mage.filter.common.FilterCreatureCard; public final class LilianasElite extends CardImpl { public LilianasElite(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}"); this.subtype.add(SubType.ZOMBIE); this.power = new MageInt(1); this.toughness = new MageInt(1); // Liliana's Elite gets +1/+1 for each creature card in your graveyard. - DynamicValue amount = new CardsInControllerGraveyardCount(new FilterCreatureCard()); + DynamicValue amount = new CardsInControllerGraveyardCount(StaticFilters.FILTER_CARD_CREATURE); Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(amount, amount, Duration.WhileOnBattlefield)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/l/LilianasIndignation.java b/Mage.Sets/src/mage/cards/l/LilianasIndignation.java index cbdcff84a2..67d0d59c1c 100644 --- a/Mage.Sets/src/mage/cards/l/LilianasIndignation.java +++ b/Mage.Sets/src/mage/cards/l/LilianasIndignation.java @@ -1,4 +1,3 @@ - package mage.cards.l; import java.util.Set; @@ -13,7 +12,7 @@ import mage.cards.CardsImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; import mage.target.TargetPlayer; @@ -25,7 +24,7 @@ import mage.target.TargetPlayer; public final class LilianasIndignation extends CardImpl { public LilianasIndignation(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{B}"); // Put the top X cards of your library into your graveyard. Target player loses 2 life for each creature card put into your graveyard this way. this.getSpellAbility().addEffect(new LilianasIndignationEffect()); @@ -70,7 +69,7 @@ class LilianasIndignationEffect extends OneShotEffect { Set movedCards = controller.moveCardsToGraveyardWithInfo(cardsToGraveyard.getCards(game), source, game, Zone.LIBRARY); Cards cardsMoved = new CardsImpl(); cardsMoved.addAll(movedCards); - int creatures = cardsMoved.count(new FilterCreatureCard(), game); + int creatures = cardsMoved.count(StaticFilters.FILTER_CARD_CREATURE, game); if (creatures > 0) { Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source)); if (targetPlayer != null) { diff --git a/Mage.Sets/src/mage/cards/l/LivingDeath.java b/Mage.Sets/src/mage/cards/l/LivingDeath.java index 5875e793e7..904c560c38 100644 --- a/Mage.Sets/src/mage/cards/l/LivingDeath.java +++ b/Mage.Sets/src/mage/cards/l/LivingDeath.java @@ -1,4 +1,3 @@ - package mage.cards.l; import java.util.HashMap; @@ -16,7 +15,6 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Zone; import mage.filter.StaticFilters; -import mage.filter.common.FilterCreatureCard; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -66,13 +64,12 @@ class LivingDeathEffect extends OneShotEffect { MageObject sourceObject = game.getObject(source.getSourceId()); if (controller != null && sourceObject != null) { Map> exiledCards = new HashMap<>(); - + // Move creature cards from graveyard to exile - for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { - Set cardsPlayer = player.getGraveyard().getCards(new FilterCreatureCard(), game); + Set cardsPlayer = player.getGraveyard().getCards(StaticFilters.FILTER_CARD_CREATURE, game); if (!cardsPlayer.isEmpty()) { exiledCards.put(player.getId(), cardsPlayer); player.moveCards(cardsPlayer, Zone.EXILED, source, game); @@ -80,22 +77,20 @@ class LivingDeathEffect extends OneShotEffect { } } game.applyEffects(); - + // Sacrifice all creatures - for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game)) { permanent.sacrifice(source.getSourceId(), game); } game.applyEffects(); - + // Exiled cards are put onto the battlefield at the same time under their owner's control - Set cardsToReturnFromExile = new HashSet<>(); for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { Set cardsPlayer = exiledCards.get(playerId); - if (cardsPlayer != null + if (cardsPlayer != null && !cardsPlayer.isEmpty()) { cardsToReturnFromExile.addAll(cardsPlayer); } diff --git a/Mage.Sets/src/mage/cards/l/LivingEnd.java b/Mage.Sets/src/mage/cards/l/LivingEnd.java index 60836f34e3..8868bb5357 100644 --- a/Mage.Sets/src/mage/cards/l/LivingEnd.java +++ b/Mage.Sets/src/mage/cards/l/LivingEnd.java @@ -1,4 +1,3 @@ - package mage.cards.l; import java.util.HashMap; @@ -17,7 +16,6 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Zone; import mage.filter.StaticFilters; -import mage.filter.common.FilterCreatureCard; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -77,7 +75,7 @@ class LivingEndEffect extends OneShotEffect { for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { - Set cardsPlayer = player.getGraveyard().getCards(new FilterCreatureCard(), game); + Set cardsPlayer = player.getGraveyard().getCards(StaticFilters.FILTER_CARD_CREATURE, game); if (!cardsPlayer.isEmpty()) { exiledCards.put(player.getId(), cardsPlayer); player.moveCards(cardsPlayer, Zone.EXILED, source, game); diff --git a/Mage.Sets/src/mage/cards/l/LordOfTheVoid.java b/Mage.Sets/src/mage/cards/l/LordOfTheVoid.java index 85b62e4715..ecf3396e0a 100644 --- a/Mage.Sets/src/mage/cards/l/LordOfTheVoid.java +++ b/Mage.Sets/src/mage/cards/l/LordOfTheVoid.java @@ -15,7 +15,7 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; import mage.target.TargetCard; @@ -76,8 +76,8 @@ class LordOfTheVoidEffect extends OneShotEffect { Cards cards = new CardsImpl(player.getLibrary().getTopCards(game, 7)); controller.moveCards(cards, Zone.EXILED, source, game); - if (!cards.getCards(new FilterCreatureCard(), game).isEmpty()) { - TargetCard target = new TargetCard(Zone.EXILED, new FilterCreatureCard()); + if (!cards.getCards(StaticFilters.FILTER_CARD_CREATURE, game).isEmpty()) { + TargetCard target = new TargetCard(Zone.EXILED, StaticFilters.FILTER_CARD_CREATURE); if (controller.chooseTarget(outcome, cards, target, source, game)) { Card card = cards.get(target.getFirstTarget(), game); if (card != null) { diff --git a/Mage.Sets/src/mage/cards/m/MagisterOfWorth.java b/Mage.Sets/src/mage/cards/m/MagisterOfWorth.java index 4a0067ac5c..436b85b0d5 100644 --- a/Mage.Sets/src/mage/cards/m/MagisterOfWorth.java +++ b/Mage.Sets/src/mage/cards/m/MagisterOfWorth.java @@ -1,4 +1,3 @@ - package mage.cards.m; import java.util.UUID; @@ -13,11 +12,11 @@ import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Outcome; +import mage.constants.SubType; import mage.constants.Zone; import mage.filter.FilterPermanent; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.permanent.AnotherPredicate; import mage.game.Game; @@ -30,7 +29,7 @@ import mage.players.Player; public final class MagisterOfWorth extends CardImpl { public MagisterOfWorth(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{W}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{W}{B}"); this.subtype.add(SubType.ANGEL); this.power = new MageInt(4); this.toughness = new MageInt(4); @@ -120,7 +119,7 @@ class MagisterOfWorthReturnFromGraveyardEffect extends OneShotEffect { for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { - player.moveCards(player.getGraveyard().getCards(new FilterCreatureCard(), game), Zone.BATTLEFIELD, source, game); + player.moveCards(player.getGraveyard().getCards(StaticFilters.FILTER_CARD_CREATURE, game), Zone.BATTLEFIELD, source, game); } } return true; diff --git a/Mage.Sets/src/mage/cards/m/MindMaggots.java b/Mage.Sets/src/mage/cards/m/MindMaggots.java index a53f2ceb1e..e98e414ce8 100644 --- a/Mage.Sets/src/mage/cards/m/MindMaggots.java +++ b/Mage.Sets/src/mage/cards/m/MindMaggots.java @@ -1,88 +1,88 @@ -package mage.cards.m; - -import java.util.UUID; -import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; -import mage.cards.Card; -import mage.constants.SubType; -import mage.cards.CardImpl; -import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.counters.CounterType; -import mage.filter.common.FilterCreatureCard; -import mage.game.Game; -import mage.players.Player; -import mage.target.common.TargetCardInHand; - -/** - * - * @author jeffwadsworth - */ -public final class MindMaggots extends CardImpl { - - public MindMaggots(UUID ownerId, CardSetInfo setInfo) { - super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}"); - - this.subtype.add(SubType.INSECT); - this.power = new MageInt(2); - this.toughness = new MageInt(2); - - // When Mind Maggots enters the battlefield, discard any number of creature cards. - // For each card discarded this way, put two +1/+1 counters on Mind Maggots. - this.addAbility(new EntersBattlefieldTriggeredAbility(new MindMaggotsEffect())); - - } - - public MindMaggots(final MindMaggots card) { - super(card); - } - - @Override - public MindMaggots copy() { - return new MindMaggots(this); - } -} - -class MindMaggotsEffect extends OneShotEffect { - - MindMaggotsEffect() { - super(Outcome.BoostCreature); - this.staticText = "discard any number of creature cards. For each card discarded this way, put two +1/+1 counters on {this}"; - } - - MindMaggotsEffect(final MindMaggotsEffect effect) { - super(effect); - } - - @Override - public MindMaggotsEffect copy() { - return new MindMaggotsEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { - int numToDiscard = controller.getAmount(0, - controller.getHand().getCards(new FilterCreatureCard(), game).size(), - "Discard how many creature cards?", - game); - TargetCardInHand target = new TargetCardInHand(numToDiscard, new FilterCreatureCard()); - if (controller.choose(Outcome.Benefit, target, source.getSourceId(), game)) { - for (UUID targetId : target.getTargets()) { - Card card = game.getCard(targetId); - if (card != null - && controller.discard(card, source, game)) { - new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)).apply(game, source); - } - } - } - return true; - } - return false; - } -} +package mage.cards.m; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.Card; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.counters.CounterType; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInHand; + +/** + * + * @author jeffwadsworth + */ +public final class MindMaggots extends CardImpl { + + public MindMaggots(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}"); + + this.subtype.add(SubType.INSECT); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // When Mind Maggots enters the battlefield, discard any number of creature cards. + // For each card discarded this way, put two +1/+1 counters on Mind Maggots. + this.addAbility(new EntersBattlefieldTriggeredAbility(new MindMaggotsEffect())); + + } + + public MindMaggots(final MindMaggots card) { + super(card); + } + + @Override + public MindMaggots copy() { + return new MindMaggots(this); + } +} + +class MindMaggotsEffect extends OneShotEffect { + + MindMaggotsEffect() { + super(Outcome.BoostCreature); + this.staticText = "discard any number of creature cards. For each card discarded this way, put two +1/+1 counters on {this}"; + } + + MindMaggotsEffect(final MindMaggotsEffect effect) { + super(effect); + } + + @Override + public MindMaggotsEffect copy() { + return new MindMaggotsEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + int numToDiscard = controller.getAmount(0, + controller.getHand().getCards(StaticFilters.FILTER_CARD_CREATURE, game).size(), + "Discard how many creature cards?", + game); + TargetCardInHand target = new TargetCardInHand(numToDiscard, StaticFilters.FILTER_CARD_CREATURE); + if (controller.choose(Outcome.Benefit, target, source.getSourceId(), game)) { + for (UUID targetId : target.getTargets()) { + Card card = game.getCard(targetId); + if (card != null + && controller.discard(card, source, game)) { + new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)).apply(game, source); + } + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/cards/m/MomirVigSimicVisionary.java b/Mage.Sets/src/mage/cards/m/MomirVigSimicVisionary.java index f2b5c9361b..fca77d6cc5 100644 --- a/Mage.Sets/src/mage/cards/m/MomirVigSimicVisionary.java +++ b/Mage.Sets/src/mage/cards/m/MomirVigSimicVisionary.java @@ -1,4 +1,3 @@ - package mage.cards.m; import java.util.Set; @@ -18,7 +17,7 @@ import mage.constants.Outcome; import mage.constants.SuperType; import mage.constants.Zone; import mage.filter.FilterSpell; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; @@ -43,7 +42,7 @@ public final class MomirVigSimicVisionary extends CardImpl { } public MomirVigSimicVisionary(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{G}{U}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}{U}"); addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.ELF); this.subtype.add(SubType.WIZARD); @@ -52,7 +51,7 @@ public final class MomirVigSimicVisionary extends CardImpl { this.toughness = new MageInt(2); // Whenever you cast a green creature spell, you may search your library for a creature card and reveal it. If you do, shuffle your library and put that card on top of it. - Effect effect = new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(new FilterCreatureCard()), true, true); + Effect effect = new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(StaticFilters.FILTER_CARD_CREATURE), true, true); effect.setText("you may search your library for a creature card and reveal it. If you do, shuffle your library and put that card on top of it"); this.addAbility(new SpellCastControllerTriggeredAbility(effect, filter, true)); diff --git a/Mage.Sets/src/mage/cards/m/MorgueTheft.java b/Mage.Sets/src/mage/cards/m/MorgueTheft.java index d588c17c38..0fc63ad40c 100644 --- a/Mage.Sets/src/mage/cards/m/MorgueTheft.java +++ b/Mage.Sets/src/mage/cards/m/MorgueTheft.java @@ -1,4 +1,3 @@ - package mage.cards.m; import java.util.UUID; @@ -9,7 +8,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.TimingRule; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.target.common.TargetCardInYourGraveyard; /** @@ -17,17 +16,16 @@ import mage.target.common.TargetCardInYourGraveyard; * @author cbt33 */ public final class MorgueTheft extends CardImpl { - - public MorgueTheft(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{B}"); + public MorgueTheft(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{B}"); // Return target creature card from your graveyard to your hand. this.getSpellAbility().addEffect(new ReturnFromGraveyardToHandTargetEffect()); - this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard())); + this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE)); // Flashback {4}{B} this.addAbility(new FlashbackAbility(new ManaCostsImpl("{4}{B}"), TimingRule.SORCERY)); - + } public MorgueTheft(final MorgueTheft card) { diff --git a/Mage.Sets/src/mage/cards/m/MortalCombat.java b/Mage.Sets/src/mage/cards/m/MortalCombat.java index 4869fd235d..eb3db1f6f4 100644 --- a/Mage.Sets/src/mage/cards/m/MortalCombat.java +++ b/Mage.Sets/src/mage/cards/m/MortalCombat.java @@ -1,4 +1,3 @@ - package mage.cards.m; import java.util.UUID; @@ -11,7 +10,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.TargetController; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; @@ -22,7 +21,7 @@ import mage.players.Player; public final class MortalCombat extends CardImpl { public MortalCombat(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{B}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}{B}"); // At the beginning of your upkeep, if twenty or more creature cards are in your graveyard, you win the game. this.addAbility(new ConditionalInterveningIfTriggeredAbility( @@ -42,12 +41,10 @@ public final class MortalCombat extends CardImpl { } class TwentyGraveyardCreatureCondition implements Condition { - - private static final FilterCreatureCard filter = new FilterCreatureCard(); - + @Override - public boolean apply(Game game, Ability source) { + public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); - return player != null && player.getGraveyard().count(filter, game) >= 20; + return player != null && player.getGraveyard().count(StaticFilters.FILTER_CARD_CREATURE, game) >= 20; } } diff --git a/Mage.Sets/src/mage/cards/n/NecromancersCovenant.java b/Mage.Sets/src/mage/cards/n/NecromancersCovenant.java index 67b5339908..88ec3503d5 100644 --- a/Mage.Sets/src/mage/cards/n/NecromancersCovenant.java +++ b/Mage.Sets/src/mage/cards/n/NecromancersCovenant.java @@ -1,4 +1,3 @@ - package mage.cards.n; import java.util.UUID; @@ -12,8 +11,8 @@ import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; +import mage.filter.StaticFilters; import mage.filter.common.FilterControlledCreaturePermanent; -import mage.filter.common.FilterCreatureCard; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.permanent.token.ZombieToken; @@ -33,7 +32,7 @@ public final class NecromancersCovenant extends CardImpl { } public NecromancersCovenant(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{W}{B}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}{B}{B}"); // When Necromancer's Covenant enters the battlefield, exile all creature cards from target player's graveyard, then create a 2/2 black Zombie creature token for each card exiled this way. Ability ability = new EntersBattlefieldTriggeredAbility(new NecromancersConvenantEffect(), false); @@ -72,7 +71,7 @@ class NecromancersConvenantEffect extends OneShotEffect { return false; } int count = 0; - for (Card card : player.getGraveyard().getCards(new FilterCreatureCard(), game)) { + for (Card card : player.getGraveyard().getCards(StaticFilters.FILTER_CARD_CREATURE, game)) { if (card.moveToExile(source.getSourceId(), "Necromancer Covenant", source.getSourceId(), game)) { count += 1; } diff --git a/Mage.Sets/src/mage/cards/n/NecromancersStockpile.java b/Mage.Sets/src/mage/cards/n/NecromancersStockpile.java index 640496dabc..13f6a4d93a 100644 --- a/Mage.Sets/src/mage/cards/n/NecromancersStockpile.java +++ b/Mage.Sets/src/mage/cards/n/NecromancersStockpile.java @@ -1,4 +1,3 @@ - package mage.cards.n; import java.util.UUID; @@ -17,7 +16,7 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.permanent.token.ZombieToken; import mage.players.Player; @@ -29,12 +28,12 @@ import mage.target.common.TargetCardInHand; public final class NecromancersStockpile extends CardImpl { public NecromancersStockpile(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}"); // {1}{B}, Discard a creature card: Draw a card. // If the discarded card was a Zombie card, create a tapped 2/2 black Zombie creature token. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new ManaCostsImpl("{1}{B}")); - ability.addCost(new NecromancersStockpileDiscardTargetCost(new TargetCardInHand(new FilterCreatureCard()))); + ability.addCost(new NecromancersStockpileDiscardTargetCost(new TargetCardInHand(StaticFilters.FILTER_CARD_CREATURE))); ability.addEffect(new NecromancersStockpilePutTokenEffect()); this.addAbility(ability); } @@ -67,7 +66,7 @@ class NecromancersStockpileDiscardTargetCost extends CostImpl { public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana, Cost costToPay) { if (targets.choose(Outcome.Discard, controllerId, sourceId, game)) { Player player = game.getPlayer(controllerId); - if(player != null) { + if (player != null) { for (UUID targetId : targets.get(0).getTargets()) { Card card = player.getHand().get(targetId, game); if (card == null) { diff --git a/Mage.Sets/src/mage/cards/n/NemesisOfMortals.java b/Mage.Sets/src/mage/cards/n/NemesisOfMortals.java index 0cab56e3fe..45bcc9b02d 100644 --- a/Mage.Sets/src/mage/cards/n/NemesisOfMortals.java +++ b/Mage.Sets/src/mage/cards/n/NemesisOfMortals.java @@ -1,6 +1,6 @@ - package mage.cards.n; +import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; @@ -12,13 +12,10 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; import mage.filter.StaticFilters; -import mage.filter.common.FilterCreatureCard; import mage.game.Game; import mage.players.Player; import mage.util.CardUtil; -import java.util.UUID; - /** * @author LevelX2 */ @@ -32,7 +29,7 @@ public final class NemesisOfMortals extends CardImpl { this.toughness = new MageInt(5); // Nemesis of Mortals costs {1} less to cast for each creature card in your graveyard. - Ability ability = new SimpleStaticAbility(Zone.ALL, new SourceCostReductionForEachCardInGraveyardEffect(new FilterCreatureCard())); + Ability ability = new SimpleStaticAbility(Zone.ALL, new SourceCostReductionForEachCardInGraveyardEffect(StaticFilters.FILTER_CARD_CREATURE)); ability.setRuleAtTheTop(true); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/n/NetherSpirit.java b/Mage.Sets/src/mage/cards/n/NetherSpirit.java index 392754dc55..edfe391c9b 100644 --- a/Mage.Sets/src/mage/cards/n/NetherSpirit.java +++ b/Mage.Sets/src/mage/cards/n/NetherSpirit.java @@ -1,4 +1,3 @@ - package mage.cards.n; import java.util.UUID; @@ -16,7 +15,7 @@ import mage.constants.CardType; import mage.constants.SubType; import mage.constants.TargetController; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; @@ -27,7 +26,7 @@ import mage.players.Player; public final class NetherSpirit extends CardImpl { public NetherSpirit(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{B}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); this.subtype.add(SubType.SPIRIT); this.power = new MageInt(2); @@ -56,7 +55,7 @@ class NetherSpiritCondition implements Condition { if (player != null) { Card card = game.getCard(source.getSourceId()); if (card != null) { - return player.getGraveyard().contains(card.getId()) && player.getGraveyard().count(new FilterCreatureCard(), game) == 1; + return player.getGraveyard().contains(card.getId()) && player.getGraveyard().count(StaticFilters.FILTER_CARD_CREATURE, game) == 1; } } return false; diff --git a/Mage.Sets/src/mage/cards/n/Nighthowler.java b/Mage.Sets/src/mage/cards/n/Nighthowler.java index 849ef4a8b6..1176375c2a 100644 --- a/Mage.Sets/src/mage/cards/n/Nighthowler.java +++ b/Mage.Sets/src/mage/cards/n/Nighthowler.java @@ -1,4 +1,3 @@ - package mage.cards.n; import java.util.UUID; @@ -14,10 +13,10 @@ import mage.abilities.keyword.BestowAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Duration; +import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; /** * @@ -26,7 +25,7 @@ import mage.filter.common.FilterCreatureCard; public final class Nighthowler extends CardImpl { public Nighthowler(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT,CardType.CREATURE},"{1}{B}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "{1}{B}{B}"); this.subtype.add(SubType.HORROR); this.power = new MageInt(0); @@ -35,7 +34,7 @@ public final class Nighthowler extends CardImpl { // Bestow {2}{B}{B} this.addAbility(new BestowAbility(this, "{2}{B}{B}")); // Nighthowler and enchanted creature each get +X/+X, where X is the number of creature cards in all graveyards. - DynamicValue graveCreatures = new CardsInAllGraveyardsCount(new FilterCreatureCard()); + DynamicValue graveCreatures = new CardsInAllGraveyardsCount(StaticFilters.FILTER_CARD_CREATURE); Effect effect = new BoostSourceEffect(graveCreatures, graveCreatures, Duration.WhileOnBattlefield); Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect); effect = new BoostEnchantedEffect(graveCreatures, graveCreatures, Duration.WhileOnBattlefield); diff --git a/Mage.Sets/src/mage/cards/o/OversoldCemetery.java b/Mage.Sets/src/mage/cards/o/OversoldCemetery.java index 5c4825f137..d855975ac5 100644 --- a/Mage.Sets/src/mage/cards/o/OversoldCemetery.java +++ b/Mage.Sets/src/mage/cards/o/OversoldCemetery.java @@ -1,4 +1,3 @@ - package mage.cards.o; import java.util.UUID; @@ -13,7 +12,6 @@ import mage.constants.CardType; import mage.constants.TargetController; import mage.constants.Zone; import mage.filter.StaticFilters; -import mage.filter.common.FilterCreatureCard; import mage.target.common.TargetCardInGraveyard; /** @@ -27,7 +25,7 @@ public final class OversoldCemetery extends CardImpl { // At the beginning of your upkeep, if you have four or more creature cards in your graveyard, you may return target creature card from your graveyard to your hand. TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new ReturnFromGraveyardToHandTargetEffect(), TargetController.YOU, true); - ability.addTarget(new TargetCardInGraveyard(new FilterCreatureCard())); + ability.addTarget(new TargetCardInGraveyard(StaticFilters.FILTER_CARD_CREATURE)); CardsInControllerGraveCondition condition = new CardsInControllerGraveCondition(4, StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD); this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, condition, "At the beginning of your upkeep, if you have four or more creature cards in your graveyard, you may return target creature card from your graveyard to your hand.")); } diff --git a/Mage.Sets/src/mage/cards/p/PalaceSiege.java b/Mage.Sets/src/mage/cards/p/PalaceSiege.java index e73cefcb5e..a6a6b38110 100644 --- a/Mage.Sets/src/mage/cards/p/PalaceSiege.java +++ b/Mage.Sets/src/mage/cards/p/PalaceSiege.java @@ -1,6 +1,6 @@ - package mage.cards.p; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.EntersBattlefieldAbility; @@ -15,11 +15,9 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.TargetController; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.target.common.TargetCardInYourGraveyard; -import java.util.UUID; - /** * * @author LevelX2 @@ -28,22 +26,22 @@ public final class PalaceSiege extends CardImpl { private static final String ruleTrigger1 = "&bull Khans — At the beginning of your upkeep, return target creature card from your graveyard to your hand."; private static final String ruleTrigger2 = "&bull Dragons — At the beginning of your upkeep, each opponent loses 2 life and you gain 2 life."; - + public PalaceSiege(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{B}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{B}{B}"); // As Palace Siege enters the battlefield, choose Khans or Dragons. - this.addAbility(new EntersBattlefieldAbility(new ChooseModeEffect("Khans or Dragons?","Khans", "Dragons"),null, - "As {this} enters the battlefield, choose Khans or Dragons.","")); - + this.addAbility(new EntersBattlefieldAbility(new ChooseModeEffect("Khans or Dragons?", "Khans", "Dragons"), null, + "As {this} enters the battlefield, choose Khans or Dragons.", "")); + // * Khans - At the beginning of your upkeep, return target creature card from your graveyard to your hand. Ability ability1 = new ConditionalTriggeredAbility( new BeginningOfUpkeepTriggeredAbility(new ReturnFromGraveyardToHandTargetEffect(), TargetController.YOU, false), new ModeChoiceSourceCondition("Khans"), ruleTrigger1); - ability1.addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard())); + ability1.addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE)); this.addAbility(ability1); - + // * Dragons - At the beginning of your upkeep, each opponent loses 2 life and you gain 2 life. Ability ability2 = new ConditionalTriggeredAbility( new BeginningOfUpkeepTriggeredAbility(new LoseLifeOpponentsEffect(2), TargetController.YOU, false), @@ -53,7 +51,7 @@ public final class PalaceSiege extends CardImpl { effect.setText("and you gain 2 life"); ability2.addEffect(effect); this.addAbility(ability2); - + } public PalaceSiege(final PalaceSiege card) { diff --git a/Mage.Sets/src/mage/cards/p/Paleoloth.java b/Mage.Sets/src/mage/cards/p/Paleoloth.java index a7650a5bbe..4c137c936f 100644 --- a/Mage.Sets/src/mage/cards/p/Paleoloth.java +++ b/Mage.Sets/src/mage/cards/p/Paleoloth.java @@ -1,4 +1,3 @@ - package mage.cards.p; import java.util.UUID; @@ -9,10 +8,10 @@ import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.ComparisonType; +import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.PowerPredicate; import mage.filter.predicate.permanent.AnotherPredicate; @@ -23,18 +22,18 @@ import mage.target.common.TargetCardInYourGraveyard; * @author jeffwadsworth */ public final class Paleoloth extends CardImpl { - + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("another creature with power 5 or greater"); - + static { filter.add(new PowerPredicate(ComparisonType.MORE_THAN, 4)); filter.add(AnotherPredicate.instance); } - + private static final String rule = "Whenever another creature with power 5 or greater enters the battlefield under your control, you may return target creature card from your graveyard to your hand."; public Paleoloth(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{G}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{G}{G}"); this.subtype.add(SubType.BEAST); this.power = new MageInt(5); @@ -42,9 +41,9 @@ public final class Paleoloth extends CardImpl { // Whenever another creature with power 5 or greater enters the battlefield under your control, you may return target creature card from your graveyard to your hand. Ability ability = new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, new ReturnFromGraveyardToHandTargetEffect(), filter, true, rule); - ability.addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard())); + ability.addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE)); this.addAbility(ability); - + } public Paleoloth(final Paleoloth card) { diff --git a/Mage.Sets/src/mage/cards/p/PatternOfRebirth.java b/Mage.Sets/src/mage/cards/p/PatternOfRebirth.java index d0a9f2c77e..2434439563 100644 --- a/Mage.Sets/src/mage/cards/p/PatternOfRebirth.java +++ b/Mage.Sets/src/mage/cards/p/PatternOfRebirth.java @@ -1,5 +1,6 @@ package mage.cards.p; +import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.DiesAttachedTriggeredAbility; import mage.abilities.effects.Effect; @@ -12,13 +13,11 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.SetTargetPointer; import mage.constants.SubType; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.target.TargetPermanent; import mage.target.common.TargetCardInLibrary; import mage.target.common.TargetCreaturePermanent; -import java.util.UUID; - /** * @author LevelX2 */ @@ -36,7 +35,7 @@ public final class PatternOfRebirth extends CardImpl { this.addAbility(ability); // When enchanted creature dies, that creature's controller may search their library for a creature card and put that card onto the battlefield. If that player does, they shuffle their library. - Effect effect = new SearchLibraryPutInPlayTargetPlayerEffect(new TargetCardInLibrary(new FilterCreatureCard()), false, false, Outcome.PutCreatureInPlay); + Effect effect = new SearchLibraryPutInPlayTargetPlayerEffect(new TargetCardInLibrary(StaticFilters.FILTER_CARD_CREATURE), false, false, Outcome.PutCreatureInPlay); effect.setText("that creature's controller may search their library for a creature card and put that card onto the battlefield. If that player does, they shuffle their library"); this.addAbility(new DiesAttachedTriggeredAbility(effect, "enchanted creature", true, true, SetTargetPointer.ATTACHED_TO_CONTROLLER)); diff --git a/Mage.Sets/src/mage/cards/p/PitKeeper.java b/Mage.Sets/src/mage/cards/p/PitKeeper.java index ce51141cf7..00834f6622 100644 --- a/Mage.Sets/src/mage/cards/p/PitKeeper.java +++ b/Mage.Sets/src/mage/cards/p/PitKeeper.java @@ -1,4 +1,3 @@ - package mage.cards.p; import java.util.UUID; @@ -14,7 +13,6 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.filter.StaticFilters; -import mage.filter.common.FilterCreatureCard; import mage.game.Game; import mage.players.Player; import mage.target.common.TargetCardInYourGraveyard; @@ -62,7 +60,7 @@ class CreatureCardsInControllerGraveCondition implements Condition { @Override public boolean apply(Game game, Ability source) { Player p = game.getPlayer(source.getControllerId()); - if (p != null && p.getGraveyard().count(new FilterCreatureCard(), game) >= value) { + if (p != null && p.getGraveyard().count(StaticFilters.FILTER_CARD_CREATURE, game) >= value) { return true; } return false; diff --git a/Mage.Sets/src/mage/cards/p/PrimalCommand.java b/Mage.Sets/src/mage/cards/p/PrimalCommand.java index d20b5bf91c..93ddcec52b 100644 --- a/Mage.Sets/src/mage/cards/p/PrimalCommand.java +++ b/Mage.Sets/src/mage/cards/p/PrimalCommand.java @@ -1,4 +1,3 @@ - package mage.cards.p; import java.util.UUID; @@ -15,7 +14,7 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Zone; import mage.filter.FilterPermanent; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; @@ -32,15 +31,15 @@ import mage.target.common.TargetCardInLibrary; public final class PrimalCommand extends CardImpl { private static final FilterPermanent filterNonCreature = new FilterPermanent("noncreature permanent"); + static { filterNonCreature.add(Predicates.not(new CardTypePredicate(CardType.CREATURE))); } public PrimalCommand(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{G}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{G}{G}"); - - // Choose two - + // Choose two - this.getSpellAbility().getModes().setMinModes(2); this.getSpellAbility().getModes().setMaxModes(2); // Target player gains 7 life; @@ -56,12 +55,12 @@ public final class PrimalCommand extends CardImpl { mode = new Mode(); mode.addEffect(new PrimalCommandShuffleGraveyardEffect()); mode.addTarget(new TargetPlayer()); - this.getSpellAbility().getModes().addMode(mode); + this.getSpellAbility().getModes().addMode(mode); // or search your library for a creature card, reveal it, put it into your hand, then shuffle your library. mode = new Mode(); - mode.addEffect(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(new FilterCreatureCard()), true, true)); + mode.addEffect(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(StaticFilters.FILTER_CARD_CREATURE), true, true)); this.getSpellAbility().getModes().addMode(mode); - + } public PrimalCommand(final PrimalCommand card) { @@ -94,9 +93,9 @@ class PrimalCommandShuffleGraveyardEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getFirstTarget()); if (player != null) { - for (Card card: player.getGraveyard().getCards(game)) { + for (Card card : player.getGraveyard().getCards(game)) { player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.GRAVEYARD, true, true); - } + } player.shuffleLibrary(source, game); return true; } diff --git a/Mage.Sets/src/mage/cards/r/RagMan.java b/Mage.Sets/src/mage/cards/r/RagMan.java index 2910d356b5..32d11b92a7 100644 --- a/Mage.Sets/src/mage/cards/r/RagMan.java +++ b/Mage.Sets/src/mage/cards/r/RagMan.java @@ -1,6 +1,6 @@ - package mage.cards.r; +import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.ActivateIfConditionActivatedAbility; @@ -14,13 +14,11 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; import mage.target.common.TargetOpponent; -import java.util.UUID; - /** * @author Quercitron */ @@ -54,8 +52,6 @@ public final class RagMan extends CardImpl { class RagManDiscardEffect extends OneShotEffect { - private static final FilterCreatureCard filter = new FilterCreatureCard(); - public RagManDiscardEffect() { super(Outcome.Discard); this.staticText = "and discards a creature card at random"; @@ -77,7 +73,7 @@ class RagManDiscardEffect extends OneShotEffect { Cards creatureCardsInHand = new CardsImpl(); for (UUID cardId : player.getHand()) { Card card = player.getHand().get(cardId, game); - if (filter.match(card, game)) { + if (StaticFilters.FILTER_CARD_CREATURE.match(card, game)) { creatureCardsInHand.add(card); } } diff --git a/Mage.Sets/src/mage/cards/r/Repopulate.java b/Mage.Sets/src/mage/cards/r/Repopulate.java index 0bc07c48ee..7ceaa5452a 100644 --- a/Mage.Sets/src/mage/cards/r/Repopulate.java +++ b/Mage.Sets/src/mage/cards/r/Repopulate.java @@ -1,4 +1,3 @@ - package mage.cards.r; import java.util.Set; @@ -13,7 +12,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; import mage.target.TargetPlayer; @@ -25,8 +24,7 @@ import mage.target.TargetPlayer; public final class Repopulate extends CardImpl { public Repopulate(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{G}"); - + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{G}"); // Shuffle all creature cards from target player's graveyard into that player's library. this.getSpellAbility().addTarget(new TargetPlayer()); @@ -60,9 +58,8 @@ class RepopulateEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getFirstTarget()); if (player != null) { - Set cards = player.getGraveyard().getCards(new FilterCreatureCard(), game); - for(Card card : cards) - { + Set cards = player.getGraveyard().getCards(StaticFilters.FILTER_CARD_CREATURE, game); + for (Card card : cards) { card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); } player.shuffleLibrary(source, game); diff --git a/Mage.Sets/src/mage/cards/r/RitualOfTheReturned.java b/Mage.Sets/src/mage/cards/r/RitualOfTheReturned.java index 8a5c0e84e0..9de5f94614 100644 --- a/Mage.Sets/src/mage/cards/r/RitualOfTheReturned.java +++ b/Mage.Sets/src/mage/cards/r/RitualOfTheReturned.java @@ -1,4 +1,3 @@ - package mage.cards.r; import java.util.UUID; @@ -11,7 +10,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.permanent.token.RitualOfTheReturnedZombieToken; import mage.players.Player; @@ -28,7 +27,7 @@ public final class RitualOfTheReturned extends CardImpl { // Exile target creature card from your graveyard. Create a black Zombie creature token with power equal to the exiled card's power and toughness equal to the exiled card's toughness. this.getSpellAbility().addEffect(new RitualOfTheReturnedExileEffect()); - this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard())); + this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE)); } public RitualOfTheReturned(final RitualOfTheReturned card) { diff --git a/Mage.Sets/src/mage/cards/s/Seance.java b/Mage.Sets/src/mage/cards/s/Seance.java index cd3d7031d0..251b1b8e80 100644 --- a/Mage.Sets/src/mage/cards/s/Seance.java +++ b/Mage.Sets/src/mage/cards/s/Seance.java @@ -1,4 +1,3 @@ - package mage.cards.s; import java.util.UUID; @@ -7,8 +6,8 @@ import mage.abilities.DelayedTriggeredAbility; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.ExileTargetEffect; import mage.abilities.effects.common.CreateTokenCopyTargetEffect; +import mage.abilities.effects.common.ExileTargetEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -17,7 +16,7 @@ import mage.constants.Outcome; import mage.constants.SubType; import mage.constants.TargetController; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; import mage.target.common.TargetCardInYourGraveyard; @@ -35,7 +34,7 @@ public final class Seance extends CardImpl { // At the beginning of each upkeep, you may exile target creature card from your graveyard. If you do, create a token that's a copy of that card except it's a Spirit in addition to its other types. Exile it at the beginning of the next end step. Ability ability = new BeginningOfUpkeepTriggeredAbility(new SeanceEffect(), TargetController.ANY, true); - ability.addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard())); + ability.addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/s/SeedGuardian.java b/Mage.Sets/src/mage/cards/s/SeedGuardian.java index 4b1223dadb..ade4624f24 100644 --- a/Mage.Sets/src/mage/cards/s/SeedGuardian.java +++ b/Mage.Sets/src/mage/cards/s/SeedGuardian.java @@ -1,4 +1,3 @@ - package mage.cards.s; import java.util.UUID; @@ -11,9 +10,9 @@ import mage.abilities.keyword.ReachAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Outcome; -import mage.filter.common.FilterCreatureCard; +import mage.constants.SubType; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.permanent.token.SeedGuardianToken; import mage.players.Player; @@ -66,7 +65,7 @@ class SeedGuardianEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - int creaturesInGraveyard = controller.getGraveyard().count(new FilterCreatureCard(), game); + int creaturesInGraveyard = controller.getGraveyard().count(StaticFilters.FILTER_CARD_CREATURE, game); return new CreateTokenEffect(new SeedGuardianToken(creaturesInGraveyard)).apply(game, source); } return false; diff --git a/Mage.Sets/src/mage/cards/s/ShadowbornDemon.java b/Mage.Sets/src/mage/cards/s/ShadowbornDemon.java index 3df0a4f7f8..4ea9420dc0 100644 --- a/Mage.Sets/src/mage/cards/s/ShadowbornDemon.java +++ b/Mage.Sets/src/mage/cards/s/ShadowbornDemon.java @@ -1,4 +1,3 @@ - package mage.cards.s; import java.util.UUID; @@ -18,7 +17,6 @@ import mage.constants.CardType; import mage.constants.SubType; import mage.constants.TargetController; import mage.filter.StaticFilters; -import mage.filter.common.FilterCreatureCard; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.SubtypePredicate; @@ -83,7 +81,7 @@ class CreatureCardsInControllerGraveCondition implements Condition { @Override public boolean apply(Game game, Ability source) { Player p = game.getPlayer(source.getControllerId()); - if (p != null && p.getGraveyard().count(new FilterCreatureCard(), game) >= value) { + if (p != null && p.getGraveyard().count(StaticFilters.FILTER_CARD_CREATURE, game) >= value) { return true; } return false; diff --git a/Mage.Sets/src/mage/cards/s/ShadowsOfThePast.java b/Mage.Sets/src/mage/cards/s/ShadowsOfThePast.java index a231f823b9..7efe75f4e2 100644 --- a/Mage.Sets/src/mage/cards/s/ShadowsOfThePast.java +++ b/Mage.Sets/src/mage/cards/s/ShadowsOfThePast.java @@ -1,4 +1,3 @@ - package mage.cards.s; import java.util.UUID; @@ -15,7 +14,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; /** * @@ -24,14 +23,14 @@ import mage.filter.common.FilterCreatureCard; public final class ShadowsOfThePast extends CardImpl { public ShadowsOfThePast(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}"); // Whenever a creature dies, scry 1. this.addAbility(new DiesCreatureTriggeredAbility(new ScryEffect(1), false)); // {4}{B}: Each opponent loses 2 life and you gain 2 life. Activate this ability only if there are four or more creature cards in your graveyard. Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, - new LoseLifeOpponentsEffect(2), new ManaCostsImpl<>("{4}{B}"), new CardsInControllerGraveCondition(4, new FilterCreatureCard())); + new LoseLifeOpponentsEffect(2), new ManaCostsImpl<>("{4}{B}"), new CardsInControllerGraveCondition(4, StaticFilters.FILTER_CARD_CREATURE)); Effect effect = new GainLifeEffect(2); effect.setText("and you gain 2 life"); ability.addEffect(effect); diff --git a/Mage.Sets/src/mage/cards/s/SignalTheClans.java b/Mage.Sets/src/mage/cards/s/SignalTheClans.java index 44fc5b18e5..0a9d34bad7 100644 --- a/Mage.Sets/src/mage/cards/s/SignalTheClans.java +++ b/Mage.Sets/src/mage/cards/s/SignalTheClans.java @@ -1,6 +1,8 @@ - package mage.cards.s; +import java.util.UUID; +import java.util.stream.Collectors; +import java.util.stream.Stream; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.effects.SearchEffect; @@ -8,24 +10,19 @@ import mage.cards.*; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; import mage.target.common.TargetCardInLibrary; -import java.util.UUID; -import java.util.stream.Collectors; -import java.util.stream.Stream; - /** * * @author Plopman */ public final class SignalTheClans extends CardImpl { - public SignalTheClans (UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{R}{G}"); - + public SignalTheClans(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{R}{G}"); // Search your library for three creature cards and reveal them. If you reveal three cards with different names, choose one of them at random and put that card into your hand. Shuffle the rest into your library. this.getSpellAbility().addEffect(new SignalTheClansEffect()); @@ -36,16 +33,15 @@ public final class SignalTheClans extends CardImpl { } @Override - public SignalTheClans copy() { + public SignalTheClans copy() { return new SignalTheClans(this); } } class SignalTheClansEffect extends SearchEffect { - public SignalTheClansEffect() { - super(new TargetCardInLibrary(3, new FilterCreatureCard()), Outcome.DrawCard); + super(new TargetCardInLibrary(3, StaticFilters.FILTER_CARD_CREATURE), Outcome.DrawCard); staticText = "Search your library for three creature cards and reveal them. If you reveal three cards with different names, choose one of them at random and put that card into your hand. Shuffle the rest into your library"; } @@ -68,9 +64,9 @@ class SignalTheClansEffect extends SearchEffect { if (player.searchLibrary(target, source, game)) { if (!target.getTargets().isEmpty()) { Cards cards = new CardsImpl(); - for (UUID cardId: target.getTargets()) { + for (UUID cardId : target.getTargets()) { Card card = player.getLibrary().remove(cardId, game); - if (card != null){ + if (card != null) { cards.add(card); } } @@ -78,14 +74,14 @@ class SignalTheClansEffect extends SearchEffect { player.revealCards("Reveal", cards, game); Card cardsArray[] = cards.getCards(game).toArray(new Card[0]); //If you reveal three cards with different names - if(Stream.of(cardsArray).map(MageObject::getName).collect(Collectors.toSet()).size() == 3){ + if (Stream.of(cardsArray).map(MageObject::getName).collect(Collectors.toSet()).size() == 3) { //Choose one of them at random and put that card into your hand Card randomCard = cards.getRandom(game); randomCard.moveToZone(Zone.HAND, source.getSourceId(), game, true); cards.remove(randomCard); } //Shuffle the rest into your library - for(Card card : cards.getCards(game)){ + for (Card card : cards.getCards(game)) { card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); } } diff --git a/Mage.Sets/src/mage/cards/s/SistersOfStoneDeath.java b/Mage.Sets/src/mage/cards/s/SistersOfStoneDeath.java index ab178a600c..4cb7bc88da 100644 --- a/Mage.Sets/src/mage/cards/s/SistersOfStoneDeath.java +++ b/Mage.Sets/src/mage/cards/s/SistersOfStoneDeath.java @@ -1,5 +1,7 @@ package mage.cards.s; +import java.util.LinkedList; +import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -12,7 +14,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.cards.CardsImpl; import mage.constants.*; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.permanent.BlockedByIdPredicate; @@ -23,9 +25,6 @@ import mage.players.Player; import mage.target.TargetCard; import mage.target.common.TargetCreaturePermanent; -import java.util.LinkedList; -import java.util.UUID; - /** * @author jeffwadsworth */ @@ -87,7 +86,7 @@ class SistersOfStoneDeathEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { CardsImpl cardsInExile = new CardsImpl(); - TargetCard target = new TargetCard(Zone.EXILED, new FilterCreatureCard()); + TargetCard target = new TargetCard(Zone.EXILED, StaticFilters.FILTER_CARD_CREATURE); Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { ExileZone exile = game.getExile().getExileZone(exileId); diff --git a/Mage.Sets/src/mage/cards/s/SithMagic.java b/Mage.Sets/src/mage/cards/s/SithMagic.java index a45c756976..5a8049ab2d 100644 --- a/Mage.Sets/src/mage/cards/s/SithMagic.java +++ b/Mage.Sets/src/mage/cards/s/SithMagic.java @@ -1,4 +1,3 @@ - package mage.cards.s; import java.util.UUID; @@ -24,7 +23,7 @@ import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.TargetController; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.ZoneChangeEvent; @@ -41,7 +40,7 @@ import mage.watchers.common.LifeLossOtherFromCombatWatcher; public final class SithMagic extends CardImpl { public SithMagic(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{U}{B}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{U}{B}{R}"); // Hate — At the beggining of each combat, if opponent lost life from a source other than combat damage this turn, you may return target card from a graveyard to the battlefield under your control. It gains lifelink and haste. Exile it at the beginning of the next end step or if it would leave the battlefield. TriggeredAbility triggeredAbility = new BeginningOfCombatTriggeredAbility(new SithMagicEffect(), TargetController.ANY, true); @@ -50,7 +49,7 @@ public final class SithMagic extends CardImpl { triggeredAbility, HateCondition.instance, "Hate — At the beggining of each combat, if opponent lost life from a source other than combat damage this turn, you may return target card from a graveyard to the battlefield under your control. It gains lifelink and haste. Exile it at the beginning of the next end step or if it would leave the battlefield."); - ability.addTarget(new TargetCardInGraveyard(new FilterCreatureCard())); + ability.addTarget(new TargetCardInGraveyard(StaticFilters.FILTER_CARD_CREATURE)); this.addAbility(ability, new LifeLossOtherFromCombatWatcher()); } diff --git a/Mage.Sets/src/mage/cards/s/SkyshroudVampire.java b/Mage.Sets/src/mage/cards/s/SkyshroudVampire.java index f91a0f87ee..6d72660c82 100644 --- a/Mage.Sets/src/mage/cards/s/SkyshroudVampire.java +++ b/Mage.Sets/src/mage/cards/s/SkyshroudVampire.java @@ -1,4 +1,3 @@ - package mage.cards.s; import java.util.UUID; @@ -10,10 +9,10 @@ import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Duration; +import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.target.common.TargetCardInHand; /** @@ -23,19 +22,19 @@ import mage.target.common.TargetCardInHand; public final class SkyshroudVampire extends CardImpl { public SkyshroudVampire(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); this.subtype.add(SubType.VAMPIRE); this.power = new MageInt(3); this.toughness = new MageInt(3); // Flying this.addAbility(FlyingAbility.getInstance()); - + // Discard a creature card: Skyshroud Vampire gets +2/+2 until end of turn. this.addAbility(new SimpleActivatedAbility( - Zone.BATTLEFIELD, - new BoostSourceEffect(2,2, Duration.EndOfTurn), - new DiscardTargetCost(new TargetCardInHand(new FilterCreatureCard())))); + Zone.BATTLEFIELD, + new BoostSourceEffect(2, 2, Duration.EndOfTurn), + new DiscardTargetCost(new TargetCardInHand(StaticFilters.FILTER_CARD_CREATURE)))); } public SkyshroudVampire(final SkyshroudVampire card) { diff --git a/Mage.Sets/src/mage/cards/s/SneakAttack.java b/Mage.Sets/src/mage/cards/s/SneakAttack.java index c9433fd907..e898a74327 100644 --- a/Mage.Sets/src/mage/cards/s/SneakAttack.java +++ b/Mage.Sets/src/mage/cards/s/SneakAttack.java @@ -1,4 +1,3 @@ - package mage.cards.s; import java.util.UUID; @@ -19,7 +18,7 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -33,7 +32,7 @@ import mage.target.targetpointer.FixedTarget; public final class SneakAttack extends CardImpl { public SneakAttack(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{R}"); // {R}: You may put a creature card from your hand onto the battlefield. That creature gains haste. Sacrifice the creature at the beginning of the next end step. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new SneakAttackEffect(), new ManaCostsImpl("{R}"))); @@ -72,7 +71,7 @@ class SneakAttackEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { if (controller.chooseUse(Outcome.PutCreatureInPlay, choiceText, source, game)) { - TargetCardInHand target = new TargetCardInHand(new FilterCreatureCard()); + TargetCardInHand target = new TargetCardInHand(StaticFilters.FILTER_CARD_CREATURE); if (controller.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) { Card card = game.getCard(target.getFirstTarget()); if (card != null) { diff --git a/Mage.Sets/src/mage/cards/s/SongOfBlood.java b/Mage.Sets/src/mage/cards/s/SongOfBlood.java index a22893a6cb..d786f476dd 100644 --- a/Mage.Sets/src/mage/cards/s/SongOfBlood.java +++ b/Mage.Sets/src/mage/cards/s/SongOfBlood.java @@ -1,4 +1,3 @@ - package mage.cards.s; import java.util.Set; @@ -17,7 +16,7 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -76,7 +75,7 @@ class SongOfBloodEffect extends OneShotEffect { Set movedCards = controller.moveCardsToGraveyardWithInfo(cardsToGraveyard.getCards(game), source, game, Zone.LIBRARY); Cards cardsMoved = new CardsImpl(); cardsMoved.addAll(movedCards); - int creatures = cardsMoved.count(new FilterCreatureCard(), game); + int creatures = cardsMoved.count(StaticFilters.FILTER_CARD_CREATURE, game); if (creatures > 0) { // Setup a delayed trigger to give +X/+0 to any creature attacking this turn.. DelayedTriggeredAbility delayedAbility = new SongOfBloodTriggeredAbility(creatures); diff --git a/Mage.Sets/src/mage/cards/s/SongsOfTheDamned.java b/Mage.Sets/src/mage/cards/s/SongsOfTheDamned.java index aef71cf0bc..1ed0a99acb 100644 --- a/Mage.Sets/src/mage/cards/s/SongsOfTheDamned.java +++ b/Mage.Sets/src/mage/cards/s/SongsOfTheDamned.java @@ -1,4 +1,3 @@ - package mage.cards.s; import java.util.UUID; @@ -8,7 +7,7 @@ import mage.abilities.effects.mana.DynamicManaEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; /** * @@ -17,10 +16,10 @@ import mage.filter.common.FilterCreatureCard; public final class SongsOfTheDamned extends CardImpl { public SongsOfTheDamned(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{B}"); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{B}"); // Add {B} for each creature card in your graveyard. - DynamicManaEffect effect = new DynamicManaEffect(Mana.BlackMana(1), new CardsInControllerGraveyardCount(new FilterCreatureCard())); + DynamicManaEffect effect = new DynamicManaEffect(Mana.BlackMana(1), new CardsInControllerGraveyardCount(StaticFilters.FILTER_CARD_CREATURE)); this.getSpellAbility().addEffect(effect); } diff --git a/Mage.Sets/src/mage/cards/s/SpiderSpawning.java b/Mage.Sets/src/mage/cards/s/SpiderSpawning.java index ff127fadc1..f597f564d5 100644 --- a/Mage.Sets/src/mage/cards/s/SpiderSpawning.java +++ b/Mage.Sets/src/mage/cards/s/SpiderSpawning.java @@ -1,4 +1,3 @@ - package mage.cards.s; import java.util.UUID; @@ -10,7 +9,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.TimingRule; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.permanent.token.SpiderToken; /** @@ -23,7 +22,7 @@ public final class SpiderSpawning extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{G}"); // Create a 1/2 green Spider creature token with reach for each creature card in your graveyard. - this.getSpellAbility().addEffect(new CreateTokenEffect(new SpiderToken(), new CardsInControllerGraveyardCount(new FilterCreatureCard()))); + this.getSpellAbility().addEffect(new CreateTokenEffect(new SpiderToken(), new CardsInControllerGraveyardCount(StaticFilters.FILTER_CARD_CREATURE))); // Flashback {6}{B} this.addAbility(new FlashbackAbility(new ManaCostsImpl("{6}{B}"), TimingRule.SORCERY)); } diff --git a/Mage.Sets/src/mage/cards/s/SylvanTutor.java b/Mage.Sets/src/mage/cards/s/SylvanTutor.java index 8baa1cb363..e2c3c6c07a 100644 --- a/Mage.Sets/src/mage/cards/s/SylvanTutor.java +++ b/Mage.Sets/src/mage/cards/s/SylvanTutor.java @@ -1,4 +1,3 @@ - package mage.cards.s; import java.util.UUID; @@ -6,7 +5,7 @@ import mage.abilities.effects.common.search.SearchLibraryPutOnLibraryEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.target.common.TargetCardInLibrary; /** @@ -16,11 +15,10 @@ import mage.target.common.TargetCardInLibrary; public final class SylvanTutor extends CardImpl { public SylvanTutor(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{G}"); - + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{G}"); // Search your library for a creature card and reveal that card. Shuffle your library, then put the card on top of it. - this.getSpellAbility().addEffect(new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(new FilterCreatureCard()), true, true)); + this.getSpellAbility().addEffect(new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(StaticFilters.FILTER_CARD_CREATURE), true, true)); } public SylvanTutor(final SylvanTutor card) { diff --git a/Mage.Sets/src/mage/cards/t/TarielReckonerOfSouls.java b/Mage.Sets/src/mage/cards/t/TarielReckonerOfSouls.java index 4419c28ba5..1296352494 100644 --- a/Mage.Sets/src/mage/cards/t/TarielReckonerOfSouls.java +++ b/Mage.Sets/src/mage/cards/t/TarielReckonerOfSouls.java @@ -1,4 +1,3 @@ - package mage.cards.t; import java.util.UUID; @@ -11,11 +10,11 @@ import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.VigilanceAbility; import mage.cards.*; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Outcome; +import mage.constants.SubType; import mage.constants.SuperType; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; import mage.target.common.TargetOpponent; @@ -76,7 +75,7 @@ class TarielReckonerOfSoulsEffect extends OneShotEffect { Player targetOpponent = game.getPlayer(getTargetPointer().getFirst(game, source)); if (controller != null && targetOpponent != null) { Cards creatureCards = new CardsImpl(); - for (Card card : targetOpponent.getGraveyard().getCards(new FilterCreatureCard(), game)) { + for (Card card : targetOpponent.getGraveyard().getCards(StaticFilters.FILTER_CARD_CREATURE, game)) { creatureCards.add(card); } if (!creatureCards.isEmpty()) { diff --git a/Mage.Sets/src/mage/cards/t/TemptWithImmortality.java b/Mage.Sets/src/mage/cards/t/TemptWithImmortality.java index ad8c586bca..fb9e6f0cf0 100644 --- a/Mage.Sets/src/mage/cards/t/TemptWithImmortality.java +++ b/Mage.Sets/src/mage/cards/t/TemptWithImmortality.java @@ -1,4 +1,3 @@ - package mage.cards.t; import java.util.UUID; @@ -11,6 +10,7 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Zone; import mage.filter.FilterCard; +import mage.filter.StaticFilters; import mage.filter.common.FilterCreatureCard; import mage.filter.predicate.other.OwnerIdPredicate; import mage.game.Game; @@ -26,7 +26,7 @@ import mage.target.common.TargetCardInYourGraveyard; public final class TemptWithImmortality extends CardImpl { public TemptWithImmortality(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{4}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{B}"); // Tempting offer - Return a creature card from your graveyard to the battlefield. Each opponent may return a creature card from their graveyard to the battlefield. For each opponent who does, return a creature card from your graveyard to the battlefield. this.getSpellAbility().addEffect(new TemptWithImmortalityEffect()); @@ -98,7 +98,7 @@ class TemptWithImmortalityEffect extends OneShotEffect { } private boolean returnCreatureFromGraveToBattlefield(Player player, Ability source, Game game) { - Target target = new TargetCardInYourGraveyard(new FilterCreatureCard()); + Target target = new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE); target.setNotTarget(false); if (target.canChoose(source.getSourceId(), source.getControllerId(), game)) { if (player.chooseTarget(outcome, target, source, game)) { diff --git a/Mage.Sets/src/mage/cards/t/TheMimeoplasm.java b/Mage.Sets/src/mage/cards/t/TheMimeoplasm.java index 888e1b8beb..13b76c6478 100644 --- a/Mage.Sets/src/mage/cards/t/TheMimeoplasm.java +++ b/Mage.Sets/src/mage/cards/t/TheMimeoplasm.java @@ -1,4 +1,3 @@ - package mage.cards.t; import java.util.UUID; @@ -11,6 +10,7 @@ import mage.abilities.effects.common.CopyEffect; import mage.cards.*; import mage.constants.*; import mage.counters.CounterType; +import mage.filter.StaticFilters; import mage.filter.common.FilterCreatureCard; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardIdPredicate; @@ -67,7 +67,7 @@ class TheMimeoplasmEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); Permanent permanent = game.getPermanentEntering(source.getSourceId()); if (controller != null && permanent != null) { - if (new CardsInAllGraveyardsCount(new FilterCreatureCard()).calculate(game, source, this) >= 2) { + if (new CardsInAllGraveyardsCount(StaticFilters.FILTER_CARD_CREATURE).calculate(game, source, this) >= 2) { if (controller.chooseUse(Outcome.Benefit, "Do you want to exile two creature cards from graveyards?", source, game)) { TargetCardInGraveyard targetCopy = new TargetCardInGraveyard(new FilterCreatureCard("creature card to become a copy of")); targetCopy.setNotTarget(true); diff --git a/Mage.Sets/src/mage/cards/t/ThicketElemental.java b/Mage.Sets/src/mage/cards/t/ThicketElemental.java index e5ee92f1ee..314fc6b94e 100644 --- a/Mage.Sets/src/mage/cards/t/ThicketElemental.java +++ b/Mage.Sets/src/mage/cards/t/ThicketElemental.java @@ -1,4 +1,3 @@ - package mage.cards.t; import java.util.UUID; @@ -14,7 +13,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; /** * @@ -32,7 +31,7 @@ public final class ThicketElemental extends CardImpl { this.addAbility(new KickerAbility("{1}{G}")); // When Thicket Elemental enters the battlefield, if it was kicked, you may reveal cards from the top of your library until you reveal a creature card. If you do, put that card onto the battlefield and shuffle all other cards revealed this way into your library. - TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new RevealCardsFromLibraryUntilEffect(new FilterCreatureCard(), Zone.BATTLEFIELD, Zone.LIBRARY, true)); + TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new RevealCardsFromLibraryUntilEffect(StaticFilters.FILTER_CARD_CREATURE, Zone.BATTLEFIELD, Zone.LIBRARY, true)); this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, KickedCondition.instance, "When {this} enters the battlefield, if it was kicked, you may reveal cards from the top of your library until you reveal a creature card. If you do, put that card onto the battlefield and shuffle all other cards revealed this way into your library.")); } diff --git a/Mage.Sets/src/mage/cards/t/ThroughTheBreach.java b/Mage.Sets/src/mage/cards/t/ThroughTheBreach.java index 0afea9c31c..3929fee737 100644 --- a/Mage.Sets/src/mage/cards/t/ThroughTheBreach.java +++ b/Mage.Sets/src/mage/cards/t/ThroughTheBreach.java @@ -1,4 +1,3 @@ - package mage.cards.t; import java.util.UUID; @@ -16,11 +15,11 @@ import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Duration; import mage.constants.Outcome; +import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -34,7 +33,7 @@ import mage.target.targetpointer.FixedTarget; public final class ThroughTheBreach extends CardImpl { public ThroughTheBreach(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{4}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{4}{R}"); this.subtype.add(SubType.ARCANE); // You may put a creature card from your hand onto the battlefield. That creature gains haste. Sacrifice that creature at the beginning of the next end step. @@ -76,7 +75,7 @@ class ThroughTheBreachEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { if (controller.chooseUse(Outcome.PutCreatureInPlay, choiceText, source, game)) { - TargetCardInHand target = new TargetCardInHand(new FilterCreatureCard()); + TargetCardInHand target = new TargetCardInHand(StaticFilters.FILTER_CARD_CREATURE); if (controller.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) { Card card = game.getCard(target.getFirstTarget()); if (card != null) { diff --git a/Mage.Sets/src/mage/cards/t/TombstoneStairwell.java b/Mage.Sets/src/mage/cards/t/TombstoneStairwell.java index f492841772..6442bbcbb4 100644 --- a/Mage.Sets/src/mage/cards/t/TombstoneStairwell.java +++ b/Mage.Sets/src/mage/cards/t/TombstoneStairwell.java @@ -1,4 +1,3 @@ - package mage.cards.t; import java.util.HashSet; @@ -18,15 +17,14 @@ import mage.constants.Outcome; import mage.constants.SuperType; import mage.constants.TargetController; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; import mage.game.events.ZoneChangeEvent; import mage.game.permanent.Permanent; -import mage.game.permanent.token.TombspawnZombieToken; -import mage.game.permanent.token.TokenImpl; import mage.game.permanent.token.Token; +import mage.game.permanent.token.TombspawnZombieToken; import mage.players.Player; import mage.target.targetpointer.FixedTarget; import mage.util.CardUtil; @@ -91,11 +89,11 @@ class TombstoneStairwellCreateTokenEffect extends OneShotEffect { } else { tokensCreated = new HashSet<>(); } - + for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { Player player = game.getPlayer(playerId); - int creatureCardsInGraveyard = player.getGraveyard().count(new FilterCreatureCard(), source.getControllerId(), source.getSourceId(), game); - token.putOntoBattlefield(creatureCardsInGraveyard, game, source.getSourceId(), playerId); + int creatureCardsInGraveyard = player.getGraveyard().count(StaticFilters.FILTER_CARD_CREATURE, source.getControllerId(), source.getSourceId(), game); + token.putOntoBattlefield(creatureCardsInGraveyard, game, source.getSourceId(), playerId); for (UUID tokenId : token.getLastAddedTokenIds()) { tokensCreated.add(tokenId); } @@ -119,7 +117,7 @@ class TombstoneStairwellTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == EventType.END_TURN_STEP_PRE + return event.getType() == EventType.END_TURN_STEP_PRE || event.getType() == EventType.ZONE_CHANGE; } @@ -138,8 +136,7 @@ class TombstoneStairwellTriggeredAbility extends TriggeredAbilityImpl { } return true; } - } - else if (event.getType() == EventType.ZONE_CHANGE) { + } else if (event.getType() == EventType.ZONE_CHANGE) { if (event.getTargetId().equals(this.getSourceId())) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; if (zEvent.getFromZone() == Zone.BATTLEFIELD) { diff --git a/Mage.Sets/src/mage/cards/t/ToothAndNail.java b/Mage.Sets/src/mage/cards/t/ToothAndNail.java index 9059f778c3..2b2bd35a10 100644 --- a/Mage.Sets/src/mage/cards/t/ToothAndNail.java +++ b/Mage.Sets/src/mage/cards/t/ToothAndNail.java @@ -1,4 +1,3 @@ - package mage.cards.t; import java.util.UUID; @@ -13,6 +12,7 @@ import mage.cards.CardsImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Zone; +import mage.filter.StaticFilters; import mage.filter.common.FilterCreatureCard; import mage.game.Game; import mage.players.Player; @@ -26,11 +26,11 @@ import mage.target.common.TargetCardInLibrary; public final class ToothAndNail extends CardImpl { public ToothAndNail(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{5}{G}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{5}{G}{G}"); // Choose one - // Search your library for up to two creature cards, reveal them, put them into your hand, then shuffle your library; - this.getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 2, new FilterCreatureCard()), true)); + this.getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 2, StaticFilters.FILTER_CARD_CREATURE), true)); // or put up to two creature cards from your hand onto the battlefield. Mode mode = new Mode(); mode.addEffect(new ToothAndNailPutCreatureOnBattlefieldEffect()); diff --git a/Mage.Sets/src/mage/cards/t/TorturedExistence.java b/Mage.Sets/src/mage/cards/t/TorturedExistence.java index a77823150c..8ff13eb53e 100644 --- a/Mage.Sets/src/mage/cards/t/TorturedExistence.java +++ b/Mage.Sets/src/mage/cards/t/TorturedExistence.java @@ -1,4 +1,3 @@ - package mage.cards.t; import java.util.UUID; @@ -12,7 +11,6 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Zone; import mage.filter.StaticFilters; -import mage.filter.common.FilterCreatureCard; import mage.target.common.TargetCardInYourGraveyard; /** @@ -26,7 +24,7 @@ public final class TorturedExistence extends CardImpl { // {B}, Discard a creature card: Return target creature card from your graveyard to your hand. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnFromGraveyardToHandTargetEffect(), new ManaCostsImpl("{B}")); - ability.addCost(new DiscardCardCost(new FilterCreatureCard())); + ability.addCost(new DiscardCardCost(StaticFilters.FILTER_CARD_CREATURE)); ability.addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/t/TreacherousUrge.java b/Mage.Sets/src/mage/cards/t/TreacherousUrge.java index 21fc9a93c4..412ae5bf62 100644 --- a/Mage.Sets/src/mage/cards/t/TreacherousUrge.java +++ b/Mage.Sets/src/mage/cards/t/TreacherousUrge.java @@ -1,4 +1,3 @@ - package mage.cards.t; import java.util.UUID; @@ -18,7 +17,7 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -33,7 +32,7 @@ import mage.target.targetpointer.FixedTarget; public final class TreacherousUrge extends CardImpl { public TreacherousUrge(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{4}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{4}{B}"); // Target opponent reveals their hand. You may put a creature card from it onto the battlefield under your control. That creature gains haste. Sacrifice it at the beginning of the next end step. this.getSpellAbility().addEffect(new TreacherousUrgeEffect()); @@ -52,8 +51,6 @@ public final class TreacherousUrge extends CardImpl { class TreacherousUrgeEffect extends OneShotEffect { - private static final FilterCreatureCard filter = new FilterCreatureCard(); - public TreacherousUrgeEffect() { super(Outcome.Benefit); this.staticText = "Target opponent reveals their hand. You may put a creature card from it onto the battlefield under your control. That creature gains haste. Sacrifice it at the beginning of the next end step"; @@ -76,10 +73,10 @@ class TreacherousUrgeEffect extends OneShotEffect { opponent.revealCards(sourceObject.getName(), opponent.getHand(), game); Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - int cardsHand = opponent.getHand().count(filter, game); + int cardsHand = opponent.getHand().count(StaticFilters.FILTER_CARD_CREATURE, game); Card card = null; if (cardsHand > 0) { - TargetCard target = new TargetCard(Zone.HAND, filter); + TargetCard target = new TargetCard(Zone.HAND, StaticFilters.FILTER_CARD_CREATURE); if (controller.choose(Outcome.Benefit, opponent.getHand(), target, game)) { card = opponent.getHand().get(target.getFirstTarget(), game); if (card != null) { diff --git a/Mage.Sets/src/mage/cards/u/UndergrowthScavenger.java b/Mage.Sets/src/mage/cards/u/UndergrowthScavenger.java index 09d5708e19..8907d900df 100644 --- a/Mage.Sets/src/mage/cards/u/UndergrowthScavenger.java +++ b/Mage.Sets/src/mage/cards/u/UndergrowthScavenger.java @@ -1,4 +1,3 @@ - package mage.cards.u; import java.util.UUID; @@ -12,7 +11,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.counters.CounterType; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; /** * @@ -21,7 +20,7 @@ import mage.filter.common.FilterCreatureCard; public final class UndergrowthScavenger extends CardImpl { public UndergrowthScavenger(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}"); this.subtype.add(SubType.FUNGUS); this.subtype.add(SubType.HORROR); @@ -29,9 +28,9 @@ public final class UndergrowthScavenger extends CardImpl { this.toughness = new MageInt(0); // Undergrowth Scavenger enters the battlefield with a number of +1/+1 counters on it equal to the number of creature cards in all graveyards. - Effect effect = new AddCountersSourceEffect(CounterType.P1P1.createInstance(0), new CardsInAllGraveyardsCount(new FilterCreatureCard()), true); + Effect effect = new AddCountersSourceEffect(CounterType.P1P1.createInstance(0), new CardsInAllGraveyardsCount(StaticFilters.FILTER_CARD_CREATURE), true); effect.setText("with a number of +1/+1 counters on it equal to the number of creature cards in all graveyards"); - this.addAbility(new EntersBattlefieldAbility(effect)); + this.addAbility(new EntersBattlefieldAbility(effect)); } public UndergrowthScavenger(final UndergrowthScavenger card) { diff --git a/Mage.Sets/src/mage/cards/u/UrzaAcademyHeadmaster.java b/Mage.Sets/src/mage/cards/u/UrzaAcademyHeadmaster.java index a82331476a..66e4c3b6ee 100644 --- a/Mage.Sets/src/mage/cards/u/UrzaAcademyHeadmaster.java +++ b/Mage.Sets/src/mage/cards/u/UrzaAcademyHeadmaster.java @@ -1,5 +1,6 @@ package mage.cards.u; +import java.util.*; import mage.Mana; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; @@ -45,8 +46,6 @@ import mage.target.TargetPlayer; import mage.target.common.*; import mage.util.RandomUtil; -import java.util.*; - /** * @author L_J */ @@ -263,7 +262,7 @@ class UrzaAcademyHeadmasterRandomEffect extends OneShotEffect { break; case 6: // (altered) GARRUK CALLER OF BEASTS 2 sb.append("You may put a creature card from your hand onto the battlefield."); - effects.add(new PutCardFromHandOntoBattlefieldEffect(new FilterCreatureCard())); + effects.add(new PutCardFromHandOntoBattlefieldEffect(StaticFilters.FILTER_CARD_CREATURE)); break; case 7: // (altered) JACE THE MIND SCULPTOR 2 sb.append("Draw three cards, then put a card from your hand on top of your library."); diff --git a/Mage.Sets/src/mage/cards/v/VampireHounds.java b/Mage.Sets/src/mage/cards/v/VampireHounds.java index 6f00309cf0..f231c28a65 100644 --- a/Mage.Sets/src/mage/cards/v/VampireHounds.java +++ b/Mage.Sets/src/mage/cards/v/VampireHounds.java @@ -1,4 +1,3 @@ - package mage.cards.v; import java.util.UUID; @@ -9,10 +8,10 @@ import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Duration; +import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.target.common.TargetCardInHand; /** @@ -22,7 +21,7 @@ import mage.target.common.TargetCardInHand; public final class VampireHounds extends CardImpl { public VampireHounds(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}"); this.subtype.add(SubType.VAMPIRE); this.subtype.add(SubType.HOUND); this.power = new MageInt(2); @@ -30,9 +29,9 @@ public final class VampireHounds extends CardImpl { // Discard a creature card: Vampire Hounds gets +2/+2 until end of turn. this.addAbility(new SimpleActivatedAbility( - Zone.BATTLEFIELD, - new BoostSourceEffect(2, 2, Duration.EndOfTurn), - new DiscardTargetCost(new TargetCardInHand(new FilterCreatureCard())))); + Zone.BATTLEFIELD, + new BoostSourceEffect(2, 2, Duration.EndOfTurn), + new DiscardTargetCost(new TargetCardInHand(StaticFilters.FILTER_CARD_CREATURE)))); } public VampireHounds(final VampireHounds card) { diff --git a/Mage.Sets/src/mage/cards/v/VigorMortis.java b/Mage.Sets/src/mage/cards/v/VigorMortis.java index 494e7383c9..20b1e2bb5b 100644 --- a/Mage.Sets/src/mage/cards/v/VigorMortis.java +++ b/Mage.Sets/src/mage/cards/v/VigorMortis.java @@ -1,4 +1,3 @@ - package mage.cards.v; import java.util.UUID; @@ -14,7 +13,7 @@ import mage.constants.ColoredManaSymbol; import mage.constants.Duration; import mage.constants.Outcome; import mage.counters.CounterType; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; @@ -34,7 +33,7 @@ public final class VigorMortis extends CardImpl { this.getSpellAbility().addEffect(new VigorMortisReplacementEffect()); // has to be added before the moving effect this.getSpellAbility().addEffect(new ReturnFromGraveyardToBattlefieldTargetEffect()); this.getSpellAbility().addEffect(new InfoEffect("If {G} was spent to cast this spell, that creature enters the battlefield with an additional +1/+1 counter on it")); - this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard())); + this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE)); } diff --git a/Mage.Sets/src/mage/cards/v/VolrathTheFallen.java b/Mage.Sets/src/mage/cards/v/VolrathTheFallen.java index d7344404e4..3828187306 100644 --- a/Mage.Sets/src/mage/cards/v/VolrathTheFallen.java +++ b/Mage.Sets/src/mage/cards/v/VolrathTheFallen.java @@ -1,4 +1,3 @@ - package mage.cards.v; import java.util.UUID; @@ -13,11 +12,11 @@ import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Duration; +import mage.constants.SubType; import mage.constants.SuperType; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; /** * @@ -26,22 +25,22 @@ import mage.filter.common.FilterCreatureCard; public final class VolrathTheFallen extends CardImpl { public VolrathTheFallen(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}{B}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}{B}"); addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.SHAPESHIFTER); this.power = new MageInt(6); this.toughness = new MageInt(4); - // {1}{B}, Discard a creature card: + // {1}{B}, Discard a creature card: // Volrath the Fallen gets +X/+X until end of turn, where X is the discarded card's converted mana cost. - Effect effect = new BoostSourceEffect(DiscardCostCardConvertedMana.instance,DiscardCostCardConvertedMana.instance,Duration.EndOfTurn); + Effect effect = new BoostSourceEffect(DiscardCostCardConvertedMana.instance, DiscardCostCardConvertedMana.instance, Duration.EndOfTurn); effect.setText("{this} gets +X/+X until end of turn, where X is the discarded card's converted mana cost"); - + Ability ability = new SimpleActivatedAbility( - Zone.BATTLEFIELD, + Zone.BATTLEFIELD, effect, new ManaCostsImpl("{1}{B}")); - ability.addCost(new DiscardCardCost(new FilterCreatureCard())); + ability.addCost(new DiscardCardCost(StaticFilters.FILTER_CARD_CREATURE)); this.addAbility(ability); } @@ -53,4 +52,4 @@ public final class VolrathTheFallen extends CardImpl { public VolrathTheFallen copy() { return new VolrathTheFallen(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/cards/w/WeirdHarvest.java b/Mage.Sets/src/mage/cards/w/WeirdHarvest.java index ca1fa3a86f..3bd2728d72 100644 --- a/Mage.Sets/src/mage/cards/w/WeirdHarvest.java +++ b/Mage.Sets/src/mage/cards/w/WeirdHarvest.java @@ -1,4 +1,3 @@ - package mage.cards.w; import java.util.ArrayList; @@ -14,7 +13,7 @@ import mage.cards.CardsImpl; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; import mage.target.common.TargetCardInLibrary; @@ -26,7 +25,7 @@ import mage.target.common.TargetCardInLibrary; public final class WeirdHarvest extends CardImpl { public WeirdHarvest(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{G}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{G}{G}"); // Each player may search their library for up to X creature cards, reveal those cards, and put them into their hand. Then each player who searched their library this way shuffles it. getSpellAbility().addEffect(new WeirdHarvestEffect()); @@ -87,7 +86,7 @@ class WeirdHarvestEffect extends OneShotEffect { private void chooseAndSearchLibrary(List usingPlayers, Player player, int xValue, Ability source, MageObject sourceObject, Game game) { if (player.chooseUse(Outcome.PutCardInPlay, "Search your library for up " + xValue + " creature cards and put them into your hand?", source, game)) { usingPlayers.add(player); - TargetCardInLibrary target = new TargetCardInLibrary(0, xValue, new FilterCreatureCard()); + TargetCardInLibrary target = new TargetCardInLibrary(0, xValue, StaticFilters.FILTER_CARD_CREATURE); if (player.searchLibrary(target, source, game)) { if (!target.getTargets().isEmpty()) { Cards cards = new CardsImpl(target.getTargets()); diff --git a/Mage.Sets/src/mage/cards/w/WindingCanyons.java b/Mage.Sets/src/mage/cards/w/WindingCanyons.java index cc15ea5676..a20ba3d7ae 100644 --- a/Mage.Sets/src/mage/cards/w/WindingCanyons.java +++ b/Mage.Sets/src/mage/cards/w/WindingCanyons.java @@ -1,4 +1,3 @@ - package mage.cards.w; import java.util.UUID; @@ -15,7 +14,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; /** * @@ -30,7 +29,7 @@ public final class WindingCanyons extends CardImpl { this.addAbility(new ColorlessManaAbility()); // {2}, {tap}: Until end of turn, you may cast creature spells as though they had flash. - Effect effect = new AddContinuousEffectToGame(new CastAsThoughItHadFlashAllEffect(Duration.EndOfTurn, new FilterCreatureCard())); + Effect effect = new AddContinuousEffectToGame(new CastAsThoughItHadFlashAllEffect(Duration.EndOfTurn, StaticFilters.FILTER_CARD_CREATURE)); effect.setText("Until end of turn, you may cast creature spells as though they had flash."); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new GenericManaCost(2)); ability.addCost(new TapSourceCost()); diff --git a/Mage.Sets/src/mage/cards/w/WoodlandSleuth.java b/Mage.Sets/src/mage/cards/w/WoodlandSleuth.java index bb5b2b2a95..008cea1616 100644 --- a/Mage.Sets/src/mage/cards/w/WoodlandSleuth.java +++ b/Mage.Sets/src/mage/cards/w/WoodlandSleuth.java @@ -1,4 +1,3 @@ - package mage.cards.w; import java.util.UUID; @@ -13,10 +12,10 @@ import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Outcome; +import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; import mage.util.RandomUtil; @@ -30,7 +29,7 @@ public final class WoodlandSleuth extends CardImpl { private static final String staticText = "Morbid — When {this} enters the battlefield, if a creature died this turn, return a creature card at random from your graveyard to your hand."; public WoodlandSleuth(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.SCOUT); @@ -73,7 +72,7 @@ class WoodlandSleuthEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { - Card[] cards = player.getGraveyard().getCards(new FilterCreatureCard(), game).toArray(new Card[0]); + Card[] cards = player.getGraveyard().getCards(StaticFilters.FILTER_CARD_CREATURE, game).toArray(new Card[0]); if (cards.length > 0) { Card card = cards[RandomUtil.nextInt(cards.length)]; card.moveToZone(Zone.HAND, source.getSourceId(), game, true); diff --git a/Mage.Sets/src/mage/cards/w/WorldlyTutor.java b/Mage.Sets/src/mage/cards/w/WorldlyTutor.java index 637a9ef6ea..d6faec91c1 100644 --- a/Mage.Sets/src/mage/cards/w/WorldlyTutor.java +++ b/Mage.Sets/src/mage/cards/w/WorldlyTutor.java @@ -1,4 +1,3 @@ - package mage.cards.w; import java.util.UUID; @@ -6,7 +5,7 @@ import mage.abilities.effects.common.search.SearchLibraryPutOnLibraryEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.target.common.TargetCardInLibrary; /** @@ -16,11 +15,10 @@ import mage.target.common.TargetCardInLibrary; public final class WorldlyTutor extends CardImpl { public WorldlyTutor(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{G}"); - + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{G}"); // Search your library for a creature card and reveal that card. Shuffle your library, then put the card on top of it. - this.getSpellAbility().addEffect(new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(new FilterCreatureCard()), true, true)); + this.getSpellAbility().addEffect(new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(StaticFilters.FILTER_CARD_CREATURE), true, true)); } public WorldlyTutor(final WorldlyTutor card) { diff --git a/Mage.Sets/src/mage/cards/w/WreathOfGeists.java b/Mage.Sets/src/mage/cards/w/WreathOfGeists.java index 8991b23d96..2b7090df7e 100644 --- a/Mage.Sets/src/mage/cards/w/WreathOfGeists.java +++ b/Mage.Sets/src/mage/cards/w/WreathOfGeists.java @@ -1,4 +1,3 @@ - package mage.cards.w; import java.util.UUID; @@ -12,10 +11,10 @@ import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Outcome; +import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -26,10 +25,9 @@ import mage.target.common.TargetCreaturePermanent; public final class WreathOfGeists extends CardImpl { public WreathOfGeists(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{G}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{G}"); this.subtype.add(SubType.AURA); - // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); @@ -39,7 +37,7 @@ public final class WreathOfGeists extends CardImpl { this.addAbility(ability); // Enchanted creature gets +X/+X, where X is the number of creature cards in your graveyard. - DynamicValue value = new CardsInControllerGraveyardCount(new FilterCreatureCard()); + DynamicValue value = new CardsInControllerGraveyardCount(StaticFilters.FILTER_CARD_CREATURE); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(value, value))); } diff --git a/Mage.Sets/src/mage/cards/y/YoreTillerNephilim.java b/Mage.Sets/src/mage/cards/y/YoreTillerNephilim.java index fab802d749..107995d451 100644 --- a/Mage.Sets/src/mage/cards/y/YoreTillerNephilim.java +++ b/Mage.Sets/src/mage/cards/y/YoreTillerNephilim.java @@ -1,4 +1,3 @@ - package mage.cards.y; import java.util.UUID; @@ -13,7 +12,7 @@ import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.SubType; import mage.constants.Zone; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -33,7 +32,7 @@ public final class YoreTillerNephilim extends CardImpl { // Whenever Yore-Tiller Nephilim attacks, return target creature card from your graveyard to the battlefield tapped and attacking. Ability ability = new AttacksTriggeredAbility(new YoreTillerNephilimEffect(), false); - ability.addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard())); + ability.addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/z/ZamWesell.java b/Mage.Sets/src/mage/cards/z/ZamWesell.java index bc9d2fac4b..7a9b511c27 100644 --- a/Mage.Sets/src/mage/cards/z/ZamWesell.java +++ b/Mage.Sets/src/mage/cards/z/ZamWesell.java @@ -1,4 +1,3 @@ - package mage.cards.z; import java.util.UUID; @@ -12,7 +11,7 @@ import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; -import mage.filter.common.FilterCreatureCard; +import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; import mage.target.TargetCard; @@ -70,7 +69,7 @@ class ZamWesselEffect extends OneShotEffect { if (controller != null) { Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source)); if (targetPlayer != null) { - TargetCard targetCard = new TargetCard(0, 1, Zone.HAND, new FilterCreatureCard()); + TargetCard targetCard = new TargetCard(0, 1, Zone.HAND, StaticFilters.FILTER_CARD_CREATURE); controller.choose(outcome, targetPlayer.getHand(), targetCard, game); Card copyFromCard = game.getCard(targetCard.getFirstTarget()); if (copyFromCard != null) { diff --git a/Mage/src/main/java/mage/filter/StaticFilters.java b/Mage/src/main/java/mage/filter/StaticFilters.java index cbd2348a98..ac07a4d47a 100644 --- a/Mage/src/main/java/mage/filter/StaticFilters.java +++ b/Mage/src/main/java/mage/filter/StaticFilters.java @@ -55,10 +55,9 @@ public final class StaticFilters { FILTER_CARD_CARDS.setLockedFilter(true); } - public static final FilterCard FILTER_CARD_ENTCHANTMENT = new FilterCard("entchantment card"); + public static final FilterCard FILTER_CARD_ENTCHANTMENT = new FilterEnchantmentCard(); static { - FILTER_CARD_ENTCHANTMENT.add(new CardTypePredicate(CardType.ENCHANTMENT)); FILTER_CARD_ENTCHANTMENT.setLockedFilter(true); }