From 4806738cfb5c63abbff5a8c70e0d340826d14a4d Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 23 Jul 2017 14:59:13 +0200 Subject: [PATCH] * Some more use of StaticFilter objects. --- .../java/mage/player/ai/ComputerPlayer.java | 4 +- .../src/mage/cards/a/AbhorrentOverlord.java | 2 +- .../mage/cards/a/AbolisherOfBloodlines.java | 2 +- .../src/mage/cards/a/AccursedCentaur.java | 2 +- Mage.Sets/src/mage/cards/a/AlphaStatus.java | 2 +- Mage.Sets/src/mage/cards/a/AngelsTrumpet.java | 2 +- .../src/mage/cards/a/ArtisanOfForms.java | 2 +- Mage.Sets/src/mage/cards/a/AuraShards.java | 2 +- .../src/mage/cards/a/AurraSingBaneOfJedi.java | 2 +- Mage.Sets/src/mage/cards/a/AvatarOfMight.java | 4 +- Mage.Sets/src/mage/cards/a/AvengingArrow.java | 2 +- .../src/mage/cards/b/BalefireDragon.java | 2 +- Mage.Sets/src/mage/cards/b/BarrinsSpite.java | 224 +++++----- Mage.Sets/src/mage/cards/b/BatheInLight.java | 2 +- .../src/mage/cards/b/BearerOfSilence.java | 2 +- .../src/mage/cards/b/BenevolentOffering.java | 4 +- .../src/mage/cards/b/BiomanticMastery.java | 2 +- .../src/mage/cards/b/BlasphemousAct.java | 2 +- Mage.Sets/src/mage/cards/b/BlightedFen.java | 2 +- Mage.Sets/src/mage/cards/b/BlindWorship.java | 166 ++++---- .../src/mage/cards/b/BloodReckoning.java | 2 +- Mage.Sets/src/mage/cards/b/BoldDefense.java | 2 +- Mage.Sets/src/mage/cards/b/BreakingWave.java | 2 +- Mage.Sets/src/mage/cards/b/BurstOfSpeed.java | 2 +- .../src/mage/cards/c/CabalExecutioner.java | 2 +- Mage.Sets/src/mage/cards/c/CallForUnity.java | 2 +- Mage.Sets/src/mage/cards/c/CallToGlory.java | 2 +- Mage.Sets/src/mage/cards/c/Caltrops.java | 2 +- .../src/mage/cards/c/CankerAbomination.java | 2 +- Mage.Sets/src/mage/cards/c/Cannibalize.java | 2 +- Mage.Sets/src/mage/cards/c/Catastrophe.java | 2 +- .../src/mage/cards/c/CauldronOfSouls.java | 2 +- Mage.Sets/src/mage/cards/c/ChainersEdict.java | 2 +- .../src/mage/cards/c/ChandrasIgnition.java | 2 +- Mage.Sets/src/mage/cards/c/CleaverRiot.java | 2 +- Mage.Sets/src/mage/cards/c/CloneLegion.java | 2 +- .../src/mage/cards/c/CollectiveEffort.java | 2 +- .../mage/cards/c/CommanderGrevenIlVec.java | 2 +- .../src/mage/cards/c/ContagionEngine.java | 2 +- Mage.Sets/src/mage/cards/c/CracklingDoom.java | 2 +- Mage.Sets/src/mage/cards/c/CraterHellion.java | 2 +- .../src/mage/cards/c/CreamOfTheCrop.java | 2 +- .../src/mage/cards/c/CrownOfConvergence.java | 2 +- Mage.Sets/src/mage/cards/c/CrownOfDoom.java | 2 +- Mage.Sets/src/mage/cards/c/CruelEdict.java | 2 +- .../src/mage/cards/c/CruelUltimatum.java | 2 +- .../src/mage/cards/c/CrueltyOfTheSith.java | 178 ++++---- .../src/mage/cards/c/CurseOfDeathsHold.java | 2 +- Mage.Sets/src/mage/cards/d/DarkDabbling.java | 2 +- Mage.Sets/src/mage/cards/d/DarkSalvation.java | 2 +- Mage.Sets/src/mage/cards/d/DarkestHour.java | 2 +- Mage.Sets/src/mage/cards/d/DarthVader.java | 252 +++++------ Mage.Sets/src/mage/cards/d/DeadDrop.java | 2 +- Mage.Sets/src/mage/cards/d/DeadlyTempest.java | 2 +- Mage.Sets/src/mage/cards/d/DeathMatch.java | 2 +- .../src/mage/cards/d/DeathPitOffering.java | 2 +- .../src/mage/cards/d/DeathbringerRegent.java | 2 +- .../src/mage/cards/d/DeceiverOfForm.java | 2 +- Mage.Sets/src/mage/cards/d/DecreeOfPain.java | 2 +- .../src/mage/cards/d/DefenseOfTheHeart.java | 2 +- .../mage/cards/d/DesecrationElemental.java | 2 +- Mage.Sets/src/mage/cards/d/DiabolicEdict.java | 2 +- .../mage/cards/d/DiaochanArtfulBeauty.java | 2 +- Mage.Sets/src/mage/cards/d/DoOrDie.java | 2 +- Mage.Sets/src/mage/cards/d/DoublingChant.java | 2 +- .../src/mage/cards/d/DragonlordKolaghan.java | 2 +- Mage.Sets/src/mage/cards/d/DwarvenSong.java | 2 +- Mage.Sets/src/mage/cards/e/EgoErasure.java | 4 +- .../src/mage/cards/e/EldraziMonument.java | 2 +- Mage.Sets/src/mage/cards/e/ElspethTirel.java | 2 +- .../src/mage/cards/e/EssenceHarvest.java | 2 +- Mage.Sets/src/mage/cards/e/EvilTwin.java | 2 +- .../src/mage/cards/e/ExecutionersSwing.java | 2 +- Mage.Sets/src/mage/cards/f/FarAway.java | 2 +- .../src/mage/cards/f/FavorOfTheMighty.java | 2 +- Mage.Sets/src/mage/cards/f/FellTheMighty.java | 2 +- Mage.Sets/src/mage/cards/f/Fervor.java | 2 +- Mage.Sets/src/mage/cards/f/Festercreep.java | 2 +- Mage.Sets/src/mage/cards/f/FinalRevels.java | 4 +- Mage.Sets/src/mage/cards/f/ForcedMarch.java | 2 +- .../mage/cards/f/FoulTongueInvocation.java | 2 +- Mage.Sets/src/mage/cards/f/Fumigate.java | 2 +- .../src/mage/cards/f/FungalBehemoth.java | 2 +- Mage.Sets/src/mage/cards/g/GaeasAnthem.java | 2 +- .../src/mage/cards/g/GerrardsBattleCry.java | 2 +- Mage.Sets/src/mage/cards/g/GethsVerdict.java | 2 +- Mage.Sets/src/mage/cards/g/Gigantoplasm.java | 2 +- .../src/mage/cards/g/GiltspireAvenger.java | 2 +- .../src/mage/cards/g/GlaringSpotlight.java | 2 +- .../src/mage/cards/g/GleamOfResistance.java | 2 +- .../src/mage/cards/g/GloriousAnthem.java | 2 +- .../src/mage/cards/g/GloriousCharge.java | 2 +- .../src/mage/cards/g/GreatOakGuardian.java | 4 +- Mage.Sets/src/mage/cards/g/GrixisCharm.java | 2 +- .../src/mage/cards/h/HallowedBurial.java | 2 +- .../src/mage/cards/h/HauntedPlateMail.java | 2 +- Mage.Sets/src/mage/cards/h/HeavensGate.java | 2 +- .../src/mage/cards/h/HeliodGodOfTheSun.java | 2 +- .../src/mage/cards/h/HellionEruption.java | 2 +- Mage.Sets/src/mage/cards/h/Humility.java | 2 +- Mage.Sets/src/mage/cards/i/IG88B.java | 230 +++++------ .../src/mage/cards/i/IchorExplosion.java | 2 +- Mage.Sets/src/mage/cards/i/IcyBlast.java | 4 +- .../src/mage/cards/i/InciteHysteria.java | 2 +- .../src/mage/cards/j/JaggedLightning.java | 2 +- .../src/mage/cards/j/JeskaiAscendancy.java | 2 +- .../mage/cards/j/JorKadeenThePrevailer.java | 2 +- .../src/mage/cards/j/JoragaInvocation.java | 2 +- Mage.Sets/src/mage/cards/j/Juxtapose.java | 2 +- .../src/mage/cards/k/KabiraVindicator.java | 4 +- .../mage/cards/k/KagemaroFirstToSuffer.java | 2 +- .../src/mage/cards/k/KinTreeInvocation.java | 2 +- .../mage/cards/k/KioraMasterOfTheDepths.java | 2 +- .../src/mage/cards/k/KitsunePalliator.java | 2 +- Mage.Sets/src/mage/cards/k/KjeldoranDead.java | 2 +- Mage.Sets/src/mage/cards/k/Knighthood.java | 2 +- .../mage/cards/k/KodamaOfTheSouthTree.java | 2 +- Mage.Sets/src/mage/cards/k/KondasBanner.java | 4 +- .../src/mage/cards/k/KuonOgreAscendant.java | 2 +- Mage.Sets/src/mage/cards/k/KusariGama.java | 2 +- .../src/mage/cards/l/LeoninSunStandard.java | 2 +- Mage.Sets/src/mage/cards/l/LethalSting.java | 2 +- .../src/mage/cards/l/LeylineOfVitality.java | 2 +- .../src/mage/cards/l/LilianaOfTheVeil.java | 2 +- Mage.Sets/src/mage/cards/l/LivingDeath.java | 2 +- Mage.Sets/src/mage/cards/l/LivingEnd.java | 2 +- .../src/mage/cards/l/LostInTheWoods.java | 2 +- .../mage/cards/m/MagusOfTheTabernacle.java | 2 +- Mage.Sets/src/mage/cards/m/ManaEchoes.java | 2 +- .../src/mage/cards/m/MarchesasDecree.java | 2 +- Mage.Sets/src/mage/cards/m/MassHysteria.java | 2 +- Mage.Sets/src/mage/cards/m/MassPolymorph.java | 2 +- Mage.Sets/src/mage/cards/m/MayaelsAria.java | 2 +- Mage.Sets/src/mage/cards/m/Meadowboon.java | 2 +- .../src/mage/cards/m/MeishinTheMindCage.java | 2 +- .../src/mage/cards/m/MinionsMurmurs.java | 184 ++++----- .../src/mage/cards/m/MoggInfestation.java | 2 +- .../src/mage/cards/m/MossbridgeTroll.java | 2 +- .../mage/cards/n/NecromanticSelection.java | 2 +- .../src/mage/cards/n/NetherbornPhalanx.java | 2 +- Mage.Sets/src/mage/cards/n/NightDay.java | 2 +- .../mage/cards/n/NovijenHeartOfProgress.java | 2 +- .../src/mage/cards/n/NyleaGodOfTheHunt.java | 2 +- .../src/mage/cards/o/OathswornGiant.java | 4 +- .../src/mage/cards/o/OpenIntoWonder.java | 166 ++++---- .../src/mage/cards/o/OverwhelmingForces.java | 2 +- .../mage/cards/o/OverwhelmingSplendor.java | 390 +++++++++--------- .../mage/cards/o/OverwhelmingStampede.java | 2 +- .../cards/o/OviyaPashiriSageLifecrafter.java | 2 +- Mage.Sets/src/mage/cards/p/Pandemonium.java | 2 +- .../src/mage/cards/p/PathOfAngersFlame.java | 2 +- .../src/mage/cards/p/PathbreakerIbex.java | 2 +- .../src/mage/cards/p/PatronOfTheAkki.java | 2 +- .../src/mage/cards/p/PhantasmalImage.java | 2 +- .../mage/cards/p/PhyrexianDreadnought.java | 2 +- .../src/mage/cards/p/PhyrexianRebirth.java | 2 +- .../src/mage/cards/p/PlanarCollapse.java | 4 +- Mage.Sets/src/mage/cards/p/PollenLullaby.java | 2 +- Mage.Sets/src/mage/cards/p/PrimalRage.java | 2 +- .../src/mage/cards/r/RageReflection.java | 2 +- Mage.Sets/src/mage/cards/r/RainOfDaggers.java | 2 +- .../src/mage/cards/r/RallyTheRighteous.java | 4 +- .../src/mage/cards/r/RavagerOfTheFells.java | 2 +- Mage.Sets/src/mage/cards/r/Reciprocate.java | 2 +- Mage.Sets/src/mage/cards/r/Riddlekeeper.java | 136 +++--- Mage.Sets/src/mage/cards/r/RivalsDuel.java | 2 +- .../src/mage/cards/s/SageOfTheInwardEye.java | 2 +- .../src/mage/cards/s/SakashimasStudent.java | 2 +- .../src/mage/cards/s/SanguinePraetor.java | 2 +- Mage.Sets/src/mage/cards/s/SavageBeating.java | 2 +- .../src/mage/cards/s/ScarscaleRitual.java | 2 +- .../src/mage/cards/s/ScreamsFromWithin.java | 2 +- .../src/mage/cards/s/SeaKingsBlessing.java | 2 +- .../mage/cards/s/SelvalaHeartOfTheWilds.java | 2 +- .../src/mage/cards/s/ServantOfVolrath.java | 2 +- .../src/mage/cards/s/ShadowbornDemon.java | 2 +- .../src/mage/cards/s/ShieldsOfVelisVel.java | 2 +- .../src/mage/cards/s/ShockmawDragon.java | 2 +- .../src/mage/cards/s/ShowOfDominance.java | 2 +- Mage.Sets/src/mage/cards/s/SigilBlessing.java | 2 +- .../cards/s/SilumgarTheDriftingDeath.java | 2 +- Mage.Sets/src/mage/cards/s/Sleep.java | 2 +- .../src/mage/cards/s/SlumberingDragon.java | 2 +- .../src/mage/cards/s/SoltariChampion.java | 2 +- Mage.Sets/src/mage/cards/s/SpareFromEvil.java | 2 +- .../src/mage/cards/s/SpreadingPlague.java | 2 +- .../mage/cards/s/StoneforgeMasterwork.java | 2 +- .../mage/cards/s/StrongholdDiscipline.java | 2 +- .../src/mage/cards/s/SublimeArchangel.java | 2 +- .../src/mage/cards/s/SuddenSpoiling.java | 4 +- Mage.Sets/src/mage/cards/s/SunbladeElf.java | 2 +- Mage.Sets/src/mage/cards/s/SurgeOfZeal.java | 2 +- .../src/mage/cards/s/SurrakDragonclaw.java | 2 +- .../src/mage/cards/s/SwayOfIllusion.java | 2 +- .../src/mage/cards/s/SylvanParadise.java | 2 +- .../src/mage/cards/s/SyntheticDestiny.java | 2 +- Mage.Sets/src/mage/cards/t/Tenacity.java | 2 +- .../mage/cards/t/TibaltTheFiendBlooded.java | 2 +- .../src/mage/cards/t/ToTheSlaughter.java | 2 +- .../src/mage/cards/t/TouchOfDarkness.java | 2 +- Mage.Sets/src/mage/cards/t/TritonTactics.java | 2 +- Mage.Sets/src/mage/cards/t/Tromokratis.java | 2 +- .../src/mage/cards/t/TrompTheDomains.java | 2 +- .../src/mage/cards/t/TwistAllegiance.java | 2 +- .../src/mage/cards/v/VelaTheNightClad.java | 2 +- .../src/mage/cards/v/VesuvanShapeshifter.java | 2 +- .../src/mage/cards/v/VillageSurvivors.java | 2 +- Mage.Sets/src/mage/cards/v/VindictiveMob.java | 2 +- Mage.Sets/src/mage/cards/v/Vitalize.java | 2 +- Mage.Sets/src/mage/cards/v/VolatileRig.java | 2 +- .../src/mage/cards/v/VolcanicEruption.java | 2 +- Mage.Sets/src/mage/cards/w/WarFlare.java | 2 +- Mage.Sets/src/mage/cards/w/WarReport.java | 2 +- Mage.Sets/src/mage/cards/w/WardOfBones.java | 4 +- Mage.Sets/src/mage/cards/w/WarriorsHonor.java | 2 +- .../src/mage/cards/w/WaveOfIndifference.java | 2 +- .../src/mage/cards/w/WildBeastmaster.java | 2 +- .../src/mage/cards/w/WojekApothecary.java | 2 +- Mage.Sets/src/mage/cards/w/WojekSiren.java | 2 +- .../src/mage/cards/w/WretchedBanquet.java | 2 +- Mage.Sets/src/mage/cards/x/Xenograft.java | 2 +- .../src/mage/cards/z/ZadaHedronGrinder.java | 2 +- .../src/mage/cards/z/ZhangHeWeiGeneral.java | 2 +- .../org/mage/test/cards/copy/CloneTest.java | 2 +- .../cards/copy/KikiJikiMirrorBreakerTest.java | 2 +- .../common/AttacksAllTriggeredAbility.java | 4 +- .../effects/common/CopyPermanentEffect.java | 2 +- .../effects/keyword/BolsterEffect.java | 2 +- .../main/java/mage/game/combat/Combat.java | 2 +- .../emblems/SorinSolemnVisitorEmblem.java | 2 +- .../common/TargetCreatureOrPlayerAmount.java | 8 +- .../common/TargetCreaturePermanent.java | 4 +- .../common/TargetCreaturePermanentAmount.java | 8 +- .../common/TargetPermanentOrPlayer.java | 4 +- 234 files changed, 1211 insertions(+), 1211 deletions(-) diff --git a/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java b/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java index dc1baacac2..3f033f2c58 100644 --- a/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java +++ b/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java @@ -781,9 +781,9 @@ public class ComputerPlayer extends PlayerImpl implements Player { } List targets; if (outcome.isGood()) { - targets = threats(playerId, source.getSourceId(), new FilterCreaturePermanent(), game, target.getTargets()); + targets = threats(playerId, source.getSourceId(), StaticFilters.FILTER_PERMANENT_CREATURE, game, target.getTargets()); } else { - targets = threats(opponentId, source.getSourceId(), new FilterCreaturePermanent(), game, target.getTargets()); + targets = threats(opponentId, source.getSourceId(), StaticFilters.FILTER_PERMANENT_CREATURE, game, target.getTargets()); } for (Permanent permanent : targets) { if (target.canTarget(getId(), permanent.getId(), source, game)) { diff --git a/Mage.Sets/src/mage/cards/a/AbhorrentOverlord.java b/Mage.Sets/src/mage/cards/a/AbhorrentOverlord.java index 6727b0a605..24cddb0f9f 100644 --- a/Mage.Sets/src/mage/cards/a/AbhorrentOverlord.java +++ b/Mage.Sets/src/mage/cards/a/AbhorrentOverlord.java @@ -66,7 +66,7 @@ public class AbhorrentOverlord extends CardImpl { effect.setText("create a number of 1/1 black Harpy creature tokens with flying equal to your devotion to black. (Each {B} in the mana costs of permanents you control counts toward your devotion to black.)"); this.addAbility(new EntersBattlefieldTriggeredAbility(effect)); // At the beginning of your upkeep, sacrifice a creature. - this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeControllerEffect(new FilterCreaturePermanent(), 1, null), TargetController.YOU, false)); + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeControllerEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 1, null), TargetController.YOU, false)); } public AbhorrentOverlord(final AbhorrentOverlord card) { diff --git a/Mage.Sets/src/mage/cards/a/AbolisherOfBloodlines.java b/Mage.Sets/src/mage/cards/a/AbolisherOfBloodlines.java index c8dfee1ca7..ae83d3e55c 100644 --- a/Mage.Sets/src/mage/cards/a/AbolisherOfBloodlines.java +++ b/Mage.Sets/src/mage/cards/a/AbolisherOfBloodlines.java @@ -84,7 +84,7 @@ class AbolisherOfBloodlinesAbility extends TriggeredAbilityImpl { static final String RULE_TEXT = "When this creature transforms into Abolisher of Bloodlines, target opponent sacrifices three creatures"; public AbolisherOfBloodlinesAbility() { - super(Zone.BATTLEFIELD, new SacrificeEffect(new FilterCreaturePermanent(), 3, "Target opponent"), false); + super(Zone.BATTLEFIELD, new SacrificeEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 3, "Target opponent"), false); Target target = new TargetOpponent(); this.addTarget(target); } diff --git a/Mage.Sets/src/mage/cards/a/AccursedCentaur.java b/Mage.Sets/src/mage/cards/a/AccursedCentaur.java index efda95d43d..e768b6b3c7 100644 --- a/Mage.Sets/src/mage/cards/a/AccursedCentaur.java +++ b/Mage.Sets/src/mage/cards/a/AccursedCentaur.java @@ -52,7 +52,7 @@ public class AccursedCentaur extends CardImpl { this.toughness = new MageInt(2); // When Accursed Centaur enters the battlefield, sacrifice a creature. - this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeControllerEffect(new FilterCreaturePermanent(), 1, null))); + this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeControllerEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 1, null))); } public AccursedCentaur(final AccursedCentaur card) { diff --git a/Mage.Sets/src/mage/cards/a/AlphaStatus.java b/Mage.Sets/src/mage/cards/a/AlphaStatus.java index 8ac4c29bc4..68ccc8f7f4 100644 --- a/Mage.Sets/src/mage/cards/a/AlphaStatus.java +++ b/Mage.Sets/src/mage/cards/a/AlphaStatus.java @@ -86,7 +86,7 @@ class AlphaStatusDynamicValue implements DynamicValue { if (enchantment != null && enchantment.getAttachedTo() != null) { Permanent enchanted = game.getPermanent(enchantment.getAttachedTo()); if (enchanted != null) { - for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), game)) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, game)) { if (!permanent.getId().equals(enchanted.getId())) { if (enchanted.shareSubtypes(permanent, game)) { xValue += 2; diff --git a/Mage.Sets/src/mage/cards/a/AngelsTrumpet.java b/Mage.Sets/src/mage/cards/a/AngelsTrumpet.java index 3a9eac03fc..855e406940 100644 --- a/Mage.Sets/src/mage/cards/a/AngelsTrumpet.java +++ b/Mage.Sets/src/mage/cards/a/AngelsTrumpet.java @@ -91,7 +91,7 @@ class AngelsTrumpetTapEffect extends OneShotEffect { Player player = game.getPlayer(game.getActivePlayerId()); int count = 0; if (player != null) { - for (Permanent creature : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), player.getId(), game)) { + for (Permanent creature : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, player.getId(), game)) { // Untapped creatures are safe. if (creature.isTapped()) { continue; diff --git a/Mage.Sets/src/mage/cards/a/ArtisanOfForms.java b/Mage.Sets/src/mage/cards/a/ArtisanOfForms.java index 4fbb3db2f1..ac90464867 100644 --- a/Mage.Sets/src/mage/cards/a/ArtisanOfForms.java +++ b/Mage.Sets/src/mage/cards/a/ArtisanOfForms.java @@ -60,7 +60,7 @@ public class ArtisanOfForms extends CardImpl { this.toughness = new MageInt(1); // Heroic - Whenever you cast a spell that targets Artisan of Forms, you may have Artisan of Forms become a copy of target creature and gain this ability. - Effect effect = new CopyPermanentEffect(new FilterCreaturePermanent(), new ArtisanOfFormsApplyToPermanent(), true); + Effect effect = new CopyPermanentEffect(StaticFilters.FILTER_PERMANENT_CREATURE, new ArtisanOfFormsApplyToPermanent(), true); effect.setText("have {this} become a copy of target creature and gain this ability"); Ability ability = new HeroicAbility(effect, true); ability.addTarget(new TargetCreaturePermanent()); diff --git a/Mage.Sets/src/mage/cards/a/AuraShards.java b/Mage.Sets/src/mage/cards/a/AuraShards.java index 7e31df4cc6..a7c00927d4 100644 --- a/Mage.Sets/src/mage/cards/a/AuraShards.java +++ b/Mage.Sets/src/mage/cards/a/AuraShards.java @@ -49,7 +49,7 @@ public class AuraShards extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{G}{W}"); // Whenever a creature enters the battlefield under your control, you may destroy target artifact or enchantment. - Ability ability = new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new FilterCreaturePermanent(), true, "Whenever a creature enters the battlefield under your control, you may destroy target artifact or enchantment"); + Ability ability = new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), StaticFilters.FILTER_PERMANENT_CREATURE, true, "Whenever a creature enters the battlefield under your control, you may destroy target artifact or enchantment"); ability.addTarget(new TargetPermanent(new FilterArtifactOrEnchantmentPermanent())); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/a/AurraSingBaneOfJedi.java b/Mage.Sets/src/mage/cards/a/AurraSingBaneOfJedi.java index df8ad0aa9d..71d7f172e1 100644 --- a/Mage.Sets/src/mage/cards/a/AurraSingBaneOfJedi.java +++ b/Mage.Sets/src/mage/cards/a/AurraSingBaneOfJedi.java @@ -138,7 +138,7 @@ class SacrificeAllEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - List permanents = game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), source.getId(), game); + List permanents = game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), source.getId(), game); for (Permanent p : permanents) { p.sacrifice(source.getSourceId(), game); } diff --git a/Mage.Sets/src/mage/cards/a/AvatarOfMight.java b/Mage.Sets/src/mage/cards/a/AvatarOfMight.java index c47d6642df..4dde442c0d 100644 --- a/Mage.Sets/src/mage/cards/a/AvatarOfMight.java +++ b/Mage.Sets/src/mage/cards/a/AvatarOfMight.java @@ -102,10 +102,10 @@ class AvatarOfMightCostReductionEffect extends CostModificationEffectImpl { @Override public boolean applies(Ability abilityToModify, Ability source, Game game) { if (abilityToModify.getSourceId().equals(source.getSourceId()) && (abilityToModify instanceof SpellAbility)) { - int creatures = game.getBattlefield().countAll(new FilterCreaturePermanent(), source.getControllerId(), game); + int creatures = game.getBattlefield().countAll(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game); for (UUID playerId : game.getOpponents(source.getControllerId())) { Player opponent = game.getPlayer(playerId); - if (opponent != null && game.getBattlefield().countAll(new FilterCreaturePermanent(), opponent.getId(), game) >= creatures + 4) { + if (opponent != null && game.getBattlefield().countAll(StaticFilters.FILTER_PERMANENT_CREATURE, opponent.getId(), game) >= creatures + 4) { return true; } } diff --git a/Mage.Sets/src/mage/cards/a/AvengingArrow.java b/Mage.Sets/src/mage/cards/a/AvengingArrow.java index daca860209..7215ca4eb2 100644 --- a/Mage.Sets/src/mage/cards/a/AvengingArrow.java +++ b/Mage.Sets/src/mage/cards/a/AvengingArrow.java @@ -71,7 +71,7 @@ public class AvengingArrow extends CardImpl { class AvengingArrowTarget extends TargetPermanent { public AvengingArrowTarget() { - super(1, 1, new FilterCreaturePermanent(), false); + super(1, 1, StaticFilters.FILTER_PERMANENT_CREATURE, false); targetName = "creature that dealt damage this turn"; } diff --git a/Mage.Sets/src/mage/cards/b/BalefireDragon.java b/Mage.Sets/src/mage/cards/b/BalefireDragon.java index 4b1f87cc01..87ec1d9e6a 100644 --- a/Mage.Sets/src/mage/cards/b/BalefireDragon.java +++ b/Mage.Sets/src/mage/cards/b/BalefireDragon.java @@ -90,7 +90,7 @@ class BalefireDragonEffect extends OneShotEffect { if (player != null) { int amount = (Integer)getValue("damage"); if (amount > 0) { - for (Permanent creature: game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), player.getId(), game)) { + for (Permanent creature: game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, player.getId(), game)) { creature.damage(amount, source.getSourceId(), game, false, true); } } diff --git a/Mage.Sets/src/mage/cards/b/BarrinsSpite.java b/Mage.Sets/src/mage/cards/b/BarrinsSpite.java index 269bb317a4..a2ede2789b 100644 --- a/Mage.Sets/src/mage/cards/b/BarrinsSpite.java +++ b/Mage.Sets/src/mage/cards/b/BarrinsSpite.java @@ -1,112 +1,112 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.cards.b; - -import java.util.UUID; -import mage.MageObject; -import mage.abilities.Ability; -import mage.abilities.effects.OneShotEffect; -import mage.cards.CardImpl; -import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Zone; -import mage.filter.common.FilterCreaturePermanent; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; -import mage.target.common.TargetCreaturePermanentSameController; - -/** - * - * @author jeffwadsworth - */ -public class BarrinsSpite extends CardImpl { - - public BarrinsSpite(UUID ownerId, CardSetInfo setInfo) { - super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{U}{B}"); - - // Choose two target creatures controlled by the same player. Their controller chooses and sacrifices one of them. Return the other to its owner's hand. - this.getSpellAbility().addEffect(new BarrinsSpiteEffect()); - this.getSpellAbility().addTarget(new TargetCreaturePermanentSameController(2, 2, new FilterCreaturePermanent(), false)); - - } - - public BarrinsSpite(final BarrinsSpite card) { - super(card); - } - - @Override - public BarrinsSpite copy() { - return new BarrinsSpite(this); - } -} - -class BarrinsSpiteEffect extends OneShotEffect { - - public BarrinsSpiteEffect() { - super(Outcome.Detriment); - this.staticText = "Choose two target creatures controlled by the same player. Their controller chooses and sacrifices one of them. Return the other to its owner's hand"; - } - - public BarrinsSpiteEffect(final BarrinsSpiteEffect effect) { - super(effect); - } - - @Override - public BarrinsSpiteEffect copy() { - return new BarrinsSpiteEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - MageObject sourceObject = source.getSourceObject(game); - if (sourceObject != null) { - boolean sacrificeDone = false; - int count = 0; - for (UUID targetId : getTargetPointer().getTargets(game, source)) { - Permanent creature = game.getPermanent(targetId); - if (creature != null) { - Player controllerOfCreature = game.getPlayer(creature.getControllerId()); - if ((count == 0 - && controllerOfCreature.chooseUse(Outcome.Sacrifice, "Sacrifice " + creature.getLogName() + '?', source, game)) - || (count == 1 - && !sacrificeDone)) { - creature.sacrifice(source.getId(), game); - sacrificeDone = true; - } else { - creature.moveToZone(Zone.HAND, source.getId(), game, false); - } - count++; - } - } - return true; - } - return false; - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.b; + +import java.util.UUID; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCreaturePermanentSameController; + +/** + * + * @author jeffwadsworth + */ +public class BarrinsSpite extends CardImpl { + + public BarrinsSpite(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{U}{B}"); + + // Choose two target creatures controlled by the same player. Their controller chooses and sacrifices one of them. Return the other to its owner's hand. + this.getSpellAbility().addEffect(new BarrinsSpiteEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanentSameController(2, 2, StaticFilters.FILTER_PERMANENT_CREATURE, false)); + + } + + public BarrinsSpite(final BarrinsSpite card) { + super(card); + } + + @Override + public BarrinsSpite copy() { + return new BarrinsSpite(this); + } +} + +class BarrinsSpiteEffect extends OneShotEffect { + + public BarrinsSpiteEffect() { + super(Outcome.Detriment); + this.staticText = "Choose two target creatures controlled by the same player. Their controller chooses and sacrifices one of them. Return the other to its owner's hand"; + } + + public BarrinsSpiteEffect(final BarrinsSpiteEffect effect) { + super(effect); + } + + @Override + public BarrinsSpiteEffect copy() { + return new BarrinsSpiteEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + MageObject sourceObject = source.getSourceObject(game); + if (sourceObject != null) { + boolean sacrificeDone = false; + int count = 0; + for (UUID targetId : getTargetPointer().getTargets(game, source)) { + Permanent creature = game.getPermanent(targetId); + if (creature != null) { + Player controllerOfCreature = game.getPlayer(creature.getControllerId()); + if ((count == 0 + && controllerOfCreature.chooseUse(Outcome.Sacrifice, "Sacrifice " + creature.getLogName() + '?', source, game)) + || (count == 1 + && !sacrificeDone)) { + creature.sacrifice(source.getId(), game); + sacrificeDone = true; + } else { + creature.moveToZone(Zone.HAND, source.getId(), game, false); + } + count++; + } + } + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/cards/b/BatheInLight.java b/Mage.Sets/src/mage/cards/b/BatheInLight.java index 1cd8d649bc..f28d7463df 100644 --- a/Mage.Sets/src/mage/cards/b/BatheInLight.java +++ b/Mage.Sets/src/mage/cards/b/BatheInLight.java @@ -99,7 +99,7 @@ class BatheInLightEffect extends OneShotEffect { ObjectColor protectColor = (ObjectColor) game.getState().getValue(target.getId() + "_color"); if (protectColor != null) { ObjectColor color = target.getColor(game); - for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), source.getSourceId(), game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), source.getSourceId(), game)) { if (permanent.getColor(game).shares(color)) { ContinuousEffect effect = new GainProtectionFromColorTargetEffect(Duration.EndOfTurn, protectColor); effect.setTargetPointer(new FixedTarget(permanent, game)); diff --git a/Mage.Sets/src/mage/cards/b/BearerOfSilence.java b/Mage.Sets/src/mage/cards/b/BearerOfSilence.java index 4d511984e6..381c79d13a 100644 --- a/Mage.Sets/src/mage/cards/b/BearerOfSilence.java +++ b/Mage.Sets/src/mage/cards/b/BearerOfSilence.java @@ -61,7 +61,7 @@ public class BearerOfSilence extends CardImpl { this.addAbility(new DevoidAbility(this.color)); // When you cast Bearer of Silence, you may pay {1}{C}. If you do, target opponent sacrifices a creature. - Ability ability = new CastSourceTriggeredAbility(new DoIfCostPaid(new SacrificeEffect(new FilterCreaturePermanent(), 1, "Target opponent"), new ManaCostsImpl("{1}{C}"))); + Ability ability = new CastSourceTriggeredAbility(new DoIfCostPaid(new SacrificeEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 1, "Target opponent"), new ManaCostsImpl("{1}{C}"))); ability.addTarget(new TargetOpponent()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/b/BenevolentOffering.java b/Mage.Sets/src/mage/cards/b/BenevolentOffering.java index 91ff5f517c..8073431150 100644 --- a/Mage.Sets/src/mage/cards/b/BenevolentOffering.java +++ b/Mage.Sets/src/mage/cards/b/BenevolentOffering.java @@ -132,9 +132,9 @@ class BenevolentOfferingEffect2 extends OneShotEffect { target.choose(Outcome.Sacrifice, source.getControllerId(), source.getSourceId(), game); Player opponent = game.getPlayer(target.getFirstTarget()); if (opponent != null) { - int count = game.getBattlefield().countAll(new FilterCreaturePermanent(), controller.getId(), game) * 2; + int count = game.getBattlefield().countAll(StaticFilters.FILTER_PERMANENT_CREATURE, controller.getId(), game) * 2; controller.gainLife(count, game); - count = game.getBattlefield().countAll(new FilterCreaturePermanent(), opponent.getId(), game) * 2; + count = game.getBattlefield().countAll(StaticFilters.FILTER_PERMANENT_CREATURE, opponent.getId(), game) * 2; opponent.gainLife(count, game); return true; } diff --git a/Mage.Sets/src/mage/cards/b/BiomanticMastery.java b/Mage.Sets/src/mage/cards/b/BiomanticMastery.java index b5c2d1c29e..913043f07a 100644 --- a/Mage.Sets/src/mage/cards/b/BiomanticMastery.java +++ b/Mage.Sets/src/mage/cards/b/BiomanticMastery.java @@ -90,7 +90,7 @@ class BiomanticMasteryEffect extends OneShotEffect { for(UUID playerId: getTargetPointer().getTargets(game, source)) { Player player = game.getPlayer(playerId); if (player != null) { - int creatures = game.getBattlefield().countAll(new FilterCreaturePermanent(), playerId, game); + int creatures = game.getBattlefield().countAll(StaticFilters.FILTER_PERMANENT_CREATURE, playerId, game); controller.drawCards(creatures, game); } } diff --git a/Mage.Sets/src/mage/cards/b/BlasphemousAct.java b/Mage.Sets/src/mage/cards/b/BlasphemousAct.java index 60fa924a64..7a8e204bd6 100644 --- a/Mage.Sets/src/mage/cards/b/BlasphemousAct.java +++ b/Mage.Sets/src/mage/cards/b/BlasphemousAct.java @@ -85,7 +85,7 @@ class BlasphemousCostReductionEffect extends CostModificationEffectImpl { public boolean apply(Game game, Ability source, Ability abilityToModify) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { - int reductionAmount = game.getBattlefield().count(new FilterCreaturePermanent(), source.getSourceId(), source.getControllerId(), game); + int reductionAmount = game.getBattlefield().count(StaticFilters.FILTER_PERMANENT_CREATURE, source.getSourceId(), source.getControllerId(), game); CardUtil.reduceCost(abilityToModify, reductionAmount); return true; } diff --git a/Mage.Sets/src/mage/cards/b/BlightedFen.java b/Mage.Sets/src/mage/cards/b/BlightedFen.java index 586f3ddc92..68aa6fb046 100644 --- a/Mage.Sets/src/mage/cards/b/BlightedFen.java +++ b/Mage.Sets/src/mage/cards/b/BlightedFen.java @@ -57,7 +57,7 @@ public class BlightedFen extends CardImpl { // {4}{B}, {T}, Sacrifice Blighted Fen: Target opponent sacrifices a creature. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, - new SacrificeEffect(new FilterCreaturePermanent(), 1, "Target opponent"), + new SacrificeEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 1, "Target opponent"), new ManaCostsImpl<>("{4}{B}")); ability.addCost(new TapSourceCost()); ability.addCost(new SacrificeSourceCost()); diff --git a/Mage.Sets/src/mage/cards/b/BlindWorship.java b/Mage.Sets/src/mage/cards/b/BlindWorship.java index 4f2207346c..64dc39e93c 100644 --- a/Mage.Sets/src/mage/cards/b/BlindWorship.java +++ b/Mage.Sets/src/mage/cards/b/BlindWorship.java @@ -1,83 +1,83 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.cards.b; - -import mage.abilities.Ability; -import mage.abilities.common.AttacksTriggeredAbility; -import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.dynamicvalue.DynamicValue; -import mage.abilities.dynamicvalue.common.SourcePermanentPowerCount; -import mage.abilities.effects.Effect; -import mage.abilities.effects.common.AttachEffect; -import mage.abilities.effects.common.continuous.BoostControlledEffect; -import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; -import mage.abilities.keyword.EnchantAbility; -import mage.cards.CardImpl; -import mage.cards.CardSetInfo; -import mage.constants.*; -import mage.filter.common.FilterCreaturePermanent; -import mage.target.TargetPermanent; -import mage.target.common.TargetCreaturePermanent; - -import java.util.UUID; - -/** - * - * @author Styxo - */ -public class BlindWorship extends CardImpl { - - public BlindWorship(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{R}{G}{W}"); - this.subtype.add(SubType.AURA); - - // Enchant creature - TargetPermanent auraTarget = new TargetCreaturePermanent(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); - - // Enchanted creature has "Whenever this creature attacks, each other creature you control gets +X/+X until end of turn, where X is this creature's power." - DynamicValue xValue = new SourcePermanentPowerCount(); - Ability attachedAbility = new AttacksTriggeredAbility(new BoostControlledEffect(xValue, xValue, Duration.EndOfTurn, new FilterCreaturePermanent(), true), false); - Effect gainAbilityEffect = new GainAbilityAttachedEffect(attachedAbility, AttachmentType.AURA); - gainAbilityEffect.setText("Enchanted creature has \"Whenever this creature attacks, each other creature you control gets +X/+X until end of turn, where X is this creature's power\""); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, gainAbilityEffect)); - - } - - public BlindWorship(final BlindWorship card) { - super(card); - } - - @Override - public BlindWorship copy() { - return new BlindWorship(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.b; + +import mage.abilities.Ability; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.dynamicvalue.common.SourcePermanentPowerCount; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.filter.common.FilterCreaturePermanent; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +import java.util.UUID; + +/** + * + * @author Styxo + */ +public class BlindWorship extends CardImpl { + + public BlindWorship(UUID ownerId, CardSetInfo setInfo) { + super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{R}{G}{W}"); + this.subtype.add(SubType.AURA); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // Enchanted creature has "Whenever this creature attacks, each other creature you control gets +X/+X until end of turn, where X is this creature's power." + DynamicValue xValue = new SourcePermanentPowerCount(); + Ability attachedAbility = new AttacksTriggeredAbility(new BoostControlledEffect(xValue, xValue, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, true), false); + Effect gainAbilityEffect = new GainAbilityAttachedEffect(attachedAbility, AttachmentType.AURA); + gainAbilityEffect.setText("Enchanted creature has \"Whenever this creature attacks, each other creature you control gets +X/+X until end of turn, where X is this creature's power\""); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, gainAbilityEffect)); + + } + + public BlindWorship(final BlindWorship card) { + super(card); + } + + @Override + public BlindWorship copy() { + return new BlindWorship(this); + } +} diff --git a/Mage.Sets/src/mage/cards/b/BloodReckoning.java b/Mage.Sets/src/mage/cards/b/BloodReckoning.java index 3a81e67bf2..e95c5ee1ed 100644 --- a/Mage.Sets/src/mage/cards/b/BloodReckoning.java +++ b/Mage.Sets/src/mage/cards/b/BloodReckoning.java @@ -50,7 +50,7 @@ public class BloodReckoning extends CardImpl { // Whenever a creature attacks you or a planeswalker you control, that creature's controller loses 1 life. Effect effect = new LoseLifeTargetEffect(1); effect.setText("that creature's controller loses 1 life"); - this.addAbility(new AttacksAllTriggeredAbility(effect, false, new FilterCreaturePermanent(), SetTargetPointer.PLAYER, true, true)); + this.addAbility(new AttacksAllTriggeredAbility(effect, false, StaticFilters.FILTER_PERMANENT_CREATURE, SetTargetPointer.PLAYER, true, true)); } public BloodReckoning(final BloodReckoning card) { diff --git a/Mage.Sets/src/mage/cards/b/BoldDefense.java b/Mage.Sets/src/mage/cards/b/BoldDefense.java index 32be186a43..2ae2d5b558 100644 --- a/Mage.Sets/src/mage/cards/b/BoldDefense.java +++ b/Mage.Sets/src/mage/cards/b/BoldDefense.java @@ -58,7 +58,7 @@ public class BoldDefense extends CardImpl { this.getSpellAbility().addEffect(new ConditionalContinuousEffect(new BoostControlledEffect(2, 2, Duration.EndOfTurn), new BoostTargetEffect(1, 1, Duration.EndOfTurn), new LockedInCondition(KickedCondition.instance), "Creatures you control get +1/+1 until end of turn. If {this} was kicked, instead creatures you control get +2/+2")); - this.getSpellAbility().addEffect(new ConditionalContinuousEffect(new GainAbilityControlledEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent(), false), + this.getSpellAbility().addEffect(new ConditionalContinuousEffect(new GainAbilityControlledEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, false), null, new LockedInCondition(KickedCondition.instance), "and gain first strike until end of turn")); } diff --git a/Mage.Sets/src/mage/cards/b/BreakingWave.java b/Mage.Sets/src/mage/cards/b/BreakingWave.java index bcc9a861d6..1e6c9656c9 100644 --- a/Mage.Sets/src/mage/cards/b/BreakingWave.java +++ b/Mage.Sets/src/mage/cards/b/BreakingWave.java @@ -90,7 +90,7 @@ class BreakingWaveEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - List creatures = game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), + List creatures = game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), source.getSourceId(), game); for(Permanent creature: creatures) { if(creature.isTapped()) { diff --git a/Mage.Sets/src/mage/cards/b/BurstOfSpeed.java b/Mage.Sets/src/mage/cards/b/BurstOfSpeed.java index 0015005670..f8ff00c88c 100644 --- a/Mage.Sets/src/mage/cards/b/BurstOfSpeed.java +++ b/Mage.Sets/src/mage/cards/b/BurstOfSpeed.java @@ -46,7 +46,7 @@ public class BurstOfSpeed extends CardImpl { public BurstOfSpeed(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{R}"); - this.getSpellAbility().addEffect(new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent(), false)); + this.getSpellAbility().addEffect(new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, false)); } public BurstOfSpeed(final BurstOfSpeed card) { diff --git a/Mage.Sets/src/mage/cards/c/CabalExecutioner.java b/Mage.Sets/src/mage/cards/c/CabalExecutioner.java index 8973e7806d..f5b195c5b9 100644 --- a/Mage.Sets/src/mage/cards/c/CabalExecutioner.java +++ b/Mage.Sets/src/mage/cards/c/CabalExecutioner.java @@ -79,7 +79,7 @@ public class CabalExecutioner extends CardImpl { class CabalExecutionerAbility extends TriggeredAbilityImpl { public CabalExecutionerAbility() { - super(Zone.BATTLEFIELD, new SacrificeEffect(new FilterCreaturePermanent(), 1, "")); + super(Zone.BATTLEFIELD, new SacrificeEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 1, "")); } public CabalExecutionerAbility(final CabalExecutionerAbility ability) { diff --git a/Mage.Sets/src/mage/cards/c/CallForUnity.java b/Mage.Sets/src/mage/cards/c/CallForUnity.java index 87a58e0b23..0403efed60 100644 --- a/Mage.Sets/src/mage/cards/c/CallForUnity.java +++ b/Mage.Sets/src/mage/cards/c/CallForUnity.java @@ -65,7 +65,7 @@ public class CallForUnity extends CardImpl { // Creatures you control get +1/+1 for each unity counter on Call for Unity. Effect effect = new BoostControlledEffect(new CountersSourceCount(CounterType.UNITY), new CountersSourceCount(CounterType.UNITY), Duration.WhileOnBattlefield, - new FilterCreaturePermanent(), false); + StaticFilters.FILTER_PERMANENT_CREATURE, false); effect.setText("Creatures you control get +1/+1 for each unity counter on {this}"); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); } diff --git a/Mage.Sets/src/mage/cards/c/CallToGlory.java b/Mage.Sets/src/mage/cards/c/CallToGlory.java index 670e7d108c..0389560a27 100644 --- a/Mage.Sets/src/mage/cards/c/CallToGlory.java +++ b/Mage.Sets/src/mage/cards/c/CallToGlory.java @@ -91,7 +91,7 @@ class CalltoGloryFirstEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { - for (Permanent creature : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), player.getId(), game)) { + for (Permanent creature : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, player.getId(), game)) { creature.untap(game); } return true; diff --git a/Mage.Sets/src/mage/cards/c/Caltrops.java b/Mage.Sets/src/mage/cards/c/Caltrops.java index d3f60b1538..5c5365f7f0 100644 --- a/Mage.Sets/src/mage/cards/c/Caltrops.java +++ b/Mage.Sets/src/mage/cards/c/Caltrops.java @@ -51,7 +51,7 @@ public class Caltrops extends CardImpl { // Whenever a creature attacks, Caltrops deals 1 damage to it. Effect effect = new DamageTargetEffect(1); effect.setText("{this} deals 1 damage to it"); - this.addAbility(new AttacksAllTriggeredAbility(effect, false, new FilterCreaturePermanent(), + this.addAbility(new AttacksAllTriggeredAbility(effect, false, StaticFilters.FILTER_PERMANENT_CREATURE, SetTargetPointer.PERMANENT, false)); } diff --git a/Mage.Sets/src/mage/cards/c/CankerAbomination.java b/Mage.Sets/src/mage/cards/c/CankerAbomination.java index d837962f57..e08e72743f 100644 --- a/Mage.Sets/src/mage/cards/c/CankerAbomination.java +++ b/Mage.Sets/src/mage/cards/c/CankerAbomination.java @@ -102,7 +102,7 @@ class CankerAbominationEffect extends OneShotEffect { Player opponent = game.getPlayer(target.getFirstTarget()); if (opponent != null) { game.informPlayers(cankerAbomination.getName() + ": " + controller.getLogName() + " has chosen " + opponent.getLogName()); - int amount = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), opponent.getId(), game).size(); + int amount = game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, opponent.getId(), game).size(); if (amount > 0) { cankerAbomination.addCounters(CounterType.M1M1.createInstance(amount), source, game); } diff --git a/Mage.Sets/src/mage/cards/c/Cannibalize.java b/Mage.Sets/src/mage/cards/c/Cannibalize.java index 8b6988a3b2..f02b1b1b73 100644 --- a/Mage.Sets/src/mage/cards/c/Cannibalize.java +++ b/Mage.Sets/src/mage/cards/c/Cannibalize.java @@ -55,7 +55,7 @@ public class Cannibalize extends CardImpl { // Choose two target creatures controlled by the same player. Exile one of the creatures and put two +1/+1 counters on the other. this.getSpellAbility().addEffect(new CannibalizeEffect()); - this.getSpellAbility().addTarget(new TargetCreaturePermanentSameController(2,2,new FilterCreaturePermanent(),false)); + this.getSpellAbility().addTarget(new TargetCreaturePermanentSameController(2,2,StaticFilters.FILTER_PERMANENT_CREATURE,false)); } public Cannibalize(final Cannibalize card) { diff --git a/Mage.Sets/src/mage/cards/c/Catastrophe.java b/Mage.Sets/src/mage/cards/c/Catastrophe.java index ecd1ba65fd..204e0315c1 100644 --- a/Mage.Sets/src/mage/cards/c/Catastrophe.java +++ b/Mage.Sets/src/mage/cards/c/Catastrophe.java @@ -90,7 +90,7 @@ class CatastropheEffect extends OneShotEffect { permanent.destroy(source.getSourceId(), game, permanent.isCreature()); } } else { - for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), controller.getId(), source.getSourceId(), game)) { + for (Permanent permanent: game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, controller.getId(), source.getSourceId(), game)) { permanent.destroy(source.getSourceId(), game, true); } } diff --git a/Mage.Sets/src/mage/cards/c/CauldronOfSouls.java b/Mage.Sets/src/mage/cards/c/CauldronOfSouls.java index 2564a92f82..1dd58a7dc6 100644 --- a/Mage.Sets/src/mage/cards/c/CauldronOfSouls.java +++ b/Mage.Sets/src/mage/cards/c/CauldronOfSouls.java @@ -56,7 +56,7 @@ public class CauldronOfSouls extends CardImpl { Effect effect = new GainAbilityTargetEffect(new PersistAbility(), Duration.EndOfTurn); effect.setText("choose any number of target creatures. Each of those creatures gains persist until end of turn"); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost()); - ability.addTarget(new TargetCreaturePermanent(0, Integer.MAX_VALUE, new FilterCreaturePermanent(), false)); + ability.addTarget(new TargetCreaturePermanent(0, Integer.MAX_VALUE, StaticFilters.FILTER_PERMANENT_CREATURE, false)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/c/ChainersEdict.java b/Mage.Sets/src/mage/cards/c/ChainersEdict.java index 50b25fcd3f..730a9ab99b 100644 --- a/Mage.Sets/src/mage/cards/c/ChainersEdict.java +++ b/Mage.Sets/src/mage/cards/c/ChainersEdict.java @@ -50,7 +50,7 @@ public class ChainersEdict extends CardImpl { // Target player sacrifices a creature. - this.getSpellAbility().addEffect(new SacrificeEffect(new FilterCreaturePermanent(), 1, "Target player")); + this.getSpellAbility().addEffect(new SacrificeEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 1, "Target player")); this.getSpellAbility().addTarget(new TargetPlayer()); // Flashback {5}{B}{B} diff --git a/Mage.Sets/src/mage/cards/c/ChandrasIgnition.java b/Mage.Sets/src/mage/cards/c/ChandrasIgnition.java index 66a70d7c85..88321f9536 100644 --- a/Mage.Sets/src/mage/cards/c/ChandrasIgnition.java +++ b/Mage.Sets/src/mage/cards/c/ChandrasIgnition.java @@ -85,7 +85,7 @@ class ChandrasIgnitionEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Permanent targetCreature = game.getPermanent(getTargetPointer().getFirst(game, source)); if (targetCreature != null && targetCreature.getPower().getValue() > 0) { - for (Permanent creature : game.getState().getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), source.getSourceId(), game)) { + for (Permanent creature : game.getState().getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), source.getSourceId(), game)) { if (!creature.getId().equals(targetCreature.getId())) { creature.damage(targetCreature.getPower().getValue(), targetCreature.getId(), game, false, true); } diff --git a/Mage.Sets/src/mage/cards/c/CleaverRiot.java b/Mage.Sets/src/mage/cards/c/CleaverRiot.java index 549d3db046..4d38122f5c 100644 --- a/Mage.Sets/src/mage/cards/c/CleaverRiot.java +++ b/Mage.Sets/src/mage/cards/c/CleaverRiot.java @@ -48,7 +48,7 @@ public class CleaverRiot extends CardImpl { // Creatures you control gain double strike until end of turn. - this.getSpellAbility().addEffect(new GainAbilityControlledEffect(DoubleStrikeAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent(), false)); + this.getSpellAbility().addEffect(new GainAbilityControlledEffect(DoubleStrikeAbility.getInstance(), Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, false)); } public CleaverRiot(final CleaverRiot card) { diff --git a/Mage.Sets/src/mage/cards/c/CloneLegion.java b/Mage.Sets/src/mage/cards/c/CloneLegion.java index 7a88b5adc1..1cc33207d8 100644 --- a/Mage.Sets/src/mage/cards/c/CloneLegion.java +++ b/Mage.Sets/src/mage/cards/c/CloneLegion.java @@ -89,7 +89,7 @@ class CloneLegionEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source)); if (controller != null && targetPlayer != null) { - for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), targetPlayer.getId(), game)) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, targetPlayer.getId(), game)) { if (permanent != null) { PutTokenOntoBattlefieldCopyTargetEffect effect = new PutTokenOntoBattlefieldCopyTargetEffect(); effect.setTargetPointer(new FixedTarget(permanent, game)); diff --git a/Mage.Sets/src/mage/cards/c/CollectiveEffort.java b/Mage.Sets/src/mage/cards/c/CollectiveEffort.java index 38efbd27fa..5634ad9cd3 100644 --- a/Mage.Sets/src/mage/cards/c/CollectiveEffort.java +++ b/Mage.Sets/src/mage/cards/c/CollectiveEffort.java @@ -131,7 +131,7 @@ class CollectiveEffortEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player target = game.getPlayer(source.getFirstTarget()); if (target != null) { - for (Permanent p : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), target.getId(), game)) { + for (Permanent p : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, target.getId(), game)) { p.addCounters(CounterType.P1P1.createInstance(), source, game); } return true; diff --git a/Mage.Sets/src/mage/cards/c/CommanderGrevenIlVec.java b/Mage.Sets/src/mage/cards/c/CommanderGrevenIlVec.java index 17de7ace53..ef18c4cd8a 100644 --- a/Mage.Sets/src/mage/cards/c/CommanderGrevenIlVec.java +++ b/Mage.Sets/src/mage/cards/c/CommanderGrevenIlVec.java @@ -58,7 +58,7 @@ public class CommanderGrevenIlVec extends CardImpl { this.addAbility(FearAbility.getInstance()); // When Commander Greven il-Vec enters the battlefield, sacrifice a creature. - this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeControllerEffect(new FilterCreaturePermanent(), 1, ""), false)); + this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeControllerEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 1, ""), false)); } public CommanderGrevenIlVec(final CommanderGrevenIlVec card) { diff --git a/Mage.Sets/src/mage/cards/c/ContagionEngine.java b/Mage.Sets/src/mage/cards/c/ContagionEngine.java index e7fe2e0cc3..c91bbcb56c 100644 --- a/Mage.Sets/src/mage/cards/c/ContagionEngine.java +++ b/Mage.Sets/src/mage/cards/c/ContagionEngine.java @@ -95,7 +95,7 @@ class ContagionEngineEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source)); if (targetPlayer != null) { - for (Permanent creature : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), targetPlayer.getId(), game)) { + for (Permanent creature : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, targetPlayer.getId(), game)) { creature.addCounters(CounterType.M1M1.createInstance(), source, game); } return true; diff --git a/Mage.Sets/src/mage/cards/c/CracklingDoom.java b/Mage.Sets/src/mage/cards/c/CracklingDoom.java index a00a12f6dc..501f1d448e 100644 --- a/Mage.Sets/src/mage/cards/c/CracklingDoom.java +++ b/Mage.Sets/src/mage/cards/c/CracklingDoom.java @@ -102,7 +102,7 @@ class CracklingDoomEffect extends OneShotEffect { int greatestPower = Integer.MIN_VALUE; int numberOfCreatures = 0; Permanent permanentToSacrifice = null; - for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), playerId, game)) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, playerId, game)) { if (permanent.getPower().getValue() > greatestPower) { greatestPower = permanent.getPower().getValue(); numberOfCreatures = 1; diff --git a/Mage.Sets/src/mage/cards/c/CraterHellion.java b/Mage.Sets/src/mage/cards/c/CraterHellion.java index d9dd125e1e..09b40af988 100644 --- a/Mage.Sets/src/mage/cards/c/CraterHellion.java +++ b/Mage.Sets/src/mage/cards/c/CraterHellion.java @@ -93,7 +93,7 @@ class CraterHellionEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - List permanents = game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game); + List permanents = game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game); for (Permanent permanent : permanents) { if (!permanent.getId().equals(source.getSourceId())) { permanent.damage(4, source.getSourceId(), game, false, true); diff --git a/Mage.Sets/src/mage/cards/c/CreamOfTheCrop.java b/Mage.Sets/src/mage/cards/c/CreamOfTheCrop.java index f49cd902aa..fc71d4c3ad 100644 --- a/Mage.Sets/src/mage/cards/c/CreamOfTheCrop.java +++ b/Mage.Sets/src/mage/cards/c/CreamOfTheCrop.java @@ -58,7 +58,7 @@ public class CreamOfTheCrop extends CardImpl { // Whenever a creature enters the battlefield under your control, you may look at the top X cards of your library, where X is that creature's power. If you do, put one of those cards on top of your library and the rest on the bottom of your library in any order. this.addAbility(new EntersBattlefieldControlledTriggeredAbility( Zone.BATTLEFIELD, new CreamOfTheCropEffect(), - new FilterCreaturePermanent(), true, SetTargetPointer.PERMANENT, + StaticFilters.FILTER_PERMANENT_CREATURE, true, SetTargetPointer.PERMANENT, "Whenever a creature enters the battlefield under your control, you may look at the top X cards of your library, where X is that creature's power. If you do, put one of those cards on top of your library and the rest on the bottom of your library in any order")); } diff --git a/Mage.Sets/src/mage/cards/c/CrownOfConvergence.java b/Mage.Sets/src/mage/cards/c/CrownOfConvergence.java index 745f4d4b78..b653ddc9f2 100644 --- a/Mage.Sets/src/mage/cards/c/CrownOfConvergence.java +++ b/Mage.Sets/src/mage/cards/c/CrownOfConvergence.java @@ -89,7 +89,7 @@ class CrownOfConvergenceColorBoostEffect extends BoostAllEffect { private static final String effectText = "creatures you control that share a color with that card get +1/+1"; CrownOfConvergenceColorBoostEffect() { - super(1, 1, Duration.WhileOnBattlefield, new FilterCreaturePermanent(), false); + super(1, 1, Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE, false); staticText = effectText; } diff --git a/Mage.Sets/src/mage/cards/c/CrownOfDoom.java b/Mage.Sets/src/mage/cards/c/CrownOfDoom.java index 3463b77b85..d3b2ecb5b9 100644 --- a/Mage.Sets/src/mage/cards/c/CrownOfDoom.java +++ b/Mage.Sets/src/mage/cards/c/CrownOfDoom.java @@ -67,7 +67,7 @@ public class CrownOfDoom extends CardImpl { // Whenever a creature attacks you or a planeswalker you control, it gets +2/+0 until end of turn. Effect effect = new BoostTargetEffect(2, 0, Duration.EndOfTurn); effect.setText("it gets +2/+0 until end of turn"); - this.addAbility(new AttacksAllTriggeredAbility(effect, false, new FilterCreaturePermanent(), SetTargetPointer.PERMANENT, true)); + this.addAbility(new AttacksAllTriggeredAbility(effect, false, StaticFilters.FILTER_PERMANENT_CREATURE, SetTargetPointer.PERMANENT, true)); // {2}: Target player other than Crown of Doom's owner gains control of it. Activate this ability only during your turn. Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new CrownOfDoomEffect(), new ManaCostsImpl("{2}"), MyTurnCondition.instance); diff --git a/Mage.Sets/src/mage/cards/c/CruelEdict.java b/Mage.Sets/src/mage/cards/c/CruelEdict.java index 928e7ca009..0ffb1f82b1 100644 --- a/Mage.Sets/src/mage/cards/c/CruelEdict.java +++ b/Mage.Sets/src/mage/cards/c/CruelEdict.java @@ -45,7 +45,7 @@ public class CruelEdict extends CardImpl { public CruelEdict(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{B}"); - this.getSpellAbility().addEffect(new SacrificeEffect(new FilterCreaturePermanent(), 1, "Target opponent sacrifices a creature")); + this.getSpellAbility().addEffect(new SacrificeEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 1, "Target opponent sacrifices a creature")); this.getSpellAbility().addTarget(new TargetOpponent()); // Target opponent sacrifices a creature. } diff --git a/Mage.Sets/src/mage/cards/c/CruelUltimatum.java b/Mage.Sets/src/mage/cards/c/CruelUltimatum.java index 411a9b7d3d..bf14b072b8 100644 --- a/Mage.Sets/src/mage/cards/c/CruelUltimatum.java +++ b/Mage.Sets/src/mage/cards/c/CruelUltimatum.java @@ -61,7 +61,7 @@ public class CruelUltimatum extends CardImpl { // Target opponent sacrifices a creature, discards three cards, then loses 5 life. // You return a creature card from your graveyard to your hand, draw three cards, then gain 5 life. this.getSpellAbility().addTarget(new TargetOpponent()); - this.getSpellAbility().addEffect(new SacrificeEffect(new FilterCreaturePermanent(), 1, "Target opponent")); + this.getSpellAbility().addEffect(new SacrificeEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 1, "Target opponent")); this.getSpellAbility().addEffect(new DiscardTargetEffect(3)); this.getSpellAbility().addEffect(new LoseLifeTargetEffect(5)); diff --git a/Mage.Sets/src/mage/cards/c/CrueltyOfTheSith.java b/Mage.Sets/src/mage/cards/c/CrueltyOfTheSith.java index 07f692dbac..3f47a74fd2 100644 --- a/Mage.Sets/src/mage/cards/c/CrueltyOfTheSith.java +++ b/Mage.Sets/src/mage/cards/c/CrueltyOfTheSith.java @@ -1,89 +1,89 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.cards.c; - -import mage.abilities.Mode; -import mage.abilities.effects.common.CounterTargetEffect; -import mage.abilities.effects.common.DamageTargetEffect; -import mage.abilities.effects.common.SacrificeEffect; -import mage.abilities.effects.common.discard.DiscardTargetEffect; -import mage.cards.CardImpl; -import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.filter.FilterSpell; -import mage.filter.common.FilterCreaturePermanent; -import mage.filter.predicate.Predicates; -import mage.filter.predicate.mageobject.CardTypePredicate; -import mage.target.TargetPlayer; -import mage.target.TargetSpell; - -import java.util.UUID; - -/** - * - * @author Styxo - */ -public class CrueltyOfTheSith extends CardImpl { - - private static final FilterSpell filterNoncreature = new FilterSpell("noncreature spell"); - - static { - filterNoncreature.add(Predicates.not(new CardTypePredicate(CardType.CREATURE))); - } - - public CrueltyOfTheSith(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{U}{B}{R}"); - - // Choose one - Counter target noncreature spell. - this.getSpellAbility().addEffect(new CounterTargetEffect()); - this.getSpellAbility().addTarget(new TargetSpell(filterNoncreature)); - - // Target player sacrifices a creture. - Mode mode = new Mode(); - mode.getEffects().add(new SacrificeEffect(new FilterCreaturePermanent(), 1, "Target player")); - mode.getTargets().add(new TargetPlayer()); - this.getSpellAbility().addMode(mode); - - // Cruelty of the Sith deals 3 damage to target player. That player discards a card. - mode = new Mode(); - mode.getEffects().add(new DamageTargetEffect(3)); - mode.getEffects().add(new DiscardTargetEffect(1)); - mode.getTargets().add(new TargetPlayer()); - this.getSpellAbility().addMode(mode); - - } - - public CrueltyOfTheSith(final CrueltyOfTheSith card) { - super(card); - } - - @Override - public CrueltyOfTheSith copy() { - return new CrueltyOfTheSith(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.c; + +import mage.abilities.Mode; +import mage.abilities.effects.common.CounterTargetEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.SacrificeEffect; +import mage.abilities.effects.common.discard.DiscardTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.filter.FilterSpell; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.TargetPlayer; +import mage.target.TargetSpell; + +import java.util.UUID; + +/** + * + * @author Styxo + */ +public class CrueltyOfTheSith extends CardImpl { + + private static final FilterSpell filterNoncreature = new FilterSpell("noncreature spell"); + + static { + filterNoncreature.add(Predicates.not(new CardTypePredicate(CardType.CREATURE))); + } + + public CrueltyOfTheSith(UUID ownerId, CardSetInfo setInfo) { + super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{U}{B}{R}"); + + // Choose one - Counter target noncreature spell. + this.getSpellAbility().addEffect(new CounterTargetEffect()); + this.getSpellAbility().addTarget(new TargetSpell(filterNoncreature)); + + // Target player sacrifices a creture. + Mode mode = new Mode(); + mode.getEffects().add(new SacrificeEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 1, "Target player")); + mode.getTargets().add(new TargetPlayer()); + this.getSpellAbility().addMode(mode); + + // Cruelty of the Sith deals 3 damage to target player. That player discards a card. + mode = new Mode(); + mode.getEffects().add(new DamageTargetEffect(3)); + mode.getEffects().add(new DiscardTargetEffect(1)); + mode.getTargets().add(new TargetPlayer()); + this.getSpellAbility().addMode(mode); + + } + + public CrueltyOfTheSith(final CrueltyOfTheSith card) { + super(card); + } + + @Override + public CrueltyOfTheSith copy() { + return new CrueltyOfTheSith(this); + } +} diff --git a/Mage.Sets/src/mage/cards/c/CurseOfDeathsHold.java b/Mage.Sets/src/mage/cards/c/CurseOfDeathsHold.java index ae997c515a..de7568d363 100644 --- a/Mage.Sets/src/mage/cards/c/CurseOfDeathsHold.java +++ b/Mage.Sets/src/mage/cards/c/CurseOfDeathsHold.java @@ -91,7 +91,7 @@ class CurseOfDeathsHoldEffect extends ContinuousEffectImpl { if (enchantment != null && enchantment.getAttachedTo() != null) { Player player = game.getPlayer(enchantment.getAttachedTo()); if (player != null) { - for (Permanent perm: game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), player.getId(), game)) { + for (Permanent perm: game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, player.getId(), game)) { perm.addPower(-1); perm.addToughness(-1); } diff --git a/Mage.Sets/src/mage/cards/d/DarkDabbling.java b/Mage.Sets/src/mage/cards/d/DarkDabbling.java index 2694bfa3aa..545556bd16 100644 --- a/Mage.Sets/src/mage/cards/d/DarkDabbling.java +++ b/Mage.Sets/src/mage/cards/d/DarkDabbling.java @@ -90,7 +90,7 @@ class DarkDabblingEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { if (SpellMasteryCondition.instance.apply(game, source)) { - for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game)) { if (!permanent.getId().equals(getTargetPointer().getFirst(game, source))) { RegenerateTargetEffect regenEffect = new RegenerateTargetEffect(); regenEffect.setTargetPointer(new FixedTarget(permanent.getId())); diff --git a/Mage.Sets/src/mage/cards/d/DarkSalvation.java b/Mage.Sets/src/mage/cards/d/DarkSalvation.java index fe69c6dd58..88116875d6 100644 --- a/Mage.Sets/src/mage/cards/d/DarkSalvation.java +++ b/Mage.Sets/src/mage/cards/d/DarkSalvation.java @@ -65,7 +65,7 @@ public class DarkSalvation extends CardImpl { this.getSpellAbility().addEffect(effect); DynamicValue value = new ZombiesControlledByTargetPlayerCount(); - this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 1, new FilterCreaturePermanent(), false)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 1, StaticFilters.FILTER_PERMANENT_CREATURE, false)); effect = new BoostTargetEffect(value, value, Duration.EndOfTurn, true); effect.setTargetPointer(new SecondTargetPointer()); effect.setText(", then up to one target creature gets -1/-1 until end of turn for each Zombie that player controls"); diff --git a/Mage.Sets/src/mage/cards/d/DarkestHour.java b/Mage.Sets/src/mage/cards/d/DarkestHour.java index e14c48fa18..9d7a03a7d8 100644 --- a/Mage.Sets/src/mage/cards/d/DarkestHour.java +++ b/Mage.Sets/src/mage/cards/d/DarkestHour.java @@ -77,7 +77,7 @@ class DarkestHourEffect extends ContinuousEffectImpl { @Override public boolean apply(Game game, Ability source) { - for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), source.getSourceId(), game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), source.getSourceId(), game)) { permanent.getColor(game).setColor(ObjectColor.BLACK); } return true; diff --git a/Mage.Sets/src/mage/cards/d/DarthVader.java b/Mage.Sets/src/mage/cards/d/DarthVader.java index 7d34ee8d02..e9e9572da3 100644 --- a/Mage.Sets/src/mage/cards/d/DarthVader.java +++ b/Mage.Sets/src/mage/cards/d/DarthVader.java @@ -1,126 +1,126 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.cards.d; - -import mage.MageInt; -import mage.MageObjectReference; -import mage.abilities.Ability; -import mage.abilities.common.AttacksTriggeredAbility; -import mage.abilities.dynamicvalue.common.CountersSourceCount; -import mage.abilities.effects.ContinuousEffectImpl; -import mage.abilities.keyword.LifelinkAbility; -import mage.abilities.keyword.MenaceAbility; -import mage.cards.CardImpl; -import mage.cards.CardSetInfo; -import mage.constants.*; -import mage.counters.CounterType; -import mage.filter.common.FilterCreaturePermanent; -import mage.game.Game; -import mage.game.permanent.Permanent; - -import java.util.Iterator; -import java.util.UUID; - -/** - * - * @author Styxo - */ -public class DarthVader extends CardImpl { - - public DarthVader(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},""); - addSuperType(SuperType.LEGENDARY); - this.subtype.add("Human"); - this.subtype.add("Sith"); - this.power = new MageInt(4); - this.toughness = new MageInt(4); - this.color.setBlack(true); - - this.nightCard = true; - - // Menace - this.addAbility(new MenaceAbility()); - - // Lifelink - this.addAbility(LifelinkAbility.getInstance()); - - // Whenever Darth Vader attacks, creatures defending player controls get -1/-1 until end of turn for each +1/+1 counter on Darth Vader. - this.addAbility(new AttacksTriggeredAbility(new UnboostCreaturesDefendingPlayerEffect(), false, null, SetTargetPointer.PLAYER)); - } - - public DarthVader(final DarthVader card) { - super(card); - } - - @Override - public DarthVader copy() { - return new DarthVader(this); - } -} - -class UnboostCreaturesDefendingPlayerEffect extends ContinuousEffectImpl { - - public UnboostCreaturesDefendingPlayerEffect() { - super(Duration.EndOfTurn, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.UnboostCreature); - staticText = "creatures defending player controls get -1/-1 until end of turn for each +1/+1 counter on Darth Vader"; - } - - public UnboostCreaturesDefendingPlayerEffect(final UnboostCreaturesDefendingPlayerEffect effect) { - super(effect); - } - - @Override - public UnboostCreaturesDefendingPlayerEffect copy() { - return new UnboostCreaturesDefendingPlayerEffect(this); - } - - @Override - public void init(Ability source, Game game) { - super.init(source, game); - if (this.affectedObjectsSet) { - for (Permanent creature : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), getTargetPointer().getFirst(game, source), game)) { - affectedObjectList.add(new MageObjectReference(creature, game)); - } - } - } - - @Override - public boolean apply(Game game, Ability source) { - for (Iterator it = affectedObjectList.iterator(); it.hasNext();) { - Permanent permanent = it.next().getPermanent(game); - if (permanent != null) { - int unboostCount = -1 * new CountersSourceCount(CounterType.P1P1).calculate(game, source, this); - permanent.addPower(unboostCount); - permanent.addToughness(unboostCount); - } else { - it.remove(); - } - } - return true; - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.d; + +import mage.MageInt; +import mage.MageObjectReference; +import mage.abilities.Ability; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.dynamicvalue.common.CountersSourceCount; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.keyword.LifelinkAbility; +import mage.abilities.keyword.MenaceAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.counters.CounterType; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; + +import java.util.Iterator; +import java.util.UUID; + +/** + * + * @author Styxo + */ +public class DarthVader extends CardImpl { + + public DarthVader(UUID ownerId, CardSetInfo setInfo) { + super(ownerId,setInfo,new CardType[]{CardType.CREATURE},""); + addSuperType(SuperType.LEGENDARY); + this.subtype.add("Human"); + this.subtype.add("Sith"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + this.color.setBlack(true); + + this.nightCard = true; + + // Menace + this.addAbility(new MenaceAbility()); + + // Lifelink + this.addAbility(LifelinkAbility.getInstance()); + + // Whenever Darth Vader attacks, creatures defending player controls get -1/-1 until end of turn for each +1/+1 counter on Darth Vader. + this.addAbility(new AttacksTriggeredAbility(new UnboostCreaturesDefendingPlayerEffect(), false, null, SetTargetPointer.PLAYER)); + } + + public DarthVader(final DarthVader card) { + super(card); + } + + @Override + public DarthVader copy() { + return new DarthVader(this); + } +} + +class UnboostCreaturesDefendingPlayerEffect extends ContinuousEffectImpl { + + public UnboostCreaturesDefendingPlayerEffect() { + super(Duration.EndOfTurn, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.UnboostCreature); + staticText = "creatures defending player controls get -1/-1 until end of turn for each +1/+1 counter on Darth Vader"; + } + + public UnboostCreaturesDefendingPlayerEffect(final UnboostCreaturesDefendingPlayerEffect effect) { + super(effect); + } + + @Override + public UnboostCreaturesDefendingPlayerEffect copy() { + return new UnboostCreaturesDefendingPlayerEffect(this); + } + + @Override + public void init(Ability source, Game game) { + super.init(source, game); + if (this.affectedObjectsSet) { + for (Permanent creature : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, getTargetPointer().getFirst(game, source), game)) { + affectedObjectList.add(new MageObjectReference(creature, game)); + } + } + } + + @Override + public boolean apply(Game game, Ability source) { + for (Iterator it = affectedObjectList.iterator(); it.hasNext();) { + Permanent permanent = it.next().getPermanent(game); + if (permanent != null) { + int unboostCount = -1 * new CountersSourceCount(CounterType.P1P1).calculate(game, source, this); + permanent.addPower(unboostCount); + permanent.addToughness(unboostCount); + } else { + it.remove(); + } + } + return true; + } +} diff --git a/Mage.Sets/src/mage/cards/d/DeadDrop.java b/Mage.Sets/src/mage/cards/d/DeadDrop.java index 2d1576fd0e..4d49c55aa0 100644 --- a/Mage.Sets/src/mage/cards/d/DeadDrop.java +++ b/Mage.Sets/src/mage/cards/d/DeadDrop.java @@ -50,7 +50,7 @@ public class DeadDrop extends CardImpl { // Delve this.addAbility(new DelveAbility()); // Target player sacrifices two creatures - this.getSpellAbility().addEffect(new SacrificeEffect(new FilterCreaturePermanent(), 2, "Target player")); + this.getSpellAbility().addEffect(new SacrificeEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 2, "Target player")); this.getSpellAbility().addTarget(new TargetPlayer()); } diff --git a/Mage.Sets/src/mage/cards/d/DeadlyTempest.java b/Mage.Sets/src/mage/cards/d/DeadlyTempest.java index 036e525d05..ae197488ba 100644 --- a/Mage.Sets/src/mage/cards/d/DeadlyTempest.java +++ b/Mage.Sets/src/mage/cards/d/DeadlyTempest.java @@ -85,7 +85,7 @@ class DeadlyTempestEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { HashMap destroyedCreatures = new HashMap<>(); - for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), source.getSourceId(), game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), source.getSourceId(), game)) { if (permanent.destroy(source.getSourceId(), game, false)) { int count = destroyedCreatures.containsKey(permanent.getControllerId()) ? destroyedCreatures.get(permanent.getControllerId()) : 0; destroyedCreatures.put(permanent.getControllerId(), count + 1); diff --git a/Mage.Sets/src/mage/cards/d/DeathMatch.java b/Mage.Sets/src/mage/cards/d/DeathMatch.java index be74126730..7dea014eba 100644 --- a/Mage.Sets/src/mage/cards/d/DeathMatch.java +++ b/Mage.Sets/src/mage/cards/d/DeathMatch.java @@ -57,7 +57,7 @@ public class DeathMatch extends CardImpl { // Whenever a creature enters the battlefield, that creature's controller may have target creature of his or her choice get -3/-3 until end of turn. // NOTE: The ability being optional is implemented in the subclass to give the choice to correct player. Ability ability = new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new DeathMatchEffect(), - new FilterCreaturePermanent(), false, SetTargetPointer.PLAYER, ""); + StaticFilters.FILTER_PERMANENT_CREATURE, false, SetTargetPointer.PLAYER, ""); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); originalId = ability.getOriginalId(); diff --git a/Mage.Sets/src/mage/cards/d/DeathPitOffering.java b/Mage.Sets/src/mage/cards/d/DeathPitOffering.java index 909e16de9a..f23a50828d 100644 --- a/Mage.Sets/src/mage/cards/d/DeathPitOffering.java +++ b/Mage.Sets/src/mage/cards/d/DeathPitOffering.java @@ -93,7 +93,7 @@ class DeathPitOfferingEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - List permanents = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game); + List permanents = game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game); for (Permanent permanent : permanents) { permanent.sacrifice(source.getSourceId(), game); } diff --git a/Mage.Sets/src/mage/cards/d/DeathbringerRegent.java b/Mage.Sets/src/mage/cards/d/DeathbringerRegent.java index 316f26eb7d..755fb4da44 100644 --- a/Mage.Sets/src/mage/cards/d/DeathbringerRegent.java +++ b/Mage.Sets/src/mage/cards/d/DeathbringerRegent.java @@ -89,6 +89,6 @@ class DeathbringerRegentCondition implements Condition { @Override public boolean apply(Game game, Ability source) { return CastFromHandSourceCondition.instance.apply(game, source) - && game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), game).size() >= 6; + && game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, game).size() >= 6; } } diff --git a/Mage.Sets/src/mage/cards/d/DeceiverOfForm.java b/Mage.Sets/src/mage/cards/d/DeceiverOfForm.java index 06358fc0d3..3131846930 100644 --- a/Mage.Sets/src/mage/cards/d/DeceiverOfForm.java +++ b/Mage.Sets/src/mage/cards/d/DeceiverOfForm.java @@ -100,7 +100,7 @@ class DeceiverOfFormEffect extends OneShotEffect { if (copyFromCard.isCreature()) { if (controller.chooseUse(outcome, "Let creatures you control other than " + sourceObject.getLogName() + " becomes copies of " + copyFromCard.getLogName() + " until end of turn?", source, game)) { - for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), controller.getId(), game)) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, controller.getId(), game)) { if (!permanent.getId().equals(sourceObject.getId())) { Permanent newBluePrint = null; newBluePrint = new PermanentCard((Card) copyFromCard, source.getControllerId(), game); diff --git a/Mage.Sets/src/mage/cards/d/DecreeOfPain.java b/Mage.Sets/src/mage/cards/d/DecreeOfPain.java index 7a3dca7a06..405fcb91cf 100644 --- a/Mage.Sets/src/mage/cards/d/DecreeOfPain.java +++ b/Mage.Sets/src/mage/cards/d/DecreeOfPain.java @@ -95,7 +95,7 @@ class DecreeOfPainEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { int destroyedCreature = 0; - for(Permanent creature: game.getState().getBattlefield().getActivePermanents(new FilterCreaturePermanent(), controller.getId(), game)) { + for(Permanent creature: game.getState().getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, controller.getId(), game)) { if (creature.destroy(source.getSourceId(), game, true)) { destroyedCreature++; } diff --git a/Mage.Sets/src/mage/cards/d/DefenseOfTheHeart.java b/Mage.Sets/src/mage/cards/d/DefenseOfTheHeart.java index ef3a136e41..7e1a32c26c 100644 --- a/Mage.Sets/src/mage/cards/d/DefenseOfTheHeart.java +++ b/Mage.Sets/src/mage/cards/d/DefenseOfTheHeart.java @@ -82,7 +82,7 @@ public class DefenseOfTheHeart extends CardImpl { Set opponents = game.getOpponents(source.getControllerId()); for(UUID uuid : opponents) { - if(game.getBattlefield().countAll(new FilterCreaturePermanent(), uuid, game) >= 3) + if(game.getBattlefield().countAll(StaticFilters.FILTER_PERMANENT_CREATURE, uuid, game) >= 3) { return true; } diff --git a/Mage.Sets/src/mage/cards/d/DesecrationElemental.java b/Mage.Sets/src/mage/cards/d/DesecrationElemental.java index e868562f25..f6e81bac35 100644 --- a/Mage.Sets/src/mage/cards/d/DesecrationElemental.java +++ b/Mage.Sets/src/mage/cards/d/DesecrationElemental.java @@ -54,7 +54,7 @@ public class DesecrationElemental extends CardImpl { // Fear this.addAbility(FearAbility.getInstance()); // Whenever a player casts a spell, sacrifice a creature. - this.addAbility(new SpellCastAllTriggeredAbility(new SacrificeControllerEffect(new FilterCreaturePermanent(), 1, ""), false)); + this.addAbility(new SpellCastAllTriggeredAbility(new SacrificeControllerEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 1, ""), false)); } public DesecrationElemental(final DesecrationElemental card) { diff --git a/Mage.Sets/src/mage/cards/d/DiabolicEdict.java b/Mage.Sets/src/mage/cards/d/DiabolicEdict.java index e73cfb78eb..d5288c7ace 100644 --- a/Mage.Sets/src/mage/cards/d/DiabolicEdict.java +++ b/Mage.Sets/src/mage/cards/d/DiabolicEdict.java @@ -46,7 +46,7 @@ public class DiabolicEdict extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{B}"); // Target player sacrifices a creature. - this.getSpellAbility().addEffect(new SacrificeEffect(new FilterCreaturePermanent(), 1, "Target player")); + this.getSpellAbility().addEffect(new SacrificeEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 1, "Target player")); this.getSpellAbility().addTarget(new TargetPlayer()); } diff --git a/Mage.Sets/src/mage/cards/d/DiaochanArtfulBeauty.java b/Mage.Sets/src/mage/cards/d/DiaochanArtfulBeauty.java index e8804c8eef..55ee211b77 100644 --- a/Mage.Sets/src/mage/cards/d/DiaochanArtfulBeauty.java +++ b/Mage.Sets/src/mage/cards/d/DiaochanArtfulBeauty.java @@ -66,7 +66,7 @@ public class DiaochanArtfulBeauty extends CardImpl { // {tap}: Destroy target creature of your choice, then destroy target creature of an opponent's choice. Activate this ability only during your turn, before attackers are declared. Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new DiaochanArtfulBeautyDestroyEffect(), new TapSourceCost(), MyTurnBeforeAttackersDeclaredCondition.instance); ability.addTarget(new TargetCreaturePermanent()); - ability.addTarget(new TargetOpponentsChoicePermanent(1, 1, new FilterCreaturePermanent(), false, true)); + ability.addTarget(new TargetOpponentsChoicePermanent(1, 1, StaticFilters.FILTER_PERMANENT_CREATURE, false, true)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/d/DoOrDie.java b/Mage.Sets/src/mage/cards/d/DoOrDie.java index b694514aa4..78a145a529 100644 --- a/Mage.Sets/src/mage/cards/d/DoOrDie.java +++ b/Mage.Sets/src/mage/cards/d/DoOrDie.java @@ -104,7 +104,7 @@ class DoOrDieEffect extends OneShotEffect { } } List pile2 = new ArrayList<>(); - for (Permanent p : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), targetPlayer.getId(), game)) { + for (Permanent p : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, targetPlayer.getId(), game)) { if (!pile1.contains(p)) { pile2.add(p); } diff --git a/Mage.Sets/src/mage/cards/d/DoublingChant.java b/Mage.Sets/src/mage/cards/d/DoublingChant.java index d72e388c43..60ecd62539 100644 --- a/Mage.Sets/src/mage/cards/d/DoublingChant.java +++ b/Mage.Sets/src/mage/cards/d/DoublingChant.java @@ -95,7 +95,7 @@ class DoublingChantEffect extends OneShotEffect { if (player == null) { return false; } - List creatures = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game); + List creatures = game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game); for (Permanent creature : creatures) { final String creatureName = creature.getName(); if (!namesFiltered.contains(creatureName)) { diff --git a/Mage.Sets/src/mage/cards/d/DragonlordKolaghan.java b/Mage.Sets/src/mage/cards/d/DragonlordKolaghan.java index 595cb73a7b..de07356a11 100644 --- a/Mage.Sets/src/mage/cards/d/DragonlordKolaghan.java +++ b/Mage.Sets/src/mage/cards/d/DragonlordKolaghan.java @@ -73,7 +73,7 @@ public class DragonlordKolaghan extends CardImpl { // Other creatures you control have haste. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, - new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent(), true))); + new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE, true))); // Whenever an opponent casts a creature or planeswalker spell with the same name as a card in their graveyard, that player loses 10 life. Effect effect = new LoseLifeTargetEffect(10); diff --git a/Mage.Sets/src/mage/cards/d/DwarvenSong.java b/Mage.Sets/src/mage/cards/d/DwarvenSong.java index 369680563f..d4a2e78f0f 100644 --- a/Mage.Sets/src/mage/cards/d/DwarvenSong.java +++ b/Mage.Sets/src/mage/cards/d/DwarvenSong.java @@ -53,7 +53,7 @@ public class DwarvenSong extends CardImpl { Effect effect = new BecomesColorTargetEffect(ObjectColor.RED, Duration.EndOfTurn); effect.setText("Any number of target creatures become red until end of turn"); this.getSpellAbility().addEffect(effect); - this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, Integer.MAX_VALUE, new FilterCreaturePermanent(), false)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, Integer.MAX_VALUE, StaticFilters.FILTER_PERMANENT_CREATURE, false)); } diff --git a/Mage.Sets/src/mage/cards/e/EgoErasure.java b/Mage.Sets/src/mage/cards/e/EgoErasure.java index 6b9e2f13fe..7e172077fb 100644 --- a/Mage.Sets/src/mage/cards/e/EgoErasure.java +++ b/Mage.Sets/src/mage/cards/e/EgoErasure.java @@ -93,7 +93,7 @@ class EgoErasureLoseEffect extends ContinuousEffectImpl { public void init(Ability source, Game game) { super.init(source, game); if (this.affectedObjectsSet) { - List creatures = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getFirstTarget(), game); + List creatures = game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getFirstTarget(), game); for (Permanent creature : creatures) { affectedObjectList.add(new MageObjectReference(creature, game)); } @@ -134,7 +134,7 @@ class EgoErasureBoostEffect extends ContinuousEffectImpl { public void init(Ability source, Game game) { super.init(source, game); if (this.affectedObjectsSet) { - List creatures = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getFirstTarget(), game); + List creatures = game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getFirstTarget(), game); for (Permanent creature : creatures) { affectedObjectList.add(new MageObjectReference(creature, game)); } diff --git a/Mage.Sets/src/mage/cards/e/EldraziMonument.java b/Mage.Sets/src/mage/cards/e/EldraziMonument.java index 60868c105a..9ea9549c2b 100644 --- a/Mage.Sets/src/mage/cards/e/EldraziMonument.java +++ b/Mage.Sets/src/mage/cards/e/EldraziMonument.java @@ -65,7 +65,7 @@ public class EldraziMonument extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{5}"); // Creatures you control get +1/+1, have flying, and are indestructible. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, new FilterCreaturePermanent(), false))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE, false))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(FlyingAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent()))); Effect effect = new GainAbilityAllEffect(IndestructibleAbility.getInstance(), Duration.WhileOnBattlefield, new FilterControlledCreaturePermanent("Creatures you control"), false); effect.setText("Creatures you control are indestructible"); diff --git a/Mage.Sets/src/mage/cards/e/ElspethTirel.java b/Mage.Sets/src/mage/cards/e/ElspethTirel.java index 64ab4d54b6..ce637a3d51 100644 --- a/Mage.Sets/src/mage/cards/e/ElspethTirel.java +++ b/Mage.Sets/src/mage/cards/e/ElspethTirel.java @@ -85,7 +85,7 @@ class ElspethTirelFirstEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - int amount = game.getBattlefield().countAll(new FilterCreaturePermanent(), source.getControllerId(), game); + int amount = game.getBattlefield().countAll(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game); Player player = game.getPlayer(source.getControllerId()); if (player != null) { player.gainLife(amount, game); diff --git a/Mage.Sets/src/mage/cards/e/EssenceHarvest.java b/Mage.Sets/src/mage/cards/e/EssenceHarvest.java index c62848a1de..035d803089 100644 --- a/Mage.Sets/src/mage/cards/e/EssenceHarvest.java +++ b/Mage.Sets/src/mage/cards/e/EssenceHarvest.java @@ -88,7 +88,7 @@ class EssenceHarvestEffect extends OneShotEffect { Player player = game.getPlayer(source.getControllerId()); Player targetPlayer = game.getPlayer(source.getFirstTarget()); if (player != null && targetPlayer != null) { - List creatures = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), player.getId(), game); + List creatures = game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, player.getId(), game); int amount = 0; for (Permanent creature : creatures) { int power = creature.getPower().getValue(); diff --git a/Mage.Sets/src/mage/cards/e/EvilTwin.java b/Mage.Sets/src/mage/cards/e/EvilTwin.java index 22bbcd574a..d19ad7d627 100644 --- a/Mage.Sets/src/mage/cards/e/EvilTwin.java +++ b/Mage.Sets/src/mage/cards/e/EvilTwin.java @@ -64,7 +64,7 @@ public class EvilTwin extends CardImpl { this.toughness = new MageInt(0); // You may have Evil Twin enter the battlefield as a copy of any creature on the battlefield except it gains "{U}{B}, {T}: Destroy target creature with the same name as this creature." - Effect effect = new CopyPermanentEffect(new FilterCreaturePermanent(), new EvilTwinApplyToPermanent()); + Effect effect = new CopyPermanentEffect(StaticFilters.FILTER_PERMANENT_CREATURE, new EvilTwinApplyToPermanent()); effect.setText("a copy of any creature on the battlefield except it gains \"{U}{B}, {T}: Destroy target creature with the same name as this creature.\""); this.addAbility(new EntersBattlefieldAbility(effect, true)); diff --git a/Mage.Sets/src/mage/cards/e/ExecutionersSwing.java b/Mage.Sets/src/mage/cards/e/ExecutionersSwing.java index 44fc58f00c..f7154470a8 100644 --- a/Mage.Sets/src/mage/cards/e/ExecutionersSwing.java +++ b/Mage.Sets/src/mage/cards/e/ExecutionersSwing.java @@ -74,7 +74,7 @@ public class ExecutionersSwing extends CardImpl { class TargetCreaturePermanentThatDealtDamageThisTurn extends TargetPermanent { public TargetCreaturePermanentThatDealtDamageThisTurn() { - super(1, 1, new FilterCreaturePermanent(), false); + super(1, 1, StaticFilters.FILTER_PERMANENT_CREATURE, false); targetName = "creature that dealt damage this turn"; } diff --git a/Mage.Sets/src/mage/cards/f/FarAway.java b/Mage.Sets/src/mage/cards/f/FarAway.java index a37a00b7d5..5f761281ea 100644 --- a/Mage.Sets/src/mage/cards/f/FarAway.java +++ b/Mage.Sets/src/mage/cards/f/FarAway.java @@ -50,7 +50,7 @@ public class FarAway extends SplitCard { // Away // Target player sacrifices a creature. - getRightHalfCard().getSpellAbility().addEffect(new SacrificeEffect(new FilterCreaturePermanent(), 1, "Target player")); + getRightHalfCard().getSpellAbility().addEffect(new SacrificeEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 1, "Target player")); getRightHalfCard().getSpellAbility().addTarget(new TargetPlayer()); } diff --git a/Mage.Sets/src/mage/cards/f/FavorOfTheMighty.java b/Mage.Sets/src/mage/cards/f/FavorOfTheMighty.java index 254a318a07..58f5010c91 100644 --- a/Mage.Sets/src/mage/cards/f/FavorOfTheMighty.java +++ b/Mage.Sets/src/mage/cards/f/FavorOfTheMighty.java @@ -102,7 +102,7 @@ class FavorOfTheMightyEffect extends ContinuousEffectImpl { @Override public boolean apply(Game game, Ability source) { int maxCMC = Integer.MIN_VALUE; - for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game)) { if (permanent != null && permanent.getConvertedManaCost() > maxCMC) { maxCMC = permanent.getConvertedManaCost(); } diff --git a/Mage.Sets/src/mage/cards/f/FellTheMighty.java b/Mage.Sets/src/mage/cards/f/FellTheMighty.java index c03c261f52..693b4e0633 100644 --- a/Mage.Sets/src/mage/cards/f/FellTheMighty.java +++ b/Mage.Sets/src/mage/cards/f/FellTheMighty.java @@ -88,7 +88,7 @@ class FellTheMightyEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); Permanent targetCreature = game.getPermanentOrLKIBattlefield(source.getFirstTarget()); if (controller != null && targetCreature != null) { - for(Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), controller.getId(), source.getSourceId(), game)) { + for(Permanent permanent: game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, controller.getId(), source.getSourceId(), game)) { if (permanent.getPower().getValue() > targetCreature.getPower().getValue()) { permanent.destroy(source.getSourceId(), game, false); } diff --git a/Mage.Sets/src/mage/cards/f/Fervor.java b/Mage.Sets/src/mage/cards/f/Fervor.java index e13f38eb07..2f8a9993bd 100644 --- a/Mage.Sets/src/mage/cards/f/Fervor.java +++ b/Mage.Sets/src/mage/cards/f/Fervor.java @@ -51,7 +51,7 @@ public class Fervor extends CardImpl { // Creatures you control have haste. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect( - HasteAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent(), false))); + HasteAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE, false))); } public Fervor(final Fervor card) { diff --git a/Mage.Sets/src/mage/cards/f/Festercreep.java b/Mage.Sets/src/mage/cards/f/Festercreep.java index 72aab3475b..4b1fc0c95d 100644 --- a/Mage.Sets/src/mage/cards/f/Festercreep.java +++ b/Mage.Sets/src/mage/cards/f/Festercreep.java @@ -62,7 +62,7 @@ public class Festercreep extends CardImpl { this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(1)))); // {1}{B}, Remove a +1/+1 counter from Festercreep: All other creatures get -1/-1 until end of turn. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostAllEffect(-1, -1, Duration.EndOfTurn, new FilterCreaturePermanent(), true), new ManaCostsImpl("{1}{B}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostAllEffect(-1, -1, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, true), new ManaCostsImpl("{1}{B}")); ability.addCost(new RemoveCountersSourceCost(CounterType.P1P1.createInstance(1))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/f/FinalRevels.java b/Mage.Sets/src/mage/cards/f/FinalRevels.java index 4866a01400..bbbb00a872 100644 --- a/Mage.Sets/src/mage/cards/f/FinalRevels.java +++ b/Mage.Sets/src/mage/cards/f/FinalRevels.java @@ -46,9 +46,9 @@ public class FinalRevels extends CardImpl { public FinalRevels(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{4}{B}"); - this.getSpellAbility().addEffect(new BoostAllEffect(2, 0, Duration.EndOfTurn, new FilterCreaturePermanent(), false)); + this.getSpellAbility().addEffect(new BoostAllEffect(2, 0, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, false)); Mode mode = new Mode(); - mode.getEffects().add(new BoostAllEffect(0, -2, Duration.EndOfTurn, new FilterCreaturePermanent(), false)); + mode.getEffects().add(new BoostAllEffect(0, -2, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, false)); this.getSpellAbility().addMode(mode); } diff --git a/Mage.Sets/src/mage/cards/f/ForcedMarch.java b/Mage.Sets/src/mage/cards/f/ForcedMarch.java index 14b5054028..90e0ad7f44 100644 --- a/Mage.Sets/src/mage/cards/f/ForcedMarch.java +++ b/Mage.Sets/src/mage/cards/f/ForcedMarch.java @@ -60,7 +60,7 @@ class ForcedMarchEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { // for(Permanent permanent : game.getBattlefield().getAllActivePermanents(CardType.CREATURE)) { - for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), + for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), source.getSourceId(), game)) { diff --git a/Mage.Sets/src/mage/cards/f/FoulTongueInvocation.java b/Mage.Sets/src/mage/cards/f/FoulTongueInvocation.java index 5aece9259e..318fd83a57 100644 --- a/Mage.Sets/src/mage/cards/f/FoulTongueInvocation.java +++ b/Mage.Sets/src/mage/cards/f/FoulTongueInvocation.java @@ -70,7 +70,7 @@ public class FoulTongueInvocation extends CardImpl { // Target player sacrifices a creature. If you revealed a Dragon card or controlled a Dragon as you cast Foul-Tongue Invocation, you gain 4 life. this.getSpellAbility().addTarget(new TargetPlayer()); - this.getSpellAbility().addEffect(new SacrificeEffect(new FilterCreaturePermanent(), 1, "target player")); + this.getSpellAbility().addEffect(new SacrificeEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 1, "target player")); this.getSpellAbility().addEffect(new FoulTongueInvocationEffect()); this.getSpellAbility().addWatcher(new DragonOnTheBattlefieldWhileSpellWasCastWatcher()); } diff --git a/Mage.Sets/src/mage/cards/f/Fumigate.java b/Mage.Sets/src/mage/cards/f/Fumigate.java index 668ab91c2e..794f642284 100644 --- a/Mage.Sets/src/mage/cards/f/Fumigate.java +++ b/Mage.Sets/src/mage/cards/f/Fumigate.java @@ -84,7 +84,7 @@ class FumigateEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { int destroyedCreature = 0; - for(Permanent creature: game.getState().getBattlefield().getActivePermanents(new FilterCreaturePermanent(), controller.getId(), game)) { + for(Permanent creature: game.getState().getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, controller.getId(), game)) { if (creature.destroy(source.getSourceId(), game, false)) { destroyedCreature++; } diff --git a/Mage.Sets/src/mage/cards/f/FungalBehemoth.java b/Mage.Sets/src/mage/cards/f/FungalBehemoth.java index f63ed790e0..773bdf1546 100644 --- a/Mage.Sets/src/mage/cards/f/FungalBehemoth.java +++ b/Mage.Sets/src/mage/cards/f/FungalBehemoth.java @@ -123,7 +123,7 @@ class P1P1CountersOnControlledCreaturesCount implements DynamicValue { @Override public int calculate(Game game, Ability sourceAbility, Effect effect) { int count = 0; - for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), sourceAbility.getControllerId(), game)) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, sourceAbility.getControllerId(), game)) { count += permanent.getCounters(game).getCount(CounterType.P1P1); } return count; diff --git a/Mage.Sets/src/mage/cards/g/GaeasAnthem.java b/Mage.Sets/src/mage/cards/g/GaeasAnthem.java index 85b5f82554..f4766788cd 100644 --- a/Mage.Sets/src/mage/cards/g/GaeasAnthem.java +++ b/Mage.Sets/src/mage/cards/g/GaeasAnthem.java @@ -49,7 +49,7 @@ public class GaeasAnthem extends CardImpl { // Creatures you control get +1/+1. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, new FilterCreaturePermanent(), false))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE, false))); } public GaeasAnthem(final GaeasAnthem card) { diff --git a/Mage.Sets/src/mage/cards/g/GerrardsBattleCry.java b/Mage.Sets/src/mage/cards/g/GerrardsBattleCry.java index 211ec44d1a..a58dd0e0aa 100644 --- a/Mage.Sets/src/mage/cards/g/GerrardsBattleCry.java +++ b/Mage.Sets/src/mage/cards/g/GerrardsBattleCry.java @@ -48,7 +48,7 @@ public class GerrardsBattleCry extends CardImpl { public GerrardsBattleCry(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{W}"); - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.EndOfTurn, new FilterCreaturePermanent(), false), new ManaCostsImpl("{2}{W}"))); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, false), new ManaCostsImpl("{2}{W}"))); } public GerrardsBattleCry(final GerrardsBattleCry card) { diff --git a/Mage.Sets/src/mage/cards/g/GethsVerdict.java b/Mage.Sets/src/mage/cards/g/GethsVerdict.java index c3d623305d..12c8a9eef4 100644 --- a/Mage.Sets/src/mage/cards/g/GethsVerdict.java +++ b/Mage.Sets/src/mage/cards/g/GethsVerdict.java @@ -47,7 +47,7 @@ public class GethsVerdict extends CardImpl { public GethsVerdict (UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{B}{B}"); - this.getSpellAbility().addEffect(new SacrificeEffect(new FilterCreaturePermanent(), 1, "Target player")); + this.getSpellAbility().addEffect(new SacrificeEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 1, "Target player")); this.getSpellAbility().addEffect(new LoseLifeTargetEffect(1)); this.getSpellAbility().addTarget(new TargetPlayer()); } diff --git a/Mage.Sets/src/mage/cards/g/Gigantoplasm.java b/Mage.Sets/src/mage/cards/g/Gigantoplasm.java index 0f186bf7b0..ceee70cf5d 100644 --- a/Mage.Sets/src/mage/cards/g/Gigantoplasm.java +++ b/Mage.Sets/src/mage/cards/g/Gigantoplasm.java @@ -63,7 +63,7 @@ public class Gigantoplasm extends CardImpl { this.toughness = new MageInt(0); // You may have Gigantoplasm enter the battlefield as a copy of any creature on the battlefield except it gains "{X}: This creature has base power and toughness X/X." - Effect effect = new CopyPermanentEffect(new FilterCreaturePermanent(), new GigantoplasmApplyToPermanent()); + Effect effect = new CopyPermanentEffect(StaticFilters.FILTER_PERMANENT_CREATURE, new GigantoplasmApplyToPermanent()); effect.setText("a copy of any creature on the battlefield except it gains \"{X}: This creature has base power and toughness X/X.\""); this.addAbility(new EntersBattlefieldAbility(effect, true)); } diff --git a/Mage.Sets/src/mage/cards/g/GiltspireAvenger.java b/Mage.Sets/src/mage/cards/g/GiltspireAvenger.java index 7ed98aa5f7..8642a55832 100644 --- a/Mage.Sets/src/mage/cards/g/GiltspireAvenger.java +++ b/Mage.Sets/src/mage/cards/g/GiltspireAvenger.java @@ -86,7 +86,7 @@ public class GiltspireAvenger extends CardImpl { class GiltspireAvengerTarget extends TargetPermanent { public GiltspireAvengerTarget() { - super(1, 1, new FilterCreaturePermanent(), false); + super(1, 1, StaticFilters.FILTER_PERMANENT_CREATURE, false); targetName = "creature that dealt damage to you this turn"; } diff --git a/Mage.Sets/src/mage/cards/g/GlaringSpotlight.java b/Mage.Sets/src/mage/cards/g/GlaringSpotlight.java index 17186a5bb3..fb93d49a7c 100644 --- a/Mage.Sets/src/mage/cards/g/GlaringSpotlight.java +++ b/Mage.Sets/src/mage/cards/g/GlaringSpotlight.java @@ -67,7 +67,7 @@ public class GlaringSpotlight extends CardImpl { // {3}, Sacrifice Glaring Spotlight: Creatures you control gain hexproof until end of turn and can't be blocked this turn. Ability ability = new SimpleActivatedAbility( - Zone.BATTLEFIELD, new GainAbilityControlledEffect(HexproofAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent(),false), + Zone.BATTLEFIELD, new GainAbilityControlledEffect(HexproofAbility.getInstance(), Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE,false), new GenericManaCost(3)); ability.addEffect(new CantBeBlockedAllEffect(new FilterControlledCreaturePermanent(), Duration.EndOfTurn)); ability.addCost(new SacrificeSourceCost()); diff --git a/Mage.Sets/src/mage/cards/g/GleamOfResistance.java b/Mage.Sets/src/mage/cards/g/GleamOfResistance.java index 4e3a706373..cea87a3265 100644 --- a/Mage.Sets/src/mage/cards/g/GleamOfResistance.java +++ b/Mage.Sets/src/mage/cards/g/GleamOfResistance.java @@ -51,7 +51,7 @@ public class GleamOfResistance extends CardImpl { // Creatures you control get +1/+2 until end of turn. Untap those creatures. this.getSpellAbility().addEffect(new BoostControlledEffect(1, 2, Duration.EndOfTurn)); - this.getSpellAbility().addEffect(new UntapAllControllerEffect(new FilterCreaturePermanent(),"Untap those creatures")); + this.getSpellAbility().addEffect(new UntapAllControllerEffect(StaticFilters.FILTER_PERMANENT_CREATURE,"Untap those creatures")); // Basic landcycling {1}{W}({1}{W}, Discard this card: Search your library for a basic land card, reveal it, and put it into your hand. Then shuffle your library.) this.addAbility(new BasicLandcyclingAbility(new ManaCostsImpl("{1}{W}"))); } diff --git a/Mage.Sets/src/mage/cards/g/GloriousAnthem.java b/Mage.Sets/src/mage/cards/g/GloriousAnthem.java index 3c83937962..70cbf928fd 100644 --- a/Mage.Sets/src/mage/cards/g/GloriousAnthem.java +++ b/Mage.Sets/src/mage/cards/g/GloriousAnthem.java @@ -49,7 +49,7 @@ public class GloriousAnthem extends CardImpl { // Creatures you control get +1/+1. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, new FilterCreaturePermanent(), false))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE, false))); } public GloriousAnthem(final GloriousAnthem card) { diff --git a/Mage.Sets/src/mage/cards/g/GloriousCharge.java b/Mage.Sets/src/mage/cards/g/GloriousCharge.java index 11df001fd5..9bf4db21b5 100644 --- a/Mage.Sets/src/mage/cards/g/GloriousCharge.java +++ b/Mage.Sets/src/mage/cards/g/GloriousCharge.java @@ -47,7 +47,7 @@ public class GloriousCharge extends CardImpl { // Creatures you control get +1/+1 until end of turn. - this.getSpellAbility().addEffect(new BoostControlledEffect(1, 1, Duration.EndOfTurn, new FilterCreaturePermanent(), false)); + this.getSpellAbility().addEffect(new BoostControlledEffect(1, 1, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, false)); } public GloriousCharge(final GloriousCharge card) { diff --git a/Mage.Sets/src/mage/cards/g/GreatOakGuardian.java b/Mage.Sets/src/mage/cards/g/GreatOakGuardian.java index 93e4b56f90..3fb8108a9d 100644 --- a/Mage.Sets/src/mage/cards/g/GreatOakGuardian.java +++ b/Mage.Sets/src/mage/cards/g/GreatOakGuardian.java @@ -103,7 +103,7 @@ class GreatOakGuardianEffect extends ContinuousEffectImpl { public void init(Ability source, Game game) { super.init(source, game); if (this.affectedObjectsSet) { - List creatures = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getFirstTarget(), game); + List creatures = game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getFirstTarget(), game); for (Permanent creature : creatures) { affectedObjectList.add(new MageObjectReference(creature, game)); } @@ -145,7 +145,7 @@ class GreatOakGuardianUntapEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player targetPlayer = game.getPlayer(source.getControllerId()); if (targetPlayer != null) { - for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), targetPlayer.getId(), game)) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, targetPlayer.getId(), game)) { permanent.untap(game); } return true; diff --git a/Mage.Sets/src/mage/cards/g/GrixisCharm.java b/Mage.Sets/src/mage/cards/g/GrixisCharm.java index b9593357ca..90accc5804 100644 --- a/Mage.Sets/src/mage/cards/g/GrixisCharm.java +++ b/Mage.Sets/src/mage/cards/g/GrixisCharm.java @@ -61,7 +61,7 @@ public class GrixisCharm extends CardImpl { this.getSpellAbility().addMode(mode); // or creatures you control get +2/+0 until end of turn. mode = new Mode(); - mode.getEffects().add(new BoostControlledEffect(2, 0, Duration.EndOfTurn, new FilterCreaturePermanent(), false)); + mode.getEffects().add(new BoostControlledEffect(2, 0, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, false)); this.getSpellAbility().addMode(mode); } diff --git a/Mage.Sets/src/mage/cards/h/HallowedBurial.java b/Mage.Sets/src/mage/cards/h/HallowedBurial.java index eaee28bbfa..0ca1d5a7d5 100644 --- a/Mage.Sets/src/mage/cards/h/HallowedBurial.java +++ b/Mage.Sets/src/mage/cards/h/HallowedBurial.java @@ -85,7 +85,7 @@ class HallowedBurialEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - for (Permanent creature : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), controller.getId(), source.getSourceId(), game)) { + for (Permanent creature : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, controller.getId(), source.getSourceId(), game)) { controller.moveCardToLibraryWithInfo(creature, source.getSourceId(), game, Zone.BATTLEFIELD, false, true); } return true; diff --git a/Mage.Sets/src/mage/cards/h/HauntedPlateMail.java b/Mage.Sets/src/mage/cards/h/HauntedPlateMail.java index c545393995..08edbccdac 100644 --- a/Mage.Sets/src/mage/cards/h/HauntedPlateMail.java +++ b/Mage.Sets/src/mage/cards/h/HauntedPlateMail.java @@ -64,7 +64,7 @@ public class HauntedPlateMail extends CardImpl { Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new HauntedPlateMailToken(),"", Duration.EndOfTurn), new ManaCostsImpl("{0}"), - new PermanentsOnTheBattlefieldCondition(new FilterCreaturePermanent(), ComparisonType.EQUAL_TO, 0), + new PermanentsOnTheBattlefieldCondition(StaticFilters.FILTER_PERMANENT_CREATURE, ComparisonType.EQUAL_TO, 0), "{0}: Until end of turn, Haunted Plate Mail becomes a 4/4 Spirit artifact creature that's no longer an Equipment. Activate this ability only if you control no creatures."); this.addAbility(ability); // Equip {4} diff --git a/Mage.Sets/src/mage/cards/h/HeavensGate.java b/Mage.Sets/src/mage/cards/h/HeavensGate.java index 88923139f3..a62518ec87 100644 --- a/Mage.Sets/src/mage/cards/h/HeavensGate.java +++ b/Mage.Sets/src/mage/cards/h/HeavensGate.java @@ -53,7 +53,7 @@ public class HeavensGate extends CardImpl { Effect effect = new BecomesColorTargetEffect(ObjectColor.WHITE, Duration.EndOfTurn); effect.setText("Any number of target creatures become white until end of turn"); this.getSpellAbility().addEffect(effect); - this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, Integer.MAX_VALUE, new FilterCreaturePermanent(), false)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, Integer.MAX_VALUE, StaticFilters.FILTER_PERMANENT_CREATURE, false)); } diff --git a/Mage.Sets/src/mage/cards/h/HeliodGodOfTheSun.java b/Mage.Sets/src/mage/cards/h/HeliodGodOfTheSun.java index d28d732218..fd76707175 100644 --- a/Mage.Sets/src/mage/cards/h/HeliodGodOfTheSun.java +++ b/Mage.Sets/src/mage/cards/h/HeliodGodOfTheSun.java @@ -69,7 +69,7 @@ public class HeliodGodOfTheSun extends CardImpl { this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); // Other creatures you control have vigilance. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(VigilanceAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent(), true))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(VigilanceAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE, true))); // {2}{W}{W}: Create a 2/1 white Cleric enchantment creature token. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new HeliodGodOfTheSunToken()), new ManaCostsImpl("{2}{W}{W}"))); diff --git a/Mage.Sets/src/mage/cards/h/HellionEruption.java b/Mage.Sets/src/mage/cards/h/HellionEruption.java index 45e0c43766..e65d309d9d 100644 --- a/Mage.Sets/src/mage/cards/h/HellionEruption.java +++ b/Mage.Sets/src/mage/cards/h/HellionEruption.java @@ -81,7 +81,7 @@ class HellionEruptionEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - List permanents = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game); + List permanents = game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game); for (Permanent permanent : permanents) { permanent.sacrifice(source.getSourceId(), game); } diff --git a/Mage.Sets/src/mage/cards/h/Humility.java b/Mage.Sets/src/mage/cards/h/Humility.java index 800299bd3e..db6f22ab53 100644 --- a/Mage.Sets/src/mage/cards/h/Humility.java +++ b/Mage.Sets/src/mage/cards/h/Humility.java @@ -89,7 +89,7 @@ class HumilityEffect extends ContinuousEffectImpl { public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { - for (Permanent permanent : game.getState().getBattlefield().getActivePermanents(new FilterCreaturePermanent(), player.getId(), source.getSourceId(), game)) { + for (Permanent permanent : game.getState().getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, player.getId(), source.getSourceId(), game)) { switch (layer) { case AbilityAddingRemovingEffects_6: permanent.removeAllAbilities(source.getSourceId(), game); diff --git a/Mage.Sets/src/mage/cards/i/IG88B.java b/Mage.Sets/src/mage/cards/i/IG88B.java index 303400c55c..0eb80fd392 100644 --- a/Mage.Sets/src/mage/cards/i/IG88B.java +++ b/Mage.Sets/src/mage/cards/i/IG88B.java @@ -1,115 +1,115 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.cards.i; - -import mage.MageInt; -import mage.abilities.Ability; -import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; -import mage.abilities.dynamicvalue.DynamicValue; -import mage.abilities.effects.Effect; -import mage.abilities.effects.common.LoseLifeTargetEffect; -import mage.abilities.keyword.DeathtouchAbility; -import mage.abilities.keyword.RepairAbility; -import mage.cards.CardImpl; -import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.constants.SuperType; -import mage.counters.CounterType; -import mage.filter.common.FilterCreaturePermanent; -import mage.game.Game; -import mage.game.permanent.Permanent; - -import java.util.UUID; - -/** - * - * @author Styxo - */ -public class IG88B extends CardImpl { - - public IG88B(UUID ownerId, CardSetInfo setInfo) { - super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{1}{B}{B}"); - addSuperType(SuperType.LEGENDARY); - this.subtype.add("Droid"); - this.subtype.add("Hunter"); - this.power = new MageInt(1); - this.toughness = new MageInt(4); - - // Deathtouch - this.addAbility(DeathtouchAbility.getInstance()); - - // Bounty — Whenever IF-88B deals combat damage to a player, that player loses life equal to the number of bounty counters on creatures he or she controls. - this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility( - new LoseLifeTargetEffect(new CountersOnDefendingPlayerCreaturesCount(CounterType.BOUNTY)), - false, - "Bounty — Whenever {this} deals combat damage to a player, that player loses life equal to the number of bounty counters on creatures he or she controls", - true) - ); - - // Repair 3 - this.addAbility(new RepairAbility(3)); - } - - public IG88B(final IG88B card) { - super(card); - } - - @Override - public IG88B copy() { - return new IG88B(this); - } -} - -class CountersOnDefendingPlayerCreaturesCount implements DynamicValue { - - private CounterType counterType; - - public CountersOnDefendingPlayerCreaturesCount(CounterType counterType) { - this.counterType = counterType; - } - - @Override - public int calculate(Game game, Ability sourceAbility, Effect effect) { - int count = 0; - UUID defender = game.getCombat().getDefendingPlayerId(sourceAbility.getSourceId(), game); - for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), defender, game)) { - count += permanent.getCounters(game).getCount(counterType); - } - return count; - } - - @Override - public CountersOnDefendingPlayerCreaturesCount copy() { - return new CountersOnDefendingPlayerCreaturesCount(counterType); - } - - @Override - public String getMessage() { - return "the number of " + counterType.getName() + " counters on creatures he or she controls"; - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.i; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.LoseLifeTargetEffect; +import mage.abilities.keyword.DeathtouchAbility; +import mage.abilities.keyword.RepairAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SuperType; +import mage.counters.CounterType; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; + +import java.util.UUID; + +/** + * + * @author Styxo + */ +public class IG88B extends CardImpl { + + public IG88B(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{1}{B}{B}"); + addSuperType(SuperType.LEGENDARY); + this.subtype.add("Droid"); + this.subtype.add("Hunter"); + this.power = new MageInt(1); + this.toughness = new MageInt(4); + + // Deathtouch + this.addAbility(DeathtouchAbility.getInstance()); + + // Bounty — Whenever IF-88B deals combat damage to a player, that player loses life equal to the number of bounty counters on creatures he or she controls. + this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility( + new LoseLifeTargetEffect(new CountersOnDefendingPlayerCreaturesCount(CounterType.BOUNTY)), + false, + "Bounty — Whenever {this} deals combat damage to a player, that player loses life equal to the number of bounty counters on creatures he or she controls", + true) + ); + + // Repair 3 + this.addAbility(new RepairAbility(3)); + } + + public IG88B(final IG88B card) { + super(card); + } + + @Override + public IG88B copy() { + return new IG88B(this); + } +} + +class CountersOnDefendingPlayerCreaturesCount implements DynamicValue { + + private CounterType counterType; + + public CountersOnDefendingPlayerCreaturesCount(CounterType counterType) { + this.counterType = counterType; + } + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + int count = 0; + UUID defender = game.getCombat().getDefendingPlayerId(sourceAbility.getSourceId(), game); + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, defender, game)) { + count += permanent.getCounters(game).getCount(counterType); + } + return count; + } + + @Override + public CountersOnDefendingPlayerCreaturesCount copy() { + return new CountersOnDefendingPlayerCreaturesCount(counterType); + } + + @Override + public String getMessage() { + return "the number of " + counterType.getName() + " counters on creatures he or she controls"; + } +} diff --git a/Mage.Sets/src/mage/cards/i/IchorExplosion.java b/Mage.Sets/src/mage/cards/i/IchorExplosion.java index 32801a905b..d89eaff5e5 100644 --- a/Mage.Sets/src/mage/cards/i/IchorExplosion.java +++ b/Mage.Sets/src/mage/cards/i/IchorExplosion.java @@ -59,7 +59,7 @@ public class IchorExplosion extends CardImpl { this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); // All creatures get -X/-X until end of turn, where X is the sacrificed creature's power. DynamicValue xValue = new IchorExplosionDynamicValue(); - this.getSpellAbility().addEffect(new BoostAllEffect(xValue, xValue, Duration.EndOfTurn, new FilterCreaturePermanent(), false, null, true)); + this.getSpellAbility().addEffect(new BoostAllEffect(xValue, xValue, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, false, null, true)); } diff --git a/Mage.Sets/src/mage/cards/i/IcyBlast.java b/Mage.Sets/src/mage/cards/i/IcyBlast.java index 00bf7a9d4f..0d5992a034 100644 --- a/Mage.Sets/src/mage/cards/i/IcyBlast.java +++ b/Mage.Sets/src/mage/cards/i/IcyBlast.java @@ -55,7 +55,7 @@ public class IcyBlast extends CardImpl { // Tap X target creatures. this.getSpellAbility().addEffect(new TapTargetEffect("X target creatures")); - this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 1, new FilterCreaturePermanent(), false)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 1, StaticFilters.FILTER_PERMANENT_CREATURE, false)); // Ferocious - If you control a creature with power 4 or greater, those creatures don't untap during their controllers' next untap steps. Effect effect = new ConditionalContinuousRuleModifyingEffect( @@ -74,7 +74,7 @@ public class IcyBlast extends CardImpl { if (ability instanceof SpellAbility) { ability.getTargets().clear(); int numberToTap = ability.getManaCostsToPay().getX(); - numberToTap = Math.min(game.getBattlefield().count(new FilterCreaturePermanent(), ability.getSourceId(), ability.getControllerId(), game), numberToTap); + numberToTap = Math.min(game.getBattlefield().count(StaticFilters.FILTER_PERMANENT_CREATURE, ability.getSourceId(), ability.getControllerId(), game), numberToTap); ability.addTarget(new TargetCreaturePermanent(numberToTap)); } } diff --git a/Mage.Sets/src/mage/cards/i/InciteHysteria.java b/Mage.Sets/src/mage/cards/i/InciteHysteria.java index b79bbf6544..15e98ee950 100644 --- a/Mage.Sets/src/mage/cards/i/InciteHysteria.java +++ b/Mage.Sets/src/mage/cards/i/InciteHysteria.java @@ -95,7 +95,7 @@ class InciteHysteriaEffect extends OneShotEffect { Permanent target = game.getPermanent(getTargetPointer().getFirst(game, source)); if (target != null) { ObjectColor color = target.getColor(game); - for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), source.getSourceId(), game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), source.getSourceId(), game)) { if (permanent.getColor(game).shares(color)) { ContinuousEffect effect = new GainAbilityTargetEffect(new CantBlockAbility(), Duration.EndOfTurn); effect.setTargetPointer(new FixedTarget(permanent, game)); diff --git a/Mage.Sets/src/mage/cards/j/JaggedLightning.java b/Mage.Sets/src/mage/cards/j/JaggedLightning.java index 598f225e80..9ccd281bd9 100644 --- a/Mage.Sets/src/mage/cards/j/JaggedLightning.java +++ b/Mage.Sets/src/mage/cards/j/JaggedLightning.java @@ -46,7 +46,7 @@ public class JaggedLightning extends CardImpl { // Jagged Lightning deals 3 damage to each of two target creatures. this.getSpellAbility().addEffect(new DamageTargetEffect(3, true, "each of two target creatures")); - this.getSpellAbility().addTarget(new TargetCreaturePermanent(2, 2, new FilterCreaturePermanent(), false)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(2, 2, StaticFilters.FILTER_PERMANENT_CREATURE, false)); } public JaggedLightning(final JaggedLightning card) { diff --git a/Mage.Sets/src/mage/cards/j/JeskaiAscendancy.java b/Mage.Sets/src/mage/cards/j/JeskaiAscendancy.java index 4eefc52dc0..d5e8673d0f 100644 --- a/Mage.Sets/src/mage/cards/j/JeskaiAscendancy.java +++ b/Mage.Sets/src/mage/cards/j/JeskaiAscendancy.java @@ -62,7 +62,7 @@ public class JeskaiAscendancy extends CardImpl { // Whenever you cast a noncreature spell, creatures you control get +1/+1 until end of turn. Untap those creatures. Effect effect = new BoostControlledEffect(1,1,Duration.EndOfTurn); Ability ability = new SpellCastControllerTriggeredAbility(effect, filterNonCreature, false); - effect = new UntapAllControllerEffect(new FilterCreaturePermanent(),"Untap those creatures"); + effect = new UntapAllControllerEffect(StaticFilters.FILTER_PERMANENT_CREATURE,"Untap those creatures"); ability.addEffect(effect); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/j/JorKadeenThePrevailer.java b/Mage.Sets/src/mage/cards/j/JorKadeenThePrevailer.java index 029dee5582..6d63700c5b 100644 --- a/Mage.Sets/src/mage/cards/j/JorKadeenThePrevailer.java +++ b/Mage.Sets/src/mage/cards/j/JorKadeenThePrevailer.java @@ -64,7 +64,7 @@ public class JorKadeenThePrevailer extends CardImpl { this.addAbility(FirstStrikeAbility.getInstance()); // Metalcraft - Creatures you control get +3/+0 as long as you control three or more artifacts. - ConditionalContinuousEffect effect = new ConditionalContinuousEffect(new BoostControlledEffect(3, 0, Duration.WhileOnBattlefield, new FilterCreaturePermanent(), false), + ConditionalContinuousEffect effect = new ConditionalContinuousEffect(new BoostControlledEffect(3, 0, Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE, false), MetalcraftCondition.instance, effectText); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); } diff --git a/Mage.Sets/src/mage/cards/j/JoragaInvocation.java b/Mage.Sets/src/mage/cards/j/JoragaInvocation.java index 59290853f0..876f323d96 100644 --- a/Mage.Sets/src/mage/cards/j/JoragaInvocation.java +++ b/Mage.Sets/src/mage/cards/j/JoragaInvocation.java @@ -89,7 +89,7 @@ class JoragaInvocationEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), game)) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, game)) { ContinuousEffect effect = new MustBeBlockedByAtLeastOneTargetEffect(); effect.setTargetPointer(new FixedTarget(permanent.getId())); game.addEffect(effect, source); diff --git a/Mage.Sets/src/mage/cards/j/Juxtapose.java b/Mage.Sets/src/mage/cards/j/Juxtapose.java index 3de7511284..57a8449eb7 100644 --- a/Mage.Sets/src/mage/cards/j/Juxtapose.java +++ b/Mage.Sets/src/mage/cards/j/Juxtapose.java @@ -68,7 +68,7 @@ public class Juxtapose extends CardImpl { // You and target player exchange control of the creature you each control with the highest converted mana cost. Then exchange control of artifacts the same way. If two or more permanents a player controls are tied for highest cost, their controller chooses one of them. - this.getSpellAbility().addEffect(new JuxtaposeEffect(new FilterCreaturePermanent(), "You and target player exchange control of the creature you each control with the highest converted mana cost.")); + this.getSpellAbility().addEffect(new JuxtaposeEffect(StaticFilters.FILTER_PERMANENT_CREATURE, "You and target player exchange control of the creature you each control with the highest converted mana cost.")); this.getSpellAbility().addEffect(new JuxtaposeEffect(new FilterArtifactPermanent(), "Then exchange control of artifacts the same way. If two or more permanents a player controls are tied for highest cost, their controller chooses one of them.")); this.getSpellAbility().addTarget(new TargetPlayer() ); } diff --git a/Mage.Sets/src/mage/cards/k/KabiraVindicator.java b/Mage.Sets/src/mage/cards/k/KabiraVindicator.java index 9641d3d24e..3bb8d87f1a 100644 --- a/Mage.Sets/src/mage/cards/k/KabiraVindicator.java +++ b/Mage.Sets/src/mage/cards/k/KabiraVindicator.java @@ -63,10 +63,10 @@ public class KabiraVindicator extends LevelerCard { this.addAbility(new LevelUpAbility(new ManaCostsImpl("{2}{W}"))); Abilities abilities1 = new AbilitiesImpl<>(); - abilities1.add(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, new FilterCreaturePermanent(), true))); + abilities1.add(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE, true))); Abilities abilities2 = new AbilitiesImpl<>(); - abilities2.add(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(2, 2, Duration.WhileOnBattlefield, new FilterCreaturePermanent(), true))); + abilities2.add(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(2, 2, Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE, true))); this.addAbilities(LevelerCardBuilder.construct( new LevelerCardBuilder.LevelAbility(2, 4, abilities1, 3, 6), diff --git a/Mage.Sets/src/mage/cards/k/KagemaroFirstToSuffer.java b/Mage.Sets/src/mage/cards/k/KagemaroFirstToSuffer.java index d8f34e46dc..cc9efa1b19 100644 --- a/Mage.Sets/src/mage/cards/k/KagemaroFirstToSuffer.java +++ b/Mage.Sets/src/mage/cards/k/KagemaroFirstToSuffer.java @@ -71,7 +71,7 @@ public class KagemaroFirstToSuffer extends CardImpl { DynamicValue xMinusValue = new SignInversionDynamicValue(xValue); Ability ability = new SimpleActivatedAbility( Zone.BATTLEFIELD, - new BoostAllEffect(xMinusValue, xMinusValue, Duration.EndOfTurn, new FilterCreaturePermanent(), false, + new BoostAllEffect(xMinusValue, xMinusValue, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, false, "All creatures get -X/-X until end of turn, where X is the number of cards in your hand"), new ManaCostsImpl("{B}") ); diff --git a/Mage.Sets/src/mage/cards/k/KinTreeInvocation.java b/Mage.Sets/src/mage/cards/k/KinTreeInvocation.java index 5241ac058d..9543279032 100644 --- a/Mage.Sets/src/mage/cards/k/KinTreeInvocation.java +++ b/Mage.Sets/src/mage/cards/k/KinTreeInvocation.java @@ -87,7 +87,7 @@ class KinTreeInvocationCreateTokenEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { int value = Integer.MIN_VALUE; - for (Permanent permanent: game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) { + for (Permanent permanent: game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game)) { if (value < permanent.getToughness().getValue()) { value = permanent.getToughness().getValue(); } diff --git a/Mage.Sets/src/mage/cards/k/KioraMasterOfTheDepths.java b/Mage.Sets/src/mage/cards/k/KioraMasterOfTheDepths.java index 053fbb2616..a796d33ab5 100644 --- a/Mage.Sets/src/mage/cards/k/KioraMasterOfTheDepths.java +++ b/Mage.Sets/src/mage/cards/k/KioraMasterOfTheDepths.java @@ -71,7 +71,7 @@ public class KioraMasterOfTheDepths extends CardImpl { // +1: Untap up to one target creature and up to one target land. LoyaltyAbility ability1 = new LoyaltyAbility(new KioraUntapEffect(), 1); - ability1.addTarget(new TargetCreaturePermanent(0, 1, new FilterCreaturePermanent(), false)); + ability1.addTarget(new TargetCreaturePermanent(0, 1, StaticFilters.FILTER_PERMANENT_CREATURE, false)); ability1.addTarget(new TargetLandPermanent(0, 1, new FilterLandPermanent(), false)); this.addAbility(ability1); diff --git a/Mage.Sets/src/mage/cards/k/KitsunePalliator.java b/Mage.Sets/src/mage/cards/k/KitsunePalliator.java index f47e4a10fa..a12f729c00 100644 --- a/Mage.Sets/src/mage/cards/k/KitsunePalliator.java +++ b/Mage.Sets/src/mage/cards/k/KitsunePalliator.java @@ -93,7 +93,7 @@ class KitsunePalliatorEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { PreventDamageToTargetEffect effect = new PreventDamageToTargetEffect(Duration.EndOfTurn, 1); - List permanents = game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game); + List permanents = game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game); for (Permanent permanent: permanents) { effect.setTargetPointer(new FixedTarget(permanent.getId())); game.addEffect(effect, source); diff --git a/Mage.Sets/src/mage/cards/k/KjeldoranDead.java b/Mage.Sets/src/mage/cards/k/KjeldoranDead.java index 61cf1b0c6f..33cf9a48fa 100644 --- a/Mage.Sets/src/mage/cards/k/KjeldoranDead.java +++ b/Mage.Sets/src/mage/cards/k/KjeldoranDead.java @@ -55,7 +55,7 @@ public class KjeldoranDead extends CardImpl { this.toughness = new MageInt(1); // When Kjeldoran Dead enters the battlefield, sacrifice a creature. - Ability ability = new EntersBattlefieldTriggeredAbility(new SacrificeControllerEffect(new FilterCreaturePermanent(), 1, null)); + Ability ability = new EntersBattlefieldTriggeredAbility(new SacrificeControllerEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 1, null)); this.addAbility(ability); // {B}: Regenerate Kjeldoran Dead. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{B}"))); diff --git a/Mage.Sets/src/mage/cards/k/Knighthood.java b/Mage.Sets/src/mage/cards/k/Knighthood.java index f3d9d43ed9..93d729efe4 100644 --- a/Mage.Sets/src/mage/cards/k/Knighthood.java +++ b/Mage.Sets/src/mage/cards/k/Knighthood.java @@ -49,7 +49,7 @@ public class Knighthood extends CardImpl { // Creatures you control have first strike. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(FirstStrikeAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent(), false))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(FirstStrikeAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE, false))); } diff --git a/Mage.Sets/src/mage/cards/k/KodamaOfTheSouthTree.java b/Mage.Sets/src/mage/cards/k/KodamaOfTheSouthTree.java index 864c03d3c2..dcf5fcff5c 100644 --- a/Mage.Sets/src/mage/cards/k/KodamaOfTheSouthTree.java +++ b/Mage.Sets/src/mage/cards/k/KodamaOfTheSouthTree.java @@ -56,7 +56,7 @@ public class KodamaOfTheSouthTree extends CardImpl { this.power = new MageInt(4); this.toughness = new MageInt(4); - Ability ability = new SpellCastControllerTriggeredAbility(new BoostControlledEffect(1, 1, Duration.EndOfTurn, new FilterCreaturePermanent(), true), StaticFilters.SPIRIT_OR_ARCANE_CARD, false); + Ability ability = new SpellCastControllerTriggeredAbility(new BoostControlledEffect(1, 1, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, true), StaticFilters.SPIRIT_OR_ARCANE_CARD, false); ability.addEffect(new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, true)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/k/KondasBanner.java b/Mage.Sets/src/mage/cards/k/KondasBanner.java index 4ef27f1d2f..f7123d5a24 100644 --- a/Mage.Sets/src/mage/cards/k/KondasBanner.java +++ b/Mage.Sets/src/mage/cards/k/KondasBanner.java @@ -95,7 +95,7 @@ class KondasBannerTypeBoostEffect extends BoostAllEffect { private static final String effectText = "Creatures that share a creature type with equipped creature get +1/+1"; KondasBannerTypeBoostEffect() { - super(1, 1, Duration.WhileOnBattlefield, new FilterCreaturePermanent(), false); + super(1, 1, Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE, false); staticText = effectText; } @@ -135,7 +135,7 @@ class KondasBannerColorBoostEffect extends BoostAllEffect { private static final String effectText = "Creatures that share a color with equipped creature get +1/+1."; KondasBannerColorBoostEffect() { - super(1, 1, Duration.WhileOnBattlefield, new FilterCreaturePermanent(), false); + super(1, 1, Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE, false); staticText = effectText; } diff --git a/Mage.Sets/src/mage/cards/k/KuonOgreAscendant.java b/Mage.Sets/src/mage/cards/k/KuonOgreAscendant.java index 034869093f..ab375c6ceb 100644 --- a/Mage.Sets/src/mage/cards/k/KuonOgreAscendant.java +++ b/Mage.Sets/src/mage/cards/k/KuonOgreAscendant.java @@ -97,7 +97,7 @@ class KuonsEssenceToken extends Token { // At the beginning of each player's upkeep, that player sacrifices a creature.. this.addAbility(new BeginningOfUpkeepTriggeredAbility( Zone.BATTLEFIELD, - new SacrificeEffect(new FilterCreaturePermanent(),1,"that player"), + new SacrificeEffect(StaticFilters.FILTER_PERMANENT_CREATURE,1,"that player"), TargetController.ANY, false, true)); } } diff --git a/Mage.Sets/src/mage/cards/k/KusariGama.java b/Mage.Sets/src/mage/cards/k/KusariGama.java index 8174cd9fb2..c9d304c647 100644 --- a/Mage.Sets/src/mage/cards/k/KusariGama.java +++ b/Mage.Sets/src/mage/cards/k/KusariGama.java @@ -150,7 +150,7 @@ class KusariGamaDamageEffect extends OneShotEffect { creature = (Permanent) game.getLastKnownInformation(damagedCreatureId, Zone.BATTLEFIELD); } if (creature != null) { - for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), creature.getControllerId(), game)) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, creature.getControllerId(), game)) { if (!permanent.getId().equals(damagedCreatureId)) { permanent.damage(damage, source.getSourceId(), game, false, true); } diff --git a/Mage.Sets/src/mage/cards/l/LeoninSunStandard.java b/Mage.Sets/src/mage/cards/l/LeoninSunStandard.java index 5d275d2695..a6b775769d 100644 --- a/Mage.Sets/src/mage/cards/l/LeoninSunStandard.java +++ b/Mage.Sets/src/mage/cards/l/LeoninSunStandard.java @@ -47,7 +47,7 @@ public class LeoninSunStandard extends CardImpl { public LeoninSunStandard(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}"); - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.EndOfTurn, new FilterCreaturePermanent(), false), new ManaCostsImpl("{1}{W}"))); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, false), new ManaCostsImpl("{1}{W}"))); } public LeoninSunStandard(final LeoninSunStandard card) { diff --git a/Mage.Sets/src/mage/cards/l/LethalSting.java b/Mage.Sets/src/mage/cards/l/LethalSting.java index c341d1dda2..b4f1f60ffd 100644 --- a/Mage.Sets/src/mage/cards/l/LethalSting.java +++ b/Mage.Sets/src/mage/cards/l/LethalSting.java @@ -84,7 +84,7 @@ class LethalStingCost extends CostImpl { @Override public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { - for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), controllerId, game)) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, controllerId, game)) { return permanent != null; } return false; diff --git a/Mage.Sets/src/mage/cards/l/LeylineOfVitality.java b/Mage.Sets/src/mage/cards/l/LeylineOfVitality.java index 50ae9e414b..fecbac1dac 100644 --- a/Mage.Sets/src/mage/cards/l/LeylineOfVitality.java +++ b/Mage.Sets/src/mage/cards/l/LeylineOfVitality.java @@ -51,7 +51,7 @@ public class LeylineOfVitality extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{G}{G}"); this.addAbility(LeylineAbility.getInstance()); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(0, 1, Duration.WhileOnBattlefield, new FilterCreaturePermanent(), false))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(0, 1, Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE, false))); this.addAbility(new CreatureEntersBattlefieldTriggeredAbility(new GainLifeEffect(1), true)); } diff --git a/Mage.Sets/src/mage/cards/l/LilianaOfTheVeil.java b/Mage.Sets/src/mage/cards/l/LilianaOfTheVeil.java index fe405371f8..845a645fd9 100644 --- a/Mage.Sets/src/mage/cards/l/LilianaOfTheVeil.java +++ b/Mage.Sets/src/mage/cards/l/LilianaOfTheVeil.java @@ -64,7 +64,7 @@ public class LilianaOfTheVeil extends CardImpl { this.addAbility(new LoyaltyAbility(new DiscardEachPlayerEffect(), 1)); // -2: Target player sacrifices a creature. - LoyaltyAbility ability = new LoyaltyAbility(new SacrificeEffect(new FilterCreaturePermanent(), 1, "Target player"), -2); + LoyaltyAbility ability = new LoyaltyAbility(new SacrificeEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 1, "Target player"), -2); ability.addTarget(new TargetPlayer()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/l/LivingDeath.java b/Mage.Sets/src/mage/cards/l/LivingDeath.java index 145b0988b5..fe9447e740 100644 --- a/Mage.Sets/src/mage/cards/l/LivingDeath.java +++ b/Mage.Sets/src/mage/cards/l/LivingDeath.java @@ -104,7 +104,7 @@ class LivingDeathEffect extends OneShotEffect { } game.applyEffects(); // sacrifice all creatures - for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game)) { permanent.sacrifice(source.getSourceId(), game); } game.applyEffects(); diff --git a/Mage.Sets/src/mage/cards/l/LivingEnd.java b/Mage.Sets/src/mage/cards/l/LivingEnd.java index 8cd98a3383..4fcbd23724 100644 --- a/Mage.Sets/src/mage/cards/l/LivingEnd.java +++ b/Mage.Sets/src/mage/cards/l/LivingEnd.java @@ -111,7 +111,7 @@ class LivingEndEffect extends OneShotEffect { } } // sacrifice all creatures - for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game)) { permanent.sacrifice(source.getSourceId(), game); } // put exiled cards to battlefield diff --git a/Mage.Sets/src/mage/cards/l/LostInTheWoods.java b/Mage.Sets/src/mage/cards/l/LostInTheWoods.java index 593cd73e41..27b36caa48 100644 --- a/Mage.Sets/src/mage/cards/l/LostInTheWoods.java +++ b/Mage.Sets/src/mage/cards/l/LostInTheWoods.java @@ -57,7 +57,7 @@ public class LostInTheWoods extends CardImpl { // Whenever a creature attacks you or a planeswalker you control, reveal the top card of your library. If it's a Forest card, remove that creature from combat. Then put the revealed card on the bottom of your library. - this.addAbility(new AttacksAllTriggeredAbility(new LostInTheWoodsEffect(), false, new FilterCreaturePermanent(), SetTargetPointer.PERMANENT, true)); + this.addAbility(new AttacksAllTriggeredAbility(new LostInTheWoodsEffect(), false, StaticFilters.FILTER_PERMANENT_CREATURE, SetTargetPointer.PERMANENT, true)); } public LostInTheWoods(final LostInTheWoods card) { diff --git a/Mage.Sets/src/mage/cards/m/MagusOfTheTabernacle.java b/Mage.Sets/src/mage/cards/m/MagusOfTheTabernacle.java index 2f708a13f8..8e5a11e63b 100644 --- a/Mage.Sets/src/mage/cards/m/MagusOfTheTabernacle.java +++ b/Mage.Sets/src/mage/cards/m/MagusOfTheTabernacle.java @@ -62,7 +62,7 @@ public class MagusOfTheTabernacle extends CardImpl { // All creatures have "At the beginning of your upkeep, sacrifice this creature unless you pay {1}." Ability abilityToGain = new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new GenericManaCost(1)), TargetController.YOU, false); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(abilityToGain, Duration.WhileOnBattlefield, new FilterCreaturePermanent(), rule))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(abilityToGain, Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE, rule))); } public MagusOfTheTabernacle(final MagusOfTheTabernacle card) { diff --git a/Mage.Sets/src/mage/cards/m/ManaEchoes.java b/Mage.Sets/src/mage/cards/m/ManaEchoes.java index a8c9c698f2..356cebb0a8 100644 --- a/Mage.Sets/src/mage/cards/m/ManaEchoes.java +++ b/Mage.Sets/src/mage/cards/m/ManaEchoes.java @@ -90,7 +90,7 @@ class ManaEchoesEffect extends OneShotEffect { Permanent permanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source)); if (controller != null && permanent != null) { int foundCreatures = 0; - for (Permanent perm : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) { + for (Permanent perm : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game)) { if (permanent.shareSubtypes(perm, game)) { foundCreatures++; } diff --git a/Mage.Sets/src/mage/cards/m/MarchesasDecree.java b/Mage.Sets/src/mage/cards/m/MarchesasDecree.java index c5ae7360a3..db82ae3f0e 100644 --- a/Mage.Sets/src/mage/cards/m/MarchesasDecree.java +++ b/Mage.Sets/src/mage/cards/m/MarchesasDecree.java @@ -54,7 +54,7 @@ public class MarchesasDecree extends CardImpl { // Whenever a creature attacks you or a planeswalker you control, the controller of that creature loses 1 life. Effect effect = new LoseLifeTargetEffect(1); effect.setText("that creature's controller loses 1 life"); - this.addAbility(new AttacksAllTriggeredAbility(effect, false, new FilterCreaturePermanent(), SetTargetPointer.PLAYER, true, true)); + this.addAbility(new AttacksAllTriggeredAbility(effect, false, StaticFilters.FILTER_PERMANENT_CREATURE, SetTargetPointer.PLAYER, true, true)); } public MarchesasDecree(final MarchesasDecree card) { diff --git a/Mage.Sets/src/mage/cards/m/MassHysteria.java b/Mage.Sets/src/mage/cards/m/MassHysteria.java index b8f1a07437..9fcb9df639 100644 --- a/Mage.Sets/src/mage/cards/m/MassHysteria.java +++ b/Mage.Sets/src/mage/cards/m/MassHysteria.java @@ -48,7 +48,7 @@ public class MassHysteria extends CardImpl { public MassHysteria(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{R}"); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent(), false))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE, false))); } public MassHysteria(final MassHysteria card) { diff --git a/Mage.Sets/src/mage/cards/m/MassPolymorph.java b/Mage.Sets/src/mage/cards/m/MassPolymorph.java index de49e63a39..35661b5af1 100644 --- a/Mage.Sets/src/mage/cards/m/MassPolymorph.java +++ b/Mage.Sets/src/mage/cards/m/MassPolymorph.java @@ -90,7 +90,7 @@ class MassPolymorphEffect extends OneShotEffect { if (controller != null && sourceObject != null) { int count; // Cards creatures = new CardsImpl(); - List creatures = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game); + List creatures = game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game); Set creaturesToExile = new HashSet<>(); creaturesToExile.addAll(creatures); count = creatures.size(); diff --git a/Mage.Sets/src/mage/cards/m/MayaelsAria.java b/Mage.Sets/src/mage/cards/m/MayaelsAria.java index ae34e0602d..cc92b715b2 100644 --- a/Mage.Sets/src/mage/cards/m/MayaelsAria.java +++ b/Mage.Sets/src/mage/cards/m/MayaelsAria.java @@ -97,7 +97,7 @@ class MayaelsAriaEffect extends OneShotEffect { FilterCreaturePermanent filter = new FilterCreaturePermanent(); filter.add(new PowerPredicate(ComparisonType.MORE_THAN, 4)); if (game.getState().getBattlefield().countAll(filter, controller.getId(), game) > 0) { - for (Permanent creature : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) { + for (Permanent creature : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game)) { creature.addCounters(CounterType.P1P1.createInstance(), source, game); } } diff --git a/Mage.Sets/src/mage/cards/m/Meadowboon.java b/Mage.Sets/src/mage/cards/m/Meadowboon.java index e25b5cd2db..5d17fa80dc 100644 --- a/Mage.Sets/src/mage/cards/m/Meadowboon.java +++ b/Mage.Sets/src/mage/cards/m/Meadowboon.java @@ -90,7 +90,7 @@ class MeadowboonEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player target = game.getPlayer(source.getFirstTarget()); if (target != null) { - for (Permanent p : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), target.getId(), game)) { + for (Permanent p : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, target.getId(), game)) { p.addCounters(CounterType.P1P1.createInstance(), source, game); } return true; diff --git a/Mage.Sets/src/mage/cards/m/MeishinTheMindCage.java b/Mage.Sets/src/mage/cards/m/MeishinTheMindCage.java index ac42abec2d..b05f82cdfa 100644 --- a/Mage.Sets/src/mage/cards/m/MeishinTheMindCage.java +++ b/Mage.Sets/src/mage/cards/m/MeishinTheMindCage.java @@ -54,7 +54,7 @@ public class MeishinTheMindCage extends CardImpl { // All creatures get -X/-0, where X is the number of cards in your hand. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(new SignInversionDynamicValue(new CardsInControllerHandCount()), new StaticValue(0), Duration.WhileOnBattlefield, new FilterCreaturePermanent(), false, "All creatures get -X/-0, where X is the number of cards in your hand"))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(new SignInversionDynamicValue(new CardsInControllerHandCount()), new StaticValue(0), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE, false, "All creatures get -X/-0, where X is the number of cards in your hand"))); } public MeishinTheMindCage(final MeishinTheMindCage card) { diff --git a/Mage.Sets/src/mage/cards/m/MinionsMurmurs.java b/Mage.Sets/src/mage/cards/m/MinionsMurmurs.java index 9fcd547ad5..ffa2486ceb 100644 --- a/Mage.Sets/src/mage/cards/m/MinionsMurmurs.java +++ b/Mage.Sets/src/mage/cards/m/MinionsMurmurs.java @@ -1,92 +1,92 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.cards.m; - -import mage.abilities.Ability; -import mage.abilities.effects.OneShotEffect; -import mage.cards.CardImpl; -import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.filter.common.FilterCreaturePermanent; -import mage.game.Game; -import mage.players.Player; - -import java.util.UUID; - -/** - * - * @author Derpthemeus - */ -public class MinionsMurmurs extends CardImpl { - - public MinionsMurmurs(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{B}{B}"); - - // You draw X cards and you lose X life, where X is the number of creatures you control. - this.getSpellAbility().addEffect(new MinionsMurmursEffect()); - } - - public MinionsMurmurs(final MinionsMurmurs card) { - super(card); - } - - @Override - public MinionsMurmurs copy() { - return new MinionsMurmurs(this); - } - - static class MinionsMurmursEffect extends OneShotEffect { - - public MinionsMurmursEffect() { - super(Outcome.DrawCard); - this.staticText = "You draw X cards and you lose X life, where X is the number of creatures you control"; - } - - public MinionsMurmursEffect(final MinionsMurmursEffect effect) { - super(effect); - } - - @Override - public MinionsMurmursEffect copy() { - return new MinionsMurmursEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { - int creaturesControlled = game.getBattlefield().countAll(new FilterCreaturePermanent(), controller.getId(), game); - controller.drawCards(creaturesControlled, game); - controller.loseLife(creaturesControlled, game, false); - return true; - } - return false; - } - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.m; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.players.Player; + +import java.util.UUID; + +/** + * + * @author Derpthemeus + */ +public class MinionsMurmurs extends CardImpl { + + public MinionsMurmurs(UUID ownerId, CardSetInfo setInfo) { + super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{B}{B}"); + + // You draw X cards and you lose X life, where X is the number of creatures you control. + this.getSpellAbility().addEffect(new MinionsMurmursEffect()); + } + + public MinionsMurmurs(final MinionsMurmurs card) { + super(card); + } + + @Override + public MinionsMurmurs copy() { + return new MinionsMurmurs(this); + } + + static class MinionsMurmursEffect extends OneShotEffect { + + public MinionsMurmursEffect() { + super(Outcome.DrawCard); + this.staticText = "You draw X cards and you lose X life, where X is the number of creatures you control"; + } + + public MinionsMurmursEffect(final MinionsMurmursEffect effect) { + super(effect); + } + + @Override + public MinionsMurmursEffect copy() { + return new MinionsMurmursEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + int creaturesControlled = game.getBattlefield().countAll(StaticFilters.FILTER_PERMANENT_CREATURE, controller.getId(), game); + controller.drawCards(creaturesControlled, game); + controller.loseLife(creaturesControlled, game, false); + return true; + } + return false; + } + } +} diff --git a/Mage.Sets/src/mage/cards/m/MoggInfestation.java b/Mage.Sets/src/mage/cards/m/MoggInfestation.java index ffd03df24a..db92757fb6 100644 --- a/Mage.Sets/src/mage/cards/m/MoggInfestation.java +++ b/Mage.Sets/src/mage/cards/m/MoggInfestation.java @@ -89,7 +89,7 @@ class MoggInfestationEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null && getTargetPointer().getFirst(game, source) != null) { - for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), getTargetPointer().getFirst(game, source), game)) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, getTargetPointer().getFirst(game, source), game)) { if (permanent.destroy(source.getSourceId(), game, false)) { if (game.getState().getZone(permanent.getId()).equals(Zone.GRAVEYARD)) { // If a commander is replaced to command zone, the creature does not die Effect effect = new CreateTokenTargetEffect(new GoblinToken(), 2); diff --git a/Mage.Sets/src/mage/cards/m/MossbridgeTroll.java b/Mage.Sets/src/mage/cards/m/MossbridgeTroll.java index bb8791f6ee..07b16be5dd 100644 --- a/Mage.Sets/src/mage/cards/m/MossbridgeTroll.java +++ b/Mage.Sets/src/mage/cards/m/MossbridgeTroll.java @@ -166,7 +166,7 @@ class MossbridgeTrollCost extends CostImpl { @Override public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { int sumPower = 0; - for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), controllerId, game)) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, controllerId, game)) { if (!permanent.getId().equals(sourceId)) { sumPower += permanent.getPower().getValue(); } diff --git a/Mage.Sets/src/mage/cards/n/NecromanticSelection.java b/Mage.Sets/src/mage/cards/n/NecromanticSelection.java index f60ff6161e..dfdb481499 100644 --- a/Mage.Sets/src/mage/cards/n/NecromanticSelection.java +++ b/Mage.Sets/src/mage/cards/n/NecromanticSelection.java @@ -107,7 +107,7 @@ class NecromanticSelectionEffect extends OneShotEffect { MageObject sourceObject = game.getObject(source.getSourceId()); if (sourceObject != null && controller != null) { Cards cards = new CardsImpl(); - for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), controller.getId(), source.getSourceId(), game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, controller.getId(), source.getSourceId(), game)) { permanent.destroy(source.getSourceId(), game, false); if (game.getState().getZone(permanent.getId()) == Zone.GRAVEYARD) { cards.add(permanent); diff --git a/Mage.Sets/src/mage/cards/n/NetherbornPhalanx.java b/Mage.Sets/src/mage/cards/n/NetherbornPhalanx.java index 191652bbf1..2e0b77ecf3 100644 --- a/Mage.Sets/src/mage/cards/n/NetherbornPhalanx.java +++ b/Mage.Sets/src/mage/cards/n/NetherbornPhalanx.java @@ -92,7 +92,7 @@ class NetherbornPhalanxEffect extends OneShotEffect { Player player = game.getPlayer(source.getControllerId()); if (player != null) { for (UUID playerId : game.getOpponents(source.getControllerId())) { - final int count = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), playerId, game).size(); + final int count = game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, playerId, game).size(); if (count > 0) { Player opponent = game.getPlayer(playerId); if (opponent != null) { diff --git a/Mage.Sets/src/mage/cards/n/NightDay.java b/Mage.Sets/src/mage/cards/n/NightDay.java index 19d3f0da57..be24ab5dcf 100644 --- a/Mage.Sets/src/mage/cards/n/NightDay.java +++ b/Mage.Sets/src/mage/cards/n/NightDay.java @@ -99,7 +99,7 @@ class DayEffect extends ContinuousEffectImpl { public void init(Ability source, Game game) { super.init(source, game); if (this.affectedObjectsSet) { - List creatures = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getFirstTarget(), game); + List creatures = game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getFirstTarget(), game); for (Permanent creature : creatures) { affectedObjectList.add(new MageObjectReference(creature, game)); } diff --git a/Mage.Sets/src/mage/cards/n/NovijenHeartOfProgress.java b/Mage.Sets/src/mage/cards/n/NovijenHeartOfProgress.java index 7c38281d69..f154e0e049 100644 --- a/Mage.Sets/src/mage/cards/n/NovijenHeartOfProgress.java +++ b/Mage.Sets/src/mage/cards/n/NovijenHeartOfProgress.java @@ -95,7 +95,7 @@ class NovijenHeartOfProgressEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = game.getObject(source.getSourceId()); if (controller != null && sourceObject != null) { - for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) { + for (Permanent permanent: game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game)) { if (permanent.getTurnsOnBattlefield() == 0) { permanent.addCounters(CounterType.P1P1.createInstance(), source, game); game.informPlayers(sourceObject.getLogName()+ ": " + controller.getLogName() + " puts a +1/+1 counter on " + permanent.getLogName()); diff --git a/Mage.Sets/src/mage/cards/n/NyleaGodOfTheHunt.java b/Mage.Sets/src/mage/cards/n/NyleaGodOfTheHunt.java index 8db5c24540..31ca3af0e8 100644 --- a/Mage.Sets/src/mage/cards/n/NyleaGodOfTheHunt.java +++ b/Mage.Sets/src/mage/cards/n/NyleaGodOfTheHunt.java @@ -68,7 +68,7 @@ public class NyleaGodOfTheHunt extends CardImpl { effect.setText("As long as your devotion to green is less than five, Nylea isn't a creature.(Each {G} in the mana costs of permanents you control counts towards your devotion to green.)"); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); // Other creatures you control have trample. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent(), true))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE, true))); // {3}{G}: Target creature gets +2/+2 until end of turn. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(2,2, Duration.EndOfTurn), new ManaCostsImpl("{3}{G}")); ability.addTarget(new TargetCreaturePermanent()); diff --git a/Mage.Sets/src/mage/cards/o/OathswornGiant.java b/Mage.Sets/src/mage/cards/o/OathswornGiant.java index c56c7de889..4e6fbd6eb7 100644 --- a/Mage.Sets/src/mage/cards/o/OathswornGiant.java +++ b/Mage.Sets/src/mage/cards/o/OathswornGiant.java @@ -58,8 +58,8 @@ public class OathswornGiant extends CardImpl { this.addAbility(VigilanceAbility.getInstance()); // Other creatures you control get +0/+2 and have vigilance. - Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(0, 2, Duration.WhileOnBattlefield, new FilterCreaturePermanent(), true)); - ability.addEffect(new GainAbilityControlledEffect(VigilanceAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent(), true)); + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(0, 2, Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE, true)); + ability.addEffect(new GainAbilityControlledEffect(VigilanceAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE, true)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/o/OpenIntoWonder.java b/Mage.Sets/src/mage/cards/o/OpenIntoWonder.java index a61ba06d4c..45242504f0 100644 --- a/Mage.Sets/src/mage/cards/o/OpenIntoWonder.java +++ b/Mage.Sets/src/mage/cards/o/OpenIntoWonder.java @@ -1,83 +1,83 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.cards.o; - -import java.util.UUID; -import mage.abilities.Ability; -import mage.abilities.SpellAbility; -import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; -import mage.abilities.effects.Effect; -import mage.abilities.effects.common.DrawCardSourceControllerEffect; -import mage.abilities.effects.common.combat.CantBeBlockedTargetEffect; -import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; -import mage.cards.CardImpl; -import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.filter.common.FilterCreaturePermanent; -import mage.game.Game; -import mage.target.common.TargetCreaturePermanent; - -/** - * - * @author LevelX2 - */ -public class OpenIntoWonder extends CardImpl { - - public OpenIntoWonder(UUID ownerId, CardSetInfo setInfo) { - super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{U}{U}"); - - // X target creatures can't be blocked this turn. Until end of turn, those creatures gain "Whenever this creature deals combat damage to a player, draw a card." - Effect effect = new CantBeBlockedTargetEffect(Duration.EndOfTurn); - effect.setText("X target creatures can't be blocked this turn"); - this.getSpellAbility().addEffect(effect); - this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 1, new FilterCreaturePermanent(), false)); - Ability abilityToGain = new DealsCombatDamageToAPlayerTriggeredAbility(new DrawCardSourceControllerEffect(1), false); - this.getSpellAbility().addEffect(new GainAbilityTargetEffect(abilityToGain, Duration.EndOfTurn, - "Until end of turn, those creatures gain \"Whenever this creature deals combat damage to a player, draw a card.\"")); - } - - public OpenIntoWonder(final OpenIntoWonder card) { - super(card); - } - - @Override - public void adjustTargets(Ability ability, Game game) { - if (ability instanceof SpellAbility) { - ability.getTargets().clear(); - int numberOfTargets = ability.getManaCostsToPay().getX(); - numberOfTargets = Math.min(game.getBattlefield().count(new FilterCreaturePermanent(), ability.getSourceId(), ability.getControllerId(), game), numberOfTargets); - ability.addTarget(new TargetCreaturePermanent(numberOfTargets)); - } - } - - @Override - public OpenIntoWonder copy() { - return new OpenIntoWonder(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.o; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.SpellAbility; +import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.combat.CantBeBlockedTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LevelX2 + */ +public class OpenIntoWonder extends CardImpl { + + public OpenIntoWonder(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{U}{U}"); + + // X target creatures can't be blocked this turn. Until end of turn, those creatures gain "Whenever this creature deals combat damage to a player, draw a card." + Effect effect = new CantBeBlockedTargetEffect(Duration.EndOfTurn); + effect.setText("X target creatures can't be blocked this turn"); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 1, StaticFilters.FILTER_PERMANENT_CREATURE, false)); + Ability abilityToGain = new DealsCombatDamageToAPlayerTriggeredAbility(new DrawCardSourceControllerEffect(1), false); + this.getSpellAbility().addEffect(new GainAbilityTargetEffect(abilityToGain, Duration.EndOfTurn, + "Until end of turn, those creatures gain \"Whenever this creature deals combat damage to a player, draw a card.\"")); + } + + public OpenIntoWonder(final OpenIntoWonder card) { + super(card); + } + + @Override + public void adjustTargets(Ability ability, Game game) { + if (ability instanceof SpellAbility) { + ability.getTargets().clear(); + int numberOfTargets = ability.getManaCostsToPay().getX(); + numberOfTargets = Math.min(game.getBattlefield().count(StaticFilters.FILTER_PERMANENT_CREATURE, ability.getSourceId(), ability.getControllerId(), game), numberOfTargets); + ability.addTarget(new TargetCreaturePermanent(numberOfTargets)); + } + } + + @Override + public OpenIntoWonder copy() { + return new OpenIntoWonder(this); + } +} diff --git a/Mage.Sets/src/mage/cards/o/OverwhelmingForces.java b/Mage.Sets/src/mage/cards/o/OverwhelmingForces.java index c71be6169c..eeda7ee0cc 100644 --- a/Mage.Sets/src/mage/cards/o/OverwhelmingForces.java +++ b/Mage.Sets/src/mage/cards/o/OverwhelmingForces.java @@ -86,7 +86,7 @@ class OverwhelmingForcesEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); if (controller != null && getTargetPointer().getFirst(game, source) != null) { int destroyedCreature = 0; - for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), getTargetPointer().getFirst(game, source), game)) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, getTargetPointer().getFirst(game, source), game)) { if (permanent.destroy(source.getSourceId(), game, false)) { destroyedCreature++; } diff --git a/Mage.Sets/src/mage/cards/o/OverwhelmingSplendor.java b/Mage.Sets/src/mage/cards/o/OverwhelmingSplendor.java index 84baa650f3..939b74ae73 100644 --- a/Mage.Sets/src/mage/cards/o/OverwhelmingSplendor.java +++ b/Mage.Sets/src/mage/cards/o/OverwhelmingSplendor.java @@ -1,195 +1,195 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.cards.o; - -import java.util.Optional; -import java.util.UUID; -import mage.MageObject; -import mage.abilities.Ability; -import mage.abilities.LoyaltyAbility; -import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.ContinuousEffectImpl; -import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; -import mage.abilities.effects.common.AttachEffect; -import mage.abilities.keyword.EnchantAbility; -import mage.abilities.mana.ActivatedManaAbilityImpl; -import mage.cards.CardImpl; -import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Layer; -import static mage.constants.Layer.AbilityAddingRemovingEffects_6; -import static mage.constants.Layer.PTChangingEffects_7; -import mage.constants.Outcome; -import mage.constants.SubLayer; -import mage.constants.Zone; -import mage.filter.common.FilterCreaturePermanent; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.permanent.Permanent; -import mage.players.Player; -import mage.target.TargetPlayer; - -/** - * - * @author LevelX2 - */ -public class OverwhelmingSplendor extends CardImpl { - - public OverwhelmingSplendor(UUID ownerId, CardSetInfo setInfo) { - super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{6}{W}{W}"); - - this.subtype.add("Aura"); - this.subtype.add("Curse"); - - // Enchant player - TargetPlayer auraTarget = new TargetPlayer(); - this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Outcome.LoseAbility)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); - this.addAbility(ability); - - // Creatures enchanted player controls lose all abilities and have base power and toughness 1/1. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new OverwhelmingSplendorLoseAbilitiesEffect())); - - // Enchanted player can't activate abilities that aren't mana abilities or loyalty abilities. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new OverwhelmingSplendorCantActivateEffect())); - } - - public OverwhelmingSplendor(final OverwhelmingSplendor card) { - super(card); - } - - @Override - public OverwhelmingSplendor copy() { - return new OverwhelmingSplendor(this); - } -} - -class OverwhelmingSplendorLoseAbilitiesEffect extends ContinuousEffectImpl { - - public OverwhelmingSplendorLoseAbilitiesEffect() { - super(Duration.WhileOnBattlefield, Outcome.LoseAbility); - staticText = "Creatures enchanted player controls lose all abilities and have base power and toughness 1/1"; - } - - public OverwhelmingSplendorLoseAbilitiesEffect(final OverwhelmingSplendorLoseAbilitiesEffect effect) { - super(effect); - } - - @Override - public OverwhelmingSplendorLoseAbilitiesEffect copy() { - return new OverwhelmingSplendorLoseAbilitiesEffect(this); - } - - @Override - public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { - Permanent enchantment = game.getPermanentOrLKIBattlefield(source.getSourceId()); - if (enchantment == null) { - return false; - } - Player player = game.getPlayer(enchantment.getAttachedTo()); - if (player != null) { - for (Permanent permanent : game.getState().getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), player.getId(), game)) { - switch (layer) { - case AbilityAddingRemovingEffects_6: - permanent.removeAllAbilities(source.getSourceId(), game); - break; - case PTChangingEffects_7: - if (sublayer == SubLayer.SetPT_7b) { - permanent.getPower().setValue(1); - permanent.getToughness().setValue(1); - } - } - } - return true; - } - return false; - } - - @Override - public boolean apply(Game game, Ability source) { - return false; - } - - @Override - public boolean hasLayer(Layer layer) { - return layer == Layer.AbilityAddingRemovingEffects_6 || layer == Layer.PTChangingEffects_7; - } - -} - -class OverwhelmingSplendorCantActivateEffect extends ContinuousRuleModifyingEffectImpl { - - public OverwhelmingSplendorCantActivateEffect() { - super(Duration.WhileOnBattlefield, Outcome.Detriment); - staticText = "Enchanted player can't activate abilities that aren't mana abilities or loyalty abilities"; - } - - public OverwhelmingSplendorCantActivateEffect(final OverwhelmingSplendorCantActivateEffect effect) { - super(effect); - } - - @Override - public OverwhelmingSplendorCantActivateEffect copy() { - return new OverwhelmingSplendorCantActivateEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - return true; - } - - @Override - public String getInfoMessage(Ability source, GameEvent event, Game game) { - MageObject mageObject = game.getObject(source.getSourceId()); - if (mageObject != null) { - return "You can't activate abilities that aren't mana abilities or loyalty abilities (" + mageObject.getIdName() + ")."; - } - return null; - } - - @Override - public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getType() == GameEvent.EventType.ACTIVATE_ABILITY) { - Permanent enchantment = game.getPermanentOrLKIBattlefield(source.getSourceId()); - if (enchantment == null) { - return false; - } - if (event.getPlayerId().equals(enchantment.getAttachedTo())) { - Optional ability = game.getAbility(event.getTargetId(), event.getSourceId()); - if (ability.isPresent() - && !(ability.get() instanceof ActivatedManaAbilityImpl) - && !(ability.get() instanceof LoyaltyAbility)) { - return true; - } - } - } - return false; - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.o; + +import java.util.Optional; +import java.util.UUID; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.LoyaltyAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.mana.ActivatedManaAbilityImpl; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Layer; +import static mage.constants.Layer.AbilityAddingRemovingEffects_6; +import static mage.constants.Layer.PTChangingEffects_7; +import mage.constants.Outcome; +import mage.constants.SubLayer; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.TargetPlayer; + +/** + * + * @author LevelX2 + */ +public class OverwhelmingSplendor extends CardImpl { + + public OverwhelmingSplendor(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{6}{W}{W}"); + + this.subtype.add("Aura"); + this.subtype.add("Curse"); + + // Enchant player + TargetPlayer auraTarget = new TargetPlayer(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.LoseAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // Creatures enchanted player controls lose all abilities and have base power and toughness 1/1. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new OverwhelmingSplendorLoseAbilitiesEffect())); + + // Enchanted player can't activate abilities that aren't mana abilities or loyalty abilities. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new OverwhelmingSplendorCantActivateEffect())); + } + + public OverwhelmingSplendor(final OverwhelmingSplendor card) { + super(card); + } + + @Override + public OverwhelmingSplendor copy() { + return new OverwhelmingSplendor(this); + } +} + +class OverwhelmingSplendorLoseAbilitiesEffect extends ContinuousEffectImpl { + + public OverwhelmingSplendorLoseAbilitiesEffect() { + super(Duration.WhileOnBattlefield, Outcome.LoseAbility); + staticText = "Creatures enchanted player controls lose all abilities and have base power and toughness 1/1"; + } + + public OverwhelmingSplendorLoseAbilitiesEffect(final OverwhelmingSplendorLoseAbilitiesEffect effect) { + super(effect); + } + + @Override + public OverwhelmingSplendorLoseAbilitiesEffect copy() { + return new OverwhelmingSplendorLoseAbilitiesEffect(this); + } + + @Override + public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { + Permanent enchantment = game.getPermanentOrLKIBattlefield(source.getSourceId()); + if (enchantment == null) { + return false; + } + Player player = game.getPlayer(enchantment.getAttachedTo()); + if (player != null) { + for (Permanent permanent : game.getState().getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, player.getId(), game)) { + switch (layer) { + case AbilityAddingRemovingEffects_6: + permanent.removeAllAbilities(source.getSourceId(), game); + break; + case PTChangingEffects_7: + if (sublayer == SubLayer.SetPT_7b) { + permanent.getPower().setValue(1); + permanent.getToughness().setValue(1); + } + } + } + return true; + } + return false; + } + + @Override + public boolean apply(Game game, Ability source) { + return false; + } + + @Override + public boolean hasLayer(Layer layer) { + return layer == Layer.AbilityAddingRemovingEffects_6 || layer == Layer.PTChangingEffects_7; + } + +} + +class OverwhelmingSplendorCantActivateEffect extends ContinuousRuleModifyingEffectImpl { + + public OverwhelmingSplendorCantActivateEffect() { + super(Duration.WhileOnBattlefield, Outcome.Detriment); + staticText = "Enchanted player can't activate abilities that aren't mana abilities or loyalty abilities"; + } + + public OverwhelmingSplendorCantActivateEffect(final OverwhelmingSplendorCantActivateEffect effect) { + super(effect); + } + + @Override + public OverwhelmingSplendorCantActivateEffect copy() { + return new OverwhelmingSplendorCantActivateEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public String getInfoMessage(Ability source, GameEvent event, Game game) { + MageObject mageObject = game.getObject(source.getSourceId()); + if (mageObject != null) { + return "You can't activate abilities that aren't mana abilities or loyalty abilities (" + mageObject.getIdName() + ")."; + } + return null; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType() == GameEvent.EventType.ACTIVATE_ABILITY) { + Permanent enchantment = game.getPermanentOrLKIBattlefield(source.getSourceId()); + if (enchantment == null) { + return false; + } + if (event.getPlayerId().equals(enchantment.getAttachedTo())) { + Optional ability = game.getAbility(event.getTargetId(), event.getSourceId()); + if (ability.isPresent() + && !(ability.get() instanceof ActivatedManaAbilityImpl) + && !(ability.get() instanceof LoyaltyAbility)) { + return true; + } + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/cards/o/OverwhelmingStampede.java b/Mage.Sets/src/mage/cards/o/OverwhelmingStampede.java index 3a1be74dd6..898887076a 100644 --- a/Mage.Sets/src/mage/cards/o/OverwhelmingStampede.java +++ b/Mage.Sets/src/mage/cards/o/OverwhelmingStampede.java @@ -85,7 +85,7 @@ class OverwhelmingStampedeInitEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { int maxPower = 0; - for (Permanent perm : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) { + for (Permanent perm : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game)) { if (perm.getPower().getValue() > maxPower) { maxPower = perm.getPower().getValue(); } diff --git a/Mage.Sets/src/mage/cards/o/OviyaPashiriSageLifecrafter.java b/Mage.Sets/src/mage/cards/o/OviyaPashiriSageLifecrafter.java index f8fabc040d..e69d3e74de 100644 --- a/Mage.Sets/src/mage/cards/o/OviyaPashiriSageLifecrafter.java +++ b/Mage.Sets/src/mage/cards/o/OviyaPashiriSageLifecrafter.java @@ -101,7 +101,7 @@ class OviyaPashiriSageLifecrafterEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - int creatures = game.getBattlefield().countAll(new FilterCreaturePermanent(), source.getControllerId(), game); + int creatures = game.getBattlefield().countAll(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game); return new CreateTokenEffect(new OviyaPashiriSageLifecrafterToken(creatures)).apply(game, source); } return false; diff --git a/Mage.Sets/src/mage/cards/p/Pandemonium.java b/Mage.Sets/src/mage/cards/p/Pandemonium.java index ea08268e05..5f95f72aee 100644 --- a/Mage.Sets/src/mage/cards/p/Pandemonium.java +++ b/Mage.Sets/src/mage/cards/p/Pandemonium.java @@ -55,7 +55,7 @@ public class Pandemonium extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{R}"); // Whenever a creature enters the battlefield, that creature's controller may have it deal damage equal to its power to target creature or player of his or her choice. - Ability ability = new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new PandemoniumEffect(), new FilterCreaturePermanent(), false, SetTargetPointer.PERMANENT, ""); + Ability ability = new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new PandemoniumEffect(), StaticFilters.FILTER_PERMANENT_CREATURE, false, SetTargetPointer.PERMANENT, ""); ability.addTarget(new TargetCreatureOrPlayer()); originalId = ability.getOriginalId(); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/p/PathOfAngersFlame.java b/Mage.Sets/src/mage/cards/p/PathOfAngersFlame.java index 8c9390392c..01a0c872bc 100644 --- a/Mage.Sets/src/mage/cards/p/PathOfAngersFlame.java +++ b/Mage.Sets/src/mage/cards/p/PathOfAngersFlame.java @@ -48,7 +48,7 @@ public class PathOfAngersFlame extends CardImpl { // Creatures you control get +2/+0 until end of turn. - this.getSpellAbility().addEffect(new BoostControlledEffect(2, 0, Duration.EndOfTurn, new FilterCreaturePermanent(), false)); + this.getSpellAbility().addEffect(new BoostControlledEffect(2, 0, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, false)); } public PathOfAngersFlame(final PathOfAngersFlame card) { diff --git a/Mage.Sets/src/mage/cards/p/PathbreakerIbex.java b/Mage.Sets/src/mage/cards/p/PathbreakerIbex.java index e0fa33138c..4a2307bdb7 100644 --- a/Mage.Sets/src/mage/cards/p/PathbreakerIbex.java +++ b/Mage.Sets/src/mage/cards/p/PathbreakerIbex.java @@ -92,7 +92,7 @@ class PathbreakerIbexEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { int maxPower = 0; - for (Permanent perm : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) { + for (Permanent perm : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game)) { if (perm.getPower().getValue() > maxPower) { maxPower = perm.getPower().getValue(); } diff --git a/Mage.Sets/src/mage/cards/p/PatronOfTheAkki.java b/Mage.Sets/src/mage/cards/p/PatronOfTheAkki.java index d7be56264a..0866e0f6dd 100644 --- a/Mage.Sets/src/mage/cards/p/PatronOfTheAkki.java +++ b/Mage.Sets/src/mage/cards/p/PatronOfTheAkki.java @@ -59,7 +59,7 @@ public class PatronOfTheAkki extends CardImpl { this.addAbility(new OfferingAbility(SubType.GOBLIN)); // Whenever Patron of the Akki attacks, creatures you control get +2/+0 until end of turn. - this.addAbility(new AttacksTriggeredAbility(new BoostControlledEffect(2, 0, Duration.EndOfTurn, new FilterCreaturePermanent(), false), false)); + this.addAbility(new AttacksTriggeredAbility(new BoostControlledEffect(2, 0, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, false), false)); } public PatronOfTheAkki(final PatronOfTheAkki card) { diff --git a/Mage.Sets/src/mage/cards/p/PhantasmalImage.java b/Mage.Sets/src/mage/cards/p/PhantasmalImage.java index 74c3b8d1b1..dd271789ac 100644 --- a/Mage.Sets/src/mage/cards/p/PhantasmalImage.java +++ b/Mage.Sets/src/mage/cards/p/PhantasmalImage.java @@ -87,7 +87,7 @@ public class PhantasmalImage extends CardImpl { // You may have Phantasmal Image enter the battlefield as a copy of any creature // on the battlefield, except it's an Illusion in addition to its other types and // it gains "When this creature becomes the target of a spell or ability, sacrifice it." - Effect effect = new CopyPermanentEffect(new FilterCreaturePermanent(), phantasmalImageApplier); + Effect effect = new CopyPermanentEffect(StaticFilters.FILTER_PERMANENT_CREATURE, phantasmalImageApplier); effect.setText(effectText); this.addAbility(new EntersBattlefieldAbility(effect, true)); } diff --git a/Mage.Sets/src/mage/cards/p/PhyrexianDreadnought.java b/Mage.Sets/src/mage/cards/p/PhyrexianDreadnought.java index 75a023eedb..b7ce415ec1 100644 --- a/Mage.Sets/src/mage/cards/p/PhyrexianDreadnought.java +++ b/Mage.Sets/src/mage/cards/p/PhyrexianDreadnought.java @@ -112,7 +112,7 @@ class PhyrexianDreadnoughtSacrificeCost extends CostImpl { @Override public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { int sumPower = 0; - for (Permanent permanent :game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), controllerId, game)) { + for (Permanent permanent :game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, controllerId, game)) { if (!permanent.getId().equals(sourceId)) { sumPower += permanent.getPower().getValue(); } diff --git a/Mage.Sets/src/mage/cards/p/PhyrexianRebirth.java b/Mage.Sets/src/mage/cards/p/PhyrexianRebirth.java index cbcb3af175..c4cca39d5a 100644 --- a/Mage.Sets/src/mage/cards/p/PhyrexianRebirth.java +++ b/Mage.Sets/src/mage/cards/p/PhyrexianRebirth.java @@ -75,7 +75,7 @@ public class PhyrexianRebirth extends CardImpl { @Override public boolean apply(Game game, Ability source) { int count = 0; - for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game)) { count += permanent.destroy(source.getSourceId(), game, false) ? 1 : 0; } PhyrexianRebirthHorrorToken horrorToken = new PhyrexianRebirthHorrorToken(); diff --git a/Mage.Sets/src/mage/cards/p/PlanarCollapse.java b/Mage.Sets/src/mage/cards/p/PlanarCollapse.java index e4d31d9fe2..40f0dbc54e 100644 --- a/Mage.Sets/src/mage/cards/p/PlanarCollapse.java +++ b/Mage.Sets/src/mage/cards/p/PlanarCollapse.java @@ -55,7 +55,7 @@ public class PlanarCollapse extends CardImpl { // At the beginning of your upkeep, if there are four or more creatures on the battlefield, sacrifice Planar Collapse and destroy all creatures. They can't be regenerated. TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new SacrificeSourceEffect(), TargetController.YOU, false); - ability.addEffect(new DestroyAllEffect(new FilterCreaturePermanent(), true)); + ability.addEffect(new DestroyAllEffect(StaticFilters.FILTER_PERMANENT_CREATURE, true)); PlanarCollapseCondition contition = new PlanarCollapseCondition(); this.addAbility(new ConditionalTriggeredAbility(ability, contition, "At the beginning of your upkeep, if there are four or more creatures on the battlefield, sacrifice {this} and destroy all creatures. They can't be regenerated")); @@ -74,7 +74,7 @@ public class PlanarCollapse extends CardImpl { @Override public boolean apply(Game game, Ability source) { - return game.getBattlefield().count(new FilterCreaturePermanent(), source.getSourceId(), source.getControllerId(), game) >= 4; + return game.getBattlefield().count(StaticFilters.FILTER_PERMANENT_CREATURE, source.getSourceId(), source.getControllerId(), game) >= 4; } } } diff --git a/Mage.Sets/src/mage/cards/p/PollenLullaby.java b/Mage.Sets/src/mage/cards/p/PollenLullaby.java index ccbf2a691f..f5c72690d9 100644 --- a/Mage.Sets/src/mage/cards/p/PollenLullaby.java +++ b/Mage.Sets/src/mage/cards/p/PollenLullaby.java @@ -87,7 +87,7 @@ class PollenLullabyEffect extends OneShotEffect { Player player = game.getPlayer(getTargetPointer().getFirst(game, source)); if (player != null) { List doNotUntapNextUntapStep = new ArrayList<>(); - for (Permanent creature : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), player.getId(), game)) { + for (Permanent creature : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, player.getId(), game)) { doNotUntapNextUntapStep.add(creature); } if (!doNotUntapNextUntapStep.isEmpty()) { diff --git a/Mage.Sets/src/mage/cards/p/PrimalRage.java b/Mage.Sets/src/mage/cards/p/PrimalRage.java index 655039b540..e9001042bb 100644 --- a/Mage.Sets/src/mage/cards/p/PrimalRage.java +++ b/Mage.Sets/src/mage/cards/p/PrimalRage.java @@ -48,7 +48,7 @@ public class PrimalRage extends CardImpl { public PrimalRage(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{G}"); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent(), false))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE, false))); } public PrimalRage(final PrimalRage card) { diff --git a/Mage.Sets/src/mage/cards/r/RageReflection.java b/Mage.Sets/src/mage/cards/r/RageReflection.java index 32398cbf30..3bd3cdf390 100644 --- a/Mage.Sets/src/mage/cards/r/RageReflection.java +++ b/Mage.Sets/src/mage/cards/r/RageReflection.java @@ -51,7 +51,7 @@ public class RageReflection extends CardImpl { // Creatures you control have double strike. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(DoubleStrikeAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent(), false))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(DoubleStrikeAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE, false))); } public RageReflection(final RageReflection card) { diff --git a/Mage.Sets/src/mage/cards/r/RainOfDaggers.java b/Mage.Sets/src/mage/cards/r/RainOfDaggers.java index c02217f16a..5694e75363 100644 --- a/Mage.Sets/src/mage/cards/r/RainOfDaggers.java +++ b/Mage.Sets/src/mage/cards/r/RainOfDaggers.java @@ -86,7 +86,7 @@ class RainOfDaggersEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); if (controller != null && getTargetPointer().getFirst(game, source) != null) { int destroyedCreature = 0; - for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), getTargetPointer().getFirst(game, source), game)) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, getTargetPointer().getFirst(game, source), game)) { if (permanent.destroy(source.getSourceId(), game, false)) { destroyedCreature++; } diff --git a/Mage.Sets/src/mage/cards/r/RallyTheRighteous.java b/Mage.Sets/src/mage/cards/r/RallyTheRighteous.java index ca7ad84921..3412a1529d 100644 --- a/Mage.Sets/src/mage/cards/r/RallyTheRighteous.java +++ b/Mage.Sets/src/mage/cards/r/RallyTheRighteous.java @@ -91,7 +91,7 @@ class RallyTheRighteousUntapEffect extends OneShotEffect { if (target != null) { ObjectColor color = target.getColor(game); target.untap(game); - for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), source.getSourceId(), game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), source.getSourceId(), game)) { if (permanent.getColor(game).shares(color) && !permanent.getId().equals(target.getId())) { permanent.untap(game); } @@ -120,7 +120,7 @@ class RallyTheRighteousBoostEffect extends ContinuousEffectImpl { if (target != null) { affectedObjectList.add(new MageObjectReference(target, game)); ObjectColor color = target.getColor(game); - for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), source.getSourceId(), game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), source.getSourceId(), game)) { if (!permanent.getId().equals(target.getId()) && permanent.getColor(game).shares(color)) { affectedObjectList.add(new MageObjectReference(permanent, game)); } diff --git a/Mage.Sets/src/mage/cards/r/RavagerOfTheFells.java b/Mage.Sets/src/mage/cards/r/RavagerOfTheFells.java index 6e777ce1a4..54788b8845 100644 --- a/Mage.Sets/src/mage/cards/r/RavagerOfTheFells.java +++ b/Mage.Sets/src/mage/cards/r/RavagerOfTheFells.java @@ -171,7 +171,7 @@ class RavagerOfTheFellsEffect extends OneShotEffect { class RavagerOfTheFellsTarget extends TargetPermanent { public RavagerOfTheFellsTarget() { - super(0, 1, new FilterCreaturePermanent(), false); + super(0, 1, StaticFilters.FILTER_PERMANENT_CREATURE, false); } public RavagerOfTheFellsTarget(final RavagerOfTheFellsTarget target) { diff --git a/Mage.Sets/src/mage/cards/r/Reciprocate.java b/Mage.Sets/src/mage/cards/r/Reciprocate.java index 9ffae04e16..f26e590da5 100644 --- a/Mage.Sets/src/mage/cards/r/Reciprocate.java +++ b/Mage.Sets/src/mage/cards/r/Reciprocate.java @@ -70,7 +70,7 @@ public class Reciprocate extends CardImpl { class ReciprocateTarget extends TargetPermanent { public ReciprocateTarget() { - super(1, 1, new FilterCreaturePermanent(), false); + super(1, 1, StaticFilters.FILTER_PERMANENT_CREATURE, false); targetName = "creature that dealt damage to you this turn"; } diff --git a/Mage.Sets/src/mage/cards/r/Riddlekeeper.java b/Mage.Sets/src/mage/cards/r/Riddlekeeper.java index 72b2bd4cf2..734f705534 100644 --- a/Mage.Sets/src/mage/cards/r/Riddlekeeper.java +++ b/Mage.Sets/src/mage/cards/r/Riddlekeeper.java @@ -1,68 +1,68 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.cards.r; - -import java.util.UUID; -import mage.MageInt; -import mage.abilities.common.AttacksAllTriggeredAbility; -import mage.abilities.effects.Effect; -import mage.abilities.effects.common.PutTopCardOfLibraryIntoGraveTargetEffect; -import mage.cards.CardImpl; -import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.constants.SetTargetPointer; -import mage.filter.common.FilterCreaturePermanent; - -/** - * - * @author Styxo - */ -public class Riddlekeeper extends CardImpl { - - public Riddlekeeper(UUID ownerId, CardSetInfo setInfo) { - super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}"); - - this.subtype.add("Homunculus"); - this.power = new MageInt(1); - this.toughness = new MageInt(4); - - // Whenever a creature attacks you or a planeswalker you control, that creature's controller puts the top two cards of his or her library into his or her graveyard. - Effect effect = new PutTopCardOfLibraryIntoGraveTargetEffect(2); - effect.setText("that creature's controller puts the top two cards of his or her library into his or her graveyard"); - this.addAbility(new AttacksAllTriggeredAbility(effect, false, new FilterCreaturePermanent(), SetTargetPointer.PLAYER, true, true)); - } - - public Riddlekeeper(final Riddlekeeper card) { - super(card); - } - - @Override - public Riddlekeeper copy() { - return new Riddlekeeper(this); - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.r; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksAllTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.PutTopCardOfLibraryIntoGraveTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SetTargetPointer; +import mage.filter.common.FilterCreaturePermanent; + +/** + * + * @author Styxo + */ +public class Riddlekeeper extends CardImpl { + + public Riddlekeeper(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}"); + + this.subtype.add("Homunculus"); + this.power = new MageInt(1); + this.toughness = new MageInt(4); + + // Whenever a creature attacks you or a planeswalker you control, that creature's controller puts the top two cards of his or her library into his or her graveyard. + Effect effect = new PutTopCardOfLibraryIntoGraveTargetEffect(2); + effect.setText("that creature's controller puts the top two cards of his or her library into his or her graveyard"); + this.addAbility(new AttacksAllTriggeredAbility(effect, false, StaticFilters.FILTER_PERMANENT_CREATURE, SetTargetPointer.PLAYER, true, true)); + } + + public Riddlekeeper(final Riddlekeeper card) { + super(card); + } + + @Override + public Riddlekeeper copy() { + return new Riddlekeeper(this); + } +} diff --git a/Mage.Sets/src/mage/cards/r/RivalsDuel.java b/Mage.Sets/src/mage/cards/r/RivalsDuel.java index e86dd8686f..05b5b8dc21 100644 --- a/Mage.Sets/src/mage/cards/r/RivalsDuel.java +++ b/Mage.Sets/src/mage/cards/r/RivalsDuel.java @@ -50,7 +50,7 @@ public class RivalsDuel extends CardImpl { // Choose two target creatures that share no creature types. Those creatures fight each other. this.getSpellAbility().addEffect(new RivalsDuelFightTargetsEffect()); - this.getSpellAbility().addTarget(new TargetCreaturePermanentWithDifferentTypes(2, 2, new FilterCreaturePermanent(), false)); + this.getSpellAbility().addTarget(new TargetCreaturePermanentWithDifferentTypes(2, 2, StaticFilters.FILTER_PERMANENT_CREATURE, false)); } diff --git a/Mage.Sets/src/mage/cards/s/SageOfTheInwardEye.java b/Mage.Sets/src/mage/cards/s/SageOfTheInwardEye.java index 9549b1d1a2..22f94f9e0a 100644 --- a/Mage.Sets/src/mage/cards/s/SageOfTheInwardEye.java +++ b/Mage.Sets/src/mage/cards/s/SageOfTheInwardEye.java @@ -66,7 +66,7 @@ public class SageOfTheInwardEye extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // Whenever you cast a noncreature spell, creatures you control gain lifelink until end of turn. this.addAbility(new SpellCastControllerTriggeredAbility( - new GainAbilityControlledEffect(LifelinkAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent(), false), + new GainAbilityControlledEffect(LifelinkAbility.getInstance(), Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, false), filterNonCreature, false)); } diff --git a/Mage.Sets/src/mage/cards/s/SakashimasStudent.java b/Mage.Sets/src/mage/cards/s/SakashimasStudent.java index 8a6766c5c2..4963aa71b8 100644 --- a/Mage.Sets/src/mage/cards/s/SakashimasStudent.java +++ b/Mage.Sets/src/mage/cards/s/SakashimasStudent.java @@ -58,7 +58,7 @@ public class SakashimasStudent extends CardImpl { this.addAbility(new NinjutsuAbility(new ManaCostsImpl("{1}{U}"))); // You may have Sakashima's Student enter the battlefield as a copy of any creature on the battlefield, except it's still a Ninja in addition to its other creature types. - Effect effect = new CopyPermanentEffect(new FilterCreaturePermanent(), new AddSubtypeApplier("Ninja")); + Effect effect = new CopyPermanentEffect(StaticFilters.FILTER_PERMANENT_CREATURE, new AddSubtypeApplier("Ninja")); effect.setText("as a copy of any creature on the battlefield, except it's a Ninja in addition to its other creature types"); this.addAbility(new EntersBattlefieldAbility(effect, true)); diff --git a/Mage.Sets/src/mage/cards/s/SanguinePraetor.java b/Mage.Sets/src/mage/cards/s/SanguinePraetor.java index ab972b0fc4..f1bfd6dd20 100644 --- a/Mage.Sets/src/mage/cards/s/SanguinePraetor.java +++ b/Mage.Sets/src/mage/cards/s/SanguinePraetor.java @@ -98,7 +98,7 @@ class SanguinePraetorEffect extends OneShotEffect { } } - for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game)) { if (permanent.getConvertedManaCost() == cmc) { permanent.destroy(source.getSourceId(), game, false); } diff --git a/Mage.Sets/src/mage/cards/s/SavageBeating.java b/Mage.Sets/src/mage/cards/s/SavageBeating.java index a8a4e601db..fd5ee2a9dd 100644 --- a/Mage.Sets/src/mage/cards/s/SavageBeating.java +++ b/Mage.Sets/src/mage/cards/s/SavageBeating.java @@ -59,7 +59,7 @@ public class SavageBeating extends CardImpl { "Cast {this} only during your turn and only during combat")); // Choose one - Creatures you control gain double strike until end of turn; - this.getSpellAbility().addEffect(new GainAbilityControlledEffect(DoubleStrikeAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent(), false)); + this.getSpellAbility().addEffect(new GainAbilityControlledEffect(DoubleStrikeAbility.getInstance(), Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, false)); // or untap all creatures you control and after this phase, there is an additional combat phase. Mode mode = new Mode(); diff --git a/Mage.Sets/src/mage/cards/s/ScarscaleRitual.java b/Mage.Sets/src/mage/cards/s/ScarscaleRitual.java index 5f2227cf53..61a979fd9c 100644 --- a/Mage.Sets/src/mage/cards/s/ScarscaleRitual.java +++ b/Mage.Sets/src/mage/cards/s/ScarscaleRitual.java @@ -83,7 +83,7 @@ class ScarscaleRitualCost extends CostImpl { @Override public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) { - for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), controllerId, game)) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, controllerId, game)) { return permanent != null; } return false; diff --git a/Mage.Sets/src/mage/cards/s/ScreamsFromWithin.java b/Mage.Sets/src/mage/cards/s/ScreamsFromWithin.java index 7ec1152a29..6b6dbe2e54 100644 --- a/Mage.Sets/src/mage/cards/s/ScreamsFromWithin.java +++ b/Mage.Sets/src/mage/cards/s/ScreamsFromWithin.java @@ -100,7 +100,7 @@ class ScreamsFromWithinEffect extends OneShotEffect { Card aura = game.getCard(source.getSourceId()); Player player = game.getPlayer(source.getControllerId()); if (aura != null && game.getState().getZone(source.getSourceId()) == Zone.GRAVEYARD && player != null && player.getGraveyard().contains(source.getSourceId())) { - for (Permanent creaturePermanent : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), game)) { + for (Permanent creaturePermanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, game)) { for (Target target : aura.getSpellAbility().getTargets()) { if (target.canTarget(creaturePermanent.getId(), game)) { return player.moveCards(aura, Zone.BATTLEFIELD, source, game); diff --git a/Mage.Sets/src/mage/cards/s/SeaKingsBlessing.java b/Mage.Sets/src/mage/cards/s/SeaKingsBlessing.java index 91be754b45..9c195ac944 100644 --- a/Mage.Sets/src/mage/cards/s/SeaKingsBlessing.java +++ b/Mage.Sets/src/mage/cards/s/SeaKingsBlessing.java @@ -53,7 +53,7 @@ public class SeaKingsBlessing extends CardImpl { Effect effect = new BecomesColorTargetEffect(ObjectColor.BLUE, Duration.EndOfTurn); effect.setText("Any number of target creatures become blue until end of turn"); this.getSpellAbility().addEffect(effect); - this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, Integer.MAX_VALUE, new FilterCreaturePermanent(), false)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, Integer.MAX_VALUE, StaticFilters.FILTER_PERMANENT_CREATURE, false)); } diff --git a/Mage.Sets/src/mage/cards/s/SelvalaHeartOfTheWilds.java b/Mage.Sets/src/mage/cards/s/SelvalaHeartOfTheWilds.java index 40c56f5ba8..b5cee75e26 100644 --- a/Mage.Sets/src/mage/cards/s/SelvalaHeartOfTheWilds.java +++ b/Mage.Sets/src/mage/cards/s/SelvalaHeartOfTheWilds.java @@ -142,7 +142,7 @@ class GreatestPowerPredicate implements Predicate { for (UUID playerId : game.getPlayerList()) { Player player = game.getPlayer(playerId); if (player != null) { - for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), playerId, game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, playerId, game)) { if (permanent.getPower().getValue() >= power && !permanent.equals(input)) { return false; //we found something with equal/more power } diff --git a/Mage.Sets/src/mage/cards/s/ServantOfVolrath.java b/Mage.Sets/src/mage/cards/s/ServantOfVolrath.java index bdfe4c5d4a..fc3fabf0da 100644 --- a/Mage.Sets/src/mage/cards/s/ServantOfVolrath.java +++ b/Mage.Sets/src/mage/cards/s/ServantOfVolrath.java @@ -49,7 +49,7 @@ public class ServantOfVolrath extends CardImpl { this.toughness = new MageInt(3); // When Servant of Volrath leaves the battlefield, sacrifice a creature. - this.addAbility(new LeavesBattlefieldTriggeredAbility(new SacrificeControllerEffect(new FilterCreaturePermanent(), 1, ""), false)); + this.addAbility(new LeavesBattlefieldTriggeredAbility(new SacrificeControllerEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 1, ""), false)); } public ServantOfVolrath(final ServantOfVolrath card) { diff --git a/Mage.Sets/src/mage/cards/s/ShadowbornDemon.java b/Mage.Sets/src/mage/cards/s/ShadowbornDemon.java index d5f71de674..d368bb3e3f 100644 --- a/Mage.Sets/src/mage/cards/s/ShadowbornDemon.java +++ b/Mage.Sets/src/mage/cards/s/ShadowbornDemon.java @@ -81,7 +81,7 @@ public class ShadowbornDemon extends CardImpl { // At the beginning of your upkeep, if there are fewer than six creature cards in your graveyard, sacrifice a creature. this.addAbility(new ConditionalTriggeredAbility( - new BeginningOfUpkeepTriggeredAbility(new SacrificeControllerEffect(new FilterCreaturePermanent(), 1, ""), TargetController.YOU, false), + new BeginningOfUpkeepTriggeredAbility(new SacrificeControllerEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 1, ""), TargetController.YOU, false), new InvertCondition(new CreatureCardsInControllerGraveCondition(6)), "At the beginning of your upkeep, if there are fewer than six creature cards in your graveyard, sacrifice a creature")); diff --git a/Mage.Sets/src/mage/cards/s/ShieldsOfVelisVel.java b/Mage.Sets/src/mage/cards/s/ShieldsOfVelisVel.java index 59df991376..f4dc79d5b9 100644 --- a/Mage.Sets/src/mage/cards/s/ShieldsOfVelisVel.java +++ b/Mage.Sets/src/mage/cards/s/ShieldsOfVelisVel.java @@ -94,7 +94,7 @@ class ShieldsOfVelisVelGainEffect extends ContinuousEffectImpl { public void init(Ability source, Game game) { super.init(source, game); if (this.affectedObjectsSet) { - List creatures = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getFirstTarget(), game); + List creatures = game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getFirstTarget(), game); for (Permanent creature : creatures) { affectedObjectList.add(new MageObjectReference(creature, game)); } diff --git a/Mage.Sets/src/mage/cards/s/ShockmawDragon.java b/Mage.Sets/src/mage/cards/s/ShockmawDragon.java index f7884d4142..be2dfc1118 100644 --- a/Mage.Sets/src/mage/cards/s/ShockmawDragon.java +++ b/Mage.Sets/src/mage/cards/s/ShockmawDragon.java @@ -87,7 +87,7 @@ class ShockmawDragonEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player player = game.getPlayer(targetPointer.getFirst(game, source)); if (player != null) { - List creatures = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), player.getId(), game); + List creatures = game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, player.getId(), game); for (Permanent creature : creatures) { if (creature != null) { creature.damage(1, source.getSourceId(), game, false, true); diff --git a/Mage.Sets/src/mage/cards/s/ShowOfDominance.java b/Mage.Sets/src/mage/cards/s/ShowOfDominance.java index 294e6086e4..098e42bf1a 100644 --- a/Mage.Sets/src/mage/cards/s/ShowOfDominance.java +++ b/Mage.Sets/src/mage/cards/s/ShowOfDominance.java @@ -98,7 +98,7 @@ class ShowOfDominanceEffect extends OneShotEffect { if (controller != null) { int highestPower = Integer.MIN_VALUE; Permanent selectedCreature = null; - for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), controller.getId(), game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, controller.getId(), game)) { if (highestPower < permanent.getPower().getValue()) { highestPower = permanent.getPower().getValue(); selectedCreature = permanent; diff --git a/Mage.Sets/src/mage/cards/s/SigilBlessing.java b/Mage.Sets/src/mage/cards/s/SigilBlessing.java index 9437c24039..aa76acf0b9 100644 --- a/Mage.Sets/src/mage/cards/s/SigilBlessing.java +++ b/Mage.Sets/src/mage/cards/s/SigilBlessing.java @@ -87,7 +87,7 @@ class SigilBlessingBoostControlledEffect extends ContinuousEffectImpl { @Override public void init(Ability source, Game game) { super.init(source, game); - for (Permanent perm : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) { + for (Permanent perm : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game)) { affectedObjectList.add(new MageObjectReference(perm, game)); } } diff --git a/Mage.Sets/src/mage/cards/s/SilumgarTheDriftingDeath.java b/Mage.Sets/src/mage/cards/s/SilumgarTheDriftingDeath.java index 703b397f5a..c11af73e33 100644 --- a/Mage.Sets/src/mage/cards/s/SilumgarTheDriftingDeath.java +++ b/Mage.Sets/src/mage/cards/s/SilumgarTheDriftingDeath.java @@ -115,7 +115,7 @@ class UnboostCreaturesTargetPlayerEffect extends ContinuousEffectImpl { public void init(Ability source, Game game) { super.init(source, game); if (this.affectedObjectsSet) { - for (Permanent creature : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), getTargetPointer().getFirst(game, source), game)) { + for (Permanent creature : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, getTargetPointer().getFirst(game, source), game)) { affectedObjectList.add(new MageObjectReference(creature, game)); } } diff --git a/Mage.Sets/src/mage/cards/s/Sleep.java b/Mage.Sets/src/mage/cards/s/Sleep.java index c13ed6dc4c..425a23cf78 100644 --- a/Mage.Sets/src/mage/cards/s/Sleep.java +++ b/Mage.Sets/src/mage/cards/s/Sleep.java @@ -84,7 +84,7 @@ class SleepEffect extends OneShotEffect { Player player = game.getPlayer(source.getFirstTarget()); if (player != null) { List doNotUntapNextUntapStep = new ArrayList<>(); - for (Permanent creature : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), player.getId(), game)) { + for (Permanent creature : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, player.getId(), game)) { creature.tap(game); doNotUntapNextUntapStep.add(creature); } diff --git a/Mage.Sets/src/mage/cards/s/SlumberingDragon.java b/Mage.Sets/src/mage/cards/s/SlumberingDragon.java index 9cd88fee37..4b4a8b49d5 100644 --- a/Mage.Sets/src/mage/cards/s/SlumberingDragon.java +++ b/Mage.Sets/src/mage/cards/s/SlumberingDragon.java @@ -66,7 +66,7 @@ public class SlumberingDragon extends CardImpl { this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SlumberingDragonEffect())); // Whenever a creature attacks you or a planeswalker you control, put a +1/+1 counter on Slumbering Dragon. - this.addAbility(new AttacksAllTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false, new FilterCreaturePermanent(), SetTargetPointer.PERMANENT, true)); + this.addAbility(new AttacksAllTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false, StaticFilters.FILTER_PERMANENT_CREATURE, SetTargetPointer.PERMANENT, true)); } public SlumberingDragon(final SlumberingDragon card) { diff --git a/Mage.Sets/src/mage/cards/s/SoltariChampion.java b/Mage.Sets/src/mage/cards/s/SoltariChampion.java index 2e2e7f642d..16814288bb 100644 --- a/Mage.Sets/src/mage/cards/s/SoltariChampion.java +++ b/Mage.Sets/src/mage/cards/s/SoltariChampion.java @@ -55,7 +55,7 @@ public class SoltariChampion extends CardImpl { // Shadow this.addAbility(ShadowAbility.getInstance()); // Whenever Soltari Champion attacks, other creatures you control get +1/+1 until end of turn. - this.addAbility(new AttacksTriggeredAbility(new BoostControlledEffect(1, 1, Duration.EndOfTurn, new FilterCreaturePermanent(), true), false)); + this.addAbility(new AttacksTriggeredAbility(new BoostControlledEffect(1, 1, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, true), false)); } public SoltariChampion(final SoltariChampion card) { diff --git a/Mage.Sets/src/mage/cards/s/SpareFromEvil.java b/Mage.Sets/src/mage/cards/s/SpareFromEvil.java index d962f1d6b1..c16c9d5f36 100644 --- a/Mage.Sets/src/mage/cards/s/SpareFromEvil.java +++ b/Mage.Sets/src/mage/cards/s/SpareFromEvil.java @@ -57,7 +57,7 @@ public class SpareFromEvil extends CardImpl { // Creatures you control gain protection from non-Human creatures until end of turn. - this.getSpellAbility().addEffect(new GainAbilityControlledEffect(new ProtectionAbility(filterNonHuman), Duration.EndOfTurn, new FilterCreaturePermanent(), false)); + this.getSpellAbility().addEffect(new GainAbilityControlledEffect(new ProtectionAbility(filterNonHuman), Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, false)); } public SpareFromEvil(final SpareFromEvil card) { diff --git a/Mage.Sets/src/mage/cards/s/SpreadingPlague.java b/Mage.Sets/src/mage/cards/s/SpreadingPlague.java index a28a71ab74..551f43c6be 100644 --- a/Mage.Sets/src/mage/cards/s/SpreadingPlague.java +++ b/Mage.Sets/src/mage/cards/s/SpreadingPlague.java @@ -57,7 +57,7 @@ public class SpreadingPlague extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{4}{B}"); // Whenever a creature enters the battlefield, destroy all other creatures that share a color with it. They can't be regenerated. - this.addAbility(new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new SpreadingPlagueEffect(), new FilterCreaturePermanent(), false, SetTargetPointer.PERMANENT, RULE)); + this.addAbility(new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new SpreadingPlagueEffect(), StaticFilters.FILTER_PERMANENT_CREATURE, false, SetTargetPointer.PERMANENT, RULE)); } diff --git a/Mage.Sets/src/mage/cards/s/StoneforgeMasterwork.java b/Mage.Sets/src/mage/cards/s/StoneforgeMasterwork.java index fa3d53ccfe..fe670dd876 100644 --- a/Mage.Sets/src/mage/cards/s/StoneforgeMasterwork.java +++ b/Mage.Sets/src/mage/cards/s/StoneforgeMasterwork.java @@ -83,7 +83,7 @@ class StoneforgeMasterworkDynamicValue implements DynamicValue { if (equipment != null && equipment.getAttachedTo() != null) { Permanent equipped = game.getPermanent(equipment.getAttachedTo()); if (equipped != null) { - for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), sourceAbility.getControllerId(), game)) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, sourceAbility.getControllerId(), game)) { if (!permanent.getId().equals(equipped.getId())) { if (equipped.shareSubtypes(permanent, game)) { xValue++; diff --git a/Mage.Sets/src/mage/cards/s/StrongholdDiscipline.java b/Mage.Sets/src/mage/cards/s/StrongholdDiscipline.java index c8dd30ecf4..bb72c2d8fe 100644 --- a/Mage.Sets/src/mage/cards/s/StrongholdDiscipline.java +++ b/Mage.Sets/src/mage/cards/s/StrongholdDiscipline.java @@ -82,7 +82,7 @@ class StrongholdDisciplineEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { - final int count = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), playerId, game).size(); + final int count = game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, playerId, game).size(); if (count > 0) { Player player = game.getPlayer(playerId); if (player != null) { diff --git a/Mage.Sets/src/mage/cards/s/SublimeArchangel.java b/Mage.Sets/src/mage/cards/s/SublimeArchangel.java index ad088d1dd4..d1c602abeb 100644 --- a/Mage.Sets/src/mage/cards/s/SublimeArchangel.java +++ b/Mage.Sets/src/mage/cards/s/SublimeArchangel.java @@ -59,7 +59,7 @@ public class SublimeArchangel extends CardImpl { this.addAbility(new ExaltedAbility()); // Other creatures you control have exalted. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, - new GainAbilityControlledEffect(new ExaltedAbility(), Duration.WhileOnBattlefield, new FilterCreaturePermanent(), true))); + new GainAbilityControlledEffect(new ExaltedAbility(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE, true))); } public SublimeArchangel(final SublimeArchangel card) { diff --git a/Mage.Sets/src/mage/cards/s/SuddenSpoiling.java b/Mage.Sets/src/mage/cards/s/SuddenSpoiling.java index 0734580f6c..1aee5ca020 100644 --- a/Mage.Sets/src/mage/cards/s/SuddenSpoiling.java +++ b/Mage.Sets/src/mage/cards/s/SuddenSpoiling.java @@ -94,7 +94,7 @@ class SuddenSpoilingEffect extends ContinuousEffectImpl { super.init(source, game); Player player = game.getPlayer(this.getTargetPointer().getFirst(game, source)); if (player != null) { - for (Permanent perm: game.getState().getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), player.getId(), game)) { + for (Permanent perm: game.getState().getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, player.getId(), game)) { affectedObjectList.add(new MageObjectReference(perm, game)); } } @@ -104,7 +104,7 @@ class SuddenSpoilingEffect extends ContinuousEffectImpl { public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { Player player = game.getPlayer(this.getTargetPointer().getFirst(game, source)); if (player != null) { - for (Permanent permanent : game.getState().getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), player.getId(), game)) { + for (Permanent permanent : game.getState().getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, player.getId(), game)) { if (affectedObjectList.contains(new MageObjectReference(permanent, game))) { switch (layer) { case AbilityAddingRemovingEffects_6: diff --git a/Mage.Sets/src/mage/cards/s/SunbladeElf.java b/Mage.Sets/src/mage/cards/s/SunbladeElf.java index 9d8a8d18ef..6ed4b056c9 100644 --- a/Mage.Sets/src/mage/cards/s/SunbladeElf.java +++ b/Mage.Sets/src/mage/cards/s/SunbladeElf.java @@ -67,7 +67,7 @@ public class SunbladeElf extends CardImpl { // Sunblade Elf gets +1/+1 as long as you control a Plains. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceWhileControlsEffect(filter, 1, 1))); // {4}{W}: Creatures you control get +1/+1 until end of turn. - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.EndOfTurn, new FilterCreaturePermanent(), false), new ManaCostsImpl("{4}{W}"))); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, false), new ManaCostsImpl("{4}{W}"))); } diff --git a/Mage.Sets/src/mage/cards/s/SurgeOfZeal.java b/Mage.Sets/src/mage/cards/s/SurgeOfZeal.java index 8c0bd1223f..c0a4a2144d 100644 --- a/Mage.Sets/src/mage/cards/s/SurgeOfZeal.java +++ b/Mage.Sets/src/mage/cards/s/SurgeOfZeal.java @@ -95,7 +95,7 @@ class SurgeOfZealEffect extends OneShotEffect { Permanent target = game.getPermanent(getTargetPointer().getFirst(game, source)); if (target != null) { ObjectColor color = target.getColor(game); - for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), source.getSourceId(), game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), source.getSourceId(), game)) { if (permanent.getColor(game).shares(color)) { ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn); effect.setTargetPointer(new FixedTarget(permanent, game)); diff --git a/Mage.Sets/src/mage/cards/s/SurrakDragonclaw.java b/Mage.Sets/src/mage/cards/s/SurrakDragonclaw.java index 44624f9af5..365a893a74 100644 --- a/Mage.Sets/src/mage/cards/s/SurrakDragonclaw.java +++ b/Mage.Sets/src/mage/cards/s/SurrakDragonclaw.java @@ -79,7 +79,7 @@ public class SurrakDragonclaw extends CardImpl { // Other creatures you control have trample. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, - new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent(), true))); + new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE, true))); } diff --git a/Mage.Sets/src/mage/cards/s/SwayOfIllusion.java b/Mage.Sets/src/mage/cards/s/SwayOfIllusion.java index d8741adf0f..a57e0804f7 100644 --- a/Mage.Sets/src/mage/cards/s/SwayOfIllusion.java +++ b/Mage.Sets/src/mage/cards/s/SwayOfIllusion.java @@ -51,7 +51,7 @@ public class SwayOfIllusion extends CardImpl { Effect effect = new BecomesColorTargetEffect(Duration.EndOfTurn); effect.setText("Any number of target creatures become the color of your choice until end of turn"); this.getSpellAbility().addEffect(effect); - this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, Integer.MAX_VALUE, new FilterCreaturePermanent(), false)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, Integer.MAX_VALUE, StaticFilters.FILTER_PERMANENT_CREATURE, false)); // Draw a card. this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); diff --git a/Mage.Sets/src/mage/cards/s/SylvanParadise.java b/Mage.Sets/src/mage/cards/s/SylvanParadise.java index 95403c173b..256bebe547 100644 --- a/Mage.Sets/src/mage/cards/s/SylvanParadise.java +++ b/Mage.Sets/src/mage/cards/s/SylvanParadise.java @@ -53,7 +53,7 @@ public class SylvanParadise extends CardImpl { Effect effect = new BecomesColorTargetEffect(ObjectColor.GREEN, Duration.EndOfTurn); effect.setText("Any number of target creatures become green until end of turn"); this.getSpellAbility().addEffect(effect); - this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, Integer.MAX_VALUE, new FilterCreaturePermanent(), false)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, Integer.MAX_VALUE, StaticFilters.FILTER_PERMANENT_CREATURE, false)); } diff --git a/Mage.Sets/src/mage/cards/s/SyntheticDestiny.java b/Mage.Sets/src/mage/cards/s/SyntheticDestiny.java index 2b26417e2b..795bdb9b74 100644 --- a/Mage.Sets/src/mage/cards/s/SyntheticDestiny.java +++ b/Mage.Sets/src/mage/cards/s/SyntheticDestiny.java @@ -91,7 +91,7 @@ class SyntheticDestinyEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Set cardsToExile = new HashSet<>(); - cardsToExile.addAll(game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), controller.getId(), game)); + cardsToExile.addAll(game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, controller.getId(), game)); controller.moveCards(cardsToExile, Zone.EXILED, source, game); //Delayed ability game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility( diff --git a/Mage.Sets/src/mage/cards/t/Tenacity.java b/Mage.Sets/src/mage/cards/t/Tenacity.java index 302720c173..9126b42d4e 100644 --- a/Mage.Sets/src/mage/cards/t/Tenacity.java +++ b/Mage.Sets/src/mage/cards/t/Tenacity.java @@ -54,7 +54,7 @@ public class Tenacity extends CardImpl { boost.setText("Creatures you control get +1/+1"); this.getSpellAbility().addEffect(boost); this.getSpellAbility().addEffect(new GainAbilityAllEffect(LifelinkAbility.getInstance(), Duration.EndOfTurn, new FilterControlledCreaturePermanent(), " and gain lifelink until end of turn")); - this.getSpellAbility().addEffect(new UntapAllControllerEffect(new FilterCreaturePermanent(),"Untap those creatures")); + this.getSpellAbility().addEffect(new UntapAllControllerEffect(StaticFilters.FILTER_PERMANENT_CREATURE,"Untap those creatures")); } public Tenacity(final Tenacity card) { diff --git a/Mage.Sets/src/mage/cards/t/TibaltTheFiendBlooded.java b/Mage.Sets/src/mage/cards/t/TibaltTheFiendBlooded.java index bd5dd4c290..b062349d67 100644 --- a/Mage.Sets/src/mage/cards/t/TibaltTheFiendBlooded.java +++ b/Mage.Sets/src/mage/cards/t/TibaltTheFiendBlooded.java @@ -144,7 +144,7 @@ class TibaltTheFiendBloodedThirdEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - List permanents = game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), source.getSourceId(), game); + List permanents = game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), source.getSourceId(), game); for (Permanent permanent : permanents) { permanent.untap(game); diff --git a/Mage.Sets/src/mage/cards/t/ToTheSlaughter.java b/Mage.Sets/src/mage/cards/t/ToTheSlaughter.java index 209cd8cffa..ceafd2c471 100644 --- a/Mage.Sets/src/mage/cards/t/ToTheSlaughter.java +++ b/Mage.Sets/src/mage/cards/t/ToTheSlaughter.java @@ -57,7 +57,7 @@ public class ToTheSlaughter extends CardImpl { // Delirium — If there are four or more card types among cards in your graveyard, instead that player sacrifices a creature and a planeswalker. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( - new SacrificeEffect(new FilterCreaturePermanent(), 1, "Target player"), + new SacrificeEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 1, "Target player"), DeliriumCondition.instance, "
Delirium — If there are four or more card types among cards in your graveyard, instead that player sacrifices a creature")); this.getSpellAbility().addEffect(new ConditionalOneShotEffect( diff --git a/Mage.Sets/src/mage/cards/t/TouchOfDarkness.java b/Mage.Sets/src/mage/cards/t/TouchOfDarkness.java index 6ad5142eea..abc40ebde6 100644 --- a/Mage.Sets/src/mage/cards/t/TouchOfDarkness.java +++ b/Mage.Sets/src/mage/cards/t/TouchOfDarkness.java @@ -53,7 +53,7 @@ public class TouchOfDarkness extends CardImpl { Effect effect = new BecomesColorTargetEffect(ObjectColor.BLACK, Duration.EndOfTurn); effect.setText("Any number of target creatures become black until end of turn"); this.getSpellAbility().addEffect(effect); - this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, Integer.MAX_VALUE, new FilterCreaturePermanent(), false)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, Integer.MAX_VALUE, StaticFilters.FILTER_PERMANENT_CREATURE, false)); } diff --git a/Mage.Sets/src/mage/cards/t/TritonTactics.java b/Mage.Sets/src/mage/cards/t/TritonTactics.java index 91e186877f..5a93fdf5b8 100644 --- a/Mage.Sets/src/mage/cards/t/TritonTactics.java +++ b/Mage.Sets/src/mage/cards/t/TritonTactics.java @@ -186,7 +186,7 @@ class TritonTacticsEndOfCombatEffect extends OneShotEffect { attackerMap = (Map>) object; for (Set attackerSet : attackerMap.values()) { List doNotUntapNextUntapStep = new ArrayList<>(); - for (Permanent creature : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) { + for (Permanent creature : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game)) { if (attackerSet.contains(CardUtil.getCardZoneString(null, creature.getId(), game))) { // tap creature and add the not untap effect creature.tap(game); diff --git a/Mage.Sets/src/mage/cards/t/Tromokratis.java b/Mage.Sets/src/mage/cards/t/Tromokratis.java index e83614ca77..c8484b5c80 100644 --- a/Mage.Sets/src/mage/cards/t/Tromokratis.java +++ b/Mage.Sets/src/mage/cards/t/Tromokratis.java @@ -145,7 +145,7 @@ class CantBeBlockedUnlessAllEffect extends RestrictionEffect { for(UUID blockerId :combatGroup.getBlockers()) { Permanent blockingCreature = game.getPermanent(blockerId); if (blockingCreature != null) { - for (Permanent permanent: game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), blockingCreature.getControllerId(), game)) { + for (Permanent permanent: game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, blockingCreature.getControllerId(), game)) { if (!combatGroup.getBlockers().contains(permanent.getId())) { // not all creatures block Tromokratis return false; diff --git a/Mage.Sets/src/mage/cards/t/TrompTheDomains.java b/Mage.Sets/src/mage/cards/t/TrompTheDomains.java index 9e0370e24c..d981e59cad 100644 --- a/Mage.Sets/src/mage/cards/t/TrompTheDomains.java +++ b/Mage.Sets/src/mage/cards/t/TrompTheDomains.java @@ -54,7 +54,7 @@ public class TrompTheDomains extends CardImpl { effect.setText("Domain - Until end of turn, creatures you control gain Trample"); this.getSpellAbility().addEffect(effect); DynamicValue domain = new DomainValue(); - effect = new BoostControlledEffect(domain, domain, Duration.EndOfTurn, new FilterCreaturePermanent(), false); + effect = new BoostControlledEffect(domain, domain, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, false); effect.setText("and get +1/+1 for each basic land type among lands you control"); this.getSpellAbility().addEffect(effect); diff --git a/Mage.Sets/src/mage/cards/t/TwistAllegiance.java b/Mage.Sets/src/mage/cards/t/TwistAllegiance.java index d761b03567..cdcb2f7601 100644 --- a/Mage.Sets/src/mage/cards/t/TwistAllegiance.java +++ b/Mage.Sets/src/mage/cards/t/TwistAllegiance.java @@ -92,7 +92,7 @@ class TwistAllegianceEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); Player targetOpponent = game.getPlayer(getTargetPointer().getFirst(game, source)); if (controller != null) { - for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), source.getSourceId(), game)) { + for (Permanent permanent: game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), source.getSourceId(), game)) { // only creatures of controller & target opponent if (permanent.getControllerId().equals(source.getControllerId()) || permanent.getControllerId().equals(targetOpponent.getId())) { UUID newController = permanent.getControllerId().equals(source.getControllerId()) ? targetOpponent.getId() : source.getControllerId(); diff --git a/Mage.Sets/src/mage/cards/v/VelaTheNightClad.java b/Mage.Sets/src/mage/cards/v/VelaTheNightClad.java index 5e1803ecef..b202d2e033 100644 --- a/Mage.Sets/src/mage/cards/v/VelaTheNightClad.java +++ b/Mage.Sets/src/mage/cards/v/VelaTheNightClad.java @@ -71,7 +71,7 @@ public class VelaTheNightClad extends CardImpl { this.addAbility(new SimpleStaticAbility( Zone.BATTLEFIELD, new GainAbilityControlledEffect(IntimidateAbility.getInstance(), - Duration.WhileOnBattlefield, new FilterCreaturePermanent(), true ))); + Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE, true ))); // Whenever Vela the Night-Clad or another creature you control leaves the battlefield, each opponent loses 1 life. Ability ability = new ZoneChangeAllTriggeredAbility( Zone.BATTLEFIELD, diff --git a/Mage.Sets/src/mage/cards/v/VesuvanShapeshifter.java b/Mage.Sets/src/mage/cards/v/VesuvanShapeshifter.java index 6828fd9fd2..e8c22d51ee 100644 --- a/Mage.Sets/src/mage/cards/v/VesuvanShapeshifter.java +++ b/Mage.Sets/src/mage/cards/v/VesuvanShapeshifter.java @@ -79,7 +79,7 @@ public class VesuvanShapeshifter extends CardImpl { this.addAbility(ability); // As Vesuvan Shapeshifter etbs, you may choose another creature. If you do, until Vesuvan Shapeshifter is turned face down, it becomes a copy of that creature - Effect effect = new CopyPermanentEffect(new FilterCreaturePermanent(), new VesuvanShapeShifterFaceUpApplier()); + Effect effect = new CopyPermanentEffect(StaticFilters.FILTER_PERMANENT_CREATURE, new VesuvanShapeShifterFaceUpApplier()); effect.setText(effectText); ability = new EntersBattlefieldAbility(effect, true); ability.setWorksFaceDown(false); diff --git a/Mage.Sets/src/mage/cards/v/VillageSurvivors.java b/Mage.Sets/src/mage/cards/v/VillageSurvivors.java index 90ccf5aa91..2ef94b8a78 100644 --- a/Mage.Sets/src/mage/cards/v/VillageSurvivors.java +++ b/Mage.Sets/src/mage/cards/v/VillageSurvivors.java @@ -58,7 +58,7 @@ public class VillageSurvivors extends CardImpl { this.addAbility(VigilanceAbility.getInstance()); // Fateful hour - As long as you have 5 or less life, other creatures you control have vigilance. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( - new GainAbilityControlledEffect(VigilanceAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent(), true), + new GainAbilityControlledEffect(VigilanceAbility.getInstance(), Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT_CREATURE, true), FatefulHourCondition.instance, "Fateful hour - As long as you have 5 or less life, other creatures you control have vigilance"))); } diff --git a/Mage.Sets/src/mage/cards/v/VindictiveMob.java b/Mage.Sets/src/mage/cards/v/VindictiveMob.java index 68cdae91a2..565e290f37 100644 --- a/Mage.Sets/src/mage/cards/v/VindictiveMob.java +++ b/Mage.Sets/src/mage/cards/v/VindictiveMob.java @@ -61,7 +61,7 @@ public class VindictiveMob extends CardImpl { this.toughness = new MageInt(5); // When Vindictive Mob enters the battlefield, sacrifice a creature. - this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeControllerEffect(new FilterCreaturePermanent(), 1, null))); + this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeControllerEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 1, null))); // Vindictive Mob can't be blocked by Saprolings. this.addAbility(new SimpleEvasionAbility(new CantBeBlockedByCreaturesSourceEffect(filter, Duration.WhileOnBattlefield))); diff --git a/Mage.Sets/src/mage/cards/v/Vitalize.java b/Mage.Sets/src/mage/cards/v/Vitalize.java index 26af731000..9320a5d170 100644 --- a/Mage.Sets/src/mage/cards/v/Vitalize.java +++ b/Mage.Sets/src/mage/cards/v/Vitalize.java @@ -45,7 +45,7 @@ public class Vitalize extends CardImpl { // Untap all creatures you control. - this.getSpellAbility().addEffect(new UntapAllControllerEffect(new FilterCreaturePermanent(), "Untap all creatures you control")); + this.getSpellAbility().addEffect(new UntapAllControllerEffect(StaticFilters.FILTER_PERMANENT_CREATURE, "Untap all creatures you control")); } public Vitalize(final Vitalize card) { diff --git a/Mage.Sets/src/mage/cards/v/VolatileRig.java b/Mage.Sets/src/mage/cards/v/VolatileRig.java index 79b45ce219..0810ef7856 100644 --- a/Mage.Sets/src/mage/cards/v/VolatileRig.java +++ b/Mage.Sets/src/mage/cards/v/VolatileRig.java @@ -190,7 +190,7 @@ class VolatileRigEffect2 extends OneShotEffect { if (player != null) { if (!player.flipCoin(game)) { - List permanents = game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game); + List permanents = game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game); for (Permanent permanent: permanents) { permanent.damage(4, source.getSourceId(), game, false, true); } diff --git a/Mage.Sets/src/mage/cards/v/VolcanicEruption.java b/Mage.Sets/src/mage/cards/v/VolcanicEruption.java index b96d9a9a71..b540b4e1a0 100644 --- a/Mage.Sets/src/mage/cards/v/VolcanicEruption.java +++ b/Mage.Sets/src/mage/cards/v/VolcanicEruption.java @@ -112,7 +112,7 @@ class VolcanicEruptionEffect extends OneShotEffect { } if (destroyedCount > 0) { - List permanents = game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game); + List permanents = game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game); for (Permanent permanent: permanents) { permanent.damage(destroyedCount, source.getSourceId(), game, false, true); } diff --git a/Mage.Sets/src/mage/cards/w/WarFlare.java b/Mage.Sets/src/mage/cards/w/WarFlare.java index 90e870ea4a..0c6fbb3090 100644 --- a/Mage.Sets/src/mage/cards/w/WarFlare.java +++ b/Mage.Sets/src/mage/cards/w/WarFlare.java @@ -47,7 +47,7 @@ public class WarFlare extends CardImpl { // Creatures you control get +2/+1 until end of turn. Untap those creatures. this.getSpellAbility().addEffect(new BoostControlledEffect(2, 1, Duration.EndOfTurn)); - this.getSpellAbility().addEffect(new UntapAllControllerEffect(new FilterCreaturePermanent(),"Untap those creatures")); + this.getSpellAbility().addEffect(new UntapAllControllerEffect(StaticFilters.FILTER_PERMANENT_CREATURE,"Untap those creatures")); } public WarFlare(final WarFlare card) { diff --git a/Mage.Sets/src/mage/cards/w/WarReport.java b/Mage.Sets/src/mage/cards/w/WarReport.java index 9821592474..4c35ed7173 100644 --- a/Mage.Sets/src/mage/cards/w/WarReport.java +++ b/Mage.Sets/src/mage/cards/w/WarReport.java @@ -83,7 +83,7 @@ class WarReportEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { - int lifeToGain = game.getBattlefield().count(new FilterCreaturePermanent(), source.getSourceId(), source.getControllerId(), game); + int lifeToGain = game.getBattlefield().count(StaticFilters.FILTER_PERMANENT_CREATURE, source.getSourceId(), source.getControllerId(), game); lifeToGain += game.getBattlefield().count(new FilterArtifactPermanent(), source.getSourceId(), source.getControllerId(), game); player.gainLife(lifeToGain, game); } diff --git a/Mage.Sets/src/mage/cards/w/WardOfBones.java b/Mage.Sets/src/mage/cards/w/WardOfBones.java index b2dea634d1..5105b6c654 100644 --- a/Mage.Sets/src/mage/cards/w/WardOfBones.java +++ b/Mage.Sets/src/mage/cards/w/WardOfBones.java @@ -117,8 +117,8 @@ class WardOfBonesEffect extends ContinuousRuleModifyingEffectImpl { return false; } if (card.isCreature() - && game.getBattlefield().countAll(new FilterCreaturePermanent(), opponent.getId(), game) - > game.getBattlefield().countAll(new FilterCreaturePermanent(), source.getControllerId(), game)) { + && game.getBattlefield().countAll(StaticFilters.FILTER_PERMANENT_CREATURE, opponent.getId(), game) + > game.getBattlefield().countAll(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game)) { return true; } if (card.isArtifact() diff --git a/Mage.Sets/src/mage/cards/w/WarriorsHonor.java b/Mage.Sets/src/mage/cards/w/WarriorsHonor.java index c4f55fbf4c..b767eb6516 100644 --- a/Mage.Sets/src/mage/cards/w/WarriorsHonor.java +++ b/Mage.Sets/src/mage/cards/w/WarriorsHonor.java @@ -45,7 +45,7 @@ public class WarriorsHonor extends CardImpl { public WarriorsHonor(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{W}"); - this.getSpellAbility().addEffect(new BoostControlledEffect(1, 1, Duration.EndOfTurn, new FilterCreaturePermanent(), false)); + this.getSpellAbility().addEffect(new BoostControlledEffect(1, 1, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, false)); } public WarriorsHonor(final WarriorsHonor card) { diff --git a/Mage.Sets/src/mage/cards/w/WaveOfIndifference.java b/Mage.Sets/src/mage/cards/w/WaveOfIndifference.java index 0f7746b1c2..23c154284d 100644 --- a/Mage.Sets/src/mage/cards/w/WaveOfIndifference.java +++ b/Mage.Sets/src/mage/cards/w/WaveOfIndifference.java @@ -53,7 +53,7 @@ public class WaveOfIndifference extends CardImpl { Effect effect = new CantBlockTargetEffect(Duration.EndOfTurn); effect.setText("X target creatures can't block this turn"); this.getSpellAbility().addEffect(effect); - this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 1, new FilterCreaturePermanent(), false)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 1, StaticFilters.FILTER_PERMANENT_CREATURE, false)); } public WaveOfIndifference(final WaveOfIndifference card) { diff --git a/Mage.Sets/src/mage/cards/w/WildBeastmaster.java b/Mage.Sets/src/mage/cards/w/WildBeastmaster.java index 389812d2a8..f0cb749391 100644 --- a/Mage.Sets/src/mage/cards/w/WildBeastmaster.java +++ b/Mage.Sets/src/mage/cards/w/WildBeastmaster.java @@ -57,7 +57,7 @@ public class WildBeastmaster extends CardImpl { // Whenever Wild Beastmaster attacks, each other creature you control gets +X/+X until end of turn, where X is Wild Beastmaster's power. SourcePermanentPowerCount creaturePower = new SourcePermanentPowerCount(); - Effect effect = new BoostControlledEffect(creaturePower, creaturePower, Duration.EndOfTurn, new FilterCreaturePermanent(),true, true); + Effect effect = new BoostControlledEffect(creaturePower, creaturePower, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE,true, true); effect.setText(EFFECT_TEXT); this.addAbility(new AttacksTriggeredAbility(effect, false)); } diff --git a/Mage.Sets/src/mage/cards/w/WojekApothecary.java b/Mage.Sets/src/mage/cards/w/WojekApothecary.java index 6b1e4858ad..e5f739baeb 100644 --- a/Mage.Sets/src/mage/cards/w/WojekApothecary.java +++ b/Mage.Sets/src/mage/cards/w/WojekApothecary.java @@ -105,7 +105,7 @@ class WojekApothecaryEffect extends OneShotEffect { Permanent target = game.getPermanent(getTargetPointer().getFirst(game, source)); if (target != null) { ObjectColor color = target.getColor(game); - for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), source.getSourceId(), game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), source.getSourceId(), game)) { if (permanent.getColor(game).shares(color)) { ContinuousEffect effect = new PreventDamageToTargetEffect(Duration.EndOfTurn, 1); effect.setTargetPointer(new FixedTarget(permanent, game)); diff --git a/Mage.Sets/src/mage/cards/w/WojekSiren.java b/Mage.Sets/src/mage/cards/w/WojekSiren.java index f7acbdfc3a..c3932c0e52 100644 --- a/Mage.Sets/src/mage/cards/w/WojekSiren.java +++ b/Mage.Sets/src/mage/cards/w/WojekSiren.java @@ -89,7 +89,7 @@ class WojekSirenBoostEffect extends ContinuousEffectImpl { if (target != null) { affectedObjectList.add(new MageObjectReference(target, game)); ObjectColor color = target.getColor(game); - for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), source.getSourceId(), game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), source.getSourceId(), game)) { if (!permanent.getId().equals(target.getId()) && permanent.getColor(game).shares(color)) { affectedObjectList.add(new MageObjectReference(permanent, game)); } diff --git a/Mage.Sets/src/mage/cards/w/WretchedBanquet.java b/Mage.Sets/src/mage/cards/w/WretchedBanquet.java index 32aac94beb..364710ab93 100644 --- a/Mage.Sets/src/mage/cards/w/WretchedBanquet.java +++ b/Mage.Sets/src/mage/cards/w/WretchedBanquet.java @@ -84,7 +84,7 @@ class WretchedBanquetEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Permanent targetCreature = game.getPermanent(source.getFirstTarget()); - List creatures = game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), source.getSourceId(), game); + List creatures = game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), source.getSourceId(), game); int minPower = targetCreature.getPower().getValue() + 1; for (Permanent creature : creatures) { diff --git a/Mage.Sets/src/mage/cards/x/Xenograft.java b/Mage.Sets/src/mage/cards/x/Xenograft.java index 4413a37e24..e3e6628be7 100644 --- a/Mage.Sets/src/mage/cards/x/Xenograft.java +++ b/Mage.Sets/src/mage/cards/x/Xenograft.java @@ -86,7 +86,7 @@ class XenograftAddSubtypeEffect extends ContinuousEffectImpl { public boolean apply(Game game, Ability source) { String subtype = (String) game.getState().getValue(source.getSourceId() + "_type"); if (subtype != null) { - List permanents = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game); + List permanents = game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game); for (Permanent permanent : permanents) { if (permanent != null && !permanent.getSubtype(game).contains(subtype)) { permanent.getSubtype(game).add(subtype); diff --git a/Mage.Sets/src/mage/cards/z/ZadaHedronGrinder.java b/Mage.Sets/src/mage/cards/z/ZadaHedronGrinder.java index f78d3deeaf..82a98c05e0 100644 --- a/Mage.Sets/src/mage/cards/z/ZadaHedronGrinder.java +++ b/Mage.Sets/src/mage/cards/z/ZadaHedronGrinder.java @@ -179,7 +179,7 @@ class ZadaHedronGrinderEffect extends OneShotEffect { if (usedTarget == null) { return false; } - for (Permanent creature : game.getState().getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) { + for (Permanent creature : game.getState().getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game)) { if (!creature.getId().equals(source.getSourceId()) && usedTarget.canTarget(source.getControllerId(), creature.getId(), source, game)) { Spell copy = spell.copySpell(source.getControllerId()); game.getStack().push(copy); diff --git a/Mage.Sets/src/mage/cards/z/ZhangHeWeiGeneral.java b/Mage.Sets/src/mage/cards/z/ZhangHeWeiGeneral.java index d43e94f6a7..015411e880 100644 --- a/Mage.Sets/src/mage/cards/z/ZhangHeWeiGeneral.java +++ b/Mage.Sets/src/mage/cards/z/ZhangHeWeiGeneral.java @@ -58,7 +58,7 @@ public class ZhangHeWeiGeneral extends CardImpl { this.addAbility(HorsemanshipAbility.getInstance()); // Whenever Zhang He, Wei General attacks, each other creature you control gets +1/+0 until end of turn. this.addAbility(new AttacksTriggeredAbility(new BoostControlledEffect(1, 0, Duration.EndOfTurn, - new FilterCreaturePermanent(), true), false)); + StaticFilters.FILTER_PERMANENT_CREATURE, true), false)); } public ZhangHeWeiGeneral(final ZhangHeWeiGeneral card) { diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/CloneTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/CloneTest.java index 8863198b27..ddb8ceb5b9 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/copy/CloneTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/CloneTest.java @@ -187,7 +187,7 @@ public class CloneTest extends CardTestPlayerBase { boolean whiteLion = false; boolean blueLion = false; - for (Permanent permanent : currentGame.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), playerA.getId(), currentGame)) { + for (Permanent permanent : currentGame.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, playerA.getId(), currentGame)) { if (permanent.getColor(currentGame).isWhite()) { whiteLion = true; } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/KikiJikiMirrorBreakerTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/KikiJikiMirrorBreakerTest.java index 1fd9709bf9..148c6774c4 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/copy/KikiJikiMirrorBreakerTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/KikiJikiMirrorBreakerTest.java @@ -173,7 +173,7 @@ public class KikiJikiMirrorBreakerTest extends CardTestPlayerBase { assertPermanentCount(playerB, "Silvercoat Lion", 2); // one from Body Double and one from Kiki Permanent kikiCopy = null; - for (Permanent permanent : currentGame.getState().getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), currentGame)) { + for (Permanent permanent : currentGame.getState().getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, currentGame)) { if (permanent.getName().equals("Silvercoat Lion") && (permanent instanceof PermanentToken)) { kikiCopy = permanent; break; diff --git a/Mage/src/main/java/mage/abilities/common/AttacksAllTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/AttacksAllTriggeredAbility.java index b7dc86a895..f4971967eb 100644 --- a/Mage/src/main/java/mage/abilities/common/AttacksAllTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/AttacksAllTriggeredAbility.java @@ -51,11 +51,11 @@ public class AttacksAllTriggeredAbility extends TriggeredAbilityImpl { protected boolean controller; public AttacksAllTriggeredAbility(Effect effect, boolean optional) { - this(effect, optional, new FilterCreaturePermanent(), SetTargetPointer.NONE, false); + this(effect, optional, StaticFilters.FILTER_PERMANENT_CREATURE, SetTargetPointer.NONE, false); } public AttacksAllTriggeredAbility(Effect effect, boolean optional, boolean attacksYouOrYourPlaneswalker) { - this(effect, optional, new FilterCreaturePermanent(), SetTargetPointer.NONE, attacksYouOrYourPlaneswalker); + this(effect, optional, StaticFilters.FILTER_PERMANENT_CREATURE, SetTargetPointer.NONE, attacksYouOrYourPlaneswalker); } public AttacksAllTriggeredAbility(Effect effect, boolean optional, FilterCreaturePermanent filter, SetTargetPointer setTargetPointer, boolean attacksYouOrYourPlaneswalker) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/CopyPermanentEffect.java b/Mage/src/main/java/mage/abilities/effects/common/CopyPermanentEffect.java index 865adb292e..26cee8418a 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/CopyPermanentEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/CopyPermanentEffect.java @@ -57,7 +57,7 @@ public class CopyPermanentEffect extends OneShotEffect { } public CopyPermanentEffect(ApplyToPermanent applier) { - this(new FilterCreaturePermanent(), applier); + this(StaticFilters.FILTER_PERMANENT_CREATURE, applier); } public CopyPermanentEffect(FilterPermanent filter) { diff --git a/Mage/src/main/java/mage/abilities/effects/keyword/BolsterEffect.java b/Mage/src/main/java/mage/abilities/effects/keyword/BolsterEffect.java index 55fc107462..025524aabd 100644 --- a/Mage/src/main/java/mage/abilities/effects/keyword/BolsterEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/keyword/BolsterEffect.java @@ -84,7 +84,7 @@ public class BolsterEffect extends OneShotEffect { } int leastToughness = Integer.MAX_VALUE; Permanent selectedCreature = null; - for(Permanent permanent: game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), controller.getId(), game)) { + for(Permanent permanent: game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, controller.getId(), game)) { if (leastToughness > permanent.getToughness().getValue()) { leastToughness = permanent.getToughness().getValue(); selectedCreature = permanent; diff --git a/Mage/src/main/java/mage/game/combat/Combat.java b/Mage/src/main/java/mage/game/combat/Combat.java index d080f94c2a..4eee3f692b 100644 --- a/Mage/src/main/java/mage/game/combat/Combat.java +++ b/Mage/src/main/java/mage/game/combat/Combat.java @@ -1212,7 +1212,7 @@ public class Combat implements Serializable, Copyable { } } // reset the removeFromCombat flag on all creatures on the battlefield - for (Permanent creaturePermanent : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), game)) { + for (Permanent creaturePermanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, game)) { creaturePermanent.setRemovedFromCombat(false); } clear(); diff --git a/Mage/src/main/java/mage/game/command/emblems/SorinSolemnVisitorEmblem.java b/Mage/src/main/java/mage/game/command/emblems/SorinSolemnVisitorEmblem.java index 4aa35ee8b0..e53140f9f3 100644 --- a/Mage/src/main/java/mage/game/command/emblems/SorinSolemnVisitorEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/SorinSolemnVisitorEmblem.java @@ -48,7 +48,7 @@ public class SorinSolemnVisitorEmblem extends Emblem { public SorinSolemnVisitorEmblem() { this.setName("Emblem Sorin"); - Ability ability = new BeginningOfUpkeepTriggeredAbility(Zone.COMMAND, new SacrificeEffect(new FilterCreaturePermanent(), 1, "that player"), TargetController.OPPONENT, false, true); + Ability ability = new BeginningOfUpkeepTriggeredAbility(Zone.COMMAND, new SacrificeEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 1, "that player"), TargetController.OPPONENT, false, true); this.getAbilities().add(ability); } } diff --git a/Mage/src/main/java/mage/target/common/TargetCreatureOrPlayerAmount.java b/Mage/src/main/java/mage/target/common/TargetCreatureOrPlayerAmount.java index 60a8d04ee7..98250b2319 100644 --- a/Mage/src/main/java/mage/target/common/TargetCreatureOrPlayerAmount.java +++ b/Mage/src/main/java/mage/target/common/TargetCreatureOrPlayerAmount.java @@ -126,7 +126,7 @@ public class TargetCreatureOrPlayerAmount extends TargetAmount { } } } - for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, sourceControllerId, game)) { if (permanent.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(permanent, sourceId, sourceControllerId, game)) { count++; if (count >= this.minNumberOfTargets) { @@ -149,7 +149,7 @@ public class TargetCreatureOrPlayerAmount extends TargetAmount { } } } - for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, sourceControllerId, game)) { if (filter.match(permanent, null, sourceControllerId, game)) { count++; if (count >= this.minNumberOfTargets) { @@ -170,7 +170,7 @@ public class TargetCreatureOrPlayerAmount extends TargetAmount { possibleTargets.add(playerId); } } - for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, sourceControllerId, game)) { if (permanent.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(permanent, sourceId, sourceControllerId, game)) { possibleTargets.add(permanent.getId()); } @@ -187,7 +187,7 @@ public class TargetCreatureOrPlayerAmount extends TargetAmount { possibleTargets.add(playerId); } } - for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, sourceControllerId, game)) { if (filter.match(permanent, null, sourceControllerId, game)) { possibleTargets.add(permanent.getId()); } diff --git a/Mage/src/main/java/mage/target/common/TargetCreaturePermanent.java b/Mage/src/main/java/mage/target/common/TargetCreaturePermanent.java index d32c695481..b48d9bc5ed 100644 --- a/Mage/src/main/java/mage/target/common/TargetCreaturePermanent.java +++ b/Mage/src/main/java/mage/target/common/TargetCreaturePermanent.java @@ -46,11 +46,11 @@ public class TargetCreaturePermanent extends TargetPermanent { } public TargetCreaturePermanent(int numTargets) { - this(numTargets, numTargets, new FilterCreaturePermanent(), false); + this(numTargets, numTargets, StaticFilters.FILTER_PERMANENT_CREATURE, false); } public TargetCreaturePermanent(int minNumTargets, int maxNumTargets) { - this(minNumTargets, maxNumTargets, new FilterCreaturePermanent(), false); + this(minNumTargets, maxNumTargets, StaticFilters.FILTER_PERMANENT_CREATURE, false); } public TargetCreaturePermanent(int minNumTargets, int maxNumTargets, FilterCreaturePermanent filter, boolean notTarget) { diff --git a/Mage/src/main/java/mage/target/common/TargetCreaturePermanentAmount.java b/Mage/src/main/java/mage/target/common/TargetCreaturePermanentAmount.java index 06491ad922..7714a02c35 100644 --- a/Mage/src/main/java/mage/target/common/TargetCreaturePermanentAmount.java +++ b/Mage/src/main/java/mage/target/common/TargetCreaturePermanentAmount.java @@ -109,7 +109,7 @@ public class TargetCreaturePermanentAmount extends TargetAmount { public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { int count = 0; MageObject targetSource = game.getObject(sourceId); - for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, sourceControllerId, game)) { if (permanent.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(permanent, sourceId, sourceControllerId, game)) { count++; if (count >= this.minNumberOfTargets) { @@ -123,7 +123,7 @@ public class TargetCreaturePermanentAmount extends TargetAmount { @Override public boolean canChoose(UUID sourceControllerId, Game game) { int count = 0; - for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, sourceControllerId, game)) { if (filter.match(permanent, null, sourceControllerId, game)) { count++; if (count >= this.minNumberOfTargets) { @@ -138,7 +138,7 @@ public class TargetCreaturePermanentAmount extends TargetAmount { public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { Set possibleTargets = new HashSet<>(); MageObject targetSource = game.getObject(sourceId); - for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, sourceControllerId, game)) { if (permanent.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(permanent, sourceId, sourceControllerId, game)) { possibleTargets.add(permanent.getId()); } @@ -149,7 +149,7 @@ public class TargetCreaturePermanentAmount extends TargetAmount { @Override public Set possibleTargets(UUID sourceControllerId, Game game) { Set possibleTargets = new HashSet<>(); - for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { + for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, sourceControllerId, game)) { if (filter.match(permanent, null, sourceControllerId, game)) { possibleTargets.add(permanent.getId()); } diff --git a/Mage/src/main/java/mage/target/common/TargetPermanentOrPlayer.java b/Mage/src/main/java/mage/target/common/TargetPermanentOrPlayer.java index 0555610187..851a4137cb 100644 --- a/Mage/src/main/java/mage/target/common/TargetPermanentOrPlayer.java +++ b/Mage/src/main/java/mage/target/common/TargetPermanentOrPlayer.java @@ -159,7 +159,7 @@ public class TargetPermanentOrPlayer extends TargetImpl { } } } - for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { + for (Permanent permanent: game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, sourceControllerId, game)) { if (permanent.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(permanent, sourceId, sourceControllerId, game)) { count++; if (count >= this.minNumberOfTargets) { @@ -228,7 +228,7 @@ public class TargetPermanentOrPlayer extends TargetImpl { possibleTargets.add(playerId); } } - for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) { + for (Permanent permanent: game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, sourceControllerId, game)) { if (filter.match(permanent, null, sourceControllerId, game)) { possibleTargets.add(permanent.getId()); }