From ecf765ecf5d06b50b5e0729ae94180def3cace3e Mon Sep 17 00:00:00 2001 From: North Date: Thu, 12 Jul 2012 23:42:46 +0300 Subject: [PATCH] [filters] Replaced CardType conditions with Predicate --- .../mage/client/deckeditor/CardSelector.java | 133 +++++++++-------- .../deckeditor/table/CardTableSelector.java | 139 +++++++++--------- .../sets/alarareborn/FieldmistBorderpost.java | 5 +- .../mage/sets/alarareborn/FiligreeAngel.java | 6 +- .../sets/alarareborn/FirewildBorderpost.java | 5 +- .../sets/alarareborn/MistveinBorderpost.java | 5 +- .../sets/alarareborn/QasaliPridemage.java | 9 +- .../alarareborn/SpellbreakerBehemoth.java | 3 +- .../sets/alarareborn/VeinfireBorderpost.java | 5 +- .../sets/alarareborn/VithianRenegades.java | 5 +- .../sets/alarareborn/WildfieldBorderpost.java | 5 +- .../sets/apocalypse/DiversionaryTactics.java | 2 - .../mage/sets/apocalypse/GoblinTrenches.java | 5 +- .../mage/sets/apocalypse/OvergrownEstate.java | 5 +- .../mage/sets/apocalypse/QuagmireDruid.java | 5 +- Mage.Sets/src/mage/sets/apocalypse/Smash.java | 5 +- .../mage/sets/apocalypse/TranquilPath.java | 4 +- .../sets/avacynrestored/BanishingStroke.java | 11 +- .../sets/avacynrestored/BarterInBlood.java | 7 +- .../avacynrestored/BrunaLightOfAlabaster.java | 3 +- .../mage/sets/avacynrestored/Cursebreak.java | 5 +- .../sets/avacynrestored/DevoutChaplain.java | 9 +- .../mage/sets/avacynrestored/DualCasting.java | 9 +- .../mage/sets/avacynrestored/GeistSnatch.java | 3 +- .../sets/avacynrestored/GhostlyFlicker.java | 11 +- .../mage/sets/avacynrestored/LunarMystic.java | 3 +- .../mage/sets/avacynrestored/NaturalEnd.java | 9 +- .../mage/sets/avacynrestored/RiteOfRuin.java | 3 +- .../AkkiBlizzardHerder.java | 3 +- .../betrayersofkamigawa/FinalJudgment.java | 5 +- .../betrayersofkamigawa/Floodbringer.java | 5 +- .../championsofkamigawa/AkkiAvalanchers.java | 5 +- .../championsofkamigawa/AuraOfDominion.java | 2 - .../mage/sets/championsofkamigawa/Befoul.java | 12 +- .../championsofkamigawa/BudokaGardener.java | 5 +- .../sets/championsofkamigawa/Cleanfall.java | 5 +- .../CommuneWithNature.java | 8 +- .../championsofkamigawa/FeastOfWorms.java | 9 +- .../championsofkamigawa/Frostwielder.java | 5 +- .../championsofkamigawa/JoyousRespite.java | 5 +- .../championsofkamigawa/KamiOfAncientLaw.java | 5 +- .../KumanoMasterYamabushi.java | 15 +- .../championsofkamigawa/KumanosPupil.java | 5 +- .../MelokuTheCloudedMirror.java | 5 +- .../championsofkamigawa/MyojinOfLifesWeb.java | 3 +- .../PeerThroughDepths.java | 11 +- .../sets/championsofkamigawa/QuietPurity.java | 5 +- .../SoratamiCloudskater.java | 5 +- .../SoratamiMirrorGuard.java | 4 +- .../SoratamiMirrorMage.java | 5 +- .../SoratamiRainshaper.java | 5 +- .../championsofkamigawa/SoratamiSavant.java | 5 +- .../championsofkamigawa/SoratamiSeer.java | 5 +- .../championsofkamigawa/StrengthOfCedars.java | 5 +- .../sets/championsofkamigawa/TimeOfNeed.java | 3 +- .../championsofkamigawa/UyoSilentProphet.java | 9 +- .../src/mage/sets/conflux/Countersquall.java | 4 +- Mage.Sets/src/mage/sets/conflux/Esperzoa.java | 5 +- .../sets/conflux/EtherswornAdjudicator.java | 9 +- .../mage/sets/conflux/FaerieMechanist.java | 3 +- .../mage/sets/conflux/FiligreeFracture.java | 9 +- .../mage/sets/conflux/GoblinRazerunners.java | 7 +- .../sets/conflux/KnightOfTheReliquary.java | 5 +- .../src/mage/sets/conflux/MoltenFrame.java | 5 +- .../sets/conflux/NicolBolasPlaneswalker.java | 4 +- .../sets/conflux/SigilOfTheEmptyThrone.java | 3 +- .../sets/darkascension/AfflictedDeserter.java | 5 +- .../mage/sets/darkascension/BoneToAsh.java | 3 +- .../mage/sets/darkascension/Counterlash.java | 14 +- .../sets/darkascension/CurseOfEchoes.java | 9 +- .../mage/sets/darkascension/FeedThePack.java | 5 +- .../darkascension/IncreasingVengeance.java | 9 +- .../sets/darkascension/MysticRetrieval.java | 9 +- .../sets/darkascension/RayOfRevelation.java | 3 +- .../darkascension/SorinLordOfInnistrad.java | 9 +- .../mage/sets/darksteel/ArcaneSpyglass.java | 5 +- .../src/mage/sets/darksteel/Coretapper.java | 5 +- .../mage/sets/darksteel/DarksteelForge.java | 5 +- .../src/mage/sets/darksteel/EchoingCalm.java | 5 +- .../mage/sets/darksteel/EmissaryOfHope.java | 4 +- .../mage/sets/darksteel/KrarkClanStoker.java | 5 +- .../src/mage/sets/darksteel/MagneticFlux.java | 5 +- .../mage/sets/darksteel/NeurokProdigy.java | 5 +- .../src/mage/sets/darksteel/Oxidize.java | 5 +- .../src/mage/sets/darksteel/PteronGhost.java | 5 +- .../sets/darksteel/SlobadGoblinTinkerer.java | 8 +- .../src/mage/sets/darksteel/Soulscour.java | 7 +- .../sets/darksteel/SteelshaperApprentice.java | 3 +- .../mage/sets/darksteel/ViridianZealot.java | 9 +- .../mage/sets/darksteel/VoltaicConstruct.java | 5 +- .../mage/sets/dissension/AzoriusChancery.java | 5 +- .../sets/dissension/IndrikStomphowler.java | 9 +- .../mage/sets/dissension/RakdosCarnarium.java | 5 +- .../sets/dissension/SimicGrowthChamber.java | 5 +- .../sets/eventide/KithkinSpellduster.java | 5 +- .../sets/eventide/NoggleBridgebreaker.java | 5 +- .../src/mage/sets/eventide/Scarecrone.java | 7 +- .../mage/sets/eventide/WickerboughElder.java | 8 +- .../mage/sets/fifthedition/AshesToAshes.java | 4 +- .../sets/guildpact/DuneBroodNephilim.java | 5 +- .../src/mage/sets/guildpact/Gelectrode.java | 9 +- .../mage/sets/guildpact/GruulGuildmage.java | 3 +- .../mage/sets/guildpact/IzzetBoilerworks.java | 3 +- .../mage/sets/guildpact/IzzetChronarch.java | 9 +- .../src/mage/sets/guildpact/Mortify.java | 9 +- .../mage/sets/guildpact/OrzhovBasilica.java | 3 +- .../mage/sets/guildpact/WeeDragonauts.java | 9 +- .../src/mage/sets/guildpact/WreakHavoc.java | 9 +- .../mage/sets/innistrad/AncientGrudge.java | 5 +- .../src/mage/sets/innistrad/Bramblecrush.java | 4 +- .../sets/innistrad/CharmbreakerDevils.java | 13 +- .../sets/innistrad/GarrukTheVeilCursed.java | 5 +- .../mage/sets/innistrad/RunechantersPike.java | 9 +- .../mage/sets/innistrad/SilverchaseFox.java | 5 +- .../mage/sets/innistrad/SnapcasterMage.java | 9 +- .../mage/sets/innistrad/TributeToHunger.java | 3 +- .../src/mage/sets/magic2010/AcidicSlime.java | 11 +- Mage.Sets/src/mage/sets/magic2010/Duress.java | 6 +- .../mage/sets/magic2010/EssenceScatter.java | 3 +- .../src/mage/sets/magic2010/Fabricate.java | 5 +- .../mage/sets/magic2010/MesaEnchantress.java | 3 +- .../mage/sets/magic2010/NaturesSpiral.java | 15 +- Mage.Sets/src/mage/sets/magic2010/Negate.java | 4 +- .../mage/sets/magic2010/SolemnOffering.java | 9 +- .../mage/sets/magic2010/TempestOfLight.java | 5 +- .../src/mage/sets/magic2010/Twincast.java | 9 +- .../mage/sets/magic2010/YawningFissure.java | 3 +- .../src/mage/sets/magic2011/BackToNature.java | 3 +- .../src/mage/sets/magic2011/CallToMind.java | 9 +- .../mage/sets/magic2011/DestructiveForce.java | 3 +- .../src/mage/sets/magic2011/ManicVandal.java | 5 +- .../mage/sets/magic2011/PhylacteryLich.java | 5 +- .../src/mage/sets/magic2011/Reverberate.java | 9 +- .../mage/sets/magic2011/SteelOverseer.java | 7 +- .../src/mage/sets/magic2011/SunTitan.java | 15 +- .../src/mage/sets/magic2011/VoltaicKey.java | 5 +- .../mage/sets/magic2011/WarPriestOfThune.java | 5 +- .../src/mage/sets/magic2012/Auramancer.java | 5 +- .../sets/magic2012/BloodlordOfVaasgoth.java | 5 +- .../mage/sets/magic2012/BountifulHarvest.java | 3 +- .../sets/magic2012/GarrukPrimalHunter.java | 5 +- .../src/mage/sets/magic2012/Levitation.java | 3 +- .../src/mage/sets/magic2012/MasterThief.java | 5 +- .../src/mage/sets/magic2012/Smallpox.java | 12 +- .../mage/sets/magic2013/Archaeomancer.java | 9 +- .../mage/sets/magic2013/FungalSprouting.java | 3 +- .../sets/magic2013/TalrandSkySummoner.java | 7 +- .../src/mage/sets/mirrodin/AltarsLight.java | 9 +- Mage.Sets/src/mage/sets/mirrodin/Annul.java | 9 +- Mage.Sets/src/mage/sets/mirrodin/Atog.java | 5 +- .../mage/sets/mirrodin/AuriokTransfixer.java | 5 +- .../src/mage/sets/mirrodin/Deconstruct.java | 5 +- .../src/mage/sets/mirrodin/ElfReplica.java | 5 +- .../src/mage/sets/mirrodin/GalvanicKey.java | 5 +- .../src/mage/sets/mirrodin/GoblinReplica.java | 5 +- .../mage/sets/mirrodin/KrarkClanGrunt.java | 5 +- .../mage/sets/mirrodin/KrarkClanShaman.java | 5 +- .../src/mage/sets/mirrodin/LeoninAbunas.java | 3 +- .../mage/sets/mirrodin/LoomingHoverguard.java | 5 +- .../src/mage/sets/mirrodin/LoxodonMender.java | 5 +- Mage.Sets/src/mage/sets/mirrodin/Megatog.java | 5 +- .../src/mage/sets/mirrodin/MolderSlug.java | 5 +- .../src/mage/sets/mirrodin/NeurokSpy.java | 5 +- .../src/mage/sets/mirrodin/NimLasher.java | 5 +- .../src/mage/sets/mirrodin/NimShambler.java | 5 +- .../src/mage/sets/mirrodin/NimShrieker.java | 5 +- Mage.Sets/src/mage/sets/mirrodin/Shatter.java | 7 +- .../src/mage/sets/mirrodin/ShrapnelBlast.java | 5 +- .../mage/sets/mirrodin/SoldierReplica.java | 2 - .../mage/sets/mirrodin/TrashForTreasure.java | 5 +- .../mirrodinbesieged/BanishmentDecree.java | 13 +- .../src/mage/sets/mirrodinbesieged/Crush.java | 4 +- .../sets/mirrodinbesieged/DivineOffering.java | 5 +- .../mirrodinbesieged/GlissaTheTraitor.java | 5 +- .../sets/mirrodinbesieged/Gnathosaur.java | 5 +- .../sets/mirrodinbesieged/GoForTheThroat.java | 4 +- .../mirrodinbesieged/GreenSunsZenith.java | 4 +- .../sets/mirrodinbesieged/IntoTheCore.java | 3 +- .../mirrodinbesieged/LeoninRelicWarder.java | 9 +- .../mirrodinbesieged/MetallicMastery.java | 3 +- .../sets/mirrodinbesieged/RustedSlasher.java | 5 +- .../sets/mirrodinbesieged/SteelSabotage.java | 3 +- .../TezzeretAgentOfBolas.java | 5 +- .../sets/mirrodinbesieged/TreasureMage.java | 3 +- .../mirrodinbesieged/ViridianCorrupter.java | 7 +- .../mage/sets/morningtide/IdyllicTutor.java | 5 +- .../mage/sets/morningtide/ShardVolley.java | 5 +- .../src/mage/sets/morningtide/Shinewend.java | 5 +- .../mage/sets/morningtide/SigilTracer.java | 9 +- .../mage/sets/morningtide/Stingmoggie.java | 9 +- .../sets/newphyrexia/ApostlesBlessing.java | 11 +- .../mage/sets/newphyrexia/Artillerize.java | 9 +- .../mage/sets/newphyrexia/BirthingPod.java | 4 +- .../mage/sets/newphyrexia/BladeSplicer.java | 3 +- .../mage/sets/newphyrexia/BludgeonBrawl.java | 3 +- .../sets/newphyrexia/BrutalizerExarch.java | 4 +- .../newphyrexia/ChancellorOfTheSpires.java | 9 +- .../src/mage/sets/newphyrexia/Despise.java | 9 +- .../mage/sets/newphyrexia/EntomberExarch.java | 4 +- .../sets/newphyrexia/ExclusionRitual.java | 4 +- .../mage/sets/newphyrexia/GremlinMine.java | 6 +- .../mage/sets/newphyrexia/MaulSplicer.java | 3 +- .../mage/sets/newphyrexia/NumbingDose.java | 9 +- .../sets/newphyrexia/PhyrexianIngester.java | 5 +- .../sets/newphyrexia/PhyrexianMetamorph.java | 9 +- .../mage/sets/newphyrexia/PhyrexiasCore.java | 5 +- .../mage/sets/newphyrexia/PsychicBarrier.java | 3 +- .../mage/sets/newphyrexia/SensorSplicer.java | 3 +- .../newphyrexia/VictoriousDestruction.java | 12 +- .../mage/sets/newphyrexia/VitalSplicer.java | 3 +- .../src/mage/sets/newphyrexia/Whipflare.java | 7 +- .../mage/sets/newphyrexia/WingSplicer.java | 3 +- .../sets/planechase/AkromasVengeance.java | 11 +- .../mage/sets/planechase/BeaconOfUnrest.java | 9 +- .../mage/sets/planechase/BorosGarrison.java | 5 +- .../mage/sets/planechase/BoshIronGolem.java | 3 +- .../src/mage/sets/planechase/Broodstar.java | 5 +- .../mage/sets/planechase/CranialPlating.java | 5 +- .../src/mage/sets/planechase/GruulTurf.java | 3 +- .../mage/sets/planechase/LodestoneMyr.java | 5 +- .../src/mage/sets/ravnika/DimirAqueduct.java | 5 +- .../src/mage/sets/ravnika/DowsingShaman.java | 5 +- .../src/mage/sets/ravnika/GlareOfSubdual.java | 9 +- .../src/mage/sets/ravnika/GolgariRotFarm.java | 5 +- .../src/mage/sets/ravnika/HalcyonGlaze.java | 5 +- .../src/mage/sets/ravnika/LeaveNoTrace.java | 8 +- .../mage/sets/ravnika/MuddleTheMixture.java | 9 +- .../mage/sets/ravnika/NullmageShepherd.java | 9 +- .../src/mage/sets/ravnika/PrimordialSage.java | 5 +- Mage.Sets/src/mage/sets/ravnika/Putrefy.java | 11 +- .../mage/sets/ravnika/SelesnyaSanctuary.java | 5 +- .../riseoftheeldrazi/ConsumingVapors.java | 3 +- .../mage/sets/riseoftheeldrazi/Deprive.java | 5 +- .../InquisitionOfKozilek.java | 5 +- .../mage/sets/riseoftheeldrazi/KilnFiend.java | 9 +- .../mage/sets/riseoftheeldrazi/Magmaw.java | 4 +- .../sets/riseoftheeldrazi/MnemonicWall.java | 9 +- .../sets/riseoftheeldrazi/Narcolepsy.java | 15 +- .../sets/riseoftheeldrazi/SarkhanTheMad.java | 3 +- .../sets/riseoftheeldrazi/SphinxBoneWand.java | 9 +- .../riseoftheeldrazi/SurrakarSpellblade.java | 7 +- .../sets/riseoftheeldrazi/SurrealMemoir.java | 3 +- .../saviorsofkamigawa/KatakiWarsWage.java | 5 +- .../sets/saviorsofkamigawa/NikkoOnna.java | 5 +- .../saviorsofkamigawa/OboroBreezecaller.java | 5 +- .../saviorsofkamigawa/SunderFromWithin.java | 9 +- .../mage/sets/saviorsofkamigawa/YukiOnna.java | 5 +- .../sets/scarsofmirrodin/AbunaAcolyte.java | 5 +- .../sets/scarsofmirrodin/BarrageOgre.java | 5 +- .../scarsofmirrodin/BellowingTanglewurm.java | 5 +- .../sets/scarsofmirrodin/BluntTheAssault.java | 8 +- .../scarsofmirrodin/DarksteelJuggernaut.java | 5 +- .../mage/sets/scarsofmirrodin/Embersmith.java | 5 +- .../mage/sets/scarsofmirrodin/Ferrovore.java | 7 +- .../scarsofmirrodin/GethLordOfTheVault.java | 9 +- .../mage/sets/scarsofmirrodin/GlintHawk.java | 3 +- .../sets/scarsofmirrodin/GolemArtisan.java | 7 +- .../sets/scarsofmirrodin/GolemFoundry.java | 5 +- .../sets/scarsofmirrodin/GrandArchitect.java | 5 +- .../mage/sets/scarsofmirrodin/HaltOrder.java | 5 +- .../scarsofmirrodin/HandOfThePraetors.java | 5 +- .../scarsofmirrodin/HoardSmelterDragon.java | 5 +- .../scarsofmirrodin/IndomitableArchangel.java | 9 +- .../sets/scarsofmirrodin/KuldothaRebirth.java | 5 +- .../mage/sets/scarsofmirrodin/Lifesmith.java | 5 +- .../mage/sets/scarsofmirrodin/Myrsmith.java | 5 +- .../sets/scarsofmirrodin/OxiddaDaredevil.java | 7 +- .../mage/sets/scarsofmirrodin/Painsmith.java | 5 +- .../sets/scarsofmirrodin/PrecursorGolem.java | 8 +- .../sets/scarsofmirrodin/RevokeExistence.java | 11 +- .../sets/scarsofmirrodin/Riddlesmith.java | 5 +- .../scarsofmirrodin/ScrapdiverSerpent.java | 9 +- .../mage/sets/scarsofmirrodin/ShapeAnew.java | 3 +- .../sets/scarsofmirrodin/SliceinTwain.java | 9 +- .../sets/scarsofmirrodin/SylvokReplica.java | 11 +- .../sets/scarsofmirrodin/TemperedSteel.java | 7 +- .../sets/scarsofmirrodin/ThroneofGeth.java | 7 +- .../sets/scarsofmirrodin/TrinketMage.java | 3 +- .../sets/scarsofmirrodin/TumbleMagnet.java | 11 +- .../scarsofmirrodin/VedalkenCertarch.java | 13 +- .../mage/sets/shadowmoor/Cursecatcher.java | 9 +- .../mage/sets/shadowmoor/ElvishHexhunter.java | 3 +- .../sets/shadowmoor/GutturalResponse.java | 3 +- .../mage/sets/shadowmoor/ToilToRenown.java | 9 +- .../sets/shardsofalara/AjaniVengeant.java | 3 +- .../mage/sets/shardsofalara/BantPanorama.java | 3 +- .../sets/shardsofalara/DispellersCapsule.java | 11 +- .../shardsofalara/ElspethKnightErrant.java | 13 +- .../sets/shardsofalara/EsperPanorama.java | 3 +- .../sets/shardsofalara/FiligreeSages.java | 7 +- .../sets/shardsofalara/GrixisPanorama.java | 3 +- .../mage/sets/shardsofalara/JundPanorama.java | 3 +- .../sets/shardsofalara/MasterOfEtherium.java | 8 +- .../mage/sets/shardsofalara/NayaPanorama.java | 3 +- .../mage/sets/shardsofalara/RangerOfEos.java | 3 +- .../src/mage/sets/tempest/Aftershock.java | 11 +- .../mage/sets/tempest/AltarOfDementia.java | 3 +- Mage.Sets/src/mage/sets/tempest/Auratog.java | 5 +- .../mage/sets/tempest/CloudchaserEagle.java | 5 +- .../src/mage/sets/tempest/Disenchant.java | 9 +- .../src/mage/sets/tempest/Earthcraft.java | 5 +- .../src/mage/sets/tempest/HannasCustody.java | 5 +- Mage.Sets/src/mage/sets/tempest/Perish.java | 5 +- .../src/mage/sets/tempest/RatsOfRath.java | 11 +- .../src/mage/sets/tempest/Tranquility.java | 5 +- .../src/mage/sets/tempest/Verdigris.java | 5 +- .../src/mage/sets/tenth/AvenCloudchaser.java | 5 +- .../src/mage/sets/tenth/CreepingMold.java | 11 +- Mage.Sets/src/mage/sets/tenth/Demolish.java | 9 +- Mage.Sets/src/mage/sets/tenth/Demystify.java | 7 +- Mage.Sets/src/mage/sets/tenth/Distress.java | 4 +- .../src/mage/sets/tenth/IcyManipulator.java | 11 +- .../mage/sets/tenth/MolimoMaroSorcerer.java | 5 +- Mage.Sets/src/mage/sets/tenth/Naturalize.java | 9 +- Mage.Sets/src/mage/sets/tenth/RemoveSoul.java | 3 +- .../src/mage/sets/tenth/SculptingSteel.java | 3 +- Mage.Sets/src/mage/sets/tenth/Terror.java | 4 +- .../src/mage/sets/tenth/ViridianShaman.java | 5 +- .../mage/sets/tenth/YavimayaEnchantress.java | 5 +- .../mage/sets/urzasdestiny/KeldonVandals.java | 5 +- .../mage/sets/urzaslegacy/BoneShredder.java | 4 +- .../sets/urzaslegacy/BouncingBeebles.java | 5 +- .../src/mage/sets/urzaslegacy/Erase.java | 3 +- .../sets/urzassaga/ArgothianEnchantress.java | 3 +- .../sets/urzassaga/CitanulHierophants.java | 3 +- Mage.Sets/src/mage/sets/urzassaga/Clear.java | 5 +- .../src/mage/sets/urzassaga/GaeasCradle.java | 3 +- Mage.Sets/src/mage/sets/urzassaga/Hush.java | 5 +- .../src/mage/sets/urzassaga/RainOfSalt.java | 5 +- Mage.Sets/src/mage/sets/urzassaga/Scrap.java | 5 +- .../mage/sets/urzassaga/SerrasSanctum.java | 3 +- .../src/mage/sets/urzassaga/SternProctor.java | 11 +- .../mage/sets/urzassaga/TolarianAcademy.java | 5 +- .../src/mage/sets/urzassaga/Wildfire.java | 3 +- .../mage/sets/weatherlight/MaraxusOfKeld.java | 13 +- .../sets/worldwake/AvengerOfZendikar.java | 5 +- .../src/mage/sets/worldwake/BazaarTrader.java | 11 +- .../mage/sets/worldwake/BrinkOfDisaster.java | 11 +- .../mage/sets/worldwake/ButcherOfMalakir.java | 3 +- Mage.Sets/src/mage/sets/worldwake/Dispel.java | 3 +- .../src/mage/sets/worldwake/HorizonDrake.java | 10 +- .../mage/sets/worldwake/IonasJudgment.java | 11 +- .../src/mage/sets/worldwake/NaturesClaim.java | 8 +- .../src/mage/sets/worldwake/PilgrimsEye.java | 3 +- .../mage/sets/worldwake/SejiriMerfolk.java | 3 +- .../mage/sets/worldwake/StoneforgeMystic.java | 3 +- Mage.Sets/src/mage/sets/worldwake/Twitch.java | 11 +- .../src/mage/sets/worldwake/VaporSnare.java | 3 +- .../src/mage/sets/zendikar/ChandraAblaze.java | 7 +- .../sets/zendikar/GatekeeperOfMalakir.java | 6 +- Mage.Sets/src/mage/sets/zendikar/Harrow.java | 3 +- .../src/mage/sets/zendikar/KhalniGem.java | 3 +- .../mage/sets/zendikar/KorSanctifiers.java | 9 +- .../src/mage/sets/zendikar/MagmaRift.java | 3 +- .../src/mage/sets/zendikar/MoldShambler.java | 4 +- .../sets/zendikar/OranRiefTheVastwood.java | 3 +- .../sets/zendikar/PyromancerAscension.java | 11 +- .../sets/zendikar/QuestForTheHolyRelic.java | 5 +- .../mage/sets/zendikar/RuinousMinotaur.java | 3 +- .../src/mage/sets/zendikar/ScytheTiger.java | 5 +- .../src/mage/sets/zendikar/SpellPierce.java | 6 +- .../src/mage/sets/zendikar/SummonersBane.java | 3 +- .../common/FetchLandActivatedAbility.java | 3 +- .../condition/common/MetalcraftCondition.java | 3 +- .../costs/common/MetalcraftCost.java | 3 +- .../keyword/AffinityForArtifactsAbility.java | 5 +- Mage/src/mage/filter/FilterImpl.java | 4 - Mage/src/mage/filter/FilterObject.java | 38 ----- .../filter/common/FilterArtifactCard.java | 3 +- .../common/FilterArtifactPermanent.java | 3 +- Mage/src/mage/filter/common/FilterAura.java | 3 +- .../mage/filter/common/FilterAuraCard.java | 3 +- .../filter/common/FilterBasicLandCard.java | 4 +- .../FilterControlledCreaturePermanent.java | 3 +- .../filter/common/FilterCreatureCard.java | 3 +- .../common/FilterCreaturePermanent.java | 3 +- .../mage/filter/common/FilterEnchantment.java | 3 +- .../mage/filter/common/FilterEquipment.java | 3 +- .../filter/common/FilterFortification.java | 3 +- .../mage/filter/common/FilterLandCard.java | 3 +- .../filter/common/FilterLandPermanent.java | 3 +- .../mage/filter/common/FilterNonlandCard.java | 4 +- .../filter/common/FilterNonlandPermanent.java | 4 +- .../common/FilterPlaneswalkerPermanent.java | 3 +- .../target/common/TargetBasicLandCard.java | 5 +- 385 files changed, 1278 insertions(+), 1249 deletions(-) diff --git a/Mage.Client/src/main/java/mage/client/deckeditor/CardSelector.java b/Mage.Client/src/main/java/mage/client/deckeditor/CardSelector.java index 31ef0d80cb..1d8d3a4775 100644 --- a/Mage.Client/src/main/java/mage/client/deckeditor/CardSelector.java +++ b/Mage.Client/src/main/java/mage/client/deckeditor/CardSelector.java @@ -35,6 +35,8 @@ package mage.client.deckeditor; import mage.Constants.CardType; +import mage.MageObject; +import mage.ObjectColor; import mage.cards.Card; import mage.cards.ExpansionSet; import mage.client.cards.BigCard; @@ -44,8 +46,12 @@ import mage.client.cards.ICardGrid; import mage.client.constants.Constants.SortBy; import mage.client.deckeditor.table.TableModel; import mage.client.util.sets.ConstructedFormats; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; +import mage.filter.predicate.Predicate; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.filter.predicate.mageobject.ColorlessPredicate; import mage.sets.Sets; import mage.view.CardsView; @@ -63,7 +69,7 @@ import java.util.List; public class CardSelector extends javax.swing.JPanel implements ComponentListener { private final List cards = new ArrayList(); - private final FilterCard filter = new FilterCard(); + private FilterCard filter = new FilterCard(); private BigCard bigCard; private boolean limited = false; @@ -140,7 +146,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene for (Card card: sideboard) { this.cards.add(card); } - initFilter(); + filterCards(); } @@ -153,37 +159,70 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene cbExpansionSet.insertItemAt("-- All sets", 0); cbExpansionSet.insertItemAt("-- Standard", 1); cbExpansionSet.setSelectedIndex(0); - initFilter(); - if (this.cbExpansionSet.getSelectedItem() instanceof ExpansionSet) { + + filterCards(); + } + + private void buildFilter() { + filter = new FilterCard(); + ArrayList> predicates = new ArrayList>(); + + if (this.rdoGreen.isSelected()) { + predicates.add(new ColorPredicate(ObjectColor.GREEN)); + } + if (this.rdoRed.isSelected()) { + predicates.add(new ColorPredicate(ObjectColor.RED)); + } + if (this.rdoBlack.isSelected()) { + predicates.add(new ColorPredicate(ObjectColor.BLACK)); + } + if (this.rdoBlue.isSelected()) { + predicates.add(new ColorPredicate(ObjectColor.BLUE)); + } + if (this.rdoWhite.isSelected()) { + predicates.add(new ColorPredicate(ObjectColor.WHITE)); + } + if (this.rdoColorless.isSelected()) { + predicates.add(new ColorlessPredicate()); + } + filter.add(Predicates.or(predicates)); + + predicates.clear(); + if (this.rdoLand.isSelected()) { + predicates.add(new CardTypePredicate(CardType.LAND)); + } + if (this.rdoArtifacts.isSelected()) { + predicates.add(new CardTypePredicate(CardType.ARTIFACT)); + } + if (this.rdoCreatures.isSelected()) { + predicates.add(new CardTypePredicate(CardType.CREATURE)); + } + if (this.rdoEnchantments.isSelected()) { + predicates.add(new CardTypePredicate(CardType.ENCHANTMENT)); + } + if (this.rdoInstants.isSelected()) { + predicates.add(new CardTypePredicate(CardType.INSTANT)); + } + if (this.rdoSorceries.isSelected()) { + predicates.add(new CardTypePredicate(CardType.SORCERY)); + } + if (this.rdoPlaneswalkers.isSelected()) { + predicates.add(new CardTypePredicate(CardType.PLANESWALKER)); + } + filter.add(Predicates.or(predicates)); + + String name = jTextFieldSearch.getText().trim(); + filter.setText(name); + + if (this.cbExpansionSet.getSelectedItem() instanceof ExpansionSet) { filter.getExpansionSetCode().add(((ExpansionSet) this.cbExpansionSet.getSelectedItem()).getCode()); } else if (this.cbExpansionSet.getSelectedItem().equals("-- Standard")) { filter.getExpansionSetCode().addAll(ConstructedFormats.getSetsByFormat("Standard")); } - filterCards(); - } - - private void initFilter() { - filter.setUseColor(true); - filter.getColor().setBlack(true); - filter.getColor().setBlue(true); - filter.getColor().setGreen(true); - filter.getColor().setWhite(true); - filter.getColor().setRed(true); - filter.setColorless(true); - filter.setUseColorless(true); - filter.setNotColor(false); - filter.setScopeColor(ComparisonScope.Any); - filter.getCardType().add(CardType.LAND); - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.CREATURE); - filter.getCardType().add(CardType.ENCHANTMENT); - filter.getCardType().add(CardType.INSTANT); - filter.getCardType().add(CardType.PLANESWALKER); - filter.getCardType().add(CardType.SORCERY); - filter.setScopeCardType(ComparisonScope.Any); } private void filterCards() { + buildFilter(); try { List filteredCards = new ArrayList(); setCursor(new Cursor(Cursor.WAIT_CURSOR)); @@ -648,99 +687,62 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene }// //GEN-END:initComponents private void rdoGreenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoGreenActionPerformed - filter.getColor().setGreen(this.rdoGreen.isSelected()); filterCards(); }//GEN-LAST:event_rdoGreenActionPerformed private void rdoBlackActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoBlackActionPerformed - filter.getColor().setBlack(this.rdoBlack.isSelected()); filterCards(); }//GEN-LAST:event_rdoBlackActionPerformed private void rdoWhiteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoWhiteActionPerformed - filter.getColor().setWhite(this.rdoWhite.isSelected()); filterCards(); }//GEN-LAST:event_rdoWhiteActionPerformed private void rdoRedActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoRedActionPerformed - filter.getColor().setRed(this.rdoRed.isSelected()); filterCards(); }//GEN-LAST:event_rdoRedActionPerformed private void rdoBlueActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoBlueActionPerformed - filter.getColor().setBlue(this.rdoBlue.isSelected()); filterCards(); }//GEN-LAST:event_rdoBlueActionPerformed private void rdoColorlessActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoColorlessActionPerformed - filter.setColorless(this.rdoColorless.isSelected()); filterCards(); }//GEN-LAST:event_rdoColorlessActionPerformed private void rdoLandActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoLandActionPerformed - if (this.rdoLand.isSelected()) - filter.getCardType().add(CardType.LAND); - else - filter.getCardType().remove(CardType.LAND); filterCards(); }//GEN-LAST:event_rdoLandActionPerformed private void rdoCreaturesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoCreaturesActionPerformed - if (this.rdoCreatures.isSelected()) - filter.getCardType().add(CardType.CREATURE); - else - filter.getCardType().remove(CardType.CREATURE); filterCards(); }//GEN-LAST:event_rdoCreaturesActionPerformed private void rdoArtifactsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoArtifactsActionPerformed - if (this.rdoArtifacts.isSelected()) - filter.getCardType().add(CardType.ARTIFACT); - else - filter.getCardType().remove(CardType.ARTIFACT); filterCards(); }//GEN-LAST:event_rdoArtifactsActionPerformed private void rdoEnchantmentsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoEnchantmentsActionPerformed - if (this.rdoEnchantments.isSelected()) - filter.getCardType().add(CardType.ENCHANTMENT); - else - filter.getCardType().remove(CardType.ENCHANTMENT); filterCards(); }//GEN-LAST:event_rdoEnchantmentsActionPerformed private void rdoInstantsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoInstantsActionPerformed - if (this.rdoInstants.isSelected()) - filter.getCardType().add(CardType.INSTANT); - else - filter.getCardType().remove(CardType.INSTANT); filterCards(); }//GEN-LAST:event_rdoInstantsActionPerformed private void rdoSorceriesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoSorceriesActionPerformed - if (this.rdoSorceries.isSelected()) - filter.getCardType().add(CardType.SORCERY); - else - filter.getCardType().remove(CardType.SORCERY); filterCards(); }//GEN-LAST:event_rdoSorceriesActionPerformed private void rdoPlaneswalkersActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoPlaneswalkersActionPerformed - if (this.rdoPlaneswalkers.isSelected()) - filter.getCardType().add(CardType.PLANESWALKER); - else - filter.getCardType().remove(CardType.PLANESWALKER); filterCards(); }//GEN-LAST:event_rdoPlaneswalkersActionPerformed private void cbExpansionSetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbExpansionSetActionPerformed - filter.getExpansionSetCode().clear(); if (cbExpansionSet.getSelectedItem() instanceof ExpansionSet) { - filter.getExpansionSetCode().add(((ExpansionSet)this.cbExpansionSet.getSelectedItem()).getCode()); filterCards(); } else { if (this.cbExpansionSet.getSelectedItem().equals("-- Standard")) { - filter.getExpansionSetCode().addAll(ConstructedFormats.getSetsByFormat("Standard")); filterCards(); } else { // auto switch for ListView for "All sets" (too many cards to load) @@ -838,14 +840,11 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene private void jButtonSearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonSearchActionPerformed - String name = jTextFieldSearch.getText().trim(); - filter.setText(name); filterCards(); }//GEN-LAST:event_jButtonSearchActionPerformed private void jButtonCleanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCleanActionPerformed jTextFieldSearch.setText(""); - filter.setText(""); filterCards(); }//GEN-LAST:event_jButtonCleanActionPerformed diff --git a/Mage.Client/src/main/java/mage/client/deckeditor/table/CardTableSelector.java b/Mage.Client/src/main/java/mage/client/deckeditor/table/CardTableSelector.java index f0ad2a87a0..6a473077ce 100644 --- a/Mage.Client/src/main/java/mage/client/deckeditor/table/CardTableSelector.java +++ b/Mage.Client/src/main/java/mage/client/deckeditor/table/CardTableSelector.java @@ -29,6 +29,8 @@ package mage.client.deckeditor.table; import mage.Constants.CardType; +import mage.MageObject; +import mage.ObjectColor; import mage.cards.Card; import mage.cards.ExpansionSet; import mage.client.cards.BigCard; @@ -37,8 +39,13 @@ import mage.client.cards.CardsStorage; import mage.client.cards.ICardGrid; import mage.client.constants.Constants.DeckEditorMode; import mage.client.constants.Constants.SortBy; -import mage.filter.Filter.ComparisonScope; +import mage.client.util.sets.ConstructedFormats; import mage.filter.FilterCard; +import mage.filter.predicate.Predicate; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.filter.predicate.mageobject.ColorlessPredicate; import mage.sets.Sets; import mage.view.CardsView; @@ -59,7 +66,7 @@ import java.util.List; public class CardTableSelector extends javax.swing.JPanel implements ComponentListener { private final List cards = new ArrayList(); - private final FilterCard filter = new FilterCard(); + private FilterCard filter = new FilterCard(); private BigCard bigCard; protected CardEventSource cardEventSource = new CardEventSource(); private DeckEditorMode mode = DeckEditorMode.Constructed; @@ -86,6 +93,64 @@ public class CardTableSelector extends javax.swing.JPanel implements ComponentLi } + private void buildFilter() { + filter = new FilterCard(); + ArrayList> predicates = new ArrayList>(); + + if (this.rdoGreen.isSelected()) { + predicates.add(new ColorPredicate(ObjectColor.GREEN)); + } + if (this.rdoRed.isSelected()) { + predicates.add(new ColorPredicate(ObjectColor.RED)); + } + if (this.rdoBlack.isSelected()) { + predicates.add(new ColorPredicate(ObjectColor.BLACK)); + } + if (this.rdoBlue.isSelected()) { + predicates.add(new ColorPredicate(ObjectColor.BLUE)); + } + if (this.rdoWhite.isSelected()) { + predicates.add(new ColorPredicate(ObjectColor.WHITE)); + } + if (this.rdoColorless.isSelected()) { + predicates.add(new ColorlessPredicate()); + } + filter.add(Predicates.or(predicates)); + + predicates.clear(); + if (this.rdoLand.isSelected()) { + predicates.add(new CardTypePredicate(CardType.LAND)); + } + if (this.rdoArtifacts.isSelected()) { + predicates.add(new CardTypePredicate(CardType.ARTIFACT)); + } + if (this.rdoCreatures.isSelected()) { + predicates.add(new CardTypePredicate(CardType.CREATURE)); + } + if (this.rdoEnchantments.isSelected()) { + predicates.add(new CardTypePredicate(CardType.ENCHANTMENT)); + } + if (this.rdoInstants.isSelected()) { + predicates.add(new CardTypePredicate(CardType.INSTANT)); + } + if (this.rdoSorceries.isSelected()) { + predicates.add(new CardTypePredicate(CardType.SORCERY)); + } + if (this.rdoPlaneswalkers.isSelected()) { + predicates.add(new CardTypePredicate(CardType.PLANESWALKER)); + } + filter.add(Predicates.or(predicates)); + + String name = jTextFieldSearch.getText().trim(); + filter.setText(name); + + if (this.cbExpansionSet.getSelectedItem() instanceof ExpansionSet) { + filter.getExpansionSetCode().add(((ExpansionSet) this.cbExpansionSet.getSelectedItem()).getCode()); + } else if (this.cbExpansionSet.getSelectedItem().equals("-- Standard")) { + filter.getExpansionSetCode().addAll(ConstructedFormats.getSetsByFormat("Standard")); + } + } + public void loadCards(List sideboard, BigCard bigCard, boolean construct) { this.bigCard = bigCard; this.btnBooster.setVisible(false); @@ -95,7 +160,7 @@ public class CardTableSelector extends javax.swing.JPanel implements ComponentLi for (Card card: sideboard) { this.cards.add(card); } - initFilter(); + filterCards(); } @@ -114,35 +179,12 @@ public class CardTableSelector extends javax.swing.JPanel implements ComponentLi cbExpansionSet.setModel(new DefaultComboBoxModel(l)); cbExpansionSet.insertItemAt("-- All sets -- ", 0); cbExpansionSet.setSelectedIndex(0); - initFilter(); - if (this.cbExpansionSet.getSelectedItem() instanceof ExpansionSet) { - filter.getExpansionSetCode().add(((ExpansionSet)this.cbExpansionSet.getSelectedItem()).getCode()); - } + filterCards(); } - private void initFilter() { - filter.setUseColor(true); - filter.getColor().setBlack(true); - filter.getColor().setBlue(true); - filter.getColor().setGreen(true); - filter.getColor().setWhite(true); - filter.getColor().setRed(true); - filter.setColorless(true); - filter.setUseColorless(true); - filter.setNotColor(false); - filter.setScopeColor(ComparisonScope.Any); - filter.getCardType().add(CardType.LAND); - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.CREATURE); - filter.getCardType().add(CardType.ENCHANTMENT); - filter.getCardType().add(CardType.INSTANT); - filter.getCardType().add(CardType.PLANESWALKER); - filter.getCardType().add(CardType.SORCERY); - filter.setScopeCardType(ComparisonScope.Any); - } - private void filterCards() { + buildFilter(); try { List filteredCards = new ArrayList(); setCursor(new Cursor(Cursor.WAIT_CURSOR)); @@ -539,96 +581,58 @@ public class CardTableSelector extends javax.swing.JPanel implements ComponentLi } private void rdoGreenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoGreenActionPerformed - filter.getColor().setGreen(this.rdoGreen.isSelected()); filterCards(); }//GEN-LAST:event_rdoGreenActionPerformed private void rdoBlackActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoBlackActionPerformed - filter.getColor().setBlack(this.rdoBlack.isSelected()); filterCards(); }//GEN-LAST:event_rdoBlackActionPerformed private void rdoWhiteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoWhiteActionPerformed - filter.getColor().setWhite(this.rdoWhite.isSelected()); filterCards(); }//GEN-LAST:event_rdoWhiteActionPerformed private void rdoRedActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoRedActionPerformed - filter.getColor().setRed(this.rdoRed.isSelected()); filterCards(); }//GEN-LAST:event_rdoRedActionPerformed private void rdoBlueActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoBlueActionPerformed - filter.getColor().setBlue(this.rdoBlue.isSelected()); filterCards(); }//GEN-LAST:event_rdoBlueActionPerformed private void rdoColorlessActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoColorlessActionPerformed - filter.setColorless(this.rdoColorless.isSelected()); filterCards(); }//GEN-LAST:event_rdoColorlessActionPerformed private void rdoLandActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoLandActionPerformed - if (this.rdoLand.isSelected()) - filter.getCardType().add(CardType.LAND); - else - filter.getCardType().remove(CardType.LAND); filterCards(); }//GEN-LAST:event_rdoLandActionPerformed private void rdoCreaturesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoCreaturesActionPerformed - if (this.rdoCreatures.isSelected()) - filter.getCardType().add(CardType.CREATURE); - else - filter.getCardType().remove(CardType.CREATURE); filterCards(); }//GEN-LAST:event_rdoCreaturesActionPerformed private void rdoArtifactsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoArtifactsActionPerformed - if (this.rdoArtifacts.isSelected()) - filter.getCardType().add(CardType.ARTIFACT); - else - filter.getCardType().remove(CardType.ARTIFACT); filterCards(); }//GEN-LAST:event_rdoArtifactsActionPerformed private void rdoEnchantmentsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoEnchantmentsActionPerformed - if (this.rdoEnchantments.isSelected()) - filter.getCardType().add(CardType.ENCHANTMENT); - else - filter.getCardType().remove(CardType.ENCHANTMENT); filterCards(); }//GEN-LAST:event_rdoEnchantmentsActionPerformed private void rdoInstantsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoInstantsActionPerformed - if (this.rdoInstants.isSelected()) - filter.getCardType().add(CardType.INSTANT); - else - filter.getCardType().remove(CardType.INSTANT); filterCards(); }//GEN-LAST:event_rdoInstantsActionPerformed private void rdoSorceriesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoSorceriesActionPerformed - if (this.rdoSorceries.isSelected()) - filter.getCardType().add(CardType.SORCERY); - else - filter.getCardType().remove(CardType.SORCERY); filterCards(); }//GEN-LAST:event_rdoSorceriesActionPerformed private void rdoPlaneswalkersActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoPlaneswalkersActionPerformed - if (this.rdoPlaneswalkers.isSelected()) - filter.getCardType().add(CardType.PLANESWALKER); - else - filter.getCardType().remove(CardType.PLANESWALKER); filterCards(); }//GEN-LAST:event_rdoPlaneswalkersActionPerformed private void cbExpansionSetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbExpansionSetActionPerformed - filter.getExpansionSetCode().clear(); - if (cbExpansionSet.getSelectedItem() instanceof ExpansionSet) { - filter.getExpansionSetCode().add(((ExpansionSet)this.cbExpansionSet.getSelectedItem()).getCode()); - } filterCards(); }//GEN-LAST:event_cbExpansionSetActionPerformed @@ -690,14 +694,11 @@ public class CardTableSelector extends javax.swing.JPanel implements ComponentLi } private void jButtonSearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed - String name = jTextFieldSearch.getText().trim(); - filter.setText(name); filterCards(); }//GEN-LAST:event_jButton1ActionPerformed private void jButtonCleanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed jTextFieldSearch.setText(""); - filter.setText(""); filterCards(); }//GEN-LAST:event_jButton2ActionPerformed diff --git a/Mage.Sets/src/mage/sets/alarareborn/FieldmistBorderpost.java b/Mage.Sets/src/mage/sets/alarareborn/FieldmistBorderpost.java index cd8ac7fe05..f595c1f62a 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/FieldmistBorderpost.java +++ b/Mage.Sets/src/mage/sets/alarareborn/FieldmistBorderpost.java @@ -40,8 +40,8 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.mana.BlueManaAbility; import mage.abilities.mana.WhiteManaAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SupertypePredicate; import mage.target.common.TargetControlledPermanent; @@ -57,8 +57,7 @@ public class FieldmistBorderpost extends CardImpl { static { filter.add(new SupertypePredicate("Basic")); - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.LAND)); } public FieldmistBorderpost (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/alarareborn/FiligreeAngel.java b/Mage.Sets/src/mage/sets/alarareborn/FiligreeAngel.java index 000b1c9776..5e8eeb4621 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/FiligreeAngel.java +++ b/Mage.Sets/src/mage/sets/alarareborn/FiligreeAngel.java @@ -41,6 +41,7 @@ import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.players.Player; @@ -73,11 +74,10 @@ public class FiligreeAngel extends CardImpl { } class FiligreeAngelEffect extends OneShotEffect { - private static FilterPermanent filter = new FilterPermanent(); + private static final FilterPermanent filter = new FilterPermanent(); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.All); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public FiligreeAngelEffect() { diff --git a/Mage.Sets/src/mage/sets/alarareborn/FirewildBorderpost.java b/Mage.Sets/src/mage/sets/alarareborn/FirewildBorderpost.java index d085096ece..05c37150f2 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/FirewildBorderpost.java +++ b/Mage.Sets/src/mage/sets/alarareborn/FirewildBorderpost.java @@ -40,8 +40,8 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.mana.GreenManaAbility; import mage.abilities.mana.RedManaAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SupertypePredicate; import mage.target.common.TargetControlledPermanent; @@ -57,8 +57,7 @@ public class FirewildBorderpost extends CardImpl { static { filter.add(new SupertypePredicate("Basic")); - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.LAND)); } public FirewildBorderpost (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/alarareborn/MistveinBorderpost.java b/Mage.Sets/src/mage/sets/alarareborn/MistveinBorderpost.java index 898cd607a9..79653ccadf 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/MistveinBorderpost.java +++ b/Mage.Sets/src/mage/sets/alarareborn/MistveinBorderpost.java @@ -40,8 +40,8 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.mana.BlackManaAbility; import mage.abilities.mana.BlueManaAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SupertypePredicate; import mage.target.common.TargetControlledPermanent; @@ -57,8 +57,7 @@ public class MistveinBorderpost extends CardImpl { static { filter.add(new SupertypePredicate("Basic")); - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.LAND)); } public MistveinBorderpost (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/alarareborn/QasaliPridemage.java b/Mage.Sets/src/mage/sets/alarareborn/QasaliPridemage.java index a8e132c3ba..3df7cbc643 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/QasaliPridemage.java +++ b/Mage.Sets/src/mage/sets/alarareborn/QasaliPridemage.java @@ -39,8 +39,9 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.keyword.ExaltedAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -52,9 +53,9 @@ public class QasaliPridemage extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("artifact or enchantment"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.ENCHANTMENT))); } public QasaliPridemage(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/alarareborn/SpellbreakerBehemoth.java b/Mage.Sets/src/mage/sets/alarareborn/SpellbreakerBehemoth.java index c9f1a99d6a..efb7ca3328 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/SpellbreakerBehemoth.java +++ b/Mage.Sets/src/mage/sets/alarareborn/SpellbreakerBehemoth.java @@ -40,6 +40,7 @@ import mage.abilities.effects.common.CantCounterSourceEffect; import mage.cards.CardImpl; import mage.filter.Filter; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.PowerPredicate; @@ -52,7 +53,7 @@ public class SpellbreakerBehemoth extends CardImpl { private static final FilterSpell filter = new FilterSpell("Creature spells you control with power 5 or greater"); static { - filter.getCardType().add(CardType.CREATURE); + filter.add(new CardTypePredicate(CardType.CREATURE)); filter.add(new PowerPredicate(Filter.ComparisonType.GreaterThan, 4)); } diff --git a/Mage.Sets/src/mage/sets/alarareborn/VeinfireBorderpost.java b/Mage.Sets/src/mage/sets/alarareborn/VeinfireBorderpost.java index bc69e67a28..bd4971d26b 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/VeinfireBorderpost.java +++ b/Mage.Sets/src/mage/sets/alarareborn/VeinfireBorderpost.java @@ -40,8 +40,8 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.mana.BlackManaAbility; import mage.abilities.mana.RedManaAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SupertypePredicate; import mage.target.common.TargetControlledPermanent; @@ -57,8 +57,7 @@ public class VeinfireBorderpost extends CardImpl { static { filter.add(new SupertypePredicate("Basic")); - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.LAND)); } public VeinfireBorderpost (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/alarareborn/VithianRenegades.java b/Mage.Sets/src/mage/sets/alarareborn/VithianRenegades.java index 9b896faf77..c0e411b109 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/VithianRenegades.java +++ b/Mage.Sets/src/mage/sets/alarareborn/VithianRenegades.java @@ -36,8 +36,8 @@ import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -48,8 +48,7 @@ public class VithianRenegades extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public VithianRenegades (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/alarareborn/WildfieldBorderpost.java b/Mage.Sets/src/mage/sets/alarareborn/WildfieldBorderpost.java index 63f2522068..7714f2d634 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/WildfieldBorderpost.java +++ b/Mage.Sets/src/mage/sets/alarareborn/WildfieldBorderpost.java @@ -40,8 +40,8 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.mana.GreenManaAbility; import mage.abilities.mana.WhiteManaAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SupertypePredicate; import mage.target.common.TargetControlledPermanent; @@ -57,8 +57,7 @@ public class WildfieldBorderpost extends CardImpl { static { filter.add(new SupertypePredicate("Basic")); - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.LAND)); } public WildfieldBorderpost (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/apocalypse/DiversionaryTactics.java b/Mage.Sets/src/mage/sets/apocalypse/DiversionaryTactics.java index cb506a5856..56cecb4585 100644 --- a/Mage.Sets/src/mage/sets/apocalypse/DiversionaryTactics.java +++ b/Mage.Sets/src/mage/sets/apocalypse/DiversionaryTactics.java @@ -37,7 +37,6 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapTargetCost; import mage.abilities.effects.common.TapTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledCreaturePermanent; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreaturePermanent; @@ -52,7 +51,6 @@ public class DiversionaryTactics extends CardImpl { static { filter.setTapped(false); filter.setUseTapped(true); - filter.setScopeCardType(Filter.ComparisonScope.Any); } public DiversionaryTactics(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/apocalypse/GoblinTrenches.java b/Mage.Sets/src/mage/sets/apocalypse/GoblinTrenches.java index ac9548c3b0..0bc3585426 100644 --- a/Mage.Sets/src/mage/sets/apocalypse/GoblinTrenches.java +++ b/Mage.Sets/src/mage/sets/apocalypse/GoblinTrenches.java @@ -39,8 +39,8 @@ import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.permanent.token.Token; import mage.target.common.TargetControlledPermanent; @@ -53,8 +53,7 @@ public class GoblinTrenches extends CardImpl { final static FilterControlledPermanent filter = new FilterControlledPermanent("a land"); static { - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.LAND)); } public GoblinTrenches(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/apocalypse/OvergrownEstate.java b/Mage.Sets/src/mage/sets/apocalypse/OvergrownEstate.java index efabe86383..e4299af27c 100644 --- a/Mage.Sets/src/mage/sets/apocalypse/OvergrownEstate.java +++ b/Mage.Sets/src/mage/sets/apocalypse/OvergrownEstate.java @@ -36,8 +36,8 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledPermanent; /** @@ -49,8 +49,7 @@ public class OvergrownEstate extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("a land"); static { - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.LAND)); } public OvergrownEstate(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/apocalypse/QuagmireDruid.java b/Mage.Sets/src/mage/sets/apocalypse/QuagmireDruid.java index 3d873909ab..8219a86fe5 100644 --- a/Mage.Sets/src/mage/sets/apocalypse/QuagmireDruid.java +++ b/Mage.Sets/src/mage/sets/apocalypse/QuagmireDruid.java @@ -40,8 +40,8 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ColoredManaCost; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; import mage.target.common.TargetControlledCreaturePermanent; @@ -54,8 +54,7 @@ public class QuagmireDruid extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("enchantment"); static { - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); } diff --git a/Mage.Sets/src/mage/sets/apocalypse/Smash.java b/Mage.Sets/src/mage/sets/apocalypse/Smash.java index b782f108a1..82443749ab 100644 --- a/Mage.Sets/src/mage/sets/apocalypse/Smash.java +++ b/Mage.Sets/src/mage/sets/apocalypse/Smash.java @@ -34,8 +34,8 @@ import mage.Constants.Rarity; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.effects.common.DrawCardControllerEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -46,8 +46,7 @@ public class Smash extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public Smash(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/apocalypse/TranquilPath.java b/Mage.Sets/src/mage/sets/apocalypse/TranquilPath.java index 74f6429545..4700cac179 100644 --- a/Mage.Sets/src/mage/sets/apocalypse/TranquilPath.java +++ b/Mage.Sets/src/mage/sets/apocalypse/TranquilPath.java @@ -38,6 +38,7 @@ import mage.abilities.effects.common.DrawCardControllerEffect; import mage.cards.CardImpl; import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; @@ -70,8 +71,7 @@ class TranquilPathEffect extends OneShotEffect { private final static FilterPermanent filter = new FilterPermanent(""); static { - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); } public TranquilPathEffect() { diff --git a/Mage.Sets/src/mage/sets/avacynrestored/BanishingStroke.java b/Mage.Sets/src/mage/sets/avacynrestored/BanishingStroke.java index d7da7d182c..c1bc2b39f5 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/BanishingStroke.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/BanishingStroke.java @@ -33,8 +33,9 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.PutOnLibraryTargetEffect; import mage.abilities.keyword.MiracleAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; import java.util.UUID; @@ -48,10 +49,10 @@ public class BanishingStroke extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("artifact, creature, or enchantment"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.CREATURE); - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.CREATURE), + new CardTypePredicate(CardType.ENCHANTMENT))); } public BanishingStroke(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/avacynrestored/BarterInBlood.java b/Mage.Sets/src/mage/sets/avacynrestored/BarterInBlood.java index fa8d94e398..1eeb442d78 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/BarterInBlood.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/BarterInBlood.java @@ -27,12 +27,13 @@ */ package mage.sets.avacynrestored; +import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; -import mage.cards.CardImpl; -import java.util.UUID; import mage.abilities.effects.common.SacrificeAllEffect; +import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -43,7 +44,7 @@ public class BarterInBlood extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("creature"); static { - filter.getCardType().add(CardType.CREATURE); + filter.add(new CardTypePredicate(CardType.CREATURE)); } public BarterInBlood(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/avacynrestored/BrunaLightOfAlabaster.java b/Mage.Sets/src/mage/sets/avacynrestored/BrunaLightOfAlabaster.java index c94fdd094c..12f7d65ded 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/BrunaLightOfAlabaster.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/BrunaLightOfAlabaster.java @@ -41,6 +41,7 @@ import mage.cards.CardImpl; import mage.filter.FilterCard; import mage.filter.common.FilterAura; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -91,7 +92,7 @@ class BrunaLightOfAlabasterEffect extends OneShotEffect { private static final FilterPermanent filter = new FilterPermanent("enchantment"); static { - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); } public Cursebreak(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/avacynrestored/DevoutChaplain.java b/Mage.Sets/src/mage/sets/avacynrestored/DevoutChaplain.java index c603cc5817..560c3afb9d 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/DevoutChaplain.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/DevoutChaplain.java @@ -37,10 +37,11 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.common.TapTargetCost; import mage.abilities.effects.common.ExileTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; import mage.target.common.TargetControlledPermanent; @@ -54,9 +55,9 @@ public class DevoutChaplain extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("artifact or enchantment"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.ENCHANTMENT))); } private final static FilterControlledPermanent humanFilter = new FilterControlledPermanent("untapped Human you control"); diff --git a/Mage.Sets/src/mage/sets/avacynrestored/DualCasting.java b/Mage.Sets/src/mage/sets/avacynrestored/DualCasting.java index a1f16ffe7c..f67c70b461 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/DualCasting.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/DualCasting.java @@ -42,8 +42,9 @@ import mage.abilities.effects.common.CopyTargetSpellEffect; import mage.abilities.effects.common.continious.GainAbilityAttachedEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterSpell; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; import mage.target.TargetSpell; import mage.target.common.TargetCreaturePermanent; @@ -56,9 +57,9 @@ public class DualCasting extends CardImpl { private static final FilterSpell filter = new FilterSpell("instant or sorcery spell"); static { - filter.getCardType().add(CardType.INSTANT); - filter.getCardType().add(CardType.SORCERY); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.INSTANT), + new CardTypePredicate(CardType.SORCERY))); } public DualCasting(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/avacynrestored/GeistSnatch.java b/Mage.Sets/src/mage/sets/avacynrestored/GeistSnatch.java index 66b5cfcb17..a6a020ab20 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/GeistSnatch.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/GeistSnatch.java @@ -36,6 +36,7 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.token.Token; import mage.target.TargetSpell; @@ -51,7 +52,7 @@ public class GeistSnatch extends CardImpl { private static final FilterSpell filter = new FilterSpell("creature spell"); static { - filter.getCardType().add(CardType.CREATURE); + filter.add(new CardTypePredicate(CardType.CREATURE)); } public GeistSnatch(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/avacynrestored/GhostlyFlicker.java b/Mage.Sets/src/mage/sets/avacynrestored/GhostlyFlicker.java index da1229eb1f..d5ed11d085 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/GhostlyFlicker.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/GhostlyFlicker.java @@ -34,8 +34,9 @@ import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.common.TargetControlledPermanent; @@ -50,10 +51,10 @@ public class GhostlyFlicker extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("artifacts, creatures, and/or lands you control"); static { - filter.getCardType().add(CardType.CREATURE); - filter.getCardType().add(CardType.LAND); - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.CREATURE), + new CardTypePredicate(CardType.LAND), + new CardTypePredicate(CardType.ARTIFACT))); } public GhostlyFlicker(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/avacynrestored/LunarMystic.java b/Mage.Sets/src/mage/sets/avacynrestored/LunarMystic.java index 3bd2072317..b4524f7436 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/LunarMystic.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/LunarMystic.java @@ -36,6 +36,7 @@ import mage.abilities.effects.common.DoIfCostPaid; import mage.abilities.effects.common.DrawCardControllerEffect; import mage.cards.CardImpl; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.CardTypePredicate; import java.util.UUID; @@ -48,7 +49,7 @@ public class LunarMystic extends CardImpl { private static final FilterSpell filter = new FilterSpell("an instant spell"); static { - filter.getCardType().add(CardType.INSTANT); + filter.add(new CardTypePredicate(CardType.INSTANT)); } public LunarMystic(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/avacynrestored/NaturalEnd.java b/Mage.Sets/src/mage/sets/avacynrestored/NaturalEnd.java index 1d994ec9d9..102d25f591 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/NaturalEnd.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/NaturalEnd.java @@ -33,8 +33,9 @@ import mage.Constants.Rarity; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -46,9 +47,9 @@ public class NaturalEnd extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("artifact or enchantment"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.ENCHANTMENT))); } public NaturalEnd(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/avacynrestored/RiteOfRuin.java b/Mage.Sets/src/mage/sets/avacynrestored/RiteOfRuin.java index 44deb82dbd..30c57a36f0 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/RiteOfRuin.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/RiteOfRuin.java @@ -38,6 +38,7 @@ import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; import mage.choices.ChoiceImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -111,7 +112,7 @@ class RiteOfRuinEffect extends OneShotEffect { int count = 1; for (CardType cardType : order) { FilterControlledPermanent filter = new FilterControlledPermanent(cardType + " permanent you control"); - filter.getCardType().add(cardType); + filter.add(new CardTypePredicate(cardType)); for (UUID playerId : controller.getInRange()) { int amount = Math.min(count, game.getBattlefield().countAll(filter, playerId, game)); diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/AkkiBlizzardHerder.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/AkkiBlizzardHerder.java index 146488e203..e01a4ca32a 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/AkkiBlizzardHerder.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/AkkiBlizzardHerder.java @@ -36,6 +36,7 @@ import mage.abilities.common.DiesTriggeredAbility; import mage.abilities.effects.common.SacrificeAllEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -45,7 +46,7 @@ public class AkkiBlizzardHerder extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("land"); static { - filter.getCardType().add(CardType.LAND); + filter.add(new CardTypePredicate(CardType.LAND)); } public AkkiBlizzardHerder(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/FinalJudgment.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/FinalJudgment.java index 6daeba065b..3238e54994 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/FinalJudgment.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/FinalJudgment.java @@ -33,8 +33,8 @@ import mage.Constants.Rarity; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; @@ -70,8 +70,7 @@ class FinalJudgmentEffect extends OneShotEffect { private final static FilterPermanent filter = new FilterPermanent(""); static { - filter.getCardType().add(CardType.CREATURE); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.CREATURE)); } public FinalJudgmentEffect() { diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/Floodbringer.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/Floodbringer.java index 8b9d31224c..6521b1914c 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/Floodbringer.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/Floodbringer.java @@ -40,8 +40,8 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.TapTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetLandPermanent; @@ -54,8 +54,7 @@ public class Floodbringer extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("a land"); static { - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.LAND)); } public Floodbringer(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/AkkiAvalanchers.java b/Mage.Sets/src/mage/sets/championsofkamigawa/AkkiAvalanchers.java index 3c8df4a507..8b46a5e69a 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/AkkiAvalanchers.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/AkkiAvalanchers.java @@ -39,8 +39,8 @@ import mage.abilities.common.ActivateOncePerTurnActivatedAbility; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledPermanent; /** @@ -51,8 +51,7 @@ public class AkkiAvalanchers extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("a land"); static { - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.LAND)); } public AkkiAvalanchers(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/AuraOfDominion.java b/Mage.Sets/src/mage/sets/championsofkamigawa/AuraOfDominion.java index b5bff7c94c..cc093f6f8d 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/AuraOfDominion.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/AuraOfDominion.java @@ -41,7 +41,6 @@ import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.UntapEnchantedEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledCreaturePermanent; import mage.target.TargetPermanent; import mage.target.common.TargetControlledCreaturePermanent; @@ -57,7 +56,6 @@ public class AuraOfDominion extends CardImpl { static { filter.setTapped(false); filter.setUseTapped(true); - filter.setScopeCardType(Filter.ComparisonScope.Any); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/Befoul.java b/Mage.Sets/src/mage/sets/championsofkamigawa/Befoul.java index 7d4d99523a..66d0486b4b 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/Befoul.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/Befoul.java @@ -37,6 +37,9 @@ import mage.ObjectColor; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.TargetPermanent; /** @@ -48,10 +51,11 @@ public class Befoul extends CardImpl { public static final FilterPermanent filter = new FilterPermanent("land or nonblack creature"); static { - filter.getCardType().add(CardType.LAND); - filter.getCardType().add(CardType.CREATURE); - filter.setNotColor(true); - filter.setColor(ObjectColor.BLACK); + filter.add(Predicates.or( + new CardTypePredicate(CardType.LAND), + Predicates.and( + Predicates.not(new ColorPredicate(ObjectColor.BLACK)), + new CardTypePredicate(CardType.CREATURE)))); } public Befoul (UUID ownerId) { super(ownerId, 102, "Befoul", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{B}{B}"); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/BudokaGardener.java b/Mage.Sets/src/mage/sets/championsofkamigawa/BudokaGardener.java index 3d02edc2d6..7aff14b150 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/BudokaGardener.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/BudokaGardener.java @@ -45,9 +45,9 @@ import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.cards.Card; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; import mage.filter.common.FilterLandCard; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.permanent.token.Token; @@ -137,8 +137,7 @@ class DokaiWeaverofLifeToken extends Token { final static FilterControlledPermanent filterLands = new FilterControlledPermanent("lands"); static { - filterLands.getCardType().add(CardType.LAND); - filterLands.setScopeCardType(Filter.ComparisonScope.Any); + filterLands.add(new CardTypePredicate(CardType.LAND)); } DokaiWeaverofLifeToken() { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/Cleanfall.java b/Mage.Sets/src/mage/sets/championsofkamigawa/Cleanfall.java index 9400b648b8..473818646a 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/Cleanfall.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/Cleanfall.java @@ -34,8 +34,8 @@ import mage.Constants.CardType; import mage.Constants.Rarity; import mage.abilities.effects.common.DestroyAllEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @author Loki @@ -45,8 +45,7 @@ public class Cleanfall extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("enchantments"); static { - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); } public Cleanfall(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/CommuneWithNature.java b/Mage.Sets/src/mage/sets/championsofkamigawa/CommuneWithNature.java index e12e433a1d..f80a814b46 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/CommuneWithNature.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/CommuneWithNature.java @@ -35,6 +35,7 @@ import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.common.LookLibraryAndPickControllerEffect; import mage.cards.CardImpl; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -44,14 +45,14 @@ public class CommuneWithNature extends CardImpl { private final static FilterCard filter = new FilterCard("creature card"); static { - filter.getCardType().add(CardType.CREATURE); - } + filter.add(new CardTypePredicate(CardType.CREATURE)); + } public CommuneWithNature (UUID ownerId) { super(ownerId, 204, "Commune with Nature", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{G}"); this.expansionSetCode = "CHK"; - this.color.setGreen(true); + this.color.setGreen(true); // Look at the top five cards of your library. You may reveal a creature card from among them and put it into your hand. Put the rest on the bottom of your library in any order. this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(new StaticValue(5), false, new StaticValue(1), filter, false)); @@ -67,4 +68,3 @@ public class CommuneWithNature extends CardImpl { } } - diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/FeastOfWorms.java b/Mage.Sets/src/mage/sets/championsofkamigawa/FeastOfWorms.java index d58bf454dd..48c635ace3 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/FeastOfWorms.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/FeastOfWorms.java @@ -38,6 +38,7 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -52,15 +53,15 @@ public class FeastOfWorms extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent(); static { - filter.getCardType().add(CardType.LAND); - } + filter.add(new CardTypePredicate(CardType.LAND)); + } public FeastOfWorms (UUID ownerId) { super(ownerId, 216, "Feast of Worms", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{G}{G}"); this.expansionSetCode = "CHK"; this.subtype.add("Arcane"); - this.color.setGreen(true); + this.color.setGreen(true); // Destroy target land. If that land was legendary, its controller sacrifices another land. this.getSpellAbility().addEffect(new DestroyTargetEffect()); @@ -103,7 +104,7 @@ class FeastOfWormsEffect extends OneShotEffect { if (targetPlayer != null && permanent != null && (permanent.getSupertype().get(0).toString().equals("Legendary"))) { FilterControlledPermanent filter = new FilterControlledPermanent("land to sacrifice"); - filter.getCardType().add(CardType.LAND); + filter.add(new CardTypePredicate(CardType.LAND)); filter.getControllerId().add(targetPlayer.getId()); filter.setNotController(false); TargetControlledPermanent target = new TargetControlledPermanent(1, 1, filter, false); diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/Frostwielder.java b/Mage.Sets/src/mage/sets/championsofkamigawa/Frostwielder.java index 76d9309961..b1c6c0bbfb 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/Frostwielder.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/Frostwielder.java @@ -43,8 +43,8 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.ReplacementEffectImpl; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -61,8 +61,7 @@ public class Frostwielder extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("a land"); static { - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.LAND)); } public Frostwielder(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/JoyousRespite.java b/Mage.Sets/src/mage/sets/championsofkamigawa/JoyousRespite.java index b9f721bf6f..988b9ad0b6 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/JoyousRespite.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/JoyousRespite.java @@ -35,6 +35,7 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -44,8 +45,8 @@ public class JoyousRespite extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent(); static { - filter.getCardType().add(CardType.LAND); - } + filter.add(new CardTypePredicate(CardType.LAND)); + } public JoyousRespite (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/KamiOfAncientLaw.java b/Mage.Sets/src/mage/sets/championsofkamigawa/KamiOfAncientLaw.java index 7941cee457..bf742425eb 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/KamiOfAncientLaw.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/KamiOfAncientLaw.java @@ -39,8 +39,8 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -51,8 +51,7 @@ public class KamiOfAncientLaw extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("enchantment"); static { - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); } public KamiOfAncientLaw (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/KumanoMasterYamabushi.java b/Mage.Sets/src/mage/sets/championsofkamigawa/KumanoMasterYamabushi.java index 55d628735c..adae10259d 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/KumanoMasterYamabushi.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/KumanoMasterYamabushi.java @@ -45,8 +45,8 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.ReplacementEffectImpl; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -65,8 +65,7 @@ public class KumanoMasterYamabushi extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("a land"); static { - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.LAND)); } public KumanoMasterYamabushi(UUID ownerId) { @@ -131,11 +130,11 @@ class KumanaoMasterYamabushiEffect extends ReplacementEffectImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("a land"); static { - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.LAND)); } public KumanosPupil(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/MelokuTheCloudedMirror.java b/Mage.Sets/src/mage/sets/championsofkamigawa/MelokuTheCloudedMirror.java index e98fb13698..bded380684 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/MelokuTheCloudedMirror.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/MelokuTheCloudedMirror.java @@ -41,8 +41,8 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.permanent.token.Token; import mage.target.common.TargetControlledPermanent; @@ -54,8 +54,7 @@ public class MelokuTheCloudedMirror extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("a land"); static { - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.LAND)); } public MelokuTheCloudedMirror(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/MyojinOfLifesWeb.java b/Mage.Sets/src/mage/sets/championsofkamigawa/MyojinOfLifesWeb.java index 571c2f2b72..1c32307d8e 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/MyojinOfLifesWeb.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/MyojinOfLifesWeb.java @@ -50,6 +50,7 @@ import mage.abilities.keyword.IndestructibleAbility; import mage.cards.CardImpl; import mage.counters.CounterType; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetCardInHand; import mage.watchers.common.CastFromHandWatcher; @@ -60,7 +61,7 @@ public class MyojinOfLifesWeb extends CardImpl { private static final FilterCard filter = new FilterCard("any number of creature cards from your hand"); static { - filter.getCardType().add(CardType.CREATURE); + filter.add(new CardTypePredicate(CardType.CREATURE)); filter.setTargetOwner(TargetController.YOU); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/PeerThroughDepths.java b/Mage.Sets/src/mage/sets/championsofkamigawa/PeerThroughDepths.java index b1e2ced9ec..7a6a9dd997 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/PeerThroughDepths.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/PeerThroughDepths.java @@ -34,8 +34,9 @@ import mage.Constants.Rarity; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.common.LookLibraryAndPickControllerEffect; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -45,10 +46,10 @@ public class PeerThroughDepths extends CardImpl { private final static FilterCard filter = new FilterCard("instant or sorcery card"); static { - filter.getCardType().add(CardType.SORCERY); - filter.getCardType().add(CardType.INSTANT); - filter.setScopeCardType(ComparisonScope.Any); - } + filter.add(Predicates.or( + new CardTypePredicate(CardType.SORCERY), + new CardTypePredicate(CardType.INSTANT))); + } public PeerThroughDepths (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/QuietPurity.java b/Mage.Sets/src/mage/sets/championsofkamigawa/QuietPurity.java index 64cf15ec71..b621cc1717 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/QuietPurity.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/QuietPurity.java @@ -34,8 +34,8 @@ import mage.Constants.CardType; import mage.Constants.Rarity; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -46,8 +46,7 @@ public class QuietPurity extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("Enchantment"); static { - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); } public QuietPurity(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiCloudskater.java b/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiCloudskater.java index f25206f08d..5431075d84 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiCloudskater.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiCloudskater.java @@ -41,8 +41,8 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.DrawDiscardControllerEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledPermanent; /** @@ -53,8 +53,7 @@ public class SoratamiCloudskater extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("a land"); static { - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.LAND)); } public SoratamiCloudskater(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiMirrorGuard.java b/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiMirrorGuard.java index a92d0354db..94a373300d 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiMirrorGuard.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiMirrorGuard.java @@ -45,6 +45,7 @@ import mage.cards.CardImpl; import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.PowerPredicate; import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetCreaturePermanent; @@ -58,8 +59,7 @@ public class SoratamiMirrorGuard extends CardImpl { private final static FilterCreaturePermanent filterCreature = new FilterCreaturePermanent("creature with power 2 or less"); static { - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.LAND)); filterCreature.add(new PowerPredicate(Filter.ComparisonType.LessThan, 3)); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiMirrorMage.java b/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiMirrorMage.java index 8cab76ba57..5c4ca44112 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiMirrorMage.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiMirrorMage.java @@ -41,8 +41,8 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetCreaturePermanent; @@ -54,8 +54,7 @@ public class SoratamiMirrorMage extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("lands"); static { - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.LAND)); } public SoratamiMirrorMage(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiRainshaper.java b/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiRainshaper.java index 604807ff28..6f5840ed7e 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiRainshaper.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiRainshaper.java @@ -42,8 +42,8 @@ import mage.abilities.effects.common.continious.GainAbilityTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.ShroudAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetControlledPermanent; @@ -55,8 +55,7 @@ public class SoratamiRainshaper extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("a land"); static { - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.LAND)); } public SoratamiRainshaper(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiSavant.java b/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiSavant.java index 9d8837f7d5..ff452ba9da 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiSavant.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiSavant.java @@ -41,8 +41,8 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.CounterUnlessPaysEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetSpell; import mage.target.common.TargetControlledPermanent; @@ -54,8 +54,7 @@ public class SoratamiSavant extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("a land"); static { - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.LAND)); } public SoratamiSavant(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiSeer.java b/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiSeer.java index 5240f47b50..78a2dce4ad 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiSeer.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/SoratamiSeer.java @@ -42,8 +42,8 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.Card; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.players.Player; import mage.target.common.TargetControlledPermanent; @@ -56,8 +56,7 @@ public class SoratamiSeer extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("lands"); static { - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.LAND)); } public SoratamiSeer(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/StrengthOfCedars.java b/Mage.Sets/src/mage/sets/championsofkamigawa/StrengthOfCedars.java index c57e28d830..4bca368ba0 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/StrengthOfCedars.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/StrengthOfCedars.java @@ -36,8 +36,8 @@ import mage.Constants.Rarity; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.continious.BoostTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -48,8 +48,7 @@ public class StrengthOfCedars extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("land your control"); static { - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.LAND)); } public StrengthOfCedars (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/TimeOfNeed.java b/Mage.Sets/src/mage/sets/championsofkamigawa/TimeOfNeed.java index ce02a0e2b3..fffecc350c 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/TimeOfNeed.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/TimeOfNeed.java @@ -35,6 +35,7 @@ import mage.Constants.Rarity; import mage.abilities.effects.common.search.SearchLibraryRevealPutInHandEffect; import mage.cards.CardImpl; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SupertypePredicate; import mage.target.common.TargetCardInLibrary; @@ -46,7 +47,7 @@ public class TimeOfNeed extends CardImpl { private final static FilterCard filter = new FilterCard("legendary creature card"); static { - filter.getCardType().add(CardType.CREATURE); + filter.add(new CardTypePredicate(CardType.CREATURE)); filter.add(new SupertypePredicate("Legendary")); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/UyoSilentProphet.java b/Mage.Sets/src/mage/sets/championsofkamigawa/UyoSilentProphet.java index ccdd435780..e49e73aa31 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/UyoSilentProphet.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/UyoSilentProphet.java @@ -40,9 +40,10 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.CopyTargetSpellEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterSpell; import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetSpell; import mage.target.common.TargetControlledPermanent; @@ -55,9 +56,9 @@ public class UyoSilentProphet extends CardImpl { private final static FilterSpell filter = new FilterSpell("instant or sorcery spell"); static { - filter.getCardType().add(CardType.INSTANT); - filter.getCardType().add(CardType.SORCERY); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.INSTANT), + new CardTypePredicate(CardType.SORCERY))); } public UyoSilentProphet(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/conflux/Countersquall.java b/Mage.Sets/src/mage/sets/conflux/Countersquall.java index a7f8f61e25..d3203022c5 100644 --- a/Mage.Sets/src/mage/sets/conflux/Countersquall.java +++ b/Mage.Sets/src/mage/sets/conflux/Countersquall.java @@ -34,6 +34,8 @@ import mage.abilities.effects.common.CounterTargetEffect; import mage.abilities.effects.common.LoseLifeControllerEffect; import mage.cards.CardImpl; import mage.filter.FilterSpell; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetSpell; /** @@ -45,7 +47,7 @@ public class Countersquall extends CardImpl { private static final FilterSpell filter = new FilterSpell("noncreature spell"); static { - filter.getNotCardType().add(CardType.CREATURE); + filter.add(Predicates.not(new CardTypePredicate(CardType.CREATURE))); } public Countersquall(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/conflux/Esperzoa.java b/Mage.Sets/src/mage/sets/conflux/Esperzoa.java index 365f6e87e5..c1b6b56c0e 100644 --- a/Mage.Sets/src/mage/sets/conflux/Esperzoa.java +++ b/Mage.Sets/src/mage/sets/conflux/Esperzoa.java @@ -39,8 +39,8 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledPermanent; /** @@ -51,8 +51,7 @@ public class Esperzoa extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public Esperzoa (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/conflux/EtherswornAdjudicator.java b/Mage.Sets/src/mage/sets/conflux/EtherswornAdjudicator.java index e421b77738..14683ecf0f 100644 --- a/Mage.Sets/src/mage/sets/conflux/EtherswornAdjudicator.java +++ b/Mage.Sets/src/mage/sets/conflux/EtherswornAdjudicator.java @@ -41,8 +41,9 @@ import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.effects.common.UntapSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledPermanent; /** @@ -53,9 +54,9 @@ public class EtherswornAdjudicator extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("creature or enchantment"); static { - filter.getCardType().add(CardType.CREATURE); - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.CREATURE), + new CardTypePredicate(CardType.ENCHANTMENT))); } public EtherswornAdjudicator(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/conflux/FaerieMechanist.java b/Mage.Sets/src/mage/sets/conflux/FaerieMechanist.java index 4a5d737864..dfe4e7cfe3 100644 --- a/Mage.Sets/src/mage/sets/conflux/FaerieMechanist.java +++ b/Mage.Sets/src/mage/sets/conflux/FaerieMechanist.java @@ -38,6 +38,7 @@ import mage.abilities.effects.common.LookLibraryAndPickControllerEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -47,7 +48,7 @@ public class FaerieMechanist extends CardImpl { private final static FilterCard filter = new FilterCard("artifact card"); static { - filter.getCardType().add(CardType.ARTIFACT); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public FaerieMechanist(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/conflux/FiligreeFracture.java b/Mage.Sets/src/mage/sets/conflux/FiligreeFracture.java index a209ad11f6..f93ab31f16 100644 --- a/Mage.Sets/src/mage/sets/conflux/FiligreeFracture.java +++ b/Mage.Sets/src/mage/sets/conflux/FiligreeFracture.java @@ -36,8 +36,9 @@ import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -52,9 +53,9 @@ public class FiligreeFracture extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("artifact or enchantment"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.ENCHANTMENT))); } public FiligreeFracture(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/conflux/GoblinRazerunners.java b/Mage.Sets/src/mage/sets/conflux/GoblinRazerunners.java index 20a5f38cfa..d7d34e9236 100644 --- a/Mage.Sets/src/mage/sets/conflux/GoblinRazerunners.java +++ b/Mage.Sets/src/mage/sets/conflux/GoblinRazerunners.java @@ -44,8 +44,8 @@ import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.counters.CounterType; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPlayer; import mage.target.common.TargetControlledPermanent; @@ -54,11 +54,10 @@ import mage.target.common.TargetControlledPermanent; * @author Loki */ public class GoblinRazerunners extends CardImpl { - private static FilterControlledPermanent filter = new FilterControlledPermanent("a land"); + private static final FilterControlledPermanent filter = new FilterControlledPermanent("a land"); static { - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.LAND)); } public GoblinRazerunners (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/conflux/KnightOfTheReliquary.java b/Mage.Sets/src/mage/sets/conflux/KnightOfTheReliquary.java index 76fd668993..06f488a2f6 100644 --- a/Mage.Sets/src/mage/sets/conflux/KnightOfTheReliquary.java +++ b/Mage.Sets/src/mage/sets/conflux/KnightOfTheReliquary.java @@ -44,10 +44,10 @@ import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.common.FilterControlledPermanent; import mage.filter.common.FilterLandCard; import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCardInLibrary; import mage.target.common.TargetControlledPermanent; @@ -61,8 +61,7 @@ public class KnightOfTheReliquary extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("Forest or Plains"); static { - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.LAND)); filter.add(Predicates.or(new SubtypePredicate("Forest"), new SubtypePredicate("Plains"))); } diff --git a/Mage.Sets/src/mage/sets/conflux/MoltenFrame.java b/Mage.Sets/src/mage/sets/conflux/MoltenFrame.java index 1e267ec465..ccd4b4b562 100644 --- a/Mage.Sets/src/mage/sets/conflux/MoltenFrame.java +++ b/Mage.Sets/src/mage/sets/conflux/MoltenFrame.java @@ -35,8 +35,8 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.keyword.CyclingAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -48,8 +48,7 @@ public class MoltenFrame extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("artifact creature"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public MoltenFrame(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/conflux/NicolBolasPlaneswalker.java b/Mage.Sets/src/mage/sets/conflux/NicolBolasPlaneswalker.java index 40c7e03721..124f9c9226 100644 --- a/Mage.Sets/src/mage/sets/conflux/NicolBolasPlaneswalker.java +++ b/Mage.Sets/src/mage/sets/conflux/NicolBolasPlaneswalker.java @@ -42,6 +42,8 @@ import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.counters.CounterType; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; import mage.target.TargetPlayer; import mage.target.common.TargetCreaturePermanent; @@ -55,7 +57,7 @@ public class NicolBolasPlaneswalker extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("noncreature permanent"); static { - filter.getNotCardType().add(CardType.CREATURE); + filter.add(Predicates.not(new CardTypePredicate(CardType.CREATURE))); } public NicolBolasPlaneswalker(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/conflux/SigilOfTheEmptyThrone.java b/Mage.Sets/src/mage/sets/conflux/SigilOfTheEmptyThrone.java index 3200c052b1..f202e680d9 100644 --- a/Mage.Sets/src/mage/sets/conflux/SigilOfTheEmptyThrone.java +++ b/Mage.Sets/src/mage/sets/conflux/SigilOfTheEmptyThrone.java @@ -35,6 +35,7 @@ import mage.abilities.common.SpellCastTriggeredAbility; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.permanent.token.AngelToken; /** @@ -46,7 +47,7 @@ public class SigilOfTheEmptyThrone extends CardImpl { private static final FilterSpell filter = new FilterSpell("an enchantment spell"); static { - filter.getCardType().add(CardType.ENCHANTMENT); + filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); } public SigilOfTheEmptyThrone(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/darkascension/AfflictedDeserter.java b/Mage.Sets/src/mage/sets/darkascension/AfflictedDeserter.java index 5f1d0b37c2..566bc86b5f 100644 --- a/Mage.Sets/src/mage/sets/darkascension/AfflictedDeserter.java +++ b/Mage.Sets/src/mage/sets/darkascension/AfflictedDeserter.java @@ -43,8 +43,8 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.TransformSourceEffect; import mage.abilities.keyword.TransformAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; @@ -95,8 +95,7 @@ class WerewolfRansackerAbility extends TriggeredAbilityImpl { private static final FilterSpell filter = new FilterSpell("creature spell"); static { - filter.getCardType().add(CardType.CREATURE); + filter.add(new CardTypePredicate(CardType.CREATURE)); } public BoneToAsh(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/darkascension/Counterlash.java b/Mage.Sets/src/mage/sets/darkascension/Counterlash.java index 6658e3617a..dec7db0fb8 100644 --- a/Mage.Sets/src/mage/sets/darkascension/Counterlash.java +++ b/Mage.Sets/src/mage/sets/darkascension/Counterlash.java @@ -27,16 +27,20 @@ */ package mage.sets.darkascension; +import java.util.ArrayList; import java.util.UUID; import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterCard; +import mage.filter.predicate.Predicate; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.stack.StackObject; import mage.players.Player; @@ -94,11 +98,13 @@ class CounterlashEffect extends OneShotEffect { game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game); if (player.chooseUse(Constants.Outcome.PutCardInPlay, "Cast a nonland card in your hand that shares a card type with that spell without paying its mana cost?", game)) { FilterCard filter = new FilterCard(); + ArrayList> types = new ArrayList>(); for (CardType type: stackObject.getCardType()) { - if (type != CardType.LAND) - filter.getCardType().add(type); + if (type != CardType.LAND) { + types.add(new CardTypePredicate(type)); + } } - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(Predicates.or(types)); TargetCardInHand target = new TargetCardInHand(filter); if (player.choose(Constants.Outcome.PutCardInPlay, target, source.getSourceId(), game)) { Card card = player.getHand().get(target.getFirstTarget(), game); diff --git a/Mage.Sets/src/mage/sets/darkascension/CurseOfEchoes.java b/Mage.Sets/src/mage/sets/darkascension/CurseOfEchoes.java index b4bb562660..903b2a0e54 100644 --- a/Mage.Sets/src/mage/sets/darkascension/CurseOfEchoes.java +++ b/Mage.Sets/src/mage/sets/darkascension/CurseOfEchoes.java @@ -38,8 +38,9 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.AttachEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterSpell; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; @@ -87,9 +88,9 @@ class CurseOfEchoesCopyTriggeredAbility extends TriggeredAbilityImpl { private static final FilterNonTokenPermanent filter = new FilterNonTokenPermanent("nontoken creature"); static { - filter.getCardType().add(CardType.CREATURE); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.CREATURE)); filter.setTargetController(Constants.TargetController.YOU); } diff --git a/Mage.Sets/src/mage/sets/darkascension/IncreasingVengeance.java b/Mage.Sets/src/mage/sets/darkascension/IncreasingVengeance.java index 49b93250db..7fead2840b 100644 --- a/Mage.Sets/src/mage/sets/darkascension/IncreasingVengeance.java +++ b/Mage.Sets/src/mage/sets/darkascension/IncreasingVengeance.java @@ -36,8 +36,9 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.FlashbackAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterSpell; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.stack.Spell; import mage.target.TargetSpell; @@ -51,9 +52,9 @@ public class IncreasingVengeance extends CardImpl { private final static FilterSpell filter = new FilterSpell("instant or sorcery spell"); static { - filter.getCardType().add(CardType.INSTANT); - filter.getCardType().add(CardType.SORCERY); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.INSTANT), + new CardTypePredicate(CardType.SORCERY))); filter.setTargetController(Constants.TargetController.YOU); } diff --git a/Mage.Sets/src/mage/sets/darkascension/MysticRetrieval.java b/Mage.Sets/src/mage/sets/darkascension/MysticRetrieval.java index ec33f76c2f..ac8e101a3e 100644 --- a/Mage.Sets/src/mage/sets/darkascension/MysticRetrieval.java +++ b/Mage.Sets/src/mage/sets/darkascension/MysticRetrieval.java @@ -36,8 +36,9 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.keyword.FlashbackAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetCardInYourGraveyard; /** @@ -48,9 +49,9 @@ public class MysticRetrieval extends CardImpl { private static final FilterCard filter = new FilterCard("instant or sorcery card from your graveyard"); static { - filter.getCardType().add(CardType.INSTANT); - filter.getCardType().add(CardType.SORCERY); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.INSTANT), + new CardTypePredicate(CardType.SORCERY))); } public MysticRetrieval(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/darkascension/RayOfRevelation.java b/Mage.Sets/src/mage/sets/darkascension/RayOfRevelation.java index 65f74cdedd..15bd3eb130 100644 --- a/Mage.Sets/src/mage/sets/darkascension/RayOfRevelation.java +++ b/Mage.Sets/src/mage/sets/darkascension/RayOfRevelation.java @@ -36,6 +36,7 @@ import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.keyword.FlashbackAbility; import mage.cards.CardImpl; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -47,7 +48,7 @@ public class RayOfRevelation extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("enchantment"); static { - filter.getCardType().add(CardType.ENCHANTMENT); + filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); } public RayOfRevelation(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/darkascension/SorinLordOfInnistrad.java b/Mage.Sets/src/mage/sets/darkascension/SorinLordOfInnistrad.java index 096a9390d0..1f931e9b19 100644 --- a/Mage.Sets/src/mage/sets/darkascension/SorinLordOfInnistrad.java +++ b/Mage.Sets/src/mage/sets/darkascension/SorinLordOfInnistrad.java @@ -46,8 +46,9 @@ import mage.abilities.keyword.LifelinkAbility; import mage.cards.Card; import mage.cards.CardImpl; import mage.counters.CounterType; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.command.Emblem; import mage.game.permanent.Permanent; @@ -66,9 +67,9 @@ public class SorinLordOfInnistrad extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("creature or planeswalker"); static { - filter.getCardType().add(CardType.CREATURE); - filter.getCardType().add(CardType.PLANESWALKER); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.CREATURE), + new CardTypePredicate(CardType.PLANESWALKER))); } public SorinLordOfInnistrad(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/darksteel/ArcaneSpyglass.java b/Mage.Sets/src/mage/sets/darksteel/ArcaneSpyglass.java index 45357677e7..436f6a13f0 100644 --- a/Mage.Sets/src/mage/sets/darksteel/ArcaneSpyglass.java +++ b/Mage.Sets/src/mage/sets/darksteel/ArcaneSpyglass.java @@ -43,8 +43,8 @@ import mage.abilities.effects.common.DrawCardControllerEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.counters.CounterType; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledPermanent; /** @@ -56,8 +56,7 @@ public class ArcaneSpyglass extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("a land"); static { - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.LAND)); } public ArcaneSpyglass (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/darksteel/Coretapper.java b/Mage.Sets/src/mage/sets/darksteel/Coretapper.java index 0e60b06ee5..cf5e53e0e9 100644 --- a/Mage.Sets/src/mage/sets/darksteel/Coretapper.java +++ b/Mage.Sets/src/mage/sets/darksteel/Coretapper.java @@ -41,8 +41,8 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.counter.AddCountersTargetEffect; import mage.cards.CardImpl; import mage.counters.CounterType; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -53,8 +53,7 @@ public class Coretapper extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public Coretapper(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/darksteel/DarksteelForge.java b/Mage.Sets/src/mage/sets/darksteel/DarksteelForge.java index aef0e7e416..fe6d61c921 100644 --- a/Mage.Sets/src/mage/sets/darksteel/DarksteelForge.java +++ b/Mage.Sets/src/mage/sets/darksteel/DarksteelForge.java @@ -37,8 +37,8 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.continious.GainAbilityControlledEffect; import mage.abilities.keyword.IndestructibleAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @author Loki @@ -48,8 +48,7 @@ public class DarksteelForge extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("Artifacts"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public DarksteelForge(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/darksteel/EchoingCalm.java b/Mage.Sets/src/mage/sets/darksteel/EchoingCalm.java index 84fca0f4f2..3f51b5fcdd 100644 --- a/Mage.Sets/src/mage/sets/darksteel/EchoingCalm.java +++ b/Mage.Sets/src/mage/sets/darksteel/EchoingCalm.java @@ -35,8 +35,8 @@ import mage.Constants.Rarity; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.TargetPermanent; @@ -48,8 +48,7 @@ public class EchoingCalm extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("enchantment"); static { - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); } public EchoingCalm(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/darksteel/EmissaryOfHope.java b/Mage.Sets/src/mage/sets/darksteel/EmissaryOfHope.java index 298920e699..80a88adb32 100644 --- a/Mage.Sets/src/mage/sets/darksteel/EmissaryOfHope.java +++ b/Mage.Sets/src/mage/sets/darksteel/EmissaryOfHope.java @@ -40,6 +40,7 @@ import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.players.Player; @@ -77,8 +78,7 @@ class EmissaryOfHopeEffect extends OneShotEffect { private final static FilterPermanent filter = new FilterPermanent("artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); filter.setTargetController(Constants.TargetController.YOU); } diff --git a/Mage.Sets/src/mage/sets/darksteel/KrarkClanStoker.java b/Mage.Sets/src/mage/sets/darksteel/KrarkClanStoker.java index 886e6c80b8..5e49302135 100644 --- a/Mage.Sets/src/mage/sets/darksteel/KrarkClanStoker.java +++ b/Mage.Sets/src/mage/sets/darksteel/KrarkClanStoker.java @@ -39,8 +39,8 @@ import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.effects.common.BasicManaEffect; import mage.abilities.mana.BasicManaAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledPermanent; /** @@ -51,8 +51,7 @@ public class KrarkClanStoker extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("an artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public KrarkClanStoker(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/darksteel/MagneticFlux.java b/Mage.Sets/src/mage/sets/darksteel/MagneticFlux.java index 0f56ec40c5..2186c78a12 100644 --- a/Mage.Sets/src/mage/sets/darksteel/MagneticFlux.java +++ b/Mage.Sets/src/mage/sets/darksteel/MagneticFlux.java @@ -37,6 +37,7 @@ import mage.abilities.effects.common.continious.GainAbilityControlledEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @author Loki @@ -46,8 +47,8 @@ public class MagneticFlux extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("Artifact creatures"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.CREATURE); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); + filter.add(new CardTypePredicate(CardType.CREATURE)); } public MagneticFlux(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/darksteel/NeurokProdigy.java b/Mage.Sets/src/mage/sets/darksteel/NeurokProdigy.java index e7a38d4d2f..5d76361502 100644 --- a/Mage.Sets/src/mage/sets/darksteel/NeurokProdigy.java +++ b/Mage.Sets/src/mage/sets/darksteel/NeurokProdigy.java @@ -39,8 +39,8 @@ import mage.abilities.costs.common.DiscardTargetCost; import mage.abilities.effects.common.ReturnToHandSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetCardInHand; /** @@ -51,8 +51,7 @@ public class NeurokProdigy extends CardImpl { private final static FilterCard filter = new FilterCard("an artifact card"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public NeurokProdigy(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/darksteel/Oxidize.java b/Mage.Sets/src/mage/sets/darksteel/Oxidize.java index c8b070309e..6273e1ea57 100644 --- a/Mage.Sets/src/mage/sets/darksteel/Oxidize.java +++ b/Mage.Sets/src/mage/sets/darksteel/Oxidize.java @@ -34,8 +34,8 @@ import mage.Constants.CardType; import mage.Constants.Rarity; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -46,8 +46,7 @@ public class Oxidize extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public Oxidize(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/darksteel/PteronGhost.java b/Mage.Sets/src/mage/sets/darksteel/PteronGhost.java index fc561afc85..f71aadaf55 100644 --- a/Mage.Sets/src/mage/sets/darksteel/PteronGhost.java +++ b/Mage.Sets/src/mage/sets/darksteel/PteronGhost.java @@ -40,8 +40,8 @@ import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.effects.common.RegenerateTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -52,8 +52,7 @@ public class PteronGhost extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public PteronGhost(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/darksteel/SlobadGoblinTinkerer.java b/Mage.Sets/src/mage/sets/darksteel/SlobadGoblinTinkerer.java index 5aa69334ac..1fbf0013c7 100644 --- a/Mage.Sets/src/mage/sets/darksteel/SlobadGoblinTinkerer.java +++ b/Mage.Sets/src/mage/sets/darksteel/SlobadGoblinTinkerer.java @@ -40,9 +40,9 @@ import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.effects.common.continious.GainAbilityTargetEffect; import mage.abilities.keyword.IndestructibleAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; import mage.target.common.TargetControlledPermanent; @@ -55,10 +55,8 @@ public class SlobadGoblinTinkerer extends CardImpl { private final static FilterControlledPermanent filterControlled = new FilterControlledPermanent("an artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); - filterControlled.getCardType().add(CardType.ARTIFACT); - filterControlled.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); + filterControlled.add(new CardTypePredicate(CardType.ARTIFACT)); } public SlobadGoblinTinkerer(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/darksteel/Soulscour.java b/Mage.Sets/src/mage/sets/darksteel/Soulscour.java index 184b161553..ed487f156c 100644 --- a/Mage.Sets/src/mage/sets/darksteel/Soulscour.java +++ b/Mage.Sets/src/mage/sets/darksteel/Soulscour.java @@ -36,8 +36,9 @@ import mage.Constants.Rarity; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; @@ -71,9 +72,7 @@ class SoulscourEffect extends OneShotEffect { private final static FilterPermanent filter = new FilterPermanent(""); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getNotCardType().add(true); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(Predicates.not(new CardTypePredicate(CardType.ARTIFACT))); } public SoulscourEffect() { diff --git a/Mage.Sets/src/mage/sets/darksteel/SteelshaperApprentice.java b/Mage.Sets/src/mage/sets/darksteel/SteelshaperApprentice.java index a8c6e5f363..117b025326 100644 --- a/Mage.Sets/src/mage/sets/darksteel/SteelshaperApprentice.java +++ b/Mage.Sets/src/mage/sets/darksteel/SteelshaperApprentice.java @@ -42,6 +42,7 @@ import mage.abilities.costs.mana.ColoredManaCost; import mage.abilities.effects.common.search.SearchLibraryRevealPutInHandEffect; import mage.cards.CardImpl; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCardInLibrary; @@ -53,7 +54,7 @@ public class SteelshaperApprentice extends CardImpl { private static final FilterCard filter = new FilterCard("Equipment card"); static { - filter.getCardType().add(CardType.ARTIFACT); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); filter.add(new SubtypePredicate("Equipment")); } diff --git a/Mage.Sets/src/mage/sets/darksteel/ViridianZealot.java b/Mage.Sets/src/mage/sets/darksteel/ViridianZealot.java index 0dd26ff86c..f43e209761 100644 --- a/Mage.Sets/src/mage/sets/darksteel/ViridianZealot.java +++ b/Mage.Sets/src/mage/sets/darksteel/ViridianZealot.java @@ -40,8 +40,9 @@ import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -52,9 +53,9 @@ public class ViridianZealot extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("artifact or enchantment"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.ENCHANTMENT))); } public ViridianZealot(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/darksteel/VoltaicConstruct.java b/Mage.Sets/src/mage/sets/darksteel/VoltaicConstruct.java index acd0f51d19..6de07591ea 100644 --- a/Mage.Sets/src/mage/sets/darksteel/VoltaicConstruct.java +++ b/Mage.Sets/src/mage/sets/darksteel/VoltaicConstruct.java @@ -39,8 +39,8 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.UntapTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -51,8 +51,7 @@ public class VoltaicConstruct extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public VoltaicConstruct(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/dissension/AzoriusChancery.java b/Mage.Sets/src/mage/sets/dissension/AzoriusChancery.java index f5384df19f..189273a9aa 100644 --- a/Mage.Sets/src/mage/sets/dissension/AzoriusChancery.java +++ b/Mage.Sets/src/mage/sets/dissension/AzoriusChancery.java @@ -41,8 +41,8 @@ import mage.abilities.effects.common.BasicManaEffect; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.mana.SimpleManaAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.Target; import mage.target.common.TargetControlledPermanent; @@ -54,8 +54,7 @@ public class AzoriusChancery extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("land you control"); static { - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.LAND)); } public AzoriusChancery(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/dissension/IndrikStomphowler.java b/Mage.Sets/src/mage/sets/dissension/IndrikStomphowler.java index a730e872d5..097501d6c2 100644 --- a/Mage.Sets/src/mage/sets/dissension/IndrikStomphowler.java +++ b/Mage.Sets/src/mage/sets/dissension/IndrikStomphowler.java @@ -36,8 +36,9 @@ import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -48,9 +49,9 @@ public class IndrikStomphowler extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("artifact or enchantment"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.ENCHANTMENT))); } public IndrikStomphowler(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/dissension/RakdosCarnarium.java b/Mage.Sets/src/mage/sets/dissension/RakdosCarnarium.java index dd4b385495..eb1d8f120f 100644 --- a/Mage.Sets/src/mage/sets/dissension/RakdosCarnarium.java +++ b/Mage.Sets/src/mage/sets/dissension/RakdosCarnarium.java @@ -41,8 +41,8 @@ import mage.abilities.effects.common.BasicManaEffect; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.mana.SimpleManaAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.Target; import mage.target.common.TargetControlledPermanent; @@ -53,8 +53,7 @@ public class RakdosCarnarium extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("land you control"); static { - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.LAND)); } public RakdosCarnarium(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/dissension/SimicGrowthChamber.java b/Mage.Sets/src/mage/sets/dissension/SimicGrowthChamber.java index 4f03f10d45..95fe3ff0ae 100644 --- a/Mage.Sets/src/mage/sets/dissension/SimicGrowthChamber.java +++ b/Mage.Sets/src/mage/sets/dissension/SimicGrowthChamber.java @@ -41,8 +41,8 @@ import mage.abilities.effects.common.BasicManaEffect; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.mana.SimpleManaAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.Target; import mage.target.common.TargetControlledPermanent; @@ -54,8 +54,7 @@ public class SimicGrowthChamber extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("land you control"); static { - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.LAND)); } public SimicGrowthChamber(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/eventide/KithkinSpellduster.java b/Mage.Sets/src/mage/sets/eventide/KithkinSpellduster.java index b0ef4c06f9..7fd961fc05 100644 --- a/Mage.Sets/src/mage/sets/eventide/KithkinSpellduster.java +++ b/Mage.Sets/src/mage/sets/eventide/KithkinSpellduster.java @@ -42,6 +42,7 @@ import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.PersistAbility; import mage.cards.CardImpl; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -49,10 +50,10 @@ import mage.target.TargetPermanent; * @author Loki */ public class KithkinSpellduster extends CardImpl { - private static FilterPermanent filter = new FilterPermanent("enchantment"); + private static final FilterPermanent filter = new FilterPermanent("enchantment"); static { - filter.getCardType().add(CardType.ENCHANTMENT); + filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); } public KithkinSpellduster(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/eventide/NoggleBridgebreaker.java b/Mage.Sets/src/mage/sets/eventide/NoggleBridgebreaker.java index 446fd06bd3..fedc5ca294 100644 --- a/Mage.Sets/src/mage/sets/eventide/NoggleBridgebreaker.java +++ b/Mage.Sets/src/mage/sets/eventide/NoggleBridgebreaker.java @@ -36,8 +36,8 @@ import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledPermanent; /** @@ -48,8 +48,7 @@ public class NoggleBridgebreaker extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("land you control"); static { - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.LAND)); } public NoggleBridgebreaker(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/eventide/Scarecrone.java b/Mage.Sets/src/mage/sets/eventide/Scarecrone.java index eab99b60b5..38921747e0 100644 --- a/Mage.Sets/src/mage/sets/eventide/Scarecrone.java +++ b/Mage.Sets/src/mage/sets/eventide/Scarecrone.java @@ -41,8 +41,8 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.DrawCardControllerEffect; import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetCardInYourGraveyard; /** @@ -53,9 +53,8 @@ public class Scarecrone extends CardImpl { private final static FilterCard filter = new FilterCard("artifact creature card from your graveyard"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.CREATURE); - filter.setScopeCardType(Filter.ComparisonScope.All); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); + filter.add(new CardTypePredicate(CardType.CREATURE)); } public Scarecrone(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/eventide/WickerboughElder.java b/Mage.Sets/src/mage/sets/eventide/WickerboughElder.java index f706c11a80..6dd47077e2 100644 --- a/Mage.Sets/src/mage/sets/eventide/WickerboughElder.java +++ b/Mage.Sets/src/mage/sets/eventide/WickerboughElder.java @@ -44,6 +44,8 @@ import mage.cards.CardImpl; import mage.counters.CounterType; import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -54,9 +56,9 @@ public class WickerboughElder extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("artifact or enchantment"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.ENCHANTMENT))); } public WickerboughElder(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/fifthedition/AshesToAshes.java b/Mage.Sets/src/mage/sets/fifthedition/AshesToAshes.java index 0c9d41644a..11c51a7706 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/AshesToAshes.java +++ b/Mage.Sets/src/mage/sets/fifthedition/AshesToAshes.java @@ -36,6 +36,8 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DamageControllerEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.TargetPermanent; @@ -49,7 +51,7 @@ public class AshesToAshes extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonartifact creature"); static { - filter.getNotCardType().add(CardType.ARTIFACT); + filter.add(Predicates.not(new CardTypePredicate(CardType.ARTIFACT))); } public AshesToAshes(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/guildpact/DuneBroodNephilim.java b/Mage.Sets/src/mage/sets/guildpact/DuneBroodNephilim.java index c10bfed864..377987d118 100644 --- a/Mage.Sets/src/mage/sets/guildpact/DuneBroodNephilim.java +++ b/Mage.Sets/src/mage/sets/guildpact/DuneBroodNephilim.java @@ -35,8 +35,8 @@ import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.permanent.token.Token; /** @@ -47,8 +47,7 @@ public class DuneBroodNephilim extends CardImpl { final static FilterControlledPermanent filterLands = new FilterControlledPermanent("land you control"); static { - filterLands.getCardType().add(CardType.LAND); - filterLands.setScopeCardType(Filter.ComparisonScope.Any); + filterLands.add(new CardTypePredicate(CardType.LAND)); } public DuneBroodNephilim(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/guildpact/Gelectrode.java b/Mage.Sets/src/mage/sets/guildpact/Gelectrode.java index 4547eda4c0..1569cea348 100644 --- a/Mage.Sets/src/mage/sets/guildpact/Gelectrode.java +++ b/Mage.Sets/src/mage/sets/guildpact/Gelectrode.java @@ -39,8 +39,9 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.UntapSourceEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterSpell; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetCreatureOrPlayer; /** @@ -52,9 +53,9 @@ public class Gelectrode extends CardImpl { private final static FilterSpell filter = new FilterSpell("an instant or sorcery spell"); static { - filter.getCardType().add(CardType.INSTANT); - filter.getCardType().add(CardType.SORCERY); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.INSTANT), + new CardTypePredicate(CardType.SORCERY))); } public Gelectrode(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/guildpact/GruulGuildmage.java b/Mage.Sets/src/mage/sets/guildpact/GruulGuildmage.java index 4795431636..12bede32e5 100644 --- a/Mage.Sets/src/mage/sets/guildpact/GruulGuildmage.java +++ b/Mage.Sets/src/mage/sets/guildpact/GruulGuildmage.java @@ -40,6 +40,7 @@ import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.continious.BoostTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPlayer; import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetCreaturePermanent; @@ -52,7 +53,7 @@ public class GruulGuildmage extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("a land"); static { - filter.getCardType().add(CardType.LAND); + filter.add(new CardTypePredicate(CardType.LAND)); } public GruulGuildmage(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/guildpact/IzzetBoilerworks.java b/Mage.Sets/src/mage/sets/guildpact/IzzetBoilerworks.java index 15d30a2f28..89374f6168 100644 --- a/Mage.Sets/src/mage/sets/guildpact/IzzetBoilerworks.java +++ b/Mage.Sets/src/mage/sets/guildpact/IzzetBoilerworks.java @@ -41,6 +41,7 @@ import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.mana.SimpleManaAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.Target; import mage.target.common.TargetControlledPermanent; @@ -52,7 +53,7 @@ public class IzzetBoilerworks extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("land"); static { - filter.getCardType().add(Constants.CardType.LAND); + filter.add(new CardTypePredicate(Constants.CardType.LAND)); } public IzzetBoilerworks(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/guildpact/IzzetChronarch.java b/Mage.Sets/src/mage/sets/guildpact/IzzetChronarch.java index 167274d821..9427f22305 100644 --- a/Mage.Sets/src/mage/sets/guildpact/IzzetChronarch.java +++ b/Mage.Sets/src/mage/sets/guildpact/IzzetChronarch.java @@ -35,8 +35,9 @@ import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetCardInYourGraveyard; /** @@ -48,9 +49,9 @@ public class IzzetChronarch extends CardImpl { private final static FilterCard filter = new FilterCard("instant or sorcery card from your graveyard"); static { - filter.getCardType().add(CardType.INSTANT); - filter.getCardType().add(CardType.SORCERY); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.INSTANT), + new CardTypePredicate(CardType.SORCERY))); } public IzzetChronarch(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/guildpact/Mortify.java b/Mage.Sets/src/mage/sets/guildpact/Mortify.java index cd89b8224f..708e052919 100644 --- a/Mage.Sets/src/mage/sets/guildpact/Mortify.java +++ b/Mage.Sets/src/mage/sets/guildpact/Mortify.java @@ -32,8 +32,9 @@ import mage.Constants.CardType; import mage.Constants.Rarity; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -44,9 +45,9 @@ public class Mortify extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("creature or enchantment"); static { - filter.getCardType().add(CardType.CREATURE); - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.CREATURE), + new CardTypePredicate(CardType.ENCHANTMENT))); } public Mortify(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/guildpact/OrzhovBasilica.java b/Mage.Sets/src/mage/sets/guildpact/OrzhovBasilica.java index 8040cfc898..603c2af66b 100644 --- a/Mage.Sets/src/mage/sets/guildpact/OrzhovBasilica.java +++ b/Mage.Sets/src/mage/sets/guildpact/OrzhovBasilica.java @@ -41,6 +41,7 @@ import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.mana.SimpleManaAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.Target; import mage.target.common.TargetControlledPermanent; @@ -53,7 +54,7 @@ public class OrzhovBasilica extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("land"); static { - filter.getCardType().add(Constants.CardType.LAND); + filter.add(new CardTypePredicate(Constants.CardType.LAND)); } public OrzhovBasilica(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/guildpact/WeeDragonauts.java b/Mage.Sets/src/mage/sets/guildpact/WeeDragonauts.java index dd54fffb6c..e095865efe 100644 --- a/Mage.Sets/src/mage/sets/guildpact/WeeDragonauts.java +++ b/Mage.Sets/src/mage/sets/guildpact/WeeDragonauts.java @@ -36,8 +36,9 @@ import mage.abilities.common.SpellCastTriggeredAbility; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterSpell; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @author Loki @@ -47,9 +48,9 @@ public class WeeDragonauts extends CardImpl { private final static FilterSpell filter = new FilterSpell("instant or sorcery spell"); static { - filter.getCardType().add(CardType.INSTANT); - filter.getCardType().add(CardType.SORCERY); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.INSTANT), + new CardTypePredicate(CardType.SORCERY))); } public WeeDragonauts(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/guildpact/WreakHavoc.java b/Mage.Sets/src/mage/sets/guildpact/WreakHavoc.java index 072158f793..ac9588bb63 100644 --- a/Mage.Sets/src/mage/sets/guildpact/WreakHavoc.java +++ b/Mage.Sets/src/mage/sets/guildpact/WreakHavoc.java @@ -33,8 +33,9 @@ import mage.Constants.Rarity; import mage.abilities.common.CantCounterAbility; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -46,9 +47,9 @@ public class WreakHavoc extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("artifact or land"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.LAND))); } public WreakHavoc(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/innistrad/AncientGrudge.java b/Mage.Sets/src/mage/sets/innistrad/AncientGrudge.java index 37b3478cef..edc3bd6ad0 100644 --- a/Mage.Sets/src/mage/sets/innistrad/AncientGrudge.java +++ b/Mage.Sets/src/mage/sets/innistrad/AncientGrudge.java @@ -34,8 +34,8 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.keyword.FlashbackAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; import java.util.UUID; @@ -48,8 +48,7 @@ public class AncientGrudge extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public AncientGrudge(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/innistrad/Bramblecrush.java b/Mage.Sets/src/mage/sets/innistrad/Bramblecrush.java index 69b45078f6..8493d02cdc 100644 --- a/Mage.Sets/src/mage/sets/innistrad/Bramblecrush.java +++ b/Mage.Sets/src/mage/sets/innistrad/Bramblecrush.java @@ -33,6 +33,8 @@ import mage.Constants.Rarity; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -44,7 +46,7 @@ public class Bramblecrush extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("noncreature permanent"); static { - filter.getNotCardType().add(CardType.CREATURE); + filter.add(Predicates.not(new CardTypePredicate(CardType.CREATURE))); } public Bramblecrush(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/innistrad/CharmbreakerDevils.java b/Mage.Sets/src/mage/sets/innistrad/CharmbreakerDevils.java index f110b242a5..a4fd636584 100644 --- a/Mage.Sets/src/mage/sets/innistrad/CharmbreakerDevils.java +++ b/Mage.Sets/src/mage/sets/innistrad/CharmbreakerDevils.java @@ -42,9 +42,10 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.cards.Card; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; import mage.filter.FilterSpell; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.events.GameEvent.EventType; import mage.players.Player; @@ -58,8 +59,9 @@ public class CharmbreakerDevils extends CardImpl { private static final FilterSpell filter = new FilterSpell("instant or sorcery card"); static { - filter.getCardType().add(CardType.INSTANT); - filter.getCardType().add(CardType.SORCERY); + filter.add(Predicates.or( + new CardTypePredicate(CardType.INSTANT), + new CardTypePredicate(CardType.SORCERY))); } public CharmbreakerDevils(UUID ownerId) { @@ -108,8 +110,9 @@ class CharmbreakerDevilsEffect extends OneShotEffect { Player player = game.getPlayer(source.getControllerId()); if (player != null) { FilterCard filter = new FilterCard("instant or sorcery card"); - filter.getCardType().add(CardType.INSTANT); - filter.getCardType().add(CardType.SORCERY); + filter.add(Predicates.or( + new CardTypePredicate(CardType.INSTANT), + new CardTypePredicate(CardType.SORCERY))); Card[] cards = player.getGraveyard().getCards(filter, game).toArray(new Card[0]); if (cards.length > 0) { Random rnd = new Random(); diff --git a/Mage.Sets/src/mage/sets/innistrad/GarrukTheVeilCursed.java b/Mage.Sets/src/mage/sets/innistrad/GarrukTheVeilCursed.java index 2037e85201..979f2b11e9 100644 --- a/Mage.Sets/src/mage/sets/innistrad/GarrukTheVeilCursed.java +++ b/Mage.Sets/src/mage/sets/innistrad/GarrukTheVeilCursed.java @@ -43,10 +43,10 @@ import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.Cards; import mage.cards.CardsImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; import mage.filter.common.FilterCreatureCard; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.permanent.token.WolfTokenWithDeathtouch; @@ -135,8 +135,7 @@ class GarrukTheVeilCursedEffect extends OneShotEffect private static final FilterPermanent filterCreature = new FilterPermanent("a creature you control"); static { - filterCreature.getCardType().add(CardType.CREATURE); - filterCreature.setScopeCardType(Filter.ComparisonScope.Any); + filterCreature.add(new CardTypePredicate(CardType.CREATURE)); filterCreature.setTargetController(Constants.TargetController.YOU); } diff --git a/Mage.Sets/src/mage/sets/innistrad/RunechantersPike.java b/Mage.Sets/src/mage/sets/innistrad/RunechantersPike.java index 9089d421b3..b88283c4d1 100644 --- a/Mage.Sets/src/mage/sets/innistrad/RunechantersPike.java +++ b/Mage.Sets/src/mage/sets/innistrad/RunechantersPike.java @@ -40,8 +40,9 @@ import mage.abilities.effects.common.continious.GainAbilityAttachedEffect; import mage.abilities.keyword.EquipAbility; import mage.abilities.keyword.FirstStrikeAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.players.Player; @@ -55,9 +56,9 @@ public class RunechantersPike extends CardImpl { protected static final FilterCard filterCard = new FilterCard(); static { - filterCard.getCardType().add(CardType.INSTANT); - filterCard.getCardType().add(CardType.SORCERY); - filterCard.setScopeCardType(Filter.ComparisonScope.Any); + filterCard.add(Predicates.or( + new CardTypePredicate(CardType.INSTANT), + new CardTypePredicate(CardType.SORCERY))); } public RunechantersPike(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/innistrad/SilverchaseFox.java b/Mage.Sets/src/mage/sets/innistrad/SilverchaseFox.java index 436e2abb70..02748f205f 100644 --- a/Mage.Sets/src/mage/sets/innistrad/SilverchaseFox.java +++ b/Mage.Sets/src/mage/sets/innistrad/SilverchaseFox.java @@ -37,8 +37,8 @@ import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.ExileTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; import java.util.UUID; @@ -51,8 +51,7 @@ public class SilverchaseFox extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("enchantment"); static { - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); } public SilverchaseFox(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/innistrad/SnapcasterMage.java b/Mage.Sets/src/mage/sets/innistrad/SnapcasterMage.java index 59de40467b..48b0cb8122 100644 --- a/Mage.Sets/src/mage/sets/innistrad/SnapcasterMage.java +++ b/Mage.Sets/src/mage/sets/innistrad/SnapcasterMage.java @@ -43,8 +43,9 @@ import mage.abilities.keyword.FlashAbility; import mage.abilities.keyword.FlashbackAbility; import mage.cards.Card; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.target.common.TargetCardInYourGraveyard; @@ -57,9 +58,9 @@ public class SnapcasterMage extends CardImpl { private static final FilterCard filter = new FilterCard("instant or sorcery card in your graveyard"); static { - filter.getCardType().add(CardType.INSTANT); - filter.getCardType().add(CardType.SORCERY); - filter.setScopeCardType(ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.INSTANT), + new CardTypePredicate(CardType.SORCERY))); } public SnapcasterMage(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/innistrad/TributeToHunger.java b/Mage.Sets/src/mage/sets/innistrad/TributeToHunger.java index c9e201c347..b1f23dff2a 100644 --- a/Mage.Sets/src/mage/sets/innistrad/TributeToHunger.java +++ b/Mage.Sets/src/mage/sets/innistrad/TributeToHunger.java @@ -36,6 +36,7 @@ import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -91,7 +92,7 @@ class TributeToHungerEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); FilterControlledPermanent filter = new FilterControlledPermanent("creature"); - filter.getCardType().add(CardType.CREATURE); + filter.add(new CardTypePredicate(CardType.CREATURE)); filter.setTargetController(TargetController.YOU); TargetControlledPermanent target = new TargetControlledPermanent(1, 1, filter, false); diff --git a/Mage.Sets/src/mage/sets/magic2010/AcidicSlime.java b/Mage.Sets/src/mage/sets/magic2010/AcidicSlime.java index b6c727d9e3..1dc94fc89e 100644 --- a/Mage.Sets/src/mage/sets/magic2010/AcidicSlime.java +++ b/Mage.Sets/src/mage/sets/magic2010/AcidicSlime.java @@ -37,8 +37,9 @@ import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.keyword.DeathtouchAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.Target; import mage.target.TargetPermanent; @@ -51,10 +52,10 @@ public class AcidicSlime extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("artifact, enchantment, or land"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.ENCHANTMENT); - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.ENCHANTMENT), + new CardTypePredicate(CardType.LAND))); } public AcidicSlime(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2010/Duress.java b/Mage.Sets/src/mage/sets/magic2010/Duress.java index cdfafc8a60..dd850b2560 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Duress.java +++ b/Mage.Sets/src/mage/sets/magic2010/Duress.java @@ -38,6 +38,8 @@ import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.players.Player; import mage.target.TargetCard; @@ -72,8 +74,8 @@ class DuressEffect extends OneShotEffect { private static final FilterCard filter = new FilterCard("noncreature, nonland card"); static { - filter.getNotCardType().add(CardType.CREATURE); - filter.getNotCardType().add(CardType.LAND); + filter.add(Predicates.not(new CardTypePredicate(CardType.CREATURE))); + filter.add(Predicates.not(new CardTypePredicate(CardType.LAND))); } public DuressEffect() { diff --git a/Mage.Sets/src/mage/sets/magic2010/EssenceScatter.java b/Mage.Sets/src/mage/sets/magic2010/EssenceScatter.java index e3a69a2028..0b56afe4fd 100644 --- a/Mage.Sets/src/mage/sets/magic2010/EssenceScatter.java +++ b/Mage.Sets/src/mage/sets/magic2010/EssenceScatter.java @@ -33,6 +33,7 @@ import mage.Constants.Rarity; import mage.abilities.effects.common.CounterTargetEffect; import mage.cards.CardImpl; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetSpell; /** @@ -44,7 +45,7 @@ public class EssenceScatter extends CardImpl { private static final FilterSpell filter = new FilterSpell("creature spell"); static { - filter.getCardType().add(CardType.CREATURE); + filter.add(new CardTypePredicate(CardType.CREATURE)); } public EssenceScatter(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2010/Fabricate.java b/Mage.Sets/src/mage/sets/magic2010/Fabricate.java index e1bde6d5a6..a843d41d78 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Fabricate.java +++ b/Mage.Sets/src/mage/sets/magic2010/Fabricate.java @@ -32,8 +32,8 @@ import mage.Constants.CardType; import mage.Constants.Rarity; import mage.abilities.effects.common.search.SearchLibraryRevealPutInHandEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetCardInLibrary; /** @@ -45,8 +45,7 @@ public class Fabricate extends CardImpl { private final static FilterCard filter = new FilterCard("artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public Fabricate(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2010/MesaEnchantress.java b/Mage.Sets/src/mage/sets/magic2010/MesaEnchantress.java index b425866092..8ce67b282f 100644 --- a/Mage.Sets/src/mage/sets/magic2010/MesaEnchantress.java +++ b/Mage.Sets/src/mage/sets/magic2010/MesaEnchantress.java @@ -35,6 +35,7 @@ import mage.abilities.common.SpellCastTriggeredAbility; import mage.abilities.effects.common.DrawCardControllerEffect; import mage.cards.CardImpl; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -45,7 +46,7 @@ public class MesaEnchantress extends CardImpl { private static final FilterSpell filter = new FilterSpell("an enchantment spell"); static { - filter.getCardType().add(CardType.ENCHANTMENT); + filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); } public MesaEnchantress(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2010/NaturesSpiral.java b/Mage.Sets/src/mage/sets/magic2010/NaturesSpiral.java index 2b1d92f1e2..a81ea9f34a 100644 --- a/Mage.Sets/src/mage/sets/magic2010/NaturesSpiral.java +++ b/Mage.Sets/src/mage/sets/magic2010/NaturesSpiral.java @@ -33,8 +33,9 @@ import mage.Constants.CardType; import mage.Constants.Rarity; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetCardInYourGraveyard; /** @@ -46,12 +47,12 @@ public class NaturesSpiral extends CardImpl { private static final FilterCard filter = new FilterCard("permanent card from your graveyard"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.CREATURE); - filter.getCardType().add(CardType.ENCHANTMENT); - filter.getCardType().add(CardType.LAND); - filter.getCardType().add(CardType.PLANESWALKER); - filter.setScopeCardType(ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.CREATURE), + new CardTypePredicate(CardType.ENCHANTMENT), + new CardTypePredicate(CardType.LAND), + new CardTypePredicate(CardType.PLANESWALKER))); } public NaturesSpiral(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2010/Negate.java b/Mage.Sets/src/mage/sets/magic2010/Negate.java index fd62f80a90..3b1f1ebe21 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Negate.java +++ b/Mage.Sets/src/mage/sets/magic2010/Negate.java @@ -34,6 +34,8 @@ import mage.Constants.Rarity; import mage.abilities.effects.common.CounterTargetEffect; import mage.cards.CardImpl; import mage.filter.FilterSpell; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetSpell; /** @@ -45,7 +47,7 @@ public class Negate extends CardImpl { private static final FilterSpell filter = new FilterSpell("noncreature spell"); static { - filter.getNotCardType().add(CardType.CREATURE); + filter.add(Predicates.not(new CardTypePredicate(CardType.CREATURE))); } public Negate(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2010/SolemnOffering.java b/Mage.Sets/src/mage/sets/magic2010/SolemnOffering.java index b700cb45cc..1ceea3516e 100644 --- a/Mage.Sets/src/mage/sets/magic2010/SolemnOffering.java +++ b/Mage.Sets/src/mage/sets/magic2010/SolemnOffering.java @@ -34,8 +34,9 @@ import mage.Constants.Rarity; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -47,9 +48,9 @@ public class SolemnOffering extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("artifact or enchantment"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.ENCHANTMENT))); } public SolemnOffering(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2010/TempestOfLight.java b/Mage.Sets/src/mage/sets/magic2010/TempestOfLight.java index 42971badb0..48acffaab0 100644 --- a/Mage.Sets/src/mage/sets/magic2010/TempestOfLight.java +++ b/Mage.Sets/src/mage/sets/magic2010/TempestOfLight.java @@ -35,8 +35,8 @@ import mage.Constants.Rarity; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; @@ -68,8 +68,7 @@ class TempestOfLightEffect extends OneShotEffect { private final static FilterPermanent filter = new FilterPermanent(""); static { - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); } public TempestOfLightEffect() { diff --git a/Mage.Sets/src/mage/sets/magic2010/Twincast.java b/Mage.Sets/src/mage/sets/magic2010/Twincast.java index f8d091c674..7beea74b08 100644 --- a/Mage.Sets/src/mage/sets/magic2010/Twincast.java +++ b/Mage.Sets/src/mage/sets/magic2010/Twincast.java @@ -32,8 +32,9 @@ import mage.Constants.CardType; import mage.Constants.Rarity; import mage.abilities.effects.common.CopyTargetSpellEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterSpell; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetSpell; /** @@ -45,9 +46,9 @@ public class Twincast extends CardImpl { private final static FilterSpell filter = new FilterSpell("instant or sorcery spell"); static { - filter.getCardType().add(CardType.INSTANT); - filter.getCardType().add(CardType.SORCERY); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.INSTANT), + new CardTypePredicate(CardType.SORCERY))); } public Twincast(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2010/YawningFissure.java b/Mage.Sets/src/mage/sets/magic2010/YawningFissure.java index bf41ed60bd..f0cbdbd341 100644 --- a/Mage.Sets/src/mage/sets/magic2010/YawningFissure.java +++ b/Mage.Sets/src/mage/sets/magic2010/YawningFissure.java @@ -37,6 +37,7 @@ import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -88,7 +89,7 @@ class YawningFissureEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { FilterControlledPermanent filter = new FilterControlledPermanent("land you control"); - filter.getCardType().add(CardType.LAND); + filter.add(new CardTypePredicate(CardType.LAND)); filter.setTargetController(TargetController.YOU); Set opponents = game.getOpponents(source.getControllerId()); diff --git a/Mage.Sets/src/mage/sets/magic2011/BackToNature.java b/Mage.Sets/src/mage/sets/magic2011/BackToNature.java index ddd32fc82e..57e592b267 100644 --- a/Mage.Sets/src/mage/sets/magic2011/BackToNature.java +++ b/Mage.Sets/src/mage/sets/magic2011/BackToNature.java @@ -34,6 +34,7 @@ import mage.Constants.Rarity; import mage.abilities.effects.common.DestroyAllEffect; import mage.cards.CardImpl; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -44,7 +45,7 @@ public class BackToNature extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("enchantments"); static { - filter.getCardType().add(CardType.ENCHANTMENT); + filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); } public BackToNature(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2011/CallToMind.java b/Mage.Sets/src/mage/sets/magic2011/CallToMind.java index d6b37ece79..414ff4b242 100644 --- a/Mage.Sets/src/mage/sets/magic2011/CallToMind.java +++ b/Mage.Sets/src/mage/sets/magic2011/CallToMind.java @@ -33,8 +33,9 @@ import mage.Constants.CardType; import mage.Constants.Rarity; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetCardInYourGraveyard; /** @@ -46,9 +47,9 @@ public class CallToMind extends CardImpl { private static final FilterCard filter = new FilterCard("instant or sorcery card from your graveyard"); static { - filter.getCardType().add(CardType.INSTANT); - filter.getCardType().add(CardType.SORCERY); - filter.setScopeCardType(ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.INSTANT), + new CardTypePredicate(CardType.SORCERY))); } public CallToMind(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2011/DestructiveForce.java b/Mage.Sets/src/mage/sets/magic2011/DestructiveForce.java index f26bb946af..474ef51097 100644 --- a/Mage.Sets/src/mage/sets/magic2011/DestructiveForce.java +++ b/Mage.Sets/src/mage/sets/magic2011/DestructiveForce.java @@ -36,6 +36,7 @@ import mage.abilities.effects.common.SacrificeAllEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -46,7 +47,7 @@ public class DestructiveForce extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("land"); static { - filter.getCardType().add(CardType.LAND); + filter.add(new CardTypePredicate(CardType.LAND)); } public DestructiveForce(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2011/ManicVandal.java b/Mage.Sets/src/mage/sets/magic2011/ManicVandal.java index 5e2a5e8e59..3ef2d35ae0 100644 --- a/Mage.Sets/src/mage/sets/magic2011/ManicVandal.java +++ b/Mage.Sets/src/mage/sets/magic2011/ManicVandal.java @@ -36,8 +36,8 @@ import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.Target; import mage.target.TargetPermanent; @@ -50,8 +50,7 @@ public class ManicVandal extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public ManicVandal(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2011/PhylacteryLich.java b/Mage.Sets/src/mage/sets/magic2011/PhylacteryLich.java index cde67c089f..a1dc1874e8 100644 --- a/Mage.Sets/src/mage/sets/magic2011/PhylacteryLich.java +++ b/Mage.Sets/src/mage/sets/magic2011/PhylacteryLich.java @@ -42,8 +42,8 @@ import mage.abilities.effects.common.SacrificeSourceEffect; import mage.abilities.keyword.IndestructibleAbility; import mage.cards.CardImpl; import mage.counters.Counter; -import mage.filter.Filter.ComparisonScope; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; @@ -116,8 +116,7 @@ class PhylacteryLichEffect extends OneShotEffect { private static final FilterControlledPermanent filter = new FilterControlledPermanent("artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public PhylacteryLichEffect() { diff --git a/Mage.Sets/src/mage/sets/magic2011/Reverberate.java b/Mage.Sets/src/mage/sets/magic2011/Reverberate.java index 2c4513b51d..79ff246387 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Reverberate.java +++ b/Mage.Sets/src/mage/sets/magic2011/Reverberate.java @@ -33,8 +33,9 @@ import mage.Constants.CardType; import mage.Constants.Rarity; import mage.abilities.effects.common.CopyTargetSpellEffect; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterSpell; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetSpell; /** @@ -46,9 +47,9 @@ public class Reverberate extends CardImpl { private static final FilterSpell filter = new FilterSpell(); static { - filter.getCardType().add(CardType.INSTANT); - filter.getCardType().add(CardType.SORCERY); - filter.setScopeCardType(ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.INSTANT), + new CardTypePredicate(CardType.SORCERY))); } public Reverberate(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2011/SteelOverseer.java b/Mage.Sets/src/mage/sets/magic2011/SteelOverseer.java index 41e2a0df7e..e26fe71df7 100644 --- a/Mage.Sets/src/mage/sets/magic2011/SteelOverseer.java +++ b/Mage.Sets/src/mage/sets/magic2011/SteelOverseer.java @@ -39,8 +39,8 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.counter.AddCountersAllEffect; import mage.cards.CardImpl; import mage.counters.CounterType; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -51,9 +51,8 @@ public class SteelOverseer extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("artifact creature you control"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.CREATURE); - filter.setScopeCardType(ComparisonScope.All); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); + filter.add(new CardTypePredicate(CardType.CREATURE)); filter.setTargetController(TargetController.YOU); } diff --git a/Mage.Sets/src/mage/sets/magic2011/SunTitan.java b/Mage.Sets/src/mage/sets/magic2011/SunTitan.java index c83b7687ee..7eda529558 100644 --- a/Mage.Sets/src/mage/sets/magic2011/SunTitan.java +++ b/Mage.Sets/src/mage/sets/magic2011/SunTitan.java @@ -37,9 +37,10 @@ import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; import mage.abilities.keyword.VigilanceAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.Filter.ComparisonType; import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; import mage.game.Game; import mage.game.events.GameEvent; @@ -81,12 +82,12 @@ class SunTitanAbility extends TriggeredAbilityImpl { private static final FilterCard filter = new FilterCard("permanent card with converted mana cost 3 or less from your graveyard"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.CREATURE); - filter.getCardType().add(CardType.ENCHANTMENT); - filter.getCardType().add(CardType.LAND); - filter.getCardType().add(CardType.PLANESWALKER); - filter.setScopeCardType(ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.CREATURE), + new CardTypePredicate(CardType.ENCHANTMENT), + new CardTypePredicate(CardType.LAND), + new CardTypePredicate(CardType.PLANESWALKER))); filter.add(new ConvertedManaCostPredicate(ComparisonType.LessThan, 4)); } diff --git a/Mage.Sets/src/mage/sets/magic2011/VoltaicKey.java b/Mage.Sets/src/mage/sets/magic2011/VoltaicKey.java index d757ed1476..0d4c5a1bac 100644 --- a/Mage.Sets/src/mage/sets/magic2011/VoltaicKey.java +++ b/Mage.Sets/src/mage/sets/magic2011/VoltaicKey.java @@ -38,8 +38,8 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.UntapTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -51,8 +51,7 @@ public class VoltaicKey extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public VoltaicKey(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2011/WarPriestOfThune.java b/Mage.Sets/src/mage/sets/magic2011/WarPriestOfThune.java index e2da3b5b53..abf5dae7a7 100644 --- a/Mage.Sets/src/mage/sets/magic2011/WarPriestOfThune.java +++ b/Mage.Sets/src/mage/sets/magic2011/WarPriestOfThune.java @@ -36,8 +36,8 @@ import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.Target; import mage.target.TargetPermanent; @@ -50,8 +50,7 @@ public class WarPriestOfThune extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("enchantment"); static { - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); } public WarPriestOfThune(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2012/Auramancer.java b/Mage.Sets/src/mage/sets/magic2012/Auramancer.java index 2cf7782e51..e508e0de78 100644 --- a/Mage.Sets/src/mage/sets/magic2012/Auramancer.java +++ b/Mage.Sets/src/mage/sets/magic2012/Auramancer.java @@ -37,8 +37,8 @@ import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetCardInYourGraveyard; /** @@ -49,8 +49,7 @@ public class Auramancer extends CardImpl { private final static FilterCard filter = new FilterCard("enchantment card from your graveyard"); static { - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); } public Auramancer(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2012/BloodlordOfVaasgoth.java b/Mage.Sets/src/mage/sets/magic2012/BloodlordOfVaasgoth.java index bf38bd4395..383fc30ca0 100644 --- a/Mage.Sets/src/mage/sets/magic2012/BloodlordOfVaasgoth.java +++ b/Mage.Sets/src/mage/sets/magic2012/BloodlordOfVaasgoth.java @@ -38,8 +38,8 @@ import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.keyword.BloodthirstAbility; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; @@ -53,8 +53,7 @@ public class BloodlordOfVaasgoth extends CardImpl { private static final FilterSpell filter = new FilterSpell("a Vampire creature spell"); static { - filter.getCardType().add(CardType.CREATURE); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.CREATURE)); filter.add(new SubtypePredicate("Vampire")); } diff --git a/Mage.Sets/src/mage/sets/magic2012/BountifulHarvest.java b/Mage.Sets/src/mage/sets/magic2012/BountifulHarvest.java index c678ffcccd..618fbc9ffa 100644 --- a/Mage.Sets/src/mage/sets/magic2012/BountifulHarvest.java +++ b/Mage.Sets/src/mage/sets/magic2012/BountifulHarvest.java @@ -36,6 +36,7 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @author Loki @@ -45,7 +46,7 @@ public class BountifulHarvest extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("land you control"); static { - filter.getCardType().add(CardType.LAND); + filter.add(new CardTypePredicate(CardType.LAND)); } public BountifulHarvest(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2012/GarrukPrimalHunter.java b/Mage.Sets/src/mage/sets/magic2012/GarrukPrimalHunter.java index a5d0a9e866..a5eb0678a7 100644 --- a/Mage.Sets/src/mage/sets/magic2012/GarrukPrimalHunter.java +++ b/Mage.Sets/src/mage/sets/magic2012/GarrukPrimalHunter.java @@ -44,9 +44,9 @@ import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.counters.CounterType; -import mage.filter.Filter; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.permanent.token.BeastToken; @@ -61,8 +61,7 @@ public class GarrukPrimalHunter extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("land your control"); static { - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.LAND)); } diff --git a/Mage.Sets/src/mage/sets/magic2012/Levitation.java b/Mage.Sets/src/mage/sets/magic2012/Levitation.java index e163ab34d8..858015e719 100644 --- a/Mage.Sets/src/mage/sets/magic2012/Levitation.java +++ b/Mage.Sets/src/mage/sets/magic2012/Levitation.java @@ -38,6 +38,7 @@ import mage.abilities.effects.common.continious.GainAbilityControlledEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -48,7 +49,7 @@ public class Levitation extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("creatures "); static { - filter.getCardType().add(CardType.CREATURE); + filter.add(new CardTypePredicate(CardType.CREATURE)); } public Levitation (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2012/MasterThief.java b/Mage.Sets/src/mage/sets/magic2012/MasterThief.java index 0ae5b6d6ec..e117177eb6 100644 --- a/Mage.Sets/src/mage/sets/magic2012/MasterThief.java +++ b/Mage.Sets/src/mage/sets/magic2012/MasterThief.java @@ -38,8 +38,8 @@ import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.continious.GainControlTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -50,8 +50,7 @@ public class MasterThief extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public MasterThief(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2012/Smallpox.java b/Mage.Sets/src/mage/sets/magic2012/Smallpox.java index e370a9b8ef..686c8a0f4e 100644 --- a/Mage.Sets/src/mage/sets/magic2012/Smallpox.java +++ b/Mage.Sets/src/mage/sets/magic2012/Smallpox.java @@ -35,8 +35,8 @@ import mage.Constants.Rarity; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -71,15 +71,13 @@ public class Smallpox extends CardImpl { class SmallpoxEffect extends OneShotEffect { - private static FilterPermanent filterCreature = new FilterPermanent("a creature you control"); - private static FilterPermanent filterLand = new FilterPermanent("a land you control"); + private static final FilterPermanent filterCreature = new FilterPermanent("a creature you control"); + private static final FilterPermanent filterLand = new FilterPermanent("a land you control"); static { - filterCreature.getCardType().add(CardType.CREATURE); - filterCreature.setScopeCardType(Filter.ComparisonScope.Any); + filterCreature.add(new CardTypePredicate(CardType.CREATURE)); filterCreature.setTargetController(Constants.TargetController.YOU); - filterLand.getCardType().add(CardType.LAND); - filterLand.setScopeCardType(Filter.ComparisonScope.Any); + filterLand.add(new CardTypePredicate(CardType.LAND)); filterLand.setTargetController(Constants.TargetController.YOU); } diff --git a/Mage.Sets/src/mage/sets/magic2013/Archaeomancer.java b/Mage.Sets/src/mage/sets/magic2013/Archaeomancer.java index 43ba2599c3..2896cae8f2 100644 --- a/Mage.Sets/src/mage/sets/magic2013/Archaeomancer.java +++ b/Mage.Sets/src/mage/sets/magic2013/Archaeomancer.java @@ -34,8 +34,9 @@ import mage.MageInt; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetCardInYourGraveyard; /** @@ -47,9 +48,9 @@ public class Archaeomancer extends CardImpl { private static final FilterCard filter = new FilterCard("instant or sorcery card from your graveyard"); static { - filter.getCardType().add(CardType.INSTANT); - filter.getCardType().add(CardType.SORCERY); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.INSTANT), + new CardTypePredicate(CardType.SORCERY))); } public Archaeomancer(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2013/FungalSprouting.java b/Mage.Sets/src/mage/sets/magic2013/FungalSprouting.java index 781a974513..4e27461043 100644 --- a/Mage.Sets/src/mage/sets/magic2013/FungalSprouting.java +++ b/Mage.Sets/src/mage/sets/magic2013/FungalSprouting.java @@ -36,6 +36,7 @@ import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; import mage.filter.FilterPermanent; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.permanent.token.SaprolingToken; @@ -72,7 +73,7 @@ class FungalSproutingEffect extends OneShotEffect { private final static FilterPermanent filter = new FilterPermanent(); static { - filter.getCardType().add(CardType.CREATURE); + filter.add(new CardTypePredicate(CardType.CREATURE)); filter.setTargetController(Constants.TargetController.YOU); } diff --git a/Mage.Sets/src/mage/sets/magic2013/TalrandSkySummoner.java b/Mage.Sets/src/mage/sets/magic2013/TalrandSkySummoner.java index b7dff246ff..65aecbea26 100644 --- a/Mage.Sets/src/mage/sets/magic2013/TalrandSkySummoner.java +++ b/Mage.Sets/src/mage/sets/magic2013/TalrandSkySummoner.java @@ -35,6 +35,8 @@ import mage.abilities.common.SpellCastTriggeredAbility; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; import mage.filter.FilterSpell; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.permanent.token.DrakeToken; /** @@ -46,8 +48,9 @@ public class TalrandSkySummoner extends CardImpl { private static final FilterSpell filter = new FilterSpell("instant or sorcery card"); static { - filter.getCardType().add(CardType.INSTANT); - filter.getCardType().add(CardType.SORCERY); + filter.add(Predicates.or( + new CardTypePredicate(CardType.INSTANT), + new CardTypePredicate(CardType.SORCERY))); } public TalrandSkySummoner(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/mirrodin/AltarsLight.java b/Mage.Sets/src/mage/sets/mirrodin/AltarsLight.java index 5e0e60fff0..ece952f18b 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/AltarsLight.java +++ b/Mage.Sets/src/mage/sets/mirrodin/AltarsLight.java @@ -32,8 +32,9 @@ import mage.Constants.CardType; import mage.Constants.Rarity; import mage.abilities.effects.common.ExileTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -45,9 +46,9 @@ public class AltarsLight extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("artifact or enchantment"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.ENCHANTMENT))); } public AltarsLight(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/mirrodin/Annul.java b/Mage.Sets/src/mage/sets/mirrodin/Annul.java index 5c83f8b2eb..71364e6cc2 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/Annul.java +++ b/Mage.Sets/src/mage/sets/mirrodin/Annul.java @@ -32,8 +32,9 @@ import mage.Constants.CardType; import mage.Constants.Rarity; import mage.abilities.effects.common.CounterTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterSpell; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetSpell; /** @@ -45,9 +46,9 @@ public class Annul extends CardImpl { private final static FilterSpell filter = new FilterSpell("artifact or enchantment spell"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.ENCHANTMENT))); } public Annul(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/mirrodin/Atog.java b/Mage.Sets/src/mage/sets/mirrodin/Atog.java index 5438dd1fce..1e321afd57 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/Atog.java +++ b/Mage.Sets/src/mage/sets/mirrodin/Atog.java @@ -37,8 +37,8 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledPermanent; /** @@ -50,8 +50,7 @@ public class Atog extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("an artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public Atog(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/mirrodin/AuriokTransfixer.java b/Mage.Sets/src/mage/sets/mirrodin/AuriokTransfixer.java index 2ef62ba054..cadb9e038a 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/AuriokTransfixer.java +++ b/Mage.Sets/src/mage/sets/mirrodin/AuriokTransfixer.java @@ -39,8 +39,8 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ColoredManaCost; import mage.abilities.effects.common.TapTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -51,8 +51,7 @@ public class AuriokTransfixer extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public AuriokTransfixer(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/mirrodin/Deconstruct.java b/Mage.Sets/src/mage/sets/mirrodin/Deconstruct.java index cddf9ae7f3..0525e088f3 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/Deconstruct.java +++ b/Mage.Sets/src/mage/sets/mirrodin/Deconstruct.java @@ -34,8 +34,8 @@ import mage.Mana; import mage.abilities.effects.common.BasicManaEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -47,8 +47,7 @@ public class Deconstruct extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public Deconstruct(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/mirrodin/ElfReplica.java b/Mage.Sets/src/mage/sets/mirrodin/ElfReplica.java index b793b162ea..91a9bc4cdd 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/ElfReplica.java +++ b/Mage.Sets/src/mage/sets/mirrodin/ElfReplica.java @@ -39,8 +39,8 @@ import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -52,8 +52,7 @@ public class ElfReplica extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("enchantment"); static { - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); } public ElfReplica(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/mirrodin/GalvanicKey.java b/Mage.Sets/src/mage/sets/mirrodin/GalvanicKey.java index b85bdd5c7a..5d7e368df2 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/GalvanicKey.java +++ b/Mage.Sets/src/mage/sets/mirrodin/GalvanicKey.java @@ -39,8 +39,8 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.UntapTargetEffect; import mage.abilities.keyword.FlashAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -52,8 +52,7 @@ public class GalvanicKey extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public GalvanicKey(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/mirrodin/GoblinReplica.java b/Mage.Sets/src/mage/sets/mirrodin/GoblinReplica.java index bce12bdff2..5db4482bbc 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/GoblinReplica.java +++ b/Mage.Sets/src/mage/sets/mirrodin/GoblinReplica.java @@ -39,8 +39,8 @@ import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -52,8 +52,7 @@ public class GoblinReplica extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public GoblinReplica(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/mirrodin/KrarkClanGrunt.java b/Mage.Sets/src/mage/sets/mirrodin/KrarkClanGrunt.java index 55def27f23..2131f1a9a0 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/KrarkClanGrunt.java +++ b/Mage.Sets/src/mage/sets/mirrodin/KrarkClanGrunt.java @@ -40,8 +40,8 @@ import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.abilities.effects.common.continious.GainAbilitySourceEffect; import mage.abilities.keyword.FirstStrikeAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledPermanent; /** @@ -53,8 +53,7 @@ public class KrarkClanGrunt extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("an artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public KrarkClanGrunt(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/mirrodin/KrarkClanShaman.java b/Mage.Sets/src/mage/sets/mirrodin/KrarkClanShaman.java index 8db4b02976..a3e0a79570 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/KrarkClanShaman.java +++ b/Mage.Sets/src/mage/sets/mirrodin/KrarkClanShaman.java @@ -38,11 +38,11 @@ import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.effects.common.DamageAllEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledPermanent; /** @@ -54,8 +54,7 @@ public class KrarkClanShaman extends CardImpl { private final static FilterCreaturePermanent filterTargetedCreatures = new FilterCreaturePermanent("creature without flying"); static { - filterSacrificed.getCardType().add(CardType.ARTIFACT); - filterSacrificed.setScopeCardType(Filter.ComparisonScope.Any); + filterSacrificed.add(new CardTypePredicate(CardType.ARTIFACT)); filterTargetedCreatures.add(Predicates.not(new AbilityPredicate(FlyingAbility.class))); } diff --git a/Mage.Sets/src/mage/sets/mirrodin/LeoninAbunas.java b/Mage.Sets/src/mage/sets/mirrodin/LeoninAbunas.java index bc39581a56..5ed5165034 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/LeoninAbunas.java +++ b/Mage.Sets/src/mage/sets/mirrodin/LeoninAbunas.java @@ -38,6 +38,7 @@ import mage.abilities.effects.common.continious.GainAbilityControlledEffect; import mage.abilities.keyword.HexproofAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @author Loki @@ -47,7 +48,7 @@ public class LeoninAbunas extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("Artifacts you control"); static { - filter.getCardType().add(CardType.ARTIFACT); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public LeoninAbunas(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/mirrodin/LoomingHoverguard.java b/Mage.Sets/src/mage/sets/mirrodin/LoomingHoverguard.java index ac610a4f98..a2296b9fe2 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/LoomingHoverguard.java +++ b/Mage.Sets/src/mage/sets/mirrodin/LoomingHoverguard.java @@ -36,8 +36,8 @@ import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.PutOnLibraryTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -49,8 +49,7 @@ public class LoomingHoverguard extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public LoomingHoverguard(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/mirrodin/LoxodonMender.java b/Mage.Sets/src/mage/sets/mirrodin/LoxodonMender.java index 72d1eab489..e49d4b67d0 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/LoxodonMender.java +++ b/Mage.Sets/src/mage/sets/mirrodin/LoxodonMender.java @@ -39,8 +39,8 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ColoredManaCost; import mage.abilities.effects.common.RegenerateTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -51,8 +51,7 @@ public class LoxodonMender extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public LoxodonMender(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/mirrodin/Megatog.java b/Mage.Sets/src/mage/sets/mirrodin/Megatog.java index 7def776a67..3f517b725c 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/Megatog.java +++ b/Mage.Sets/src/mage/sets/mirrodin/Megatog.java @@ -40,8 +40,8 @@ import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.abilities.effects.common.continious.GainAbilitySourceEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledPermanent; /** @@ -52,8 +52,7 @@ public class Megatog extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("an artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public Megatog(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/mirrodin/MolderSlug.java b/Mage.Sets/src/mage/sets/mirrodin/MolderSlug.java index 5e4de63de6..e5c4f60dff 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/MolderSlug.java +++ b/Mage.Sets/src/mage/sets/mirrodin/MolderSlug.java @@ -37,8 +37,8 @@ import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.effects.common.SacrificeEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @author Loki @@ -48,8 +48,7 @@ public class MolderSlug extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public MolderSlug(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/mirrodin/NeurokSpy.java b/Mage.Sets/src/mage/sets/mirrodin/NeurokSpy.java index 20656efab2..9ff9344e27 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/NeurokSpy.java +++ b/Mage.Sets/src/mage/sets/mirrodin/NeurokSpy.java @@ -42,8 +42,8 @@ import mage.abilities.effects.Effect; import mage.abilities.effects.common.continious.GainAbilitySourceEffect; import mage.abilities.keyword.UnblockableAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; /** @@ -56,8 +56,7 @@ public class NeurokSpy extends CardImpl { private static final FilterPermanent filter = new FilterPermanent(); static { - filter.getCardType().add(Constants.CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(Constants.CardType.ARTIFACT)); } private class DefendingPlayerControlsArtifact implements Condition { diff --git a/Mage.Sets/src/mage/sets/mirrodin/NimLasher.java b/Mage.Sets/src/mage/sets/mirrodin/NimLasher.java index 2d4fb47793..3e6b406975 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/NimLasher.java +++ b/Mage.Sets/src/mage/sets/mirrodin/NimLasher.java @@ -38,8 +38,8 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @author Loki @@ -49,8 +49,7 @@ public class NimLasher extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("artifact you control"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public NimLasher(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/mirrodin/NimShambler.java b/Mage.Sets/src/mage/sets/mirrodin/NimShambler.java index ce988d191f..cb344bde1b 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/NimShambler.java +++ b/Mage.Sets/src/mage/sets/mirrodin/NimShambler.java @@ -41,8 +41,8 @@ import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.common.RegenerateSourceEffect; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -53,8 +53,7 @@ public class NimShambler extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("artifact you control"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public NimShambler(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/mirrodin/NimShrieker.java b/Mage.Sets/src/mage/sets/mirrodin/NimShrieker.java index 7b3c7537ec..76d3390753 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/NimShrieker.java +++ b/Mage.Sets/src/mage/sets/mirrodin/NimShrieker.java @@ -39,8 +39,8 @@ import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @author Loki @@ -50,8 +50,7 @@ public class NimShrieker extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("artifact you control"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public NimShrieker(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/mirrodin/Shatter.java b/Mage.Sets/src/mage/sets/mirrodin/Shatter.java index 94dc639287..5d1587d348 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/Shatter.java +++ b/Mage.Sets/src/mage/sets/mirrodin/Shatter.java @@ -33,8 +33,8 @@ import mage.Constants.CardType; import mage.Constants.Rarity; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -42,11 +42,10 @@ import mage.target.TargetPermanent; * @author Loki */ public class Shatter extends CardImpl { - private static FilterPermanent filter = new FilterPermanent("artifact"); + private static final FilterPermanent filter = new FilterPermanent("artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public Shatter (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/mirrodin/ShrapnelBlast.java b/Mage.Sets/src/mage/sets/mirrodin/ShrapnelBlast.java index 3ee5feace5..1fd665350d 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/ShrapnelBlast.java +++ b/Mage.Sets/src/mage/sets/mirrodin/ShrapnelBlast.java @@ -34,8 +34,8 @@ import mage.Constants.Rarity; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetCreatureOrPlayer; @@ -47,8 +47,7 @@ public class ShrapnelBlast extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("an artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public ShrapnelBlast(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/mirrodin/SoldierReplica.java b/Mage.Sets/src/mage/sets/mirrodin/SoldierReplica.java index a61aa85b60..5cb9c18da7 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/SoldierReplica.java +++ b/Mage.Sets/src/mage/sets/mirrodin/SoldierReplica.java @@ -39,7 +39,6 @@ import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; import mage.target.common.TargetCreaturePermanent; @@ -54,7 +53,6 @@ public class SoldierReplica extends CardImpl { static { filter.setBlocking(true); filter.setAttacking(true); - filter.setScopeCardType(Filter.ComparisonScope.Any); } public SoldierReplica(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/mirrodin/TrashForTreasure.java b/Mage.Sets/src/mage/sets/mirrodin/TrashForTreasure.java index c702edf82c..53f7ce07af 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/TrashForTreasure.java +++ b/Mage.Sets/src/mage/sets/mirrodin/TrashForTreasure.java @@ -35,6 +35,7 @@ import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffec import mage.cards.CardImpl; import mage.filter.FilterCard; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetCardInYourGraveyard; import mage.target.common.TargetControlledPermanent; @@ -48,8 +49,8 @@ public class TrashForTreasure extends CardImpl { private static final FilterCard filterCard = new FilterCard("artifact card from your graveyard"); static { - filterPermanent.getCardType().add(CardType.ARTIFACT); - filterCard.getCardType().add(CardType.ARTIFACT); + filterPermanent.add(new CardTypePredicate(CardType.ARTIFACT)); + filterCard.add(new CardTypePredicate(CardType.ARTIFACT)); } public TrashForTreasure(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/BanishmentDecree.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/BanishmentDecree.java index fb62622dcf..8c17002490 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/BanishmentDecree.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/BanishmentDecree.java @@ -33,8 +33,9 @@ import mage.Constants.CardType; import mage.Constants.Rarity; import mage.abilities.effects.common.PutOnLibraryTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -42,13 +43,13 @@ import mage.target.TargetPermanent; * @author Loki */ public class BanishmentDecree extends CardImpl { - private static FilterPermanent filter = new FilterPermanent("artifact, creature, or enchantment"); + private static final FilterPermanent filter = new FilterPermanent("artifact, creature, or enchantment"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.CREATURE); - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.CREATURE), + new CardTypePredicate(CardType.ENCHANTMENT))); } public BanishmentDecree (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/Crush.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/Crush.java index c93809caa3..66b056df03 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/Crush.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/Crush.java @@ -33,6 +33,8 @@ import mage.Constants.Rarity; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterArtifactPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetArtifactPermanent; /** @@ -44,7 +46,7 @@ public class Crush extends CardImpl { private static final FilterArtifactPermanent filter = new FilterArtifactPermanent("noncreature artifact"); static { - filter.getNotCardType().add(CardType.CREATURE); + filter.add(Predicates.not(new CardTypePredicate(CardType.CREATURE))); } public Crush(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/DivineOffering.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/DivineOffering.java index d985d29080..c4ad707b5e 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/DivineOffering.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/DivineOffering.java @@ -38,8 +38,8 @@ import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.players.Player; import mage.target.TargetPermanent; @@ -53,8 +53,7 @@ public class DivineOffering extends CardImpl { private static FilterPermanent filter = new FilterPermanent("artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public DivineOffering (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/GlissaTheTraitor.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/GlissaTheTraitor.java index c2dd81f8f0..de15786fae 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/GlissaTheTraitor.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/GlissaTheTraitor.java @@ -39,8 +39,8 @@ import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.keyword.DeathtouchAbility; import mage.abilities.keyword.FirstStrikeAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.ZoneChangeEvent; @@ -85,8 +85,7 @@ class GlissaTheTraitorTriggeredAbility extends TriggeredAbilityImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("an artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public Gnathosaur(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/GoForTheThroat.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/GoForTheThroat.java index d95d6b7686..c73f2bee18 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/GoForTheThroat.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/GoForTheThroat.java @@ -33,6 +33,8 @@ import mage.Constants.Rarity; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.Target; import mage.target.common.TargetCreaturePermanent; @@ -45,7 +47,7 @@ public class GoForTheThroat extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); static { - filter.getNotCardType().add(CardType.ARTIFACT); + filter.add(Predicates.not(new CardTypePredicate(CardType.ARTIFACT))); } public GoForTheThroat(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/GreenSunsZenith.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/GreenSunsZenith.java index e173a1dc67..8f2605c1b4 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/GreenSunsZenith.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/GreenSunsZenith.java @@ -44,6 +44,7 @@ import mage.players.Player; import mage.target.common.TargetCardInLibrary; import java.util.UUID; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @author Loki @@ -87,8 +88,7 @@ class GreenSunsZenithSearchEffect extends OneShotEffect { private static final FilterPermanent filter = new FilterPermanent("artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public IntoTheCore(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/LeoninRelicWarder.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/LeoninRelicWarder.java index d88b27f459..f15bacd017 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/LeoninRelicWarder.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/LeoninRelicWarder.java @@ -40,8 +40,9 @@ import mage.abilities.common.LeavesBattlefieldTriggeredAbility; import mage.abilities.effects.common.ExileTargetForSourceEffect; import mage.abilities.effects.common.ReturnFromExileForSourceEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.Target; import mage.target.TargetPermanent; @@ -53,9 +54,9 @@ public class LeoninRelicWarder extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("artifact or enchantment"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.ENCHANTMENT))); } public LeoninRelicWarder (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/MetallicMastery.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/MetallicMastery.java index f7a3a72c32..4134d5d5c9 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/MetallicMastery.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/MetallicMastery.java @@ -37,6 +37,7 @@ import mage.abilities.effects.common.continious.GainControlTargetEffect; import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -48,7 +49,7 @@ public class MetallicMastery extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public MetallicMastery(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/RustedSlasher.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/RustedSlasher.java index c530da1ece..7cb9be64dc 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/RustedSlasher.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/RustedSlasher.java @@ -38,8 +38,8 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.effects.common.RegenerateSourceEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledPermanent; /** @@ -50,8 +50,7 @@ public class RustedSlasher extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("an artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public RustedSlasher (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/SteelSabotage.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/SteelSabotage.java index 01b5b124c0..45611cba24 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/SteelSabotage.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/SteelSabotage.java @@ -35,6 +35,7 @@ import mage.abilities.effects.common.CounterTargetEffect; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.cards.CardImpl; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetSpell; import mage.target.common.TargetArtifactPermanent; @@ -47,7 +48,7 @@ public class SteelSabotage extends CardImpl { private static final FilterSpell filter = new FilterSpell("artifact spell"); static { - filter.getCardType().add(CardType.ARTIFACT); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public SteelSabotage(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/TezzeretAgentOfBolas.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/TezzeretAgentOfBolas.java index 216cf03f84..e01f663ede 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/TezzeretAgentOfBolas.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/TezzeretAgentOfBolas.java @@ -47,10 +47,10 @@ import mage.cards.CardImpl; import mage.cards.Cards; import mage.cards.CardsImpl; import mage.counters.CounterType; -import mage.filter.Filter; import mage.filter.FilterCard; import mage.filter.common.FilterArtifactCard; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.token.Token; import mage.players.Player; @@ -184,8 +184,7 @@ class TezzeretAgentOfBolasEffect2 extends OneShotEffect { private static final FilterCard filter = new FilterCard("an artifact card with converted mana cost 6 or more"); static { - filter.getCardType().add(CardType.ARTIFACT); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.GreaterThan, 5)); } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/ViridianCorrupter.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/ViridianCorrupter.java index 0e0f049ac3..b0c2a67d8b 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/ViridianCorrupter.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/ViridianCorrupter.java @@ -37,8 +37,8 @@ import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.keyword.InfectAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.Target; import mage.target.TargetPermanent; @@ -48,11 +48,10 @@ import mage.target.TargetPermanent; */ public class ViridianCorrupter extends CardImpl { - private static FilterPermanent filter = new FilterPermanent("artifact"); + private static final FilterPermanent filter = new FilterPermanent("artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public ViridianCorrupter (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/morningtide/IdyllicTutor.java b/Mage.Sets/src/mage/sets/morningtide/IdyllicTutor.java index b21ce00570..27d3412988 100644 --- a/Mage.Sets/src/mage/sets/morningtide/IdyllicTutor.java +++ b/Mage.Sets/src/mage/sets/morningtide/IdyllicTutor.java @@ -33,8 +33,8 @@ import mage.Constants.CardType; import mage.Constants.Rarity; import mage.abilities.effects.common.search.SearchLibraryRevealPutInHandEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetCardInLibrary; /** @@ -45,8 +45,7 @@ public class IdyllicTutor extends CardImpl { private final static FilterCard filter = new FilterCard("enchantment"); static { - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); } public IdyllicTutor(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/morningtide/ShardVolley.java b/Mage.Sets/src/mage/sets/morningtide/ShardVolley.java index c2c799553f..79ae27345d 100644 --- a/Mage.Sets/src/mage/sets/morningtide/ShardVolley.java +++ b/Mage.Sets/src/mage/sets/morningtide/ShardVolley.java @@ -33,8 +33,8 @@ import mage.Constants.Rarity; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetCreatureOrPlayer; @@ -47,8 +47,7 @@ public class ShardVolley extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("land"); static { - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.LAND)); } public ShardVolley(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/morningtide/Shinewend.java b/Mage.Sets/src/mage/sets/morningtide/Shinewend.java index 8008e47794..6cce8fe203 100644 --- a/Mage.Sets/src/mage/sets/morningtide/Shinewend.java +++ b/Mage.Sets/src/mage/sets/morningtide/Shinewend.java @@ -43,8 +43,8 @@ import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.counters.CounterType; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -56,8 +56,7 @@ public class Shinewend extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("enchantment"); static { - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); } public Shinewend(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/morningtide/SigilTracer.java b/Mage.Sets/src/mage/sets/morningtide/SigilTracer.java index 2c04f151ff..40c2796a00 100644 --- a/Mage.Sets/src/mage/sets/morningtide/SigilTracer.java +++ b/Mage.Sets/src/mage/sets/morningtide/SigilTracer.java @@ -39,9 +39,10 @@ import mage.abilities.costs.common.TapTargetCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.CopyTargetSpellEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterSpell; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.TargetSpell; import mage.target.common.TargetControlledCreaturePermanent; @@ -58,9 +59,9 @@ public class SigilTracer extends CardImpl { filter.setTapped(false); filter.setUseTapped(true); filter.add(new SubtypePredicate("Wizard")); - filterInstorSorc.getCardType().add(CardType.INSTANT); - filterInstorSorc.getCardType().add(CardType.SORCERY); - filterInstorSorc.setScopeCardType(Filter.ComparisonScope.Any); + filterInstorSorc.add(Predicates.or( + new CardTypePredicate(CardType.INSTANT), + new CardTypePredicate(CardType.SORCERY))); } public SigilTracer(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/morningtide/Stingmoggie.java b/Mage.Sets/src/mage/sets/morningtide/Stingmoggie.java index b673e184dd..1efd4b91d9 100644 --- a/Mage.Sets/src/mage/sets/morningtide/Stingmoggie.java +++ b/Mage.Sets/src/mage/sets/morningtide/Stingmoggie.java @@ -42,8 +42,9 @@ import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.counters.CounterType; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -55,9 +56,9 @@ public class Stingmoggie extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("artifact or land"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.LAND))); } public Stingmoggie(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ApostlesBlessing.java b/Mage.Sets/src/mage/sets/newphyrexia/ApostlesBlessing.java index ff64431e41..9193c900eb 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/ApostlesBlessing.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/ApostlesBlessing.java @@ -42,6 +42,8 @@ import mage.choices.ChoiceColorOrArtifact; import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.common.TargetControlledPermanent; @@ -53,9 +55,9 @@ public class ApostlesBlessing extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("artifact or creature you control"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.CREATURE); - filter.setScopeCardType(mage.filter.Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.CREATURE))); } public ApostlesBlessing(UUID ownerId) { @@ -99,8 +101,7 @@ class ApostlesBlessingEffect extends GainAbilityTargetEffect { FilterCard protectionFilter = new FilterCard(); ChoiceColorOrArtifact choice = (ChoiceColorOrArtifact) source.getChoices().get(0); if (choice.isArtifactSelected()) { - protectionFilter.getCardType().add(Constants.CardType.ARTIFACT); - protectionFilter.setScopeCardType(ComparisonScope.Any); + protectionFilter.add(new CardTypePredicate(Constants.CardType.ARTIFACT)); } else { protectionFilter.setColor(choice.getColor()); protectionFilter.setUseColor(true); diff --git a/Mage.Sets/src/mage/sets/newphyrexia/Artillerize.java b/Mage.Sets/src/mage/sets/newphyrexia/Artillerize.java index bfc6df0466..e096a7224b 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/Artillerize.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/Artillerize.java @@ -33,8 +33,9 @@ import mage.Constants.Rarity; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetCreatureOrPlayer; @@ -47,9 +48,9 @@ public class Artillerize extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("artifact or creature"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.CREATURE); - filter.setScopeCardType(ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.CREATURE))); } public Artillerize(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/BirthingPod.java b/Mage.Sets/src/mage/sets/newphyrexia/BirthingPod.java index 78b8e5a02a..0272abfde4 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/BirthingPod.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/BirthingPod.java @@ -43,6 +43,7 @@ import mage.cards.Card; import mage.cards.CardImpl; import mage.filter.Filter; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; import mage.game.Game; import mage.game.permanent.Permanent; @@ -105,8 +106,7 @@ class BirthingPodEffect extends OneShotEffect { int newConvertedCost = sacrificedPermanent.getManaCost().convertedManaCost() + 1; FilterCard filter = new FilterCard("creature card with converted mana cost " + newConvertedCost); filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, newConvertedCost)); - filter.getCardType().add(CardType.CREATURE); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.CREATURE)); TargetCardInLibrary target = new TargetCardInLibrary(filter); if (player.searchLibrary(target, game)) { for (UUID cardId : target.getTargets()) { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/BladeSplicer.java b/Mage.Sets/src/mage/sets/newphyrexia/BladeSplicer.java index 7e1ccb81d7..6d461cbbe8 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/BladeSplicer.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/BladeSplicer.java @@ -42,6 +42,7 @@ import mage.abilities.effects.common.continious.GainAbilityControlledEffect; import mage.abilities.keyword.FirstStrikeAbility; import mage.cards.CardImpl; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.permanent.token.GolemToken; @@ -53,7 +54,7 @@ public class BladeSplicer extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("Golem creatures"); static { - filter.getCardType().add(CardType.CREATURE); + filter.add(new CardTypePredicate(CardType.CREATURE)); filter.add(new SubtypePredicate("Golem")); } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/BludgeonBrawl.java b/Mage.Sets/src/mage/sets/newphyrexia/BludgeonBrawl.java index e66749fe36..aa55312446 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/BludgeonBrawl.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/BludgeonBrawl.java @@ -47,6 +47,7 @@ import mage.abilities.keyword.EquipAbility; import mage.cards.CardImpl; import mage.filter.common.FilterArtifactPermanent; import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; @@ -112,7 +113,7 @@ class BludgeonBrawlAddSubtypeEffect extends ContinuousEffectImpl affectedPermanents = new ArrayList(); diff --git a/Mage.Sets/src/mage/sets/newphyrexia/BrutalizerExarch.java b/Mage.Sets/src/mage/sets/newphyrexia/BrutalizerExarch.java index b27946a1e8..d600196185 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/BrutalizerExarch.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/BrutalizerExarch.java @@ -43,6 +43,8 @@ import mage.cards.Cards; import mage.cards.CardsImpl; import mage.filter.FilterPermanent; import mage.filter.common.FilterCreatureCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -58,7 +60,7 @@ public class BrutalizerExarch extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("noncreature permanent"); static { - filter.getNotCardType().add(CardType.CREATURE); + filter.add(Predicates.not(new CardTypePredicate(CardType.CREATURE))); } public BrutalizerExarch(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheSpires.java b/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheSpires.java index 6873e6a4cb..e418fe6121 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheSpires.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheSpires.java @@ -42,8 +42,9 @@ import mage.abilities.effects.common.PlayTargetWithoutPayingManaEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.Card; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.players.Player; @@ -60,9 +61,9 @@ public class ChancellorOfTheSpires extends CardImpl { private static final FilterCard filter = new FilterCard("instant or sorcery card from an opponent's graveyard"); static { - filter.getCardType().add(CardType.INSTANT); - filter.getCardType().add(CardType.SORCERY); - filter.setScopeCardType(ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.INSTANT), + new CardTypePredicate(CardType.SORCERY))); } public ChancellorOfTheSpires(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/Despise.java b/Mage.Sets/src/mage/sets/newphyrexia/Despise.java index 362b6f3407..c144c9820a 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/Despise.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/Despise.java @@ -36,8 +36,9 @@ import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.players.Player; import mage.target.TargetCard; @@ -75,9 +76,9 @@ class DespiseEffect extends OneShotEffect { private static final FilterCard filter = new FilterCard("creature or planeswalker card"); static { - filter.getCardType().add(CardType.CREATURE); - filter.getCardType().add(CardType.PLANESWALKER); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.CREATURE), + new CardTypePredicate(CardType.PLANESWALKER))); } public DespiseEffect() { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/EntomberExarch.java b/Mage.Sets/src/mage/sets/newphyrexia/EntomberExarch.java index b07bbd2da8..3c2e76f930 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/EntomberExarch.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/EntomberExarch.java @@ -42,6 +42,8 @@ import mage.cards.Card; import mage.cards.CardImpl; import mage.filter.FilterCard; import mage.filter.common.FilterCreatureCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.players.Player; import mage.target.TargetCard; @@ -87,7 +89,7 @@ class EntomberExarchEffect extends OneShotEffect { private static final FilterCard filter = new FilterCard("noncreature card"); static { - filter.getNotCardType().add(CardType.CREATURE); + filter.add(Predicates.not(new CardTypePredicate(CardType.CREATURE))); } EntomberExarchEffect() { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ExclusionRitual.java b/Mage.Sets/src/mage/sets/newphyrexia/ExclusionRitual.java index 496ed4a985..88ecc4e53b 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/ExclusionRitual.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/ExclusionRitual.java @@ -40,6 +40,8 @@ import mage.abilities.effects.ReplacementEffectImpl; import mage.cards.Card; import mage.cards.CardImpl; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; @@ -52,7 +54,7 @@ public class ExclusionRitual extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("nonland permanent"); static { - filter.getNotCardType().add(CardType.LAND); + filter.add(Predicates.not(new CardTypePredicate(CardType.LAND))); } public ExclusionRitual(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/GremlinMine.java b/Mage.Sets/src/mage/sets/newphyrexia/GremlinMine.java index a50421f61a..aa15f35357 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/GremlinMine.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/GremlinMine.java @@ -44,6 +44,8 @@ import mage.choices.Choice; import mage.choices.ChoiceImpl; import mage.counters.CounterType; import mage.filter.common.FilterArtifactPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -59,8 +61,8 @@ public class GremlinMine extends CardImpl { private static final FilterArtifactPermanent filterNonCreature = new FilterArtifactPermanent("noncreature artifact"); static { - filterCreature.getCardType().add(CardType.CREATURE); - filterNonCreature.getNotCardType().add(CardType.CREATURE); + filterCreature.add(new CardTypePredicate(CardType.CREATURE)); + filterNonCreature.add(Predicates.not(new CardTypePredicate(CardType.CREATURE))); } public GremlinMine(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/MaulSplicer.java b/Mage.Sets/src/mage/sets/newphyrexia/MaulSplicer.java index bce9d591c6..206a389332 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/MaulSplicer.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/MaulSplicer.java @@ -40,6 +40,7 @@ import mage.abilities.effects.common.continious.GainAbilityControlledEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.permanent.token.GolemToken; @@ -52,7 +53,7 @@ public class MaulSplicer extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("Golem creatures"); static { - filter.getCardType().add(CardType.CREATURE); + filter.add(new CardTypePredicate(CardType.CREATURE)); filter.add(new SubtypePredicate("Golem")); } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/NumbingDose.java b/Mage.Sets/src/mage/sets/newphyrexia/NumbingDose.java index 558eeab16c..44925caf2a 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/NumbingDose.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/NumbingDose.java @@ -38,8 +38,9 @@ import mage.abilities.effects.common.LoseLifeTargetEffect; import mage.abilities.effects.common.SkipEnchantedUntapEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; @@ -55,9 +56,9 @@ public class NumbingDose extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("artifact or creature"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.CREATURE); - filter.setScopeCardType(ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.CREATURE))); } public NumbingDose(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianIngester.java b/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianIngester.java index baed65f50f..8e7519edf4 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianIngester.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianIngester.java @@ -43,8 +43,8 @@ import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterNonTokenPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.TargetPermanent; @@ -58,8 +58,7 @@ public class PhyrexianIngester extends CardImpl { private static final FilterNonTokenPermanent filter = new FilterNonTokenPermanent("nontoken creature"); static { - filter.getCardType().add(CardType.CREATURE); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.CREATURE)); } public PhyrexianIngester(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianMetamorph.java b/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianMetamorph.java index f4583d015a..bd21bec69b 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianMetamorph.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianMetamorph.java @@ -37,8 +37,9 @@ import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.effects.EntersBattlefieldEffect; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -81,9 +82,9 @@ class PhyrexianMetamorphEffect extends OneShotEffect { private static final FilterPermanent filter = new FilterPermanent("artifact or creature"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.CREATURE); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.CREATURE))); } public PhyrexianMetamorphEffect() { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/PhyrexiasCore.java b/Mage.Sets/src/mage/sets/newphyrexia/PhyrexiasCore.java index 0bfd70ecb3..23ea54543c 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/PhyrexiasCore.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/PhyrexiasCore.java @@ -38,8 +38,8 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.mana.ColorlessManaAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledPermanent; /** @@ -51,8 +51,7 @@ public class PhyrexiasCore extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public PhyrexiasCore(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/PsychicBarrier.java b/Mage.Sets/src/mage/sets/newphyrexia/PsychicBarrier.java index 29a0d40953..7edc574748 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/PsychicBarrier.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/PsychicBarrier.java @@ -34,6 +34,7 @@ import mage.abilities.effects.common.CounterTargetEffect; import mage.abilities.effects.common.LoseLifeControllerEffect; import mage.cards.CardImpl; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetSpell; /** @@ -45,7 +46,7 @@ public class PsychicBarrier extends CardImpl { private static final FilterSpell filter = new FilterSpell("creature spell"); static { - filter.getCardType().add(CardType.CREATURE); + filter.add(new CardTypePredicate(CardType.CREATURE)); } public PsychicBarrier(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/SensorSplicer.java b/Mage.Sets/src/mage/sets/newphyrexia/SensorSplicer.java index 5490e004fb..08969e60a2 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/SensorSplicer.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/SensorSplicer.java @@ -40,6 +40,7 @@ import mage.abilities.effects.common.continious.GainAbilityControlledEffect; import mage.abilities.keyword.VigilanceAbility; import mage.cards.CardImpl; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.permanent.token.GolemToken; @@ -52,7 +53,7 @@ public class SensorSplicer extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("Golem creatures"); static { - filter.getCardType().add(CardType.CREATURE); + filter.add(new CardTypePredicate(CardType.CREATURE)); filter.add(new SubtypePredicate("Golem")); } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/VictoriousDestruction.java b/Mage.Sets/src/mage/sets/newphyrexia/VictoriousDestruction.java index 3863ea40f1..3e4ed9e51a 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/VictoriousDestruction.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/VictoriousDestruction.java @@ -33,8 +33,9 @@ import mage.Constants.Rarity; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.effects.common.LoseLifeControllerEffect; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; -import mage.filter.common.FilterArtifactPermanent; +import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -43,11 +44,12 @@ import mage.target.TargetPermanent; */ public class VictoriousDestruction extends CardImpl { - private static final FilterArtifactPermanent filter = new FilterArtifactPermanent("artifact or land"); + private final static FilterPermanent filter = new FilterPermanent("artifact or land"); static { - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.LAND))); } public VictoriousDestruction(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/VitalSplicer.java b/Mage.Sets/src/mage/sets/newphyrexia/VitalSplicer.java index 13d8dfe38e..81eeb94c79 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/VitalSplicer.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/VitalSplicer.java @@ -41,6 +41,7 @@ import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.RegenerateTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.permanent.token.GolemToken; import mage.target.common.TargetCreaturePermanent; @@ -54,7 +55,7 @@ public class VitalSplicer extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Golem you control"); static { - filter.getCardType().add(CardType.CREATURE); + filter.add(new CardTypePredicate(CardType.CREATURE)); filter.add(new SubtypePredicate("Golem")); filter.setTargetController(TargetController.YOU); } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/Whipflare.java b/Mage.Sets/src/mage/sets/newphyrexia/Whipflare.java index 9aaa8309c6..92ef12f0a1 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/Whipflare.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/Whipflare.java @@ -27,13 +27,14 @@ */ package mage.sets.newphyrexia; +import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.abilities.effects.common.DamageAllEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; - -import java.util.UUID; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -44,7 +45,7 @@ public class Whipflare extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonartifact creature"); static { - filter.getNotCardType().add(CardType.ARTIFACT); + filter.add(Predicates.not(new CardTypePredicate(CardType.ARTIFACT))); } public Whipflare(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/WingSplicer.java b/Mage.Sets/src/mage/sets/newphyrexia/WingSplicer.java index 3abee59fad..e4f500fac8 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/WingSplicer.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/WingSplicer.java @@ -40,6 +40,7 @@ import mage.abilities.effects.common.continious.GainAbilityControlledEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.permanent.token.GolemToken; @@ -52,7 +53,7 @@ public class WingSplicer extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("Golem creatures"); static { - filter.getCardType().add(CardType.CREATURE); + filter.add(new CardTypePredicate(CardType.CREATURE)); filter.add(new SubtypePredicate("Golem")); } diff --git a/Mage.Sets/src/mage/sets/planechase/AkromasVengeance.java b/Mage.Sets/src/mage/sets/planechase/AkromasVengeance.java index 9abfc8065f..faf2a5ee37 100644 --- a/Mage.Sets/src/mage/sets/planechase/AkromasVengeance.java +++ b/Mage.Sets/src/mage/sets/planechase/AkromasVengeance.java @@ -37,8 +37,9 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.CyclingAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; @@ -71,10 +72,10 @@ class AkromasVengeanceEffect extends OneShotEffect { private final static FilterPermanent filter = new FilterPermanent(""); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.CREATURE); - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.CREATURE), + new CardTypePredicate(CardType.ENCHANTMENT))); } public AkromasVengeanceEffect() { diff --git a/Mage.Sets/src/mage/sets/planechase/BeaconOfUnrest.java b/Mage.Sets/src/mage/sets/planechase/BeaconOfUnrest.java index 54752a676e..b0f7588d17 100644 --- a/Mage.Sets/src/mage/sets/planechase/BeaconOfUnrest.java +++ b/Mage.Sets/src/mage/sets/planechase/BeaconOfUnrest.java @@ -33,8 +33,9 @@ import mage.Constants.Rarity; import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; import mage.abilities.effects.common.ShuffleSpellEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetCardInGraveyard; /** @@ -45,9 +46,9 @@ public class BeaconOfUnrest extends CardImpl { private static final FilterCard filter = new FilterCard("artifact or creature"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.CREATURE); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.CREATURE))); } public BeaconOfUnrest(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/planechase/BorosGarrison.java b/Mage.Sets/src/mage/sets/planechase/BorosGarrison.java index 87f4593a9d..ee291f888b 100644 --- a/Mage.Sets/src/mage/sets/planechase/BorosGarrison.java +++ b/Mage.Sets/src/mage/sets/planechase/BorosGarrison.java @@ -41,8 +41,8 @@ import mage.abilities.effects.common.BasicManaEffect; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.mana.SimpleManaAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.Target; import mage.target.common.TargetControlledPermanent; @@ -55,8 +55,7 @@ public class BorosGarrison extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("land you control"); static { - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.LAND)); } public BorosGarrison(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/planechase/BoshIronGolem.java b/Mage.Sets/src/mage/sets/planechase/BoshIronGolem.java index 6b208e1db9..a6bca4e488 100644 --- a/Mage.Sets/src/mage/sets/planechase/BoshIronGolem.java +++ b/Mage.Sets/src/mage/sets/planechase/BoshIronGolem.java @@ -41,6 +41,7 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -56,7 +57,7 @@ public class BoshIronGolem extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public BoshIronGolem(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/planechase/Broodstar.java b/Mage.Sets/src/mage/sets/planechase/Broodstar.java index 2d332310f9..b1e0eda62d 100644 --- a/Mage.Sets/src/mage/sets/planechase/Broodstar.java +++ b/Mage.Sets/src/mage/sets/planechase/Broodstar.java @@ -39,8 +39,8 @@ import mage.abilities.effects.common.continious.SetPowerToughnessSourceEffect; import mage.abilities.keyword.AffinityForArtifactsAbility; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -50,8 +50,7 @@ public class Broodstar extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("artifacts you control"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public Broodstar(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/planechase/CranialPlating.java b/Mage.Sets/src/mage/sets/planechase/CranialPlating.java index a3a95cb74a..c8b5328181 100644 --- a/Mage.Sets/src/mage/sets/planechase/CranialPlating.java +++ b/Mage.Sets/src/mage/sets/planechase/CranialPlating.java @@ -43,8 +43,8 @@ import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.continious.BoostEquippedEffect; import mage.abilities.keyword.EquipAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -55,8 +55,7 @@ public class CranialPlating extends CardImpl { private final static FilterControlledPermanent filterCounted = new FilterControlledPermanent("artifacts you control"); static { - filterCounted.getCardType().add(CardType.ARTIFACT); - filterCounted.setScopeCardType(Filter.ComparisonScope.Any); + filterCounted.add(new CardTypePredicate(CardType.ARTIFACT)); } public CranialPlating(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/planechase/GruulTurf.java b/Mage.Sets/src/mage/sets/planechase/GruulTurf.java index 097c1d03da..00edaca390 100644 --- a/Mage.Sets/src/mage/sets/planechase/GruulTurf.java +++ b/Mage.Sets/src/mage/sets/planechase/GruulTurf.java @@ -41,6 +41,7 @@ import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.mana.SimpleManaAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.Target; import mage.target.common.TargetControlledPermanent; @@ -52,7 +53,7 @@ public class GruulTurf extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("land"); static { - filter.getCardType().add(Constants.CardType.LAND); + filter.add(new CardTypePredicate(Constants.CardType.LAND)); } public GruulTurf(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/planechase/LodestoneMyr.java b/Mage.Sets/src/mage/sets/planechase/LodestoneMyr.java index 8414f3468f..20b0eda03f 100644 --- a/Mage.Sets/src/mage/sets/planechase/LodestoneMyr.java +++ b/Mage.Sets/src/mage/sets/planechase/LodestoneMyr.java @@ -38,8 +38,8 @@ import mage.abilities.costs.common.TapTargetCost; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledPermanent; /** @@ -52,8 +52,7 @@ public class LodestoneMyr extends CardImpl { static { filter.setTapped(false); filter.setUseTapped(true); - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public LodestoneMyr(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/ravnika/DimirAqueduct.java b/Mage.Sets/src/mage/sets/ravnika/DimirAqueduct.java index 334afa86b1..7773cadb42 100644 --- a/Mage.Sets/src/mage/sets/ravnika/DimirAqueduct.java +++ b/Mage.Sets/src/mage/sets/ravnika/DimirAqueduct.java @@ -41,8 +41,8 @@ import mage.abilities.effects.common.BasicManaEffect; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.mana.SimpleManaAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.Target; import mage.target.common.TargetControlledPermanent; @@ -53,8 +53,7 @@ public class DimirAqueduct extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("land you control"); static { - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.LAND)); } diff --git a/Mage.Sets/src/mage/sets/ravnika/DowsingShaman.java b/Mage.Sets/src/mage/sets/ravnika/DowsingShaman.java index 85c891ff51..bbade83879 100644 --- a/Mage.Sets/src/mage/sets/ravnika/DowsingShaman.java +++ b/Mage.Sets/src/mage/sets/ravnika/DowsingShaman.java @@ -39,8 +39,8 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetCardInYourGraveyard; /** @@ -52,8 +52,7 @@ public class DowsingShaman extends CardImpl { private final static FilterCard filter = new FilterCard("enchantment card from your graveyard"); static { - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); } public DowsingShaman(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/ravnika/GlareOfSubdual.java b/Mage.Sets/src/mage/sets/ravnika/GlareOfSubdual.java index a97812d2d0..6eb1d3b8b7 100644 --- a/Mage.Sets/src/mage/sets/ravnika/GlareOfSubdual.java +++ b/Mage.Sets/src/mage/sets/ravnika/GlareOfSubdual.java @@ -37,9 +37,10 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapTargetCost; import mage.abilities.effects.common.TapTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; import mage.target.common.TargetControlledCreaturePermanent; @@ -55,9 +56,9 @@ public class GlareOfSubdual extends CardImpl { static { filterCost.setTapped(false); filterCost.setUseTapped(true); - filterTarget.getCardType().add(CardType.ARTIFACT); - filterTarget.getCardType().add(CardType.CREATURE); - filterTarget.setScopeCardType(Filter.ComparisonScope.Any); + filterTarget.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.CREATURE))); } public GlareOfSubdual(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/ravnika/GolgariRotFarm.java b/Mage.Sets/src/mage/sets/ravnika/GolgariRotFarm.java index 17d2746533..cece174bc9 100644 --- a/Mage.Sets/src/mage/sets/ravnika/GolgariRotFarm.java +++ b/Mage.Sets/src/mage/sets/ravnika/GolgariRotFarm.java @@ -41,8 +41,8 @@ import mage.abilities.effects.common.BasicManaEffect; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.mana.SimpleManaAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.Target; import mage.target.common.TargetControlledPermanent; @@ -54,8 +54,7 @@ public class GolgariRotFarm extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("land you control"); static { - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.LAND)); } public GolgariRotFarm(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/ravnika/HalcyonGlaze.java b/Mage.Sets/src/mage/sets/ravnika/HalcyonGlaze.java index ff1419f3ea..5f766df1d8 100644 --- a/Mage.Sets/src/mage/sets/ravnika/HalcyonGlaze.java +++ b/Mage.Sets/src/mage/sets/ravnika/HalcyonGlaze.java @@ -36,8 +36,8 @@ import mage.abilities.common.SpellCastTriggeredAbility; import mage.abilities.effects.common.continious.BecomesCreatureSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.permanent.token.Token; /** @@ -49,8 +49,7 @@ public class HalcyonGlaze extends CardImpl { private static final FilterSpell filter = new FilterSpell("a creature spell"); static { - filter.getCardType().add(CardType.CREATURE); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.CREATURE)); } public HalcyonGlaze(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/ravnika/LeaveNoTrace.java b/Mage.Sets/src/mage/sets/ravnika/LeaveNoTrace.java index cf805e2f86..a25304c807 100644 --- a/Mage.Sets/src/mage/sets/ravnika/LeaveNoTrace.java +++ b/Mage.Sets/src/mage/sets/ravnika/LeaveNoTrace.java @@ -36,8 +36,8 @@ import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.TargetPermanent; @@ -49,8 +49,7 @@ public class LeaveNoTrace extends CardImpl { static final FilterPermanent filter = new FilterPermanent("enchantment"); static { - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); } public LeaveNoTrace(UUID ownerId) { @@ -78,8 +77,7 @@ class LeaveNoTraceEffect extends OneShotEffect { static final FilterPermanent filter = new FilterPermanent("enchantment"); static { - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); } LeaveNoTraceEffect() { diff --git a/Mage.Sets/src/mage/sets/ravnika/MuddleTheMixture.java b/Mage.Sets/src/mage/sets/ravnika/MuddleTheMixture.java index a7580cb676..51fee86e60 100644 --- a/Mage.Sets/src/mage/sets/ravnika/MuddleTheMixture.java +++ b/Mage.Sets/src/mage/sets/ravnika/MuddleTheMixture.java @@ -33,8 +33,9 @@ import mage.Constants.Rarity; import mage.abilities.effects.common.CounterTargetEffect; import mage.abilities.keyword.TransmuteAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterSpell; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetSpell; /** @@ -45,9 +46,9 @@ public class MuddleTheMixture extends CardImpl { private static final FilterSpell filter = new FilterSpell("instant or sorcery spell"); static { - filter.getCardType().add(CardType.INSTANT); - filter.getCardType().add(CardType.SORCERY); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.INSTANT), + new CardTypePredicate(CardType.SORCERY))); } public MuddleTheMixture(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/ravnika/NullmageShepherd.java b/Mage.Sets/src/mage/sets/ravnika/NullmageShepherd.java index 0278a0f816..0d5739aab9 100644 --- a/Mage.Sets/src/mage/sets/ravnika/NullmageShepherd.java +++ b/Mage.Sets/src/mage/sets/ravnika/NullmageShepherd.java @@ -38,9 +38,10 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapTargetCost; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; import mage.target.common.TargetControlledCreaturePermanent; @@ -56,9 +57,9 @@ public class NullmageShepherd extends CardImpl { static { filterCost.setTapped(false); filterCost.setUseTapped(true); - filterTarget.getCardType().add(CardType.ARTIFACT); - filterTarget.getCardType().add(CardType.ENCHANTMENT); - filterTarget.setScopeCardType(Filter.ComparisonScope.Any); + filterTarget.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.ENCHANTMENT))); } public NullmageShepherd(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/ravnika/PrimordialSage.java b/Mage.Sets/src/mage/sets/ravnika/PrimordialSage.java index 63523697d0..a42a628410 100644 --- a/Mage.Sets/src/mage/sets/ravnika/PrimordialSage.java +++ b/Mage.Sets/src/mage/sets/ravnika/PrimordialSage.java @@ -34,8 +34,8 @@ import mage.MageInt; import mage.abilities.common.SpellCastTriggeredAbility; import mage.abilities.effects.common.DrawCardControllerEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -46,8 +46,7 @@ public class PrimordialSage extends CardImpl { private static final FilterSpell filter = new FilterSpell("a creature spell"); static { - filter.getCardType().add(CardType.CREATURE); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.CREATURE)); } public PrimordialSage(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/ravnika/Putrefy.java b/Mage.Sets/src/mage/sets/ravnika/Putrefy.java index a639c80801..f7dcb961d5 100644 --- a/Mage.Sets/src/mage/sets/ravnika/Putrefy.java +++ b/Mage.Sets/src/mage/sets/ravnika/Putrefy.java @@ -33,8 +33,9 @@ import mage.Constants.CardType; import mage.Constants.Rarity; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -42,12 +43,12 @@ import mage.target.TargetPermanent; * @author Loki */ public class Putrefy extends CardImpl { - private static FilterPermanent filter = new FilterPermanent("artifact or creature"); + private static final FilterPermanent filter = new FilterPermanent("artifact or creature"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.CREATURE); - filter.setScopeCardType(ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.CREATURE))); } public Putrefy (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/ravnika/SelesnyaSanctuary.java b/Mage.Sets/src/mage/sets/ravnika/SelesnyaSanctuary.java index 4d3d8fdd22..bd30b072c4 100644 --- a/Mage.Sets/src/mage/sets/ravnika/SelesnyaSanctuary.java +++ b/Mage.Sets/src/mage/sets/ravnika/SelesnyaSanctuary.java @@ -41,8 +41,8 @@ import mage.abilities.effects.common.BasicManaEffect; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.mana.SimpleManaAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.Target; import mage.target.common.TargetControlledPermanent; @@ -54,8 +54,7 @@ public class SelesnyaSanctuary extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("land you control"); static { - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.LAND)); } public SelesnyaSanctuary(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/ConsumingVapors.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/ConsumingVapors.java index ee0fcea486..b55fb49e5f 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/ConsumingVapors.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/ConsumingVapors.java @@ -37,6 +37,7 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.ReboundAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -88,7 +89,7 @@ class ConsumingVaporsEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); FilterControlledPermanent filter = new FilterControlledPermanent("creature"); - filter.getCardType().add(CardType.CREATURE); + filter.add(new CardTypePredicate(CardType.CREATURE)); filter.setTargetController(TargetController.YOU); TargetControlledPermanent target = new TargetControlledPermanent(1, 1, filter, false); diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Deprive.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Deprive.java index a069ddf70a..6892b16b2a 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Deprive.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Deprive.java @@ -34,8 +34,8 @@ import mage.Constants.Rarity; import mage.abilities.costs.common.ReturnToHandTargetCost; import mage.abilities.effects.common.CounterTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetSpell; import mage.target.common.TargetControlledPermanent; @@ -48,8 +48,7 @@ public class Deprive extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("land"); static { - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.LAND)); } public Deprive(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/InquisitionOfKozilek.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/InquisitionOfKozilek.java index efe7fcb0fd..5127b494de 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/InquisitionOfKozilek.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/InquisitionOfKozilek.java @@ -39,6 +39,8 @@ import mage.cards.Card; import mage.cards.CardImpl; import mage.filter.Filter; import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; import mage.game.Game; import mage.players.Player; @@ -74,8 +76,7 @@ class InquisitionOfKozilekEffect extends OneShotEffect { private static final FilterSpell filter = new FilterSpell("an instant or sorcery spell"); static { - filter.getCardType().add(CardType.INSTANT); - filter.getCardType().add(CardType.SORCERY); - filter.setScopeCardType(ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.INSTANT), + new CardTypePredicate(CardType.SORCERY))); } public KilnFiend(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Magmaw.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Magmaw.java index 5fe7e73101..d3f7675e07 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Magmaw.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Magmaw.java @@ -37,6 +37,8 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetCreatureOrPlayer; @@ -51,7 +53,7 @@ public class Magmaw extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("nonland permanent"); static { - filter.getNotCardType().add(CardType.LAND); + filter.add(Predicates.not(new CardTypePredicate(CardType.LAND))); } public Magmaw(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/MnemonicWall.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/MnemonicWall.java index dea9ef5127..9f9ed2f941 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/MnemonicWall.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/MnemonicWall.java @@ -36,8 +36,9 @@ import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.keyword.DefenderAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetCardInYourGraveyard; /** @@ -49,9 +50,9 @@ public class MnemonicWall extends CardImpl { private static final FilterCard filter = new FilterCard("instant or sorcery card from your graveyard"); static { - filter.getCardType().add(CardType.INSTANT); - filter.getCardType().add(CardType.SORCERY); - filter.setScopeCardType(ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.INSTANT), + new CardTypePredicate(CardType.SORCERY))); } public MnemonicWall(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Narcolepsy.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Narcolepsy.java index fcccef728e..3fed288eca 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Narcolepsy.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Narcolepsy.java @@ -31,18 +31,17 @@ import java.util.UUID; import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.AttachEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; -import mage.target.TargetPermanent; -import mage.Constants.Zone; -import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; -import mage.game.permanent.Permanent; -import mage.abilities.Ability; import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.TargetPermanent; /** * @@ -52,10 +51,6 @@ public class Narcolepsy extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature"); - static { - filter.setScopeCardType(Filter.ComparisonScope.Any); - } - public Narcolepsy(UUID ownerId) { super(ownerId, 79, "Narcolepsy", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}"); this.expansionSetCode = "ROE"; diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/SarkhanTheMad.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/SarkhanTheMad.java index 0403b26e86..12f5f1bca1 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/SarkhanTheMad.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/SarkhanTheMad.java @@ -45,6 +45,7 @@ import mage.cards.Cards; import mage.cards.CardsImpl; import mage.counters.CounterType; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; @@ -166,7 +167,7 @@ class SarkhanTheMadDragonDamageEffect extends OneShotEffect { private static final FilterSpell filter = new FilterSpell("an instant or sorcery spell"); static { - filter.getCardType().add(CardType.INSTANT); - filter.getCardType().add(CardType.SORCERY); - filter.setScopeCardType(ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.INSTANT), + new CardTypePredicate(CardType.SORCERY))); } public SphinxBoneWand(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/SurrakarSpellblade.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/SurrakarSpellblade.java index 8471598d8f..8e381c4cb3 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/SurrakarSpellblade.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/SurrakarSpellblade.java @@ -39,6 +39,8 @@ import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.counters.CounterType; import mage.filter.FilterSpell; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -49,8 +51,9 @@ public class SurrakarSpellblade extends CardImpl { private static final FilterSpell filter = new FilterSpell("instant or sorcery card"); static { - filter.getCardType().add(CardType.INSTANT); - filter.getCardType().add(CardType.SORCERY); + filter.add(Predicates.or( + new CardTypePredicate(CardType.INSTANT), + new CardTypePredicate(CardType.SORCERY))); } public SurrakarSpellblade(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/SurrealMemoir.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/SurrealMemoir.java index f8c67c577e..72317d69cd 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/SurrealMemoir.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/SurrealMemoir.java @@ -39,6 +39,7 @@ import mage.abilities.keyword.ReboundAbility; import mage.cards.Card; import mage.cards.CardImpl; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.players.Player; @@ -90,7 +91,7 @@ class SurrealMemoirEffect extends OneShotEffect { Player player = game.getPlayer(source.getControllerId()); if (player != null) { FilterCard filter = new FilterCard("instant card"); - filter.getCardType().add(CardType.INSTANT); + filter.add(new CardTypePredicate(CardType.INSTANT)); Card[] cards = player.getGraveyard().getCards(filter, game).toArray(new Card[0]); if (cards.length > 0) { Random rnd = new Random(); diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/KatakiWarsWage.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/KatakiWarsWage.java index df646a7085..8b6f468221 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/KatakiWarsWage.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/KatakiWarsWage.java @@ -40,8 +40,8 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; import mage.abilities.effects.common.continious.GainAbilityAllEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -52,8 +52,7 @@ public class KatakiWarsWage extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("artifacts"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public KatakiWarsWage(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/NikkoOnna.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/NikkoOnna.java index ea531d0c57..72d9dcc5bf 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/NikkoOnna.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/NikkoOnna.java @@ -37,9 +37,9 @@ import mage.abilities.common.SpellCastTriggeredAbility; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.effects.common.ReturnToHandSourceEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; import mage.filter.common.FilterSpiritOrArcaneCard; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -52,8 +52,7 @@ public class NikkoOnna extends CardImpl { private final static FilterPermanent filterTarget = new FilterPermanent("enchantment"); static { - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); } public NikkoOnna(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/OboroBreezecaller.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/OboroBreezecaller.java index dcc1d7917d..e27f8210f7 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/OboroBreezecaller.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/OboroBreezecaller.java @@ -40,8 +40,8 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.UntapTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetLandPermanent; @@ -54,8 +54,7 @@ public class OboroBreezecaller extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("land"); static { - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.LAND)); } public OboroBreezecaller(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/SunderFromWithin.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/SunderFromWithin.java index 42242b1a95..c31db2ceff 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/SunderFromWithin.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/SunderFromWithin.java @@ -32,8 +32,9 @@ import mage.Constants.CardType; import mage.Constants.Rarity; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -45,9 +46,9 @@ public class SunderFromWithin extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("artifact or land"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.LAND))); } public SunderFromWithin(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/YukiOnna.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/YukiOnna.java index 4fb0de4e27..ed53e6551d 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/YukiOnna.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/YukiOnna.java @@ -38,9 +38,9 @@ import mage.abilities.common.SpellCastTriggeredAbility; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.effects.common.ReturnToHandSourceEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; import mage.filter.common.FilterSpiritOrArcaneCard; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -52,8 +52,7 @@ public class YukiOnna extends CardImpl { private final static FilterPermanent filterTarget = new FilterPermanent("artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public YukiOnna(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/AbunaAcolyte.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/AbunaAcolyte.java index 81ccbe5a91..09028bf86e 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/AbunaAcolyte.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/AbunaAcolyte.java @@ -37,8 +37,8 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.PreventDamageTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetCreatureOrPlayer; import mage.target.common.TargetCreaturePermanent; @@ -53,8 +53,7 @@ public class AbunaAcolyte extends CardImpl { final static FilterCreaturePermanent filter = new FilterCreaturePermanent("artifact creature"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(ComparisonScope.All); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public AbunaAcolyte(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/BarrageOgre.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/BarrageOgre.java index 81c0881616..91d33a6ea5 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/BarrageOgre.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/BarrageOgre.java @@ -38,8 +38,8 @@ import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetCreatureOrPlayer; @@ -53,8 +53,7 @@ public class BarrageOgre extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("an artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public BarrageOgre (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/BellowingTanglewurm.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/BellowingTanglewurm.java index 6cb61e5455..ea4472cb6b 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/BellowingTanglewurm.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/BellowingTanglewurm.java @@ -38,8 +38,8 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.continious.GainAbilityControlledEffect; import mage.abilities.keyword.IntimidateAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -49,8 +49,7 @@ public class BellowingTanglewurm extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("green creatures"); static { - filter.getCardType().add(CardType.CREATURE); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.CREATURE)); filter.setUseColor(true); filter.getColor().setGreen(true); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/BluntTheAssault.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/BluntTheAssault.java index 9e290f7832..79eda67144 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/BluntTheAssault.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/BluntTheAssault.java @@ -37,7 +37,7 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.effects.common.PreventAllDamageEffect; import mage.cards.CardImpl; -import mage.filter.FilterPermanent; +import mage.filter.common.FilterCreaturePermanent; /** * @@ -45,11 +45,7 @@ import mage.filter.FilterPermanent; */ public class BluntTheAssault extends CardImpl { - private static final FilterPermanent filter = new FilterPermanent("creature on the battlefield"); - - static { - filter.getCardType().add(Constants.CardType.CREATURE); - } + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature on the battlefield"); public BluntTheAssault (UUID ownerId) { super(ownerId, 113, "Blunt the Assault", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{3}{G}"); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/DarksteelJuggernaut.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/DarksteelJuggernaut.java index 51ad787452..6ea2957961 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/DarksteelJuggernaut.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/DarksteelJuggernaut.java @@ -40,17 +40,16 @@ import mage.abilities.effects.common.continious.SetPowerToughnessSourceEffect; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.keyword.IndestructibleAbility; import mage.cards.CardImpl; -import mage.filter.FilterPermanent; +import mage.filter.common.FilterArtifactPermanent; /** * * @author Loki */ public class DarksteelJuggernaut extends CardImpl { - private static final FilterPermanent filter = new FilterPermanent("artifacts you control"); + private static final FilterArtifactPermanent filter = new FilterArtifactPermanent("artifacts you control"); static { - filter.getCardType().add(Constants.CardType.ARTIFACT); filter.setTargetController(Constants.TargetController.YOU); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Embersmith.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Embersmith.java index 510d34301d..d712fb4609 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Embersmith.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Embersmith.java @@ -39,8 +39,8 @@ import mage.abilities.costs.Cost; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -53,8 +53,7 @@ public class Embersmith extends CardImpl { private static final FilterSpell filter = new FilterSpell("an artifact spell"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public Embersmith(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Ferrovore.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Ferrovore.java index 090989aff7..3a012cc001 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Ferrovore.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Ferrovore.java @@ -40,8 +40,8 @@ import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledPermanent; /** @@ -49,11 +49,10 @@ import mage.target.common.TargetControlledPermanent; * @author Loki */ public class Ferrovore extends CardImpl { - private static FilterControlledPermanent filter = new FilterControlledPermanent("artifact"); + private static final FilterControlledPermanent filter = new FilterControlledPermanent("artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public Ferrovore (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/GethLordOfTheVault.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/GethLordOfTheVault.java index 38bbc68ea2..23714430f0 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/GethLordOfTheVault.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/GethLordOfTheVault.java @@ -45,8 +45,9 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.IntimidateAbility; import mage.cards.Card; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -61,9 +62,9 @@ public class GethLordOfTheVault extends CardImpl { private static final FilterCard filter = new FilterCard("artifact or creature card from an opponent's graveyard"); static { - filter.getCardType().add(CardType.CREATURE); - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.CREATURE))); } public GethLordOfTheVault (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/GlintHawk.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/GlintHawk.java index 1d8c9d68b5..1b48fd47c2 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/GlintHawk.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/GlintHawk.java @@ -40,6 +40,7 @@ import mage.abilities.effects.common.SacrificeSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -81,7 +82,7 @@ class GlintHawkEffect extends OneShotEffect { static { filter = new FilterControlledPermanent(); - filter.getCardType().add(CardType.ARTIFACT); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } GlintHawkEffect ( ) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/GolemArtisan.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/GolemArtisan.java index 2a32d62331..1415e279e1 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/GolemArtisan.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/GolemArtisan.java @@ -44,8 +44,8 @@ import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; import mage.choices.Choice; import mage.choices.ChoiceImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -64,9 +64,8 @@ public class GolemArtisan extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("artifact creature"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.CREATURE); - filter.setScopeCardType(Filter.ComparisonScope.All); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); + filter.add(new CardTypePredicate(CardType.CREATURE)); } public GolemArtisan(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/GolemFoundry.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/GolemFoundry.java index 822644a3e4..d96452f33a 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/GolemFoundry.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/GolemFoundry.java @@ -40,8 +40,8 @@ import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.counters.CounterType; -import mage.filter.Filter; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.permanent.token.Token; /** @@ -52,8 +52,7 @@ public class GolemFoundry extends CardImpl { private static final FilterSpell filter = new FilterSpell("an artifact spell"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public GolemFoundry (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/GrandArchitect.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/GrandArchitect.java index ff951a52ce..c4374447de 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/GrandArchitect.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/GrandArchitect.java @@ -52,9 +52,9 @@ import mage.abilities.effects.common.BasicManaEffect; import mage.abilities.effects.common.continious.BoostControlledEffect; import mage.abilities.mana.ManaAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.TargetPermanent; @@ -72,8 +72,7 @@ public class GrandArchitect extends CardImpl { static { boostFilter.getColor().setBlue(true); boostFilter.setUseColor(true); - targetFilter.getCardType().add(CardType.ARTIFACT); - targetFilter.setScopeCardType(ComparisonScope.All); + targetFilter.add(new CardTypePredicate(CardType.ARTIFACT)); } public GrandArchitect(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/HaltOrder.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/HaltOrder.java index 012c08716b..3464b4505e 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/HaltOrder.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/HaltOrder.java @@ -34,8 +34,8 @@ import mage.Constants.Rarity; import mage.abilities.effects.common.CounterTargetEffect; import mage.abilities.effects.common.DrawCardControllerEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetSpell; /** @@ -47,8 +47,7 @@ public class HaltOrder extends CardImpl { private static final FilterSpell filter = new FilterSpell("artifact spell"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public HaltOrder (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/HandOfThePraetors.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/HandOfThePraetors.java index f4e0cf7cb7..d2772b2814 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/HandOfThePraetors.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/HandOfThePraetors.java @@ -43,9 +43,9 @@ import mage.filter.common.FilterCreaturePermanent; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.continious.BoostControlledEffect; import mage.abilities.common.SpellCastTriggeredAbility; -import mage.filter.Filter; import mage.filter.FilterSpell; import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -59,8 +59,7 @@ public class HandOfThePraetors extends CardImpl { static { filter.add(new AbilityPredicate(InfectAbility.class)); filterSpell.add(new AbilityPredicate(InfectAbility.class)); - filterSpell.getCardType().add(CardType.CREATURE); - filterSpell.setScopeCardType(Filter.ComparisonScope.Any); + filterSpell.add(new CardTypePredicate(CardType.CREATURE)); } public HandOfThePraetors (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/HoardSmelterDragon.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/HoardSmelterDragon.java index b8ff6198ad..d88df9cca0 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/HoardSmelterDragon.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/HoardSmelterDragon.java @@ -43,6 +43,7 @@ import mage.abilities.keyword.FlyingAbility; import mage.cards.Card; import mage.cards.CardImpl; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.TargetPermanent; @@ -52,10 +53,10 @@ import mage.target.TargetPermanent; * @author Loki */ public class HoardSmelterDragon extends CardImpl { - private static FilterPermanent filter = new FilterPermanent("artifact"); + private static final FilterPermanent filter = new FilterPermanent("artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public HoardSmelterDragon (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/IndomitableArchangel.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/IndomitableArchangel.java index 9a052edaa5..113ae6b542 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/IndomitableArchangel.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/IndomitableArchangel.java @@ -44,18 +44,19 @@ import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.ShroudAbility; import mage.cards.CardImpl; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @author nantuko */ public class IndomitableArchangel extends CardImpl { - private final String text = "Metalcraft - Artifacts you control have shroud as long as you control three or more artifacts."; + private static final String rule = "Metalcraft - Artifacts you control have shroud as long as you control three or more artifacts."; - private static FilterPermanent filter = new FilterPermanent("Artifacts"); + private static final FilterPermanent filter = new FilterPermanent("Artifacts"); static { - filter.getCardType().add(CardType.ARTIFACT); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public IndomitableArchangel(UUID ownerId) { @@ -67,7 +68,7 @@ public class IndomitableArchangel extends CardImpl { this.toughness = new MageInt(4); this.addAbility(FlyingAbility.getInstance()); ContinuousEffect gainAbilityEffect = new GainAbilityControlledEffect(ShroudAbility.getInstance(), Duration.WhileOnBattlefield, filter); - ConditionalContinousEffect effect = new ConditionalContinousEffect(gainAbilityEffect, MetalcraftCondition.getInstance(), text); + ConditionalContinousEffect effect = new ConditionalContinousEffect(gainAbilityEffect, MetalcraftCondition.getInstance(), rule); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/KuldothaRebirth.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/KuldothaRebirth.java index bfb5277113..2177c5f5a0 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/KuldothaRebirth.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/KuldothaRebirth.java @@ -33,8 +33,8 @@ import mage.Constants.Rarity; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.permanent.token.GoblinToken; import mage.target.common.TargetControlledPermanent; @@ -48,8 +48,7 @@ public class KuldothaRebirth extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("an artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public KuldothaRebirth (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Lifesmith.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Lifesmith.java index 0f3b7e00dc..c3e5cbbbeb 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Lifesmith.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Lifesmith.java @@ -39,8 +39,8 @@ import mage.abilities.costs.Cost; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.players.Player; @@ -52,8 +52,7 @@ public class Lifesmith extends CardImpl { private static final FilterSpell filter = new FilterSpell("an artifact spell"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public Lifesmith (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Myrsmith.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Myrsmith.java index c44eeddff2..de00f528da 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Myrsmith.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Myrsmith.java @@ -39,8 +39,8 @@ import mage.abilities.costs.Cost; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.token.MyrToken; @@ -52,8 +52,7 @@ public class Myrsmith extends CardImpl { private static final FilterSpell filter = new FilterSpell("an artifact spell"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public Myrsmith (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/OxiddaDaredevil.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/OxiddaDaredevil.java index 798940c6fe..1f4570c18c 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/OxiddaDaredevil.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/OxiddaDaredevil.java @@ -38,8 +38,8 @@ import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.effects.common.continious.GainAbilitySourceEffect; import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledPermanent; import java.util.UUID; @@ -49,11 +49,10 @@ import java.util.UUID; * @author Loki */ public class OxiddaDaredevil extends CardImpl { - private static FilterControlledPermanent filter = new FilterControlledPermanent("an artifact"); + private static final FilterControlledPermanent filter = new FilterControlledPermanent("an artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public OxiddaDaredevil (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Painsmith.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Painsmith.java index dc5a3c5c5e..3204d43ff8 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Painsmith.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Painsmith.java @@ -38,8 +38,8 @@ import mage.abilities.effects.common.continious.BoostTargetEffect; import mage.abilities.effects.common.continious.GainAbilityTargetEffect; import mage.abilities.keyword.DeathtouchAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -50,8 +50,7 @@ public class Painsmith extends CardImpl { private static final FilterSpell filter = new FilterSpell("an artifact spell"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public Painsmith (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/PrecursorGolem.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/PrecursorGolem.java index bb1756fee7..3bb22ea164 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/PrecursorGolem.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/PrecursorGolem.java @@ -51,6 +51,8 @@ import mage.target.Target; import mage.target.targetpointer.FixedTarget; import java.util.UUID; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @author nantuko @@ -87,9 +89,9 @@ class PrecursorGolemCopyTriggeredAbility extends TriggeredAbilityImpl { - private static FilterPermanent filter = new FilterPermanent("artifact or enchantment"); + private static final FilterPermanent filter = new FilterPermanent("artifact or enchantment"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.ENCHANTMENT))); } public RevokeExistence (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Riddlesmith.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Riddlesmith.java index d09b9fb0ed..fad5a6e39f 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Riddlesmith.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Riddlesmith.java @@ -35,8 +35,8 @@ import mage.MageInt; import mage.abilities.common.SpellCastTriggeredAbility; import mage.abilities.effects.common.DrawDiscardControllerEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -46,8 +46,7 @@ public class Riddlesmith extends CardImpl { private static final FilterSpell filter = new FilterSpell("an artifact spell"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public Riddlesmith (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/ScrapdiverSerpent.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/ScrapdiverSerpent.java index 8f37c3fb54..ae285bacf8 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/ScrapdiverSerpent.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/ScrapdiverSerpent.java @@ -43,8 +43,8 @@ import mage.abilities.effects.Effect; import mage.abilities.effects.common.continious.GainAbilitySourceEffect; import mage.abilities.keyword.UnblockableAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; /** @@ -53,13 +53,12 @@ import mage.game.Game; */ public class ScrapdiverSerpent extends CardImpl { - private static final String text = "Scrapdiver Serpent is unblockable as long as defending player controls an artifact"; + private static final String rule = "Scrapdiver Serpent is unblockable as long as defending player controls an artifact"; private static final FilterPermanent filter = new FilterPermanent(); static { - filter.getCardType().add(Constants.CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(Constants.CardType.ARTIFACT)); } private class DefendingPlayerControlsArtifact implements Condition { @@ -81,7 +80,7 @@ public class ScrapdiverSerpent extends CardImpl { this.power = new MageInt(5); this.toughness = new MageInt(5); ContinuousEffect gainAbility = new GainAbilitySourceEffect(UnblockableAbility.getInstance(), Constants.Duration.WhileOnBattlefield); - Effect effect = new ConditionalContinousEffect(gainAbility, new DefendingPlayerControlsArtifact(), text); + Effect effect = new ConditionalContinousEffect(gainAbility, new DefendingPlayerControlsArtifact(), rule); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, effect)); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/ShapeAnew.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/ShapeAnew.java index 227e03c213..0ad082aca8 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/ShapeAnew.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/ShapeAnew.java @@ -41,6 +41,7 @@ import mage.cards.CardImpl; import mage.cards.Cards; import mage.cards.CardsImpl; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -55,7 +56,7 @@ public class ShapeAnew extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("an artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public ShapeAnew (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/SliceinTwain.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/SliceinTwain.java index 5c58186aa4..8245e9868a 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/SliceinTwain.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/SliceinTwain.java @@ -34,8 +34,9 @@ import mage.Constants.Rarity; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.effects.common.DrawCardControllerEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -46,9 +47,9 @@ public class SliceinTwain extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("artifact or enchantment"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.ENCHANTMENT))); } public SliceinTwain (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/SylvokReplica.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/SylvokReplica.java index 15499be4fb..7103d0eee3 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/SylvokReplica.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/SylvokReplica.java @@ -39,8 +39,9 @@ import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -48,12 +49,12 @@ import mage.target.TargetPermanent; * @author Loki */ public class SylvokReplica extends CardImpl { - private static FilterPermanent filter = new FilterPermanent("artifact or enchantment"); + private static final FilterPermanent filter = new FilterPermanent("artifact or enchantment"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.ENCHANTMENT))); } public SylvokReplica (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/TemperedSteel.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/TemperedSteel.java index 06e3b78d6a..e08a1177c3 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/TemperedSteel.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/TemperedSteel.java @@ -37,19 +37,18 @@ import mage.Constants.Rarity; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.continious.BoostControlledEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * * @author Loki */ public class TemperedSteel extends CardImpl { - private static FilterCreaturePermanent filter = new FilterCreaturePermanent("Artifact creatures"); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Artifact creatures"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.All); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public TemperedSteel (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/ThroneofGeth.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/ThroneofGeth.java index 4f4af272a8..c25f7c90a8 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/ThroneofGeth.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/ThroneofGeth.java @@ -38,8 +38,8 @@ import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.counter.ProliferateEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledPermanent; /** @@ -47,11 +47,10 @@ import mage.target.common.TargetControlledPermanent; * @author Loki */ public class ThroneofGeth extends CardImpl { - private static FilterControlledPermanent filter = new FilterControlledPermanent("an artifact"); + private static final FilterControlledPermanent filter = new FilterControlledPermanent("an artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public ThroneofGeth (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/TrinketMage.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/TrinketMage.java index eedf04cffe..0d409da823 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/TrinketMage.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/TrinketMage.java @@ -38,6 +38,7 @@ import mage.cards.CardImpl; import mage.filter.Filter; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetCardInLibrary; import java.util.UUID; @@ -50,7 +51,7 @@ public class TrinketMage extends CardImpl { private static final FilterCard filter = new FilterCard("an artifact card with converted mana cost 1 or less"); static { - filter.getCardType().add(CardType.ARTIFACT); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.LessThan, 2)); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/TumbleMagnet.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/TumbleMagnet.java index fc1b6ca54a..37ff7dd7cf 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/TumbleMagnet.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/TumbleMagnet.java @@ -37,12 +37,13 @@ import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.RemoveCountersSourceCost; import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.effects.common.TapTargetEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.counters.CounterType; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -53,9 +54,9 @@ public class TumbleMagnet extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("artifact or creature"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.CREATURE); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.CREATURE))); } public TumbleMagnet (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/VedalkenCertarch.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/VedalkenCertarch.java index 2d0ba5ab93..dd94fbaeb2 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/VedalkenCertarch.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/VedalkenCertarch.java @@ -37,8 +37,9 @@ import mage.abilities.common.MetalcraftActivatedAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.TapTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; import java.util.UUID; @@ -48,13 +49,13 @@ import java.util.UUID; * @author Loki */ public class VedalkenCertarch extends CardImpl { - private static FilterPermanent filter = new FilterPermanent("artifact, creature, or land"); + private static final FilterPermanent filter = new FilterPermanent("artifact, creature, or land"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.CREATURE); - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.CREATURE), + new CardTypePredicate(CardType.LAND))); } public VedalkenCertarch (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/shadowmoor/Cursecatcher.java b/Mage.Sets/src/mage/sets/shadowmoor/Cursecatcher.java index 76281c82f9..9ee18fb19c 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/Cursecatcher.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/Cursecatcher.java @@ -37,8 +37,9 @@ import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.CounterUnlessPaysEffect; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterSpell; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetSpell; /** @@ -50,9 +51,9 @@ public class Cursecatcher extends CardImpl { private static final FilterSpell filter = new FilterSpell("instant or sorcery spell"); static { - filter.getCardType().add(CardType.INSTANT); - filter.getCardType().add(CardType.SORCERY); - filter.setScopeCardType(ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.INSTANT), + new CardTypePredicate(CardType.SORCERY))); } public Cursecatcher(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/shadowmoor/ElvishHexhunter.java b/Mage.Sets/src/mage/sets/shadowmoor/ElvishHexhunter.java index 2dab532c09..68ca0b5393 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/ElvishHexhunter.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/ElvishHexhunter.java @@ -40,6 +40,7 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -51,7 +52,7 @@ public class ElvishHexhunter extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("enchantment"); static { - filter.getCardType().add(CardType.ENCHANTMENT); + filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); } public ElvishHexhunter(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/shadowmoor/GutturalResponse.java b/Mage.Sets/src/mage/sets/shadowmoor/GutturalResponse.java index 1c72319aa4..b34b20069d 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/GutturalResponse.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/GutturalResponse.java @@ -33,6 +33,7 @@ import mage.Constants.Rarity; import mage.abilities.effects.common.CounterTargetEffect; import mage.cards.CardImpl; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetSpell; /** @@ -44,7 +45,7 @@ public class GutturalResponse extends CardImpl { private static final FilterSpell filter = new FilterSpell("blue instant spell"); static { - filter.getCardType().add(CardType.INSTANT); + filter.add(new CardTypePredicate(CardType.INSTANT)); filter.getColor().setBlue(true); filter.setUseColor(true); } diff --git a/Mage.Sets/src/mage/sets/shadowmoor/ToilToRenown.java b/Mage.Sets/src/mage/sets/shadowmoor/ToilToRenown.java index 5f4409ffac..b11340fb3b 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/ToilToRenown.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/ToilToRenown.java @@ -35,6 +35,8 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -46,9 +48,10 @@ public class ToilToRenown extends CardImpl { static { filter.setTapped(true); - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.CREATURE); - filter.getCardType().add(CardType.LAND); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.CREATURE), + new CardTypePredicate(CardType.LAND))); filter.setTargetController(TargetController.YOU); } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/AjaniVengeant.java b/Mage.Sets/src/mage/sets/shardsofalara/AjaniVengeant.java index 42b724685d..d3068b6d67 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/AjaniVengeant.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/AjaniVengeant.java @@ -42,6 +42,7 @@ import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.counters.CounterType; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; import mage.target.TargetPlayer; import mage.target.common.TargetCreatureOrPlayer; @@ -54,7 +55,7 @@ public class AjaniVengeant extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("lands"); static { - filter.getCardType().add(CardType.LAND); + filter.add(new CardTypePredicate(CardType.LAND)); } public AjaniVengeant(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/shardsofalara/BantPanorama.java b/Mage.Sets/src/mage/sets/shardsofalara/BantPanorama.java index 54ac1989f3..efe738fa30 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/BantPanorama.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/BantPanorama.java @@ -42,6 +42,7 @@ import mage.abilities.mana.ColorlessManaAbility; import mage.cards.CardImpl; import mage.filter.FilterCard; import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SupertypePredicate; import mage.target.common.TargetCardInLibrary; @@ -55,7 +56,7 @@ public class BantPanorama extends CardImpl { private static final FilterCard filter = new FilterCard("a basic Forest, Plains, or Island card"); static { - filter.getCardType().add(CardType.LAND); + filter.add(new CardTypePredicate(CardType.LAND)); filter.add(new SupertypePredicate("Basic")); filter.add(Predicates.or( new SubtypePredicate("Forest"), diff --git a/Mage.Sets/src/mage/sets/shardsofalara/DispellersCapsule.java b/Mage.Sets/src/mage/sets/shardsofalara/DispellersCapsule.java index 18f61c1169..76e63e6e33 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/DispellersCapsule.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/DispellersCapsule.java @@ -39,8 +39,9 @@ import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -48,12 +49,12 @@ import mage.target.TargetPermanent; * @author Loki */ public class DispellersCapsule extends CardImpl { - private static FilterPermanent filter = new FilterPermanent("artifact or enchantment"); + private static final FilterPermanent filter = new FilterPermanent("artifact or enchantment"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.ENCHANTMENT))); } public DispellersCapsule (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/shardsofalara/ElspethKnightErrant.java b/Mage.Sets/src/mage/sets/shardsofalara/ElspethKnightErrant.java index faf6f0ada3..862c78c1e7 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/ElspethKnightErrant.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/ElspethKnightErrant.java @@ -48,8 +48,9 @@ import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.IndestructibleAbility; import mage.cards.CardImpl; import mage.counters.CounterType; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.permanent.token.SoldierToken; @@ -99,11 +100,11 @@ class ElspethKnightErrantEffect extends ContinuousEffectImpl { private static final FilterCard filter = new FilterCard("a basic Plains, Island, or Swamp"); static { - filter.getCardType().add(CardType.LAND); + filter.add(new CardTypePredicate(CardType.LAND)); filter.add(new SupertypePredicate("Basic")); filter.add(Predicates.or( new SubtypePredicate("Plains"), diff --git a/Mage.Sets/src/mage/sets/shardsofalara/FiligreeSages.java b/Mage.Sets/src/mage/sets/shardsofalara/FiligreeSages.java index 7748e87ee1..af3bca9534 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/FiligreeSages.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/FiligreeSages.java @@ -38,8 +38,8 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.UntapTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -47,11 +47,10 @@ import mage.target.TargetPermanent; * @author Loki */ public class FiligreeSages extends CardImpl { - private static FilterPermanent filter = new FilterPermanent("artifact"); + private static final FilterPermanent filter = new FilterPermanent("artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public FiligreeSages (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/shardsofalara/GrixisPanorama.java b/Mage.Sets/src/mage/sets/shardsofalara/GrixisPanorama.java index 0320971444..d1bcc47738 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/GrixisPanorama.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/GrixisPanorama.java @@ -42,6 +42,7 @@ import mage.abilities.mana.ColorlessManaAbility; import mage.cards.CardImpl; import mage.filter.FilterCard; import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SupertypePredicate; import mage.target.common.TargetCardInLibrary; @@ -55,7 +56,7 @@ public class GrixisPanorama extends CardImpl { private static final FilterCard filter = new FilterCard("a basic Island, Swamp, or Mountain card"); static { - filter.getCardType().add(CardType.LAND); + filter.add(new CardTypePredicate(CardType.LAND)); filter.add(new SupertypePredicate("Basic")); filter.add(Predicates.or( new SubtypePredicate("Island"), diff --git a/Mage.Sets/src/mage/sets/shardsofalara/JundPanorama.java b/Mage.Sets/src/mage/sets/shardsofalara/JundPanorama.java index 8bd1f54365..c61c45d914 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/JundPanorama.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/JundPanorama.java @@ -43,6 +43,7 @@ import mage.abilities.mana.ColorlessManaAbility; import mage.cards.CardImpl; import mage.filter.FilterCard; import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SupertypePredicate; import mage.target.common.TargetCardInLibrary; @@ -56,7 +57,7 @@ public class JundPanorama extends CardImpl { private static final FilterCard filter = new FilterCard("a basic Swamp, Mountain, or Forest card"); static { - filter.getCardType().add(CardType.LAND); + filter.add(new CardTypePredicate(CardType.LAND)); filter.add(new SupertypePredicate("Basic")); filter.add(Predicates.or( new SubtypePredicate("Swamp"), diff --git a/Mage.Sets/src/mage/sets/shardsofalara/MasterOfEtherium.java b/Mage.Sets/src/mage/sets/shardsofalara/MasterOfEtherium.java index 6a3d7722d3..10995dfa63 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/MasterOfEtherium.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/MasterOfEtherium.java @@ -38,9 +38,9 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.continious.BoostControlledEffect; import mage.abilities.effects.common.continious.SetPowerToughnessSourceEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -52,10 +52,8 @@ public class MasterOfEtherium extends CardImpl { private final static FilterCreaturePermanent filterBoosted = new FilterCreaturePermanent("artifact creatures you control"); static { - filterCounted.getCardType().add(CardType.ARTIFACT); - filterCounted.setScopeCardType(Filter.ComparisonScope.Any); - filterBoosted.getCardType().add(CardType.ARTIFACT); - filterBoosted.setScopeCardType(Filter.ComparisonScope.All); + filterCounted.add(new CardTypePredicate(CardType.ARTIFACT)); + filterBoosted.add(new CardTypePredicate(CardType.ARTIFACT)); filterBoosted.setTargetController(Constants.TargetController.YOU); } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/NayaPanorama.java b/Mage.Sets/src/mage/sets/shardsofalara/NayaPanorama.java index 841592f228..d562ddab5f 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/NayaPanorama.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/NayaPanorama.java @@ -42,6 +42,7 @@ import mage.abilities.mana.ColorlessManaAbility; import mage.cards.CardImpl; import mage.filter.FilterCard; import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SupertypePredicate; import mage.target.common.TargetCardInLibrary; @@ -55,7 +56,7 @@ public class NayaPanorama extends CardImpl { private static final FilterCard filter = new FilterCard("a basic Mountain, Forest, or Plains card"); static { - filter.getCardType().add(CardType.LAND); + filter.add(new CardTypePredicate(CardType.LAND)); filter.add(new SupertypePredicate("Basic")); filter.add(Predicates.or( new SubtypePredicate("Mountain"), diff --git a/Mage.Sets/src/mage/sets/shardsofalara/RangerOfEos.java b/Mage.Sets/src/mage/sets/shardsofalara/RangerOfEos.java index b8f463d662..1edef336ab 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/RangerOfEos.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/RangerOfEos.java @@ -37,6 +37,7 @@ import mage.abilities.effects.common.search.SearchLibraryRevealPutInHandEffect; import mage.cards.CardImpl; import mage.filter.Filter.ComparisonType; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; import mage.target.common.TargetCardInLibrary; @@ -49,7 +50,7 @@ public class RangerOfEos extends CardImpl { private static final FilterCard filter = new FilterCard("creature cards with converted mana cost 1 or less"); static { - filter.getCardType().add(CardType.CREATURE); + filter.add(new CardTypePredicate(CardType.CREATURE)); filter.add(new ConvertedManaCostPredicate(ComparisonType.LessThan, 2)); } diff --git a/Mage.Sets/src/mage/sets/tempest/Aftershock.java b/Mage.Sets/src/mage/sets/tempest/Aftershock.java index f9acf4954a..efba5d027b 100644 --- a/Mage.Sets/src/mage/sets/tempest/Aftershock.java +++ b/Mage.Sets/src/mage/sets/tempest/Aftershock.java @@ -33,8 +33,9 @@ import mage.Constants.Rarity; import mage.abilities.effects.common.DamageControllerEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -46,10 +47,10 @@ public class Aftershock extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("artifact, creature, or land"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.CREATURE); - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.CREATURE), + new CardTypePredicate(CardType.LAND))); } public Aftershock(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tempest/AltarOfDementia.java b/Mage.Sets/src/mage/sets/tempest/AltarOfDementia.java index f8ea0999f8..66869a56a3 100644 --- a/Mage.Sets/src/mage/sets/tempest/AltarOfDementia.java +++ b/Mage.Sets/src/mage/sets/tempest/AltarOfDementia.java @@ -39,6 +39,7 @@ import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.players.Player; import mage.target.TargetPlayer; @@ -53,7 +54,7 @@ public class AltarOfDementia extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("creature"); static { - filter.getCardType().add(CardType.CREATURE); + filter.add(new CardTypePredicate(CardType.CREATURE)); } public AltarOfDementia(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tempest/Auratog.java b/Mage.Sets/src/mage/sets/tempest/Auratog.java index 0b79e9f361..ec0800abbb 100644 --- a/Mage.Sets/src/mage/sets/tempest/Auratog.java +++ b/Mage.Sets/src/mage/sets/tempest/Auratog.java @@ -37,8 +37,8 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledPermanent; /** @@ -50,8 +50,7 @@ public class Auratog extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("an enchantment"); static { - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); } public Auratog(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tempest/CloudchaserEagle.java b/Mage.Sets/src/mage/sets/tempest/CloudchaserEagle.java index 5b7584bff8..ee1950f640 100644 --- a/Mage.Sets/src/mage/sets/tempest/CloudchaserEagle.java +++ b/Mage.Sets/src/mage/sets/tempest/CloudchaserEagle.java @@ -36,8 +36,8 @@ import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -49,8 +49,7 @@ public class CloudchaserEagle extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("enchantment"); static { - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); } public CloudchaserEagle(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tempest/Disenchant.java b/Mage.Sets/src/mage/sets/tempest/Disenchant.java index b4420965dc..d6bc1fc3c5 100644 --- a/Mage.Sets/src/mage/sets/tempest/Disenchant.java +++ b/Mage.Sets/src/mage/sets/tempest/Disenchant.java @@ -32,8 +32,9 @@ import mage.Constants.CardType; import mage.Constants.Rarity; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -45,9 +46,9 @@ public class Disenchant extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("artifact or enchantment"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.ENCHANTMENT))); } public Disenchant(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tempest/Earthcraft.java b/Mage.Sets/src/mage/sets/tempest/Earthcraft.java index 909fed63ec..32bf3bee8b 100644 --- a/Mage.Sets/src/mage/sets/tempest/Earthcraft.java +++ b/Mage.Sets/src/mage/sets/tempest/Earthcraft.java @@ -37,9 +37,9 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapTargetCost; import mage.abilities.effects.common.UntapTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SupertypePredicate; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetControlledPermanent; @@ -55,8 +55,7 @@ public class Earthcraft extends CardImpl { static { filterCreature.setUseTapped(true); filterCreature.setTapped(false); - filterLand.getCardType().add(CardType.LAND); - filterLand.setScopeCardType(Filter.ComparisonScope.Any); + filterLand.add(new CardTypePredicate(CardType.LAND)); filterLand.add(new SupertypePredicate("Basic")); } diff --git a/Mage.Sets/src/mage/sets/tempest/HannasCustody.java b/Mage.Sets/src/mage/sets/tempest/HannasCustody.java index 6fa85fcf41..fd81a9c386 100644 --- a/Mage.Sets/src/mage/sets/tempest/HannasCustody.java +++ b/Mage.Sets/src/mage/sets/tempest/HannasCustody.java @@ -36,8 +36,8 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.continious.GainAbilityAllEffect; import mage.abilities.keyword.ShroudAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -48,8 +48,7 @@ public class HannasCustody extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("artifacts"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public HannasCustody(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tempest/Perish.java b/Mage.Sets/src/mage/sets/tempest/Perish.java index 4fd629b472..faa6298768 100644 --- a/Mage.Sets/src/mage/sets/tempest/Perish.java +++ b/Mage.Sets/src/mage/sets/tempest/Perish.java @@ -32,8 +32,8 @@ import mage.Constants.CardType; import mage.Constants.Rarity; import mage.abilities.effects.common.DestroyAllEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -46,8 +46,7 @@ public class Perish extends CardImpl { static { filter.getColor().setGreen(true); filter.setUseColor(true); - filter.getCardType().add(CardType.CREATURE); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.CREATURE)); } public Perish(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tempest/RatsOfRath.java b/Mage.Sets/src/mage/sets/tempest/RatsOfRath.java index b2defbb0a3..17833afc1c 100644 --- a/Mage.Sets/src/mage/sets/tempest/RatsOfRath.java +++ b/Mage.Sets/src/mage/sets/tempest/RatsOfRath.java @@ -38,8 +38,9 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ColoredManaCost; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledPermanent; /** @@ -51,10 +52,10 @@ public class RatsOfRath extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("artifact, creature, or land you control"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.CREATURE); - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.CREATURE), + new CardTypePredicate(CardType.LAND))); } public RatsOfRath(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tempest/Tranquility.java b/Mage.Sets/src/mage/sets/tempest/Tranquility.java index 1d51078135..2eb5bf28a7 100644 --- a/Mage.Sets/src/mage/sets/tempest/Tranquility.java +++ b/Mage.Sets/src/mage/sets/tempest/Tranquility.java @@ -35,8 +35,8 @@ import mage.Constants.Rarity; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; @@ -68,8 +68,7 @@ class TranquilityEffect extends OneShotEffect { private final static FilterPermanent filter = new FilterPermanent(""); static { - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); } public TranquilityEffect() { diff --git a/Mage.Sets/src/mage/sets/tempest/Verdigris.java b/Mage.Sets/src/mage/sets/tempest/Verdigris.java index 2afc2f6565..628d25d861 100644 --- a/Mage.Sets/src/mage/sets/tempest/Verdigris.java +++ b/Mage.Sets/src/mage/sets/tempest/Verdigris.java @@ -32,8 +32,8 @@ import mage.Constants.CardType; import mage.Constants.Rarity; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -45,8 +45,7 @@ public class Verdigris extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public Verdigris(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tenth/AvenCloudchaser.java b/Mage.Sets/src/mage/sets/tenth/AvenCloudchaser.java index 375300af1c..a0e5fa1f34 100644 --- a/Mage.Sets/src/mage/sets/tenth/AvenCloudchaser.java +++ b/Mage.Sets/src/mage/sets/tenth/AvenCloudchaser.java @@ -36,8 +36,8 @@ import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -49,8 +49,7 @@ public class AvenCloudchaser extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("enchantment"); static { - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); } public AvenCloudchaser(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tenth/CreepingMold.java b/Mage.Sets/src/mage/sets/tenth/CreepingMold.java index a103bdc26e..6be987ebb4 100644 --- a/Mage.Sets/src/mage/sets/tenth/CreepingMold.java +++ b/Mage.Sets/src/mage/sets/tenth/CreepingMold.java @@ -32,8 +32,9 @@ import mage.Constants.CardType; import mage.Constants.Rarity; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -45,10 +46,10 @@ public class CreepingMold extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("artifact, enchantment, or land"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.ENCHANTMENT); - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.ENCHANTMENT), + new CardTypePredicate(CardType.LAND))); } public CreepingMold(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tenth/Demolish.java b/Mage.Sets/src/mage/sets/tenth/Demolish.java index 70ea584c1c..567a7835e9 100644 --- a/Mage.Sets/src/mage/sets/tenth/Demolish.java +++ b/Mage.Sets/src/mage/sets/tenth/Demolish.java @@ -33,8 +33,9 @@ import mage.Constants.CardType; import mage.Constants.Rarity; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -46,9 +47,9 @@ public class Demolish extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("artifact or land"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.LAND))); } public Demolish(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tenth/Demystify.java b/Mage.Sets/src/mage/sets/tenth/Demystify.java index 491c6b8ca7..e77a87156c 100644 --- a/Mage.Sets/src/mage/sets/tenth/Demystify.java +++ b/Mage.Sets/src/mage/sets/tenth/Demystify.java @@ -33,8 +33,8 @@ import mage.Constants.CardType; import mage.Constants.Rarity; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -43,11 +43,10 @@ import mage.target.TargetPermanent; */ public class Demystify extends CardImpl { - private static FilterPermanent filter = new FilterPermanent("enchantment"); + private static final FilterPermanent filter = new FilterPermanent("enchantment"); static { - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); } public Demystify (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tenth/Distress.java b/Mage.Sets/src/mage/sets/tenth/Distress.java index f9bab57ef3..b12364a3b0 100644 --- a/Mage.Sets/src/mage/sets/tenth/Distress.java +++ b/Mage.Sets/src/mage/sets/tenth/Distress.java @@ -35,6 +35,8 @@ import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.players.Player; import mage.target.TargetCard; @@ -73,7 +75,7 @@ class DistressEffect extends OneShotEffect { private static final FilterCard filter = new FilterCard("nonland card"); static { - filter.getNotCardType().add(CardType.LAND); + filter.add(Predicates.not(new CardTypePredicate(CardType.LAND))); } public DistressEffect() { diff --git a/Mage.Sets/src/mage/sets/tenth/IcyManipulator.java b/Mage.Sets/src/mage/sets/tenth/IcyManipulator.java index 80bfe791f3..b0362bc325 100644 --- a/Mage.Sets/src/mage/sets/tenth/IcyManipulator.java +++ b/Mage.Sets/src/mage/sets/tenth/IcyManipulator.java @@ -38,8 +38,9 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.TapTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -51,10 +52,10 @@ public class IcyManipulator extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("artifact, creature, or land"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.CREATURE); - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.CREATURE), + new CardTypePredicate(CardType.LAND))); } public IcyManipulator(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tenth/MolimoMaroSorcerer.java b/Mage.Sets/src/mage/sets/tenth/MolimoMaroSorcerer.java index e637b5013a..9a6f6a9fde 100644 --- a/Mage.Sets/src/mage/sets/tenth/MolimoMaroSorcerer.java +++ b/Mage.Sets/src/mage/sets/tenth/MolimoMaroSorcerer.java @@ -38,8 +38,8 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.continious.SetPowerToughnessSourceEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -50,8 +50,7 @@ public class MolimoMaroSorcerer extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("lands you control"); static { - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.LAND)); } public MolimoMaroSorcerer(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tenth/Naturalize.java b/Mage.Sets/src/mage/sets/tenth/Naturalize.java index 0e17bd89fa..10f07f1090 100644 --- a/Mage.Sets/src/mage/sets/tenth/Naturalize.java +++ b/Mage.Sets/src/mage/sets/tenth/Naturalize.java @@ -33,8 +33,9 @@ import mage.Constants.CardType; import mage.Constants.Rarity; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -46,9 +47,9 @@ public class Naturalize extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("artifact or enchantment"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.ENCHANTMENT))); } public Naturalize(UUID ownerId){ diff --git a/Mage.Sets/src/mage/sets/tenth/RemoveSoul.java b/Mage.Sets/src/mage/sets/tenth/RemoveSoul.java index 40e3c9816e..52617b298a 100644 --- a/Mage.Sets/src/mage/sets/tenth/RemoveSoul.java +++ b/Mage.Sets/src/mage/sets/tenth/RemoveSoul.java @@ -33,6 +33,7 @@ import mage.Constants.Rarity; import mage.abilities.effects.common.CounterTargetEffect; import mage.cards.CardImpl; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetSpell; /** @@ -44,7 +45,7 @@ public class RemoveSoul extends CardImpl { private static final FilterSpell filter = new FilterSpell("creature spell"); static { - filter.getCardType().add(CardType.CREATURE); + filter.add(new CardTypePredicate(CardType.CREATURE)); } public RemoveSoul(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tenth/SculptingSteel.java b/Mage.Sets/src/mage/sets/tenth/SculptingSteel.java index f4dc251a61..d5106eb3d9 100644 --- a/Mage.Sets/src/mage/sets/tenth/SculptingSteel.java +++ b/Mage.Sets/src/mage/sets/tenth/SculptingSteel.java @@ -36,6 +36,7 @@ import mage.abilities.effects.EntersBattlefieldEffect; import mage.abilities.effects.common.CopyPermanentEffect; import mage.cards.CardImpl; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -46,7 +47,7 @@ public class SculptingSteel extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public SculptingSteel(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tenth/Terror.java b/Mage.Sets/src/mage/sets/tenth/Terror.java index d2724552fb..2eb8a95582 100644 --- a/Mage.Sets/src/mage/sets/tenth/Terror.java +++ b/Mage.Sets/src/mage/sets/tenth/Terror.java @@ -33,6 +33,8 @@ import mage.Constants.Rarity; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -44,7 +46,7 @@ public class Terror extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonartifact, nonblack creature"); static { - filter.getNotCardType().add(CardType.ARTIFACT); + filter.add(Predicates.not(new CardTypePredicate(CardType.ARTIFACT))); filter.getColor().setBlack(true); filter.setNotColor(true); filter.setUseColor(true); diff --git a/Mage.Sets/src/mage/sets/tenth/ViridianShaman.java b/Mage.Sets/src/mage/sets/tenth/ViridianShaman.java index b615c7591e..8227d9638a 100644 --- a/Mage.Sets/src/mage/sets/tenth/ViridianShaman.java +++ b/Mage.Sets/src/mage/sets/tenth/ViridianShaman.java @@ -35,8 +35,8 @@ import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -48,8 +48,7 @@ public class ViridianShaman extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public ViridianShaman(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tenth/YavimayaEnchantress.java b/Mage.Sets/src/mage/sets/tenth/YavimayaEnchantress.java index dcef5f52ee..134788324e 100644 --- a/Mage.Sets/src/mage/sets/tenth/YavimayaEnchantress.java +++ b/Mage.Sets/src/mage/sets/tenth/YavimayaEnchantress.java @@ -37,8 +37,8 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -49,8 +49,7 @@ public class YavimayaEnchantress extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("enchantment on the battlefield"); static { - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); } public YavimayaEnchantress(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/KeldonVandals.java b/Mage.Sets/src/mage/sets/urzasdestiny/KeldonVandals.java index eb933c79dd..b3debbb1d7 100644 --- a/Mage.Sets/src/mage/sets/urzasdestiny/KeldonVandals.java +++ b/Mage.Sets/src/mage/sets/urzasdestiny/KeldonVandals.java @@ -36,8 +36,8 @@ import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.keyword.EchoAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -49,8 +49,7 @@ public class KeldonVandals extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public KeldonVandals(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/urzaslegacy/BoneShredder.java b/Mage.Sets/src/mage/sets/urzaslegacy/BoneShredder.java index 2c5cf6a3bd..997b5cdcf2 100644 --- a/Mage.Sets/src/mage/sets/urzaslegacy/BoneShredder.java +++ b/Mage.Sets/src/mage/sets/urzaslegacy/BoneShredder.java @@ -38,6 +38,8 @@ import mage.abilities.keyword.EchoAbility; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.Target; import mage.target.common.TargetCreaturePermanent; @@ -50,7 +52,7 @@ public class BoneShredder extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonartifact, nonblack creature"); static { - filter.getNotCardType().add(CardType.ARTIFACT); + filter.add(Predicates.not(new CardTypePredicate(CardType.ARTIFACT))); filter.getColor().setBlack(true); filter.setNotColor(true); filter.setUseColor(true); diff --git a/Mage.Sets/src/mage/sets/urzaslegacy/BouncingBeebles.java b/Mage.Sets/src/mage/sets/urzaslegacy/BouncingBeebles.java index 102dc92a4d..5db60ff942 100644 --- a/Mage.Sets/src/mage/sets/urzaslegacy/BouncingBeebles.java +++ b/Mage.Sets/src/mage/sets/urzaslegacy/BouncingBeebles.java @@ -42,8 +42,8 @@ import mage.abilities.effects.Effect; import mage.abilities.effects.common.continious.GainAbilitySourceEffect; import mage.abilities.keyword.UnblockableAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; /** @@ -56,8 +56,7 @@ public class BouncingBeebles extends CardImpl { private static final FilterPermanent filter = new FilterPermanent(); static { - filter.getCardType().add(Constants.CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(Constants.CardType.ARTIFACT)); } private class DefendingPlayerControlsArtifact implements Condition { diff --git a/Mage.Sets/src/mage/sets/urzaslegacy/Erase.java b/Mage.Sets/src/mage/sets/urzaslegacy/Erase.java index 73a242c756..99eefbc105 100644 --- a/Mage.Sets/src/mage/sets/urzaslegacy/Erase.java +++ b/Mage.Sets/src/mage/sets/urzaslegacy/Erase.java @@ -33,6 +33,7 @@ import mage.Constants.Rarity; import mage.abilities.effects.common.ExileTargetEffect; import mage.cards.CardImpl; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -43,7 +44,7 @@ public class Erase extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("enchantment"); static { - filter.getCardType().add(CardType.ENCHANTMENT); + filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); } public Erase(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/urzassaga/ArgothianEnchantress.java b/Mage.Sets/src/mage/sets/urzassaga/ArgothianEnchantress.java index 672d45b33c..62da0b8bef 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/ArgothianEnchantress.java +++ b/Mage.Sets/src/mage/sets/urzassaga/ArgothianEnchantress.java @@ -36,6 +36,7 @@ import mage.abilities.effects.common.DrawCardControllerEffect; import mage.abilities.keyword.ShroudAbility; import mage.cards.CardImpl; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -46,7 +47,7 @@ public class ArgothianEnchantress extends CardImpl { private static final FilterSpell filter = new FilterSpell("an Enchantment spell"); static { - filter.getCardType().add(CardType.ENCHANTMENT); + filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); } public ArgothianEnchantress(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/urzassaga/CitanulHierophants.java b/Mage.Sets/src/mage/sets/urzassaga/CitanulHierophants.java index d345712016..482c280703 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/CitanulHierophants.java +++ b/Mage.Sets/src/mage/sets/urzassaga/CitanulHierophants.java @@ -38,6 +38,7 @@ import mage.abilities.effects.common.continious.GainAbilityControlledEffect; import mage.abilities.mana.GreenManaAbility; import mage.cards.CardImpl; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -48,7 +49,7 @@ public class CitanulHierophants extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("creatures"); static { - filter.getCardType().add(CardType.CREATURE); + filter.add(new CardTypePredicate(CardType.CREATURE)); } public CitanulHierophants(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/urzassaga/Clear.java b/Mage.Sets/src/mage/sets/urzassaga/Clear.java index cbec903f28..4b3a22685a 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/Clear.java +++ b/Mage.Sets/src/mage/sets/urzassaga/Clear.java @@ -35,8 +35,8 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.keyword.CyclingAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -48,8 +48,7 @@ public class Clear extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("enchantment"); static { - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); } public Clear(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/urzassaga/GaeasCradle.java b/Mage.Sets/src/mage/sets/urzassaga/GaeasCradle.java index a9f57346ff..31e3e60f23 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/GaeasCradle.java +++ b/Mage.Sets/src/mage/sets/urzassaga/GaeasCradle.java @@ -36,6 +36,7 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.mana.DynamicManaAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -47,7 +48,7 @@ public class GaeasCradle extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("creature you control");; static { - filter.getCardType().add(CardType.CREATURE); + filter.add(new CardTypePredicate(CardType.CREATURE)); } public GaeasCradle(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/urzassaga/Hush.java b/Mage.Sets/src/mage/sets/urzassaga/Hush.java index a11d9b9d95..8359b19045 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/Hush.java +++ b/Mage.Sets/src/mage/sets/urzassaga/Hush.java @@ -36,8 +36,8 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.CyclingAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; @@ -71,8 +71,7 @@ class HushEffect extends OneShotEffect { private final static FilterPermanent filter = new FilterPermanent(""); static { - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); } public HushEffect() { diff --git a/Mage.Sets/src/mage/sets/urzassaga/RainOfSalt.java b/Mage.Sets/src/mage/sets/urzassaga/RainOfSalt.java index 5a05a246de..b0797bd645 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/RainOfSalt.java +++ b/Mage.Sets/src/mage/sets/urzassaga/RainOfSalt.java @@ -33,8 +33,8 @@ import mage.Constants.CardType; import mage.Constants.Rarity; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -46,8 +46,7 @@ public class RainOfSalt extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("land"); static { - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.LAND)); } public RainOfSalt(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/urzassaga/Scrap.java b/Mage.Sets/src/mage/sets/urzassaga/Scrap.java index 1ea5969432..50a591a900 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/Scrap.java +++ b/Mage.Sets/src/mage/sets/urzassaga/Scrap.java @@ -35,8 +35,8 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.keyword.CyclingAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -48,8 +48,7 @@ public class Scrap extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public Scrap(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/urzassaga/SerrasSanctum.java b/Mage.Sets/src/mage/sets/urzassaga/SerrasSanctum.java index 26f8e8a2a0..a897adf6bf 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/SerrasSanctum.java +++ b/Mage.Sets/src/mage/sets/urzassaga/SerrasSanctum.java @@ -36,6 +36,7 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.mana.DynamicManaAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -47,7 +48,7 @@ public class SerrasSanctum extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("enchantment you control");; static { - filter.getCardType().add(CardType.ENCHANTMENT); + filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); } public SerrasSanctum(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/urzassaga/SternProctor.java b/Mage.Sets/src/mage/sets/urzassaga/SternProctor.java index b379699f7a..e951455daa 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/SternProctor.java +++ b/Mage.Sets/src/mage/sets/urzassaga/SternProctor.java @@ -29,17 +29,16 @@ package mage.sets.urzassaga; import java.util.UUID; -import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; -import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -50,9 +49,9 @@ public class SternProctor extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("artifact or enchantment"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.ENCHANTMENT))); } public SternProctor(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/urzassaga/TolarianAcademy.java b/Mage.Sets/src/mage/sets/urzassaga/TolarianAcademy.java index 61bd768cab..b07f425df1 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/TolarianAcademy.java +++ b/Mage.Sets/src/mage/sets/urzassaga/TolarianAcademy.java @@ -35,8 +35,8 @@ import mage.Mana; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.mana.DynamicManaAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -48,8 +48,7 @@ public class TolarianAcademy extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("artifact you control"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public TolarianAcademy(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/urzassaga/Wildfire.java b/Mage.Sets/src/mage/sets/urzassaga/Wildfire.java index 082d57df3a..0f4c117bbd 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/Wildfire.java +++ b/Mage.Sets/src/mage/sets/urzassaga/Wildfire.java @@ -35,6 +35,7 @@ import mage.abilities.effects.common.SacrificeAllEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -45,7 +46,7 @@ public class Wildfire extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("land"); static { - filter.getCardType().add(CardType.LAND); + filter.add(new CardTypePredicate(CardType.LAND)); } public Wildfire(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/weatherlight/MaraxusOfKeld.java b/Mage.Sets/src/mage/sets/weatherlight/MaraxusOfKeld.java index e1703ba36b..75e082cf37 100644 --- a/Mage.Sets/src/mage/sets/weatherlight/MaraxusOfKeld.java +++ b/Mage.Sets/src/mage/sets/weatherlight/MaraxusOfKeld.java @@ -35,8 +35,9 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.continious.SetPowerToughnessSourceEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import java.util.UUID; @@ -46,16 +47,16 @@ import java.util.UUID; */ public class MaraxusOfKeld extends CardImpl { - private static FilterControlledPermanent filterUntapped = new FilterControlledPermanent("untapped artifacts, creatures, and lands you control"); + private static final FilterControlledPermanent filterUntapped = new FilterControlledPermanent("untapped artifacts, creatures, and lands you control"); static { filterUntapped.setUseTapped(true); filterUntapped.setTapped(false); - filterUntapped.getCardType().add(CardType.CREATURE); - filterUntapped.getCardType().add(CardType.ARTIFACT); - filterUntapped.getCardType().add(CardType.LAND); - filterUntapped.setScopeCardType(Filter.ComparisonScope.Any); + filterUntapped.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.CREATURE), + new CardTypePredicate(CardType.LAND))); } public MaraxusOfKeld(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/worldwake/AvengerOfZendikar.java b/Mage.Sets/src/mage/sets/worldwake/AvengerOfZendikar.java index 4304125a6e..6dd3430ce9 100644 --- a/Mage.Sets/src/mage/sets/worldwake/AvengerOfZendikar.java +++ b/Mage.Sets/src/mage/sets/worldwake/AvengerOfZendikar.java @@ -41,6 +41,7 @@ import mage.abilities.effects.common.counter.AddCountersAllEffect; import mage.cards.CardImpl; import mage.counters.CounterType; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.permanent.token.PlantToken; @@ -53,10 +54,10 @@ public class AvengerOfZendikar extends CardImpl { private static final FilterControlledPermanent filterLand = new FilterControlledPermanent("land you control"); static { - filter.getCardType().add(CardType.CREATURE); + filter.add(new CardTypePredicate(CardType.CREATURE)); filter.add(new SubtypePredicate("Plant")); - filterLand.getCardType().add(CardType.LAND); + filterLand.add(new CardTypePredicate(CardType.LAND)); } public AvengerOfZendikar (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/worldwake/BazaarTrader.java b/Mage.Sets/src/mage/sets/worldwake/BazaarTrader.java index acd0b7bfe5..fed14f3002 100644 --- a/Mage.Sets/src/mage/sets/worldwake/BazaarTrader.java +++ b/Mage.Sets/src/mage/sets/worldwake/BazaarTrader.java @@ -41,8 +41,9 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.ContinuousEffectImpl; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -58,10 +59,10 @@ public class BazaarTrader extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("artifact, creature, or land you control"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.CREATURE); - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.CREATURE), + new CardTypePredicate(CardType.LAND))); } public BazaarTrader(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/worldwake/BrinkOfDisaster.java b/Mage.Sets/src/mage/sets/worldwake/BrinkOfDisaster.java index 32ae0b63d8..1b4c82dcf4 100644 --- a/Mage.Sets/src/mage/sets/worldwake/BrinkOfDisaster.java +++ b/Mage.Sets/src/mage/sets/worldwake/BrinkOfDisaster.java @@ -37,8 +37,9 @@ import mage.abilities.effects.Effect; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; @@ -51,12 +52,12 @@ import mage.target.targetpointer.FixedTarget; */ public class BrinkOfDisaster extends CardImpl { - private static FilterPermanent filter = new FilterPermanent(); + private static final FilterPermanent filter = new FilterPermanent(); static { - filter.getCardType().add(CardType.CREATURE); - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.CREATURE), + new CardTypePredicate(CardType.LAND))); } public BrinkOfDisaster(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/worldwake/ButcherOfMalakir.java b/Mage.Sets/src/mage/sets/worldwake/ButcherOfMalakir.java index a21807e9f2..815b4a34bb 100644 --- a/Mage.Sets/src/mage/sets/worldwake/ButcherOfMalakir.java +++ b/Mage.Sets/src/mage/sets/worldwake/ButcherOfMalakir.java @@ -39,6 +39,7 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -97,7 +98,7 @@ class ButcherOfMalakirEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { FilterControlledPermanent filter = new FilterControlledPermanent("creature you control"); - filter.getCardType().add(CardType.CREATURE); + filter.add(new CardTypePredicate(CardType.CREATURE)); filter.setTargetController(Constants.TargetController.YOU); Set opponents = game.getOpponents(source.getControllerId()); diff --git a/Mage.Sets/src/mage/sets/worldwake/Dispel.java b/Mage.Sets/src/mage/sets/worldwake/Dispel.java index b80e778703..1f1fad2620 100644 --- a/Mage.Sets/src/mage/sets/worldwake/Dispel.java +++ b/Mage.Sets/src/mage/sets/worldwake/Dispel.java @@ -33,6 +33,7 @@ import mage.Constants.Rarity; import mage.abilities.effects.common.CounterTargetEffect; import mage.cards.CardImpl; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetSpell; /** @@ -44,7 +45,7 @@ public class Dispel extends CardImpl { private static FilterSpell filter = new FilterSpell("instant spell"); static { - filter.getCardType().add(CardType.INSTANT); + filter.add(new CardTypePredicate(CardType.INSTANT)); } public Dispel(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/worldwake/HorizonDrake.java b/Mage.Sets/src/mage/sets/worldwake/HorizonDrake.java index 166977fdf6..84eac17a1a 100644 --- a/Mage.Sets/src/mage/sets/worldwake/HorizonDrake.java +++ b/Mage.Sets/src/mage/sets/worldwake/HorizonDrake.java @@ -34,8 +34,7 @@ import mage.MageInt; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; -import mage.filter.FilterCard; +import mage.filter.common.FilterLandCard; import java.util.UUID; @@ -44,12 +43,7 @@ import java.util.UUID; */ public class HorizonDrake extends CardImpl { - private static FilterCard filter = new FilterCard("lands"); - - static { - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(ComparisonScope.Any); - } + private static FilterLandCard filter = new FilterLandCard("lands"); public HorizonDrake(UUID ownerId) { super(ownerId, 30, "Horizon Drake", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{U}{U}"); diff --git a/Mage.Sets/src/mage/sets/worldwake/IonasJudgment.java b/Mage.Sets/src/mage/sets/worldwake/IonasJudgment.java index 63fe5c8ff2..afdc947b0f 100644 --- a/Mage.Sets/src/mage/sets/worldwake/IonasJudgment.java +++ b/Mage.Sets/src/mage/sets/worldwake/IonasJudgment.java @@ -33,8 +33,9 @@ import mage.Constants.CardType; import mage.Constants.Rarity; import mage.abilities.effects.common.ExileTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -42,12 +43,12 @@ import mage.target.TargetPermanent; * @author Loki */ public class IonasJudgment extends CardImpl { - private static FilterPermanent filter = new FilterPermanent("creature or enchantment"); + private static final FilterPermanent filter = new FilterPermanent("creature or enchantment"); static { - filter.getCardType().add(CardType.CREATURE); - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.CREATURE), + new CardTypePredicate(CardType.ENCHANTMENT))); } public IonasJudgment (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/worldwake/NaturesClaim.java b/Mage.Sets/src/mage/sets/worldwake/NaturesClaim.java index e925865238..9c3f5ab5ae 100644 --- a/Mage.Sets/src/mage/sets/worldwake/NaturesClaim.java +++ b/Mage.Sets/src/mage/sets/worldwake/NaturesClaim.java @@ -38,6 +38,8 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -51,9 +53,9 @@ public class NaturesClaim extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("artifact or enchantment"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(mage.filter.Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.ENCHANTMENT))); } public NaturesClaim (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/worldwake/PilgrimsEye.java b/Mage.Sets/src/mage/sets/worldwake/PilgrimsEye.java index 17796380ad..9c75761e59 100644 --- a/Mage.Sets/src/mage/sets/worldwake/PilgrimsEye.java +++ b/Mage.Sets/src/mage/sets/worldwake/PilgrimsEye.java @@ -37,6 +37,7 @@ import mage.abilities.effects.common.search.SearchLibraryRevealPutInHandEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SupertypePredicate; import mage.target.common.TargetCardInLibrary; @@ -49,7 +50,7 @@ public class PilgrimsEye extends CardImpl { static { filter.add(new SupertypePredicate("Basic")); - filter.getCardType().add(CardType.LAND); + filter.add(new CardTypePredicate(CardType.LAND)); } public PilgrimsEye (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/worldwake/SejiriMerfolk.java b/Mage.Sets/src/mage/sets/worldwake/SejiriMerfolk.java index cec7f6676a..734e22692d 100644 --- a/Mage.Sets/src/mage/sets/worldwake/SejiriMerfolk.java +++ b/Mage.Sets/src/mage/sets/worldwake/SejiriMerfolk.java @@ -40,6 +40,7 @@ import mage.abilities.keyword.FirstStrikeAbility; import mage.abilities.keyword.LifelinkAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate; /** @@ -53,7 +54,7 @@ public class SejiriMerfolk extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("Plains"); static { - filter.getCardType().add(CardType.LAND); + filter.add(new CardTypePredicate(CardType.LAND)); filter.add(new SubtypePredicate("Plains")); } diff --git a/Mage.Sets/src/mage/sets/worldwake/StoneforgeMystic.java b/Mage.Sets/src/mage/sets/worldwake/StoneforgeMystic.java index a92c4278b3..67a0f611ed 100644 --- a/Mage.Sets/src/mage/sets/worldwake/StoneforgeMystic.java +++ b/Mage.Sets/src/mage/sets/worldwake/StoneforgeMystic.java @@ -41,6 +41,7 @@ import mage.abilities.effects.common.search.SearchLibraryRevealPutInHandEffect; import mage.cards.CardImpl; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetCardInHand; import mage.target.common.TargetCardInLibrary; @@ -55,7 +56,7 @@ public class StoneforgeMystic extends CardImpl { private static final FilterCard filter = new FilterCard("an Equipment card"); static { - filter.getCardType().add(CardType.ARTIFACT); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); filter.add(new SubtypePredicate("Equipment")); } diff --git a/Mage.Sets/src/mage/sets/worldwake/Twitch.java b/Mage.Sets/src/mage/sets/worldwake/Twitch.java index 9f81dc8e6f..3340aff600 100644 --- a/Mage.Sets/src/mage/sets/worldwake/Twitch.java +++ b/Mage.Sets/src/mage/sets/worldwake/Twitch.java @@ -33,8 +33,9 @@ import mage.Constants.Rarity; import mage.abilities.effects.common.DrawCardControllerEffect; import mage.abilities.effects.common.MayTapOrUntapTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -46,10 +47,10 @@ public class Twitch extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("artifact, creature, or land"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.CREATURE); - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.CREATURE), + new CardTypePredicate(CardType.LAND))); } public Twitch(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/worldwake/VaporSnare.java b/Mage.Sets/src/mage/sets/worldwake/VaporSnare.java index fb0253e472..68a92256ac 100644 --- a/Mage.Sets/src/mage/sets/worldwake/VaporSnare.java +++ b/Mage.Sets/src/mage/sets/worldwake/VaporSnare.java @@ -41,6 +41,7 @@ import mage.abilities.effects.common.continious.ControlEnchantedEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -91,7 +92,7 @@ class VaporSnareEffect extends OneShotEffect { static { filter = new FilterControlledPermanent("land"); - filter.getCardType().add(CardType.LAND); + filter.add(new CardTypePredicate(CardType.LAND)); } VaporSnareEffect( ) { diff --git a/Mage.Sets/src/mage/sets/zendikar/ChandraAblaze.java b/Mage.Sets/src/mage/sets/zendikar/ChandraAblaze.java index 9d102e4a5a..4bc419d1ca 100644 --- a/Mage.Sets/src/mage/sets/zendikar/ChandraAblaze.java +++ b/Mage.Sets/src/mage/sets/zendikar/ChandraAblaze.java @@ -42,6 +42,8 @@ import mage.cards.Card; import mage.cards.CardImpl; import mage.counters.CounterType; import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -229,8 +231,9 @@ class ChandraAblazeEffect5 extends OneShotEffect { if (player != null) { FilterCard filter = new FilterCard("red instant or sorcery card from your graveyard to play"); filter.getColor().setRed(true); - filter.getCardType().add(CardType.INSTANT); - filter.getCardType().add(CardType.SORCERY); + filter.add(Predicates.or( + new CardTypePredicate(CardType.INSTANT), + new CardTypePredicate(CardType.SORCERY))); String message = "Play red instant or sorcery card from your graveyard without paying its mana cost?"; Set cards = player.getGraveyard().getCards(filter, game); diff --git a/Mage.Sets/src/mage/sets/zendikar/GatekeeperOfMalakir.java b/Mage.Sets/src/mage/sets/zendikar/GatekeeperOfMalakir.java index 0efff7a6c6..b677dc1b36 100644 --- a/Mage.Sets/src/mage/sets/zendikar/GatekeeperOfMalakir.java +++ b/Mage.Sets/src/mage/sets/zendikar/GatekeeperOfMalakir.java @@ -38,6 +38,7 @@ import mage.abilities.decorator.ConditionalTriggeredAbility; import mage.abilities.effects.common.SacrificeEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPlayer; import java.util.UUID; @@ -51,9 +52,8 @@ public class GatekeeperOfMalakir extends CardImpl { private static final FilterControlledPermanent filter; static { - filter = new FilterControlledPermanent(); - filter.getCardType().add(CardType.CREATURE); - filter.setMessage(" a creature"); + filter = new FilterControlledPermanent(" a creature"); + filter.add(new CardTypePredicate(CardType.CREATURE)); } public GatekeeperOfMalakir(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/zendikar/Harrow.java b/Mage.Sets/src/mage/sets/zendikar/Harrow.java index 18c510bb38..9b90e0c2a3 100644 --- a/Mage.Sets/src/mage/sets/zendikar/Harrow.java +++ b/Mage.Sets/src/mage/sets/zendikar/Harrow.java @@ -37,6 +37,7 @@ import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.cards.CardImpl; import mage.filter.common.FilterBasicLandCard; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetCardInLibrary; import mage.target.common.TargetControlledPermanent; @@ -49,7 +50,7 @@ public class Harrow extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("a land."); static{ - filter.getCardType().add(CardType.LAND); + filter.add(new CardTypePredicate(CardType.LAND)); } public Harrow(UUID ownerId){ diff --git a/Mage.Sets/src/mage/sets/zendikar/KhalniGem.java b/Mage.Sets/src/mage/sets/zendikar/KhalniGem.java index 2ae681bdf0..21104f69e9 100644 --- a/Mage.Sets/src/mage/sets/zendikar/KhalniGem.java +++ b/Mage.Sets/src/mage/sets/zendikar/KhalniGem.java @@ -42,6 +42,7 @@ import mage.abilities.effects.common.BasicManaEffect; import mage.abilities.mana.SimpleManaAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.Target; @@ -57,7 +58,7 @@ public class KhalniGem extends CardImpl { static { filter = new FilterControlledPermanent("land you control"); - filter.getCardType().add(CardType.LAND); + filter.add(new CardTypePredicate(CardType.LAND)); } public KhalniGem (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/zendikar/KorSanctifiers.java b/Mage.Sets/src/mage/sets/zendikar/KorSanctifiers.java index 9475b6a8d8..7c899be660 100644 --- a/Mage.Sets/src/mage/sets/zendikar/KorSanctifiers.java +++ b/Mage.Sets/src/mage/sets/zendikar/KorSanctifiers.java @@ -39,8 +39,9 @@ import mage.abilities.costs.mana.KickerManaCost; import mage.abilities.decorator.ConditionalTriggeredAbility; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -51,9 +52,9 @@ public class KorSanctifiers extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("artifact or enchantment"); static { - filter.getCardType().add(CardType.ARTIFACT); - filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.ENCHANTMENT))); } public KorSanctifiers (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/zendikar/MagmaRift.java b/Mage.Sets/src/mage/sets/zendikar/MagmaRift.java index 4e1a5c9f22..f856683e9f 100644 --- a/Mage.Sets/src/mage/sets/zendikar/MagmaRift.java +++ b/Mage.Sets/src/mage/sets/zendikar/MagmaRift.java @@ -34,6 +34,7 @@ import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetCreaturePermanent; @@ -46,7 +47,7 @@ public class MagmaRift extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("land"); static { - filter.getCardType().add(CardType.LAND); + filter.add(new CardTypePredicate(CardType.LAND)); } public MagmaRift(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/zendikar/MoldShambler.java b/Mage.Sets/src/mage/sets/zendikar/MoldShambler.java index b89adb1106..d5bd496db6 100644 --- a/Mage.Sets/src/mage/sets/zendikar/MoldShambler.java +++ b/Mage.Sets/src/mage/sets/zendikar/MoldShambler.java @@ -36,6 +36,8 @@ import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.keyword.KickerAbility; import mage.cards.CardImpl; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetPermanent; /** @@ -47,7 +49,7 @@ public class MoldShambler extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("noncreature permanent"); static { - filter.getNotCardType().add(CardType.CREATURE); + filter.add(Predicates.not(new CardTypePredicate(CardType.CREATURE))); } public MoldShambler(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/zendikar/OranRiefTheVastwood.java b/Mage.Sets/src/mage/sets/zendikar/OranRiefTheVastwood.java index dce09d577a..0d405cc5b3 100644 --- a/Mage.Sets/src/mage/sets/zendikar/OranRiefTheVastwood.java +++ b/Mage.Sets/src/mage/sets/zendikar/OranRiefTheVastwood.java @@ -43,6 +43,7 @@ import mage.cards.CardImpl; import mage.counters.CounterType; import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; @@ -90,7 +91,7 @@ class OranRiefTheVastwoodEffect extends OneShotEffect @Override public boolean apply(Game game, Ability source) { FilterPermanent filter = new FilterPermanent(); - filter.getCardType().add(CardType.CREATURE); + filter.add(new CardTypePredicate(CardType.CREATURE)); filter.getColor().setGreen(true); filter.setScopeColor(Filter.ComparisonScope.Any); filter.setUseColor(true); diff --git a/Mage.Sets/src/mage/sets/zendikar/PyromancerAscension.java b/Mage.Sets/src/mage/sets/zendikar/PyromancerAscension.java index 40f91dc442..71eceb2b40 100644 --- a/Mage.Sets/src/mage/sets/zendikar/PyromancerAscension.java +++ b/Mage.Sets/src/mage/sets/zendikar/PyromancerAscension.java @@ -39,8 +39,9 @@ import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.counters.CounterType; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterSpell; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; @@ -122,12 +123,12 @@ class PyromancerAscensionQuestTriggeredAbility extends TriggeredAbilityImpl { - private static FilterSpell filter = new FilterSpell(); + private static final FilterSpell filter = new FilterSpell(); static { - filter.getCardType().add(CardType.INSTANT); - filter.getCardType().add(CardType.SORCERY); - filter.setScopeCardType(ComparisonScope.Any); + filter.add(Predicates.or( + new CardTypePredicate(CardType.INSTANT), + new CardTypePredicate(CardType.SORCERY))); } PyromancerAscensionCopyTriggeredAbility() { diff --git a/Mage.Sets/src/mage/sets/zendikar/QuestForTheHolyRelic.java b/Mage.Sets/src/mage/sets/zendikar/QuestForTheHolyRelic.java index 2d2ccf3dc6..9f98dcd626 100644 --- a/Mage.Sets/src/mage/sets/zendikar/QuestForTheHolyRelic.java +++ b/Mage.Sets/src/mage/sets/zendikar/QuestForTheHolyRelic.java @@ -44,9 +44,9 @@ import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.counters.CounterType; -import mage.filter.Filter; import mage.filter.FilterCard; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; @@ -63,8 +63,7 @@ public class QuestForTheHolyRelic extends CardImpl { private static final FilterSpell filter = new FilterSpell("a creature spell"); static { - filter.getCardType().add(CardType.CREATURE); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.CREATURE)); } public QuestForTheHolyRelic(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/zendikar/RuinousMinotaur.java b/Mage.Sets/src/mage/sets/zendikar/RuinousMinotaur.java index 93b7c777f1..0fbcdce2f1 100644 --- a/Mage.Sets/src/mage/sets/zendikar/RuinousMinotaur.java +++ b/Mage.Sets/src/mage/sets/zendikar/RuinousMinotaur.java @@ -36,6 +36,7 @@ import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.SacrificeTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.target.common.TargetControlledPermanent; @@ -75,7 +76,7 @@ class RuinousMinotaurTriggeredAbility extends TriggeredAbilityImpl { this.addAbility(ShroudAbility.getInstance()); // When Scythe Tiger enters the battlefield, sacrifice it unless you // sacrifice a land. - FilterControlledPermanent filter = new FilterControlledPermanent("a land."); - filter.getCardType().add(CardType.LAND); + FilterControlledPermanent filter = new FilterControlledPermanent("a land"); + filter.add(new CardTypePredicate(CardType.LAND)); this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new SacrificeTargetCost(new TargetControlledPermanent(filter))))); } diff --git a/Mage.Sets/src/mage/sets/zendikar/SpellPierce.java b/Mage.Sets/src/mage/sets/zendikar/SpellPierce.java index 9d76fe340e..3b73f47046 100644 --- a/Mage.Sets/src/mage/sets/zendikar/SpellPierce.java +++ b/Mage.Sets/src/mage/sets/zendikar/SpellPierce.java @@ -35,6 +35,8 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.CounterUnlessPaysEffect; import mage.cards.CardImpl; import mage.filter.FilterSpell; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.target.TargetSpell; /** @@ -43,10 +45,10 @@ import mage.target.TargetSpell; */ public class SpellPierce extends CardImpl { - private static FilterSpell filter = new FilterSpell("noncreature spell"); + private static final FilterSpell filter = new FilterSpell("noncreature spell"); static { - filter.getNotCardType().add(CardType.CREATURE); + filter.add(Predicates.not(new CardTypePredicate(CardType.CREATURE))); } public SpellPierce(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/zendikar/SummonersBane.java b/Mage.Sets/src/mage/sets/zendikar/SummonersBane.java index 751752808a..61b7cb7ec2 100644 --- a/Mage.Sets/src/mage/sets/zendikar/SummonersBane.java +++ b/Mage.Sets/src/mage/sets/zendikar/SummonersBane.java @@ -36,6 +36,7 @@ import mage.abilities.effects.common.CounterTargetEffect; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.permanent.token.Token; import mage.target.TargetSpell; @@ -48,7 +49,7 @@ public class SummonersBane extends CardImpl { private static final FilterSpell filter = new FilterSpell("creature spell"); static { - filter.getCardType().add(CardType.CREATURE); + filter.add(new CardTypePredicate(CardType.CREATURE)); } public SummonersBane(UUID ownerId) { diff --git a/Mage/src/mage/abilities/common/FetchLandActivatedAbility.java b/Mage/src/mage/abilities/common/FetchLandActivatedAbility.java index 89a7337549..c61eb6fd67 100644 --- a/Mage/src/mage/abilities/common/FetchLandActivatedAbility.java +++ b/Mage/src/mage/abilities/common/FetchLandActivatedAbility.java @@ -41,6 +41,7 @@ import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.filter.FilterCard; import mage.filter.predicate.Predicate; import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCardInLibrary; @@ -56,7 +57,7 @@ public class FetchLandActivatedAbility extends ActivatedAbilityImpl> subtypePredicates = new ArrayList>(); for(int i = 0; i < subtypes.length; i++){ subtypePredicates.add(new SubtypePredicate(subtypes[i])); diff --git a/Mage/src/mage/abilities/condition/common/MetalcraftCondition.java b/Mage/src/mage/abilities/condition/common/MetalcraftCondition.java index eb587fcbda..248486aa76 100644 --- a/Mage/src/mage/abilities/condition/common/MetalcraftCondition.java +++ b/Mage/src/mage/abilities/condition/common/MetalcraftCondition.java @@ -4,6 +4,7 @@ import mage.Constants; import mage.abilities.Ability; import mage.abilities.condition.Condition; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; /** @@ -16,7 +17,7 @@ public class MetalcraftCondition implements Condition { private static final FilterPermanent filter = new FilterPermanent("artifact"); static { - filter.getCardType().add(Constants.CardType.ARTIFACT); + filter.add(new CardTypePredicate(Constants.CardType.ARTIFACT)); } private static MetalcraftCondition fInstance = new MetalcraftCondition(); diff --git a/Mage/src/mage/abilities/costs/common/MetalcraftCost.java b/Mage/src/mage/abilities/costs/common/MetalcraftCost.java index c850bc341c..7e0fd0d655 100644 --- a/Mage/src/mage/abilities/costs/common/MetalcraftCost.java +++ b/Mage/src/mage/abilities/costs/common/MetalcraftCost.java @@ -33,6 +33,7 @@ import mage.Constants.CardType; import mage.abilities.Ability; import mage.abilities.costs.CostImpl; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; /** @@ -44,7 +45,7 @@ public class MetalcraftCost extends CostImpl { private static final FilterPermanent filter = new FilterPermanent("artifact"); static { - filter.getCardType().add(CardType.ARTIFACT); + filter.add(new CardTypePredicate(CardType.ARTIFACT)); } public MetalcraftCost() { diff --git a/Mage/src/mage/abilities/keyword/AffinityForArtifactsAbility.java b/Mage/src/mage/abilities/keyword/AffinityForArtifactsAbility.java index 1732aa5efe..572b74bbda 100644 --- a/Mage/src/mage/abilities/keyword/AffinityForArtifactsAbility.java +++ b/Mage/src/mage/abilities/keyword/AffinityForArtifactsAbility.java @@ -33,8 +33,8 @@ import mage.abilities.SpellAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.AdjustingSourceCosts; import mage.abilities.effects.common.AffinityEffect; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.util.CardUtil; @@ -45,8 +45,7 @@ public class AffinityForArtifactsAbility extends SimpleStaticAbility implements private static final FilterControlledPermanent filter = new FilterControlledPermanent(); static { - filter.getCardType().add(Constants.CardType.ARTIFACT); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new CardTypePredicate(Constants.CardType.ARTIFACT)); } public AffinityForArtifactsAbility() { diff --git a/Mage/src/mage/filter/FilterImpl.java b/Mage/src/mage/filter/FilterImpl.java index 4757dab332..9654236b7a 100644 --- a/Mage/src/mage/filter/FilterImpl.java +++ b/Mage/src/mage/filter/FilterImpl.java @@ -30,7 +30,6 @@ package mage.filter; import java.util.ArrayList; import java.util.List; -import mage.Constants.CardType; import mage.filter.predicate.Predicate; import mage.game.Game; @@ -41,9 +40,6 @@ import mage.game.Game; */ public abstract class FilterImpl> implements Filter { - protected static ListComparer compCardType = new ListComparer(); - protected static ListComparer compString = new ListComparer(); - protected List predicates = new ArrayList(); protected String message; protected boolean notFilter = false; diff --git a/Mage/src/mage/filter/FilterObject.java b/Mage/src/mage/filter/FilterObject.java index ca09a278d1..ce1f0e0544 100644 --- a/Mage/src/mage/filter/FilterObject.java +++ b/Mage/src/mage/filter/FilterObject.java @@ -28,24 +28,16 @@ package mage.filter; -import mage.Constants.CardType; import mage.MageObject; import mage.ObjectColor; import mage.game.Game; -import java.util.ArrayList; -import java.util.List; - /** * * @author BetaSteward_at_googlemail.com * @author North */ public class FilterObject> extends FilterImpl implements Filter { - protected List cardType = new ArrayList(); - protected ComparisonScope scopeCardType = ComparisonScope.Any; - protected List notCardType = new ArrayList(); - protected ComparisonScope scopeNotCardType = ComparisonScope.Any; protected boolean colorless; protected boolean useColorless; protected boolean useColor; @@ -70,10 +62,6 @@ public class FilterObject> ex public FilterObject(FilterObject filter) { super(filter); - this.cardType.addAll(filter.cardType); - this.notCardType.addAll(filter.notCardType); - this.scopeCardType = filter.scopeCardType; - this.scopeNotCardType = filter.scopeNotCardType; this.colorless = filter.colorless; this.useColorless = filter.useColorless; this.useColor = filter.useColor; @@ -110,35 +98,9 @@ public class FilterObject> ex return notFilter; } - if (cardType.size() > 0) { - if (!compCardType.compare(cardType, object.getCardType(), scopeCardType, false)) - return notFilter; - } - - if (notCardType.size() > 0) { - if (compCardType.compare(notCardType, object.getCardType(), scopeNotCardType, false)) - return notFilter; - } - return !notFilter; } - public List getCardType() { - return this.cardType; - } - - public List getNotCardType() { - return this.notCardType; - } - - public void setScopeCardType(ComparisonScope scopeCardType) { - this.scopeCardType = scopeCardType; - } - - public void setScopeNotCardType(ComparisonScope scopeNotCardType) { - this.scopeNotCardType = scopeNotCardType; - } - public void setColor(ObjectColor color) { this.color = color; } diff --git a/Mage/src/mage/filter/common/FilterArtifactCard.java b/Mage/src/mage/filter/common/FilterArtifactCard.java index a6b9c6b726..f67a172231 100644 --- a/Mage/src/mage/filter/common/FilterArtifactCard.java +++ b/Mage/src/mage/filter/common/FilterArtifactCard.java @@ -30,6 +30,7 @@ package mage.filter.common; import mage.Constants.CardType; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -43,7 +44,7 @@ public class FilterArtifactCard extends FilterCard { public FilterArtifactCard(String name) { super(name); - this.cardType.add(CardType.ARTIFACT); + this.add(new CardTypePredicate(CardType.ARTIFACT)); } public FilterArtifactCard(final FilterArtifactCard filter) { diff --git a/Mage/src/mage/filter/common/FilterArtifactPermanent.java b/Mage/src/mage/filter/common/FilterArtifactPermanent.java index 8072a52527..2ff6c5bf17 100644 --- a/Mage/src/mage/filter/common/FilterArtifactPermanent.java +++ b/Mage/src/mage/filter/common/FilterArtifactPermanent.java @@ -30,6 +30,7 @@ package mage.filter.common; import mage.Constants.CardType; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; @@ -50,7 +51,7 @@ public class FilterArtifactPermanent> exten public FilterArtifactPermanent(String name) { super(name); - cardType.add(CardType.ARTIFACT); + this.add(new CardTypePredicate(CardType.ARTIFACT)); } public FilterArtifactPermanent(final FilterArtifactPermanent filter) { diff --git a/Mage/src/mage/filter/common/FilterAura.java b/Mage/src/mage/filter/common/FilterAura.java index 83d137aaff..e4c6cfd561 100644 --- a/Mage/src/mage/filter/common/FilterAura.java +++ b/Mage/src/mage/filter/common/FilterAura.java @@ -30,6 +30,7 @@ package mage.filter.common; import mage.Constants.CardType; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate; /** @@ -44,7 +45,7 @@ public class FilterAura extends FilterPermanent { public FilterAura(String name) { super(name); - this.cardType.add(CardType.ENCHANTMENT); + this.add(new CardTypePredicate(CardType.ENCHANTMENT)); this.add(new SubtypePredicate("Aura")); } diff --git a/Mage/src/mage/filter/common/FilterAuraCard.java b/Mage/src/mage/filter/common/FilterAuraCard.java index e9ae06cfde..1608027ad1 100644 --- a/Mage/src/mage/filter/common/FilterAuraCard.java +++ b/Mage/src/mage/filter/common/FilterAuraCard.java @@ -30,6 +30,7 @@ package mage.filter.common; import mage.Constants.CardType; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -43,7 +44,7 @@ public class FilterAuraCard extends FilterCard { public FilterAuraCard(String name) { super(name); - this.cardType.add(CardType.ENCHANTMENT); + this.add(new CardTypePredicate(CardType.ENCHANTMENT)); } public FilterAuraCard(final FilterAuraCard filter) { diff --git a/Mage/src/mage/filter/common/FilterBasicLandCard.java b/Mage/src/mage/filter/common/FilterBasicLandCard.java index 9a7d388428..fc033c7ed1 100644 --- a/Mage/src/mage/filter/common/FilterBasicLandCard.java +++ b/Mage/src/mage/filter/common/FilterBasicLandCard.java @@ -30,6 +30,7 @@ package mage.filter.common; import mage.Constants.CardType; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SupertypePredicate; /** @@ -40,8 +41,7 @@ public class FilterBasicLandCard extends FilterCard { public FilterBasicLandCard() { super("basic land card"); - this.cardType.add(CardType.LAND); - this.setScopeCardType(ComparisonScope.Any); + this.add(new CardTypePredicate(CardType.LAND)); this.add(new SupertypePredicate("Basic")); } diff --git a/Mage/src/mage/filter/common/FilterControlledCreaturePermanent.java b/Mage/src/mage/filter/common/FilterControlledCreaturePermanent.java index 245936e7c0..fcbac5d5f9 100644 --- a/Mage/src/mage/filter/common/FilterControlledCreaturePermanent.java +++ b/Mage/src/mage/filter/common/FilterControlledCreaturePermanent.java @@ -29,6 +29,7 @@ package mage.filter.common; import mage.Constants.CardType; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -42,7 +43,7 @@ public class FilterControlledCreaturePermanent { public FilterCreatureCard(String name) { super(name); - cardType.add(CardType.CREATURE); + this.add(new CardTypePredicate(CardType.CREATURE)); } public FilterCreatureCard(final FilterCreatureCard filter) { diff --git a/Mage/src/mage/filter/common/FilterCreaturePermanent.java b/Mage/src/mage/filter/common/FilterCreaturePermanent.java index eb6622e0e6..a5f3c97162 100644 --- a/Mage/src/mage/filter/common/FilterCreaturePermanent.java +++ b/Mage/src/mage/filter/common/FilterCreaturePermanent.java @@ -30,6 +30,7 @@ package mage.filter.common; import mage.Constants.CardType; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; @@ -52,7 +53,7 @@ public class FilterCreaturePermanent> exten public FilterCreaturePermanent(String name) { super(name); - cardType.add(CardType.CREATURE); + this.add(new CardTypePredicate(CardType.CREATURE)); } public FilterCreaturePermanent(final FilterCreaturePermanent filter) { diff --git a/Mage/src/mage/filter/common/FilterEnchantment.java b/Mage/src/mage/filter/common/FilterEnchantment.java index 7b105a022c..7a6beeba41 100644 --- a/Mage/src/mage/filter/common/FilterEnchantment.java +++ b/Mage/src/mage/filter/common/FilterEnchantment.java @@ -30,6 +30,7 @@ package mage.filter.common; import mage.Constants.CardType; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -43,7 +44,7 @@ public class FilterEnchantment extends FilterPermanent { public FilterEnchantment(String name) { super(name); - this.cardType.add(CardType.ENCHANTMENT); + this.add(new CardTypePredicate(CardType.ENCHANTMENT)); } public FilterEnchantment(final FilterEnchantment filter) { diff --git a/Mage/src/mage/filter/common/FilterEquipment.java b/Mage/src/mage/filter/common/FilterEquipment.java index 3a01d8d7af..03769465ba 100644 --- a/Mage/src/mage/filter/common/FilterEquipment.java +++ b/Mage/src/mage/filter/common/FilterEquipment.java @@ -30,6 +30,7 @@ package mage.filter.common; import mage.Constants.CardType; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate; /** @@ -44,7 +45,7 @@ public class FilterEquipment extends FilterPermanent { public FilterEquipment(String name) { super(name); - this.cardType.add(CardType.ARTIFACT); + this.add(new CardTypePredicate(CardType.ARTIFACT)); this.add(new SubtypePredicate("Equipment")); } diff --git a/Mage/src/mage/filter/common/FilterFortification.java b/Mage/src/mage/filter/common/FilterFortification.java index 5107d33fed..d55ed1bc24 100644 --- a/Mage/src/mage/filter/common/FilterFortification.java +++ b/Mage/src/mage/filter/common/FilterFortification.java @@ -30,6 +30,7 @@ package mage.filter.common; import mage.Constants.CardType; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate; /** @@ -44,7 +45,7 @@ public class FilterFortification extends FilterPermanent { public FilterFortification(String name) { super(name); - this.cardType.add(CardType.ARTIFACT); + this.add(new CardTypePredicate(CardType.ARTIFACT)); this.add(new SubtypePredicate("Fortification")); } diff --git a/Mage/src/mage/filter/common/FilterLandCard.java b/Mage/src/mage/filter/common/FilterLandCard.java index ddee1319c5..f98b1c1fd2 100644 --- a/Mage/src/mage/filter/common/FilterLandCard.java +++ b/Mage/src/mage/filter/common/FilterLandCard.java @@ -30,6 +30,7 @@ package mage.filter.common; import mage.Constants.CardType; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -43,7 +44,7 @@ public class FilterLandCard extends FilterCard { public FilterLandCard(String name) { super(name); - cardType.add(CardType.LAND); + this.add(new CardTypePredicate(CardType.LAND)); } public FilterLandCard(final FilterLandCard filter) { diff --git a/Mage/src/mage/filter/common/FilterLandPermanent.java b/Mage/src/mage/filter/common/FilterLandPermanent.java index db01bd89bf..e329adc325 100644 --- a/Mage/src/mage/filter/common/FilterLandPermanent.java +++ b/Mage/src/mage/filter/common/FilterLandPermanent.java @@ -30,6 +30,7 @@ package mage.filter.common; import mage.Constants.CardType; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -43,7 +44,7 @@ public class FilterLandPermanent extends FilterPermanent { public FilterLandPermanent(String name) { super(name); - cardType.add(CardType.LAND); + this.add(new CardTypePredicate(CardType.LAND)); } public FilterLandPermanent(final FilterLandPermanent filter) { diff --git a/Mage/src/mage/filter/common/FilterNonlandCard.java b/Mage/src/mage/filter/common/FilterNonlandCard.java index b73abf153c..eb6484795f 100644 --- a/Mage/src/mage/filter/common/FilterNonlandCard.java +++ b/Mage/src/mage/filter/common/FilterNonlandCard.java @@ -30,6 +30,8 @@ package mage.filter.common; import mage.Constants.CardType; import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -43,7 +45,7 @@ public class FilterNonlandCard extends FilterCard { public FilterNonlandCard(String name) { super(name); - this.notCardType.add(CardType.LAND); + this.add(Predicates.not(new CardTypePredicate(CardType.LAND))); } public FilterNonlandCard(final FilterNonlandCard filter) { diff --git a/Mage/src/mage/filter/common/FilterNonlandPermanent.java b/Mage/src/mage/filter/common/FilterNonlandPermanent.java index 1db9d9c142..d2fcbd2aca 100644 --- a/Mage/src/mage/filter/common/FilterNonlandPermanent.java +++ b/Mage/src/mage/filter/common/FilterNonlandPermanent.java @@ -30,6 +30,8 @@ package mage.filter.common; import mage.Constants.CardType; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; /** * @@ -43,7 +45,7 @@ public class FilterNonlandPermanent extends FilterPermanent { public TargetBasicLandCard(Zone zone) { super(zone); filter.add(new SupertypePredicate("Basic")); - filter.getCardType().add(CardType.LAND); - filter.setScopeCardType(ComparisonScope.Any); + filter.add(new CardTypePredicate(CardType.LAND)); } public TargetBasicLandCard(final TargetBasicLandCard target) {