From 2198cae333306e18bf0f4be4cdf04e27ea69297b Mon Sep 17 00:00:00 2001 From: North Date: Wed, 11 Jul 2012 23:59:41 +0300 Subject: [PATCH] [filters] Replaced Subtype condition with Predicate --- .../mage/sets/alarareborn/LichLordOfUnx.java | 5 ++- .../avacynrestored/AngelOfGlorysRise.java | 8 ++--- .../avacynrestored/BrunaLightOfAlabaster.java | 3 +- .../sets/avacynrestored/DescendantsPath.java | 19 ++++++++--- .../sets/avacynrestored/DevoutChaplain.java | 4 +-- .../sets/avacynrestored/DiregrafEscort.java | 3 +- .../avacynrestored/GallowsAtWillowHill.java | 5 ++- .../sets/avacynrestored/HumanFrailty.java | 3 +- .../avacynrestored/KessigMalcontents.java | 3 +- .../mage/sets/avacynrestored/MassAppeal.java | 3 +- .../sets/avacynrestored/MidnightDuelist.java | 5 ++- .../sets/avacynrestored/RestorationAngel.java | 5 +-- .../sets/avacynrestored/RidersOfGavony.java | 5 +-- .../sets/avacynrestored/RiotRingleader.java | 3 +- .../sets/avacynrestored/ScrollOfAvacyn.java | 7 ++-- .../avacynrestored/ScrollOfGriselbrand.java | 7 ++-- .../betrayersofkamigawa/IreOfKaminari.java | 5 ++- .../IsaoEnlightenedBushi.java | 6 ++-- .../NezumiShadowWatcher.java | 5 ++- .../RibbonsOfTheReikai.java | 6 ++-- .../betrayersofkamigawa/TakenosCavalry.java | 5 ++- .../betrayersofkamigawa/TraprootKami.java | 5 ++- .../AzamiLadyOfScrolls.java | 6 ++-- .../championsofkamigawa/BenBenAkkiHermit.java | 5 ++- .../championsofkamigawa/BloodthirstyOgre.java | 5 ++- .../sets/championsofkamigawa/CallToGlory.java | 5 ++- .../championsofkamigawa/EerieProcession.java | 5 ++- .../sets/championsofkamigawa/HanaKami.java | 5 ++- .../championsofkamigawa/HeWhoHungers.java | 5 ++- .../championsofkamigawa/HisokasDefiance.java | 7 ++-- .../HondenOfCleansingFire.java | 5 ++- .../HondenOfInfiniteRage.java | 5 ++- .../championsofkamigawa/HondenOfLifesWeb.java | 5 ++- .../HondenOfNightsReach.java | 5 ++- .../HondenOfSeeingWinds.java | 5 ++- .../championsofkamigawa/HorobiDeathsWail.java | 5 ++- .../championsofkamigawa/InameDeathAspect.java | 5 ++- .../championsofkamigawa/InameLifeAspect.java | 5 ++- .../championsofkamigawa/KitsuneDiviner.java | 5 ++- .../KitsuneRiftwalker.java | 7 ++-- .../championsofkamigawa/KondasHatamoto.java | 5 ++- .../LongForgottenGohei.java | 3 +- .../championsofkamigawa/MarrowGnawer.java | 10 +++--- .../NagaoBoundByHonor.java | 5 ++- .../championsofkamigawa/NineRingedBo.java | 5 ++- .../championsofkamigawa/PainwrackerOni.java | 5 +-- .../sets/championsofkamigawa/RendFlesh.java | 7 ++-- .../sets/championsofkamigawa/RendSpirit.java | 5 ++- .../SachiDaughterOfSeshiro.java | 5 +-- .../SeshiroTheAnointed.java | 3 +- .../ShisatoWhisperingHunter.java | 5 ++- .../SosukeSonOfSeshiro.java | 5 ++- .../TakenoSamuraiGeneral.java | 7 ++-- .../championsofkamigawa/TheUnspeakable.java | 5 ++- .../championsofkamigawa/VillainousOgre.java | 5 ++- .../sets/conflux/KnightOfTheReliquary.java | 7 ++-- .../sets/darkascension/ArchdemonOfGreed.java | 3 +- .../sets/darkascension/CallToTheKindred.java | 14 +++++--- .../sets/darkascension/ChosenOfMarkov.java | 5 ++- .../darkascension/CurseOfMisfortunes.java | 3 +- .../sets/darkascension/DerangedOutcast.java | 5 ++- .../sets/darkascension/DiregrafCaptain.java | 8 ++--- .../sets/darkascension/DrogskolCaptain.java | 5 ++- .../sets/darkascension/FiendOfTheShadows.java | 5 ++- .../mage/sets/darkascension/Gravecrawler.java | 5 ++- .../darkascension/HavengulRunebinder.java | 5 ++- .../mage/sets/darkascension/Immerwolf.java | 14 +++----- .../darkascension/MikaeusTheUnhallowed.java | 5 +-- .../sets/darkascension/RavenousDemon.java | 9 +++-- .../mage/sets/darkascension/RequiemAngel.java | 9 ++--- .../sets/darkascension/ScorchTheFields.java | 3 +- .../sets/darkascension/SkirsdagFlayer.java | 3 +- .../sets/darkascension/StromkirkCaptain.java | 5 ++- .../sets/darkascension/WolfhuntersQuiver.java | 3 +- .../sets/darkascension/ZombieApocalypse.java | 8 ++--- .../mage/sets/darksteel/BlinkmothNexus.java | 5 ++- .../src/mage/sets/darksteel/MyrMatrix.java | 5 ++- .../sets/darksteel/SteelshaperApprentice.java | 3 +- .../sets/darksteel/WandOfTheElements.java | 8 ++--- .../sets/dissension/HaazdaExonerator.java | 5 ++- .../elspethvstezzeret/DaruEncampment.java | 3 +- .../elspethvstezzeret/MishrasFactory.java | 3 +- .../mage/sets/elspethvstezzeret/Pentavus.java | 5 ++- .../mage/sets/fifthdawn/BeaconOfCreation.java | 5 ++- .../mage/sets/guildpact/SkeletalVampire.java | 5 ++- .../innistrad/AngelOfFlightAlabaster.java | 5 ++- .../mage/sets/innistrad/AngelicOverseer.java | 5 ++- .../mage/sets/innistrad/AvacynianPriest.java | 5 +-- .../sets/innistrad/BattlegroundGeist.java | 5 ++- .../mage/sets/innistrad/BitterheartWitch.java | 3 +- .../mage/sets/innistrad/BloodlineKeeper.java | 5 ++- .../sets/innistrad/CharmbreakerDevils.java | 2 -- .../mage/sets/innistrad/ClifftopRetreat.java | 10 +++--- .../mage/sets/innistrad/DearlyDeparted.java | 5 ++- .../mage/sets/innistrad/EliteInquisitor.java | 11 +++--- .../sets/innistrad/EndlessRanksOfTheDead.java | 3 +- .../mage/sets/innistrad/FullMoonsRise.java | 5 ++- .../mage/sets/innistrad/GallowsWarden.java | 3 +- .../sets/innistrad/GhoulcallersChant.java | 5 ++- .../src/mage/sets/innistrad/Ghoulraiser.java | 5 ++- .../src/mage/sets/innistrad/GraveBramble.java | 5 ++- .../mage/sets/innistrad/HamletCaptain.java | 3 +- .../mage/sets/innistrad/HinterlandHarbor.java | 10 +++--- .../mage/sets/innistrad/HowlpackAlpha.java | 7 ++-- .../mage/sets/innistrad/IsolatedChapel.java | 10 +++--- .../mage/sets/innistrad/LordOfLineage.java | 12 +++---- .../mage/sets/innistrad/MayorOfAvabruck.java | 5 ++- .../src/mage/sets/innistrad/Moonmist.java | 11 +++--- .../mage/sets/innistrad/NightRevelers.java | 3 +- .../mage/sets/innistrad/OliviaVoldaren.java | 10 +++--- .../sets/innistrad/ReaperFromTheAbyss.java | 7 ++-- .../sets/innistrad/SlayerOfTheWicked.java | 11 +++--- .../mage/sets/innistrad/SpareFromEvil.java | 5 +-- .../src/mage/sets/innistrad/SulfurFalls.java | 10 +++--- .../sets/innistrad/TerrorOfKruinPass.java | 5 ++- .../mage/sets/innistrad/UnbreathingHorde.java | 5 +-- .../src/mage/sets/innistrad/VampiricFury.java | 7 ++-- .../mage/sets/innistrad/VictimOfNight.java | 11 +++--- .../mage/sets/innistrad/WoodlandCemetery.java | 10 +++--- .../src/mage/sets/lorwyn/Benthicore.java | 5 ++- .../mage/sets/lorwyn/BlackPoplarShaman.java | 5 ++- .../mage/sets/lorwyn/BoggartBirthRite.java | 5 ++- .../src/mage/sets/lorwyn/CloudgoatRanger.java | 5 ++- .../src/mage/sets/lorwyn/ElvishEulogist.java | 5 ++- .../mage/sets/lorwyn/ElvishHandservant.java | 4 +-- .../src/mage/sets/lorwyn/ElvishPromenade.java | 5 ++- .../mage/sets/lorwyn/EyeblightsEnding.java | 7 ++-- .../src/mage/sets/lorwyn/Facevaulter.java | 5 ++- .../src/mage/sets/lorwyn/FaerieTrickery.java | 5 +-- .../src/mage/sets/lorwyn/Goatnapper.java | 5 ++- .../sets/lorwyn/GuardianOfCloverdell.java | 5 ++- .../src/mage/sets/lorwyn/HarpoonSniper.java | 5 ++- .../src/mage/sets/lorwyn/HearthcageGiant.java | 8 ++--- .../sets/lorwyn/ImmaculateMagistrate.java | 3 +- .../mage/sets/lorwyn/ImperiousPerfect.java | 5 ++- .../mage/sets/lorwyn/LysAlanaHuntmaster.java | 5 ++- Mage.Sets/src/mage/sets/lorwyn/MadAuntie.java | 8 ++--- .../src/mage/sets/lorwyn/NectarFaerie.java | 7 ++-- .../mage/sets/lorwyn/ScarredVinebreeder.java | 3 +- .../src/mage/sets/lorwyn/ScionOfOona.java | 24 ++++++------- .../src/mage/sets/lorwyn/SeedguideAsh.java | 5 ++- .../src/mage/sets/lorwyn/SummonTheSchool.java | 5 ++- .../mage/sets/lorwyn/SunriseSovereign.java | 5 ++- .../src/mage/sets/lorwyn/TarPitcher.java | 5 ++- .../src/mage/sets/lorwyn/ThorntoothWitch.java | 5 ++- .../src/mage/sets/lorwyn/TimberProtector.java | 10 +++--- .../mage/sets/lorwyn/WarrenScourgeElf.java | 3 +- .../src/mage/sets/lorwyn/WizenedCenn.java | 5 ++- .../mage/sets/lorwyn/WortBoggartAuntie.java | 5 ++- .../mage/sets/magic2010/ArmoredAscension.java | 3 +- .../mage/sets/magic2010/AwakenerDruid.java | 3 +- .../mage/sets/magic2010/BaneslayerAngel.java | 8 ++--- .../sets/magic2010/CaptainOfTheWatch.java | 3 +- .../sets/magic2010/DragonskullSummit.java | 10 +++--- .../mage/sets/magic2010/DrownedCatacomb.java | 10 +++--- .../mage/sets/magic2010/ElvishArchdruid.java | 5 +-- .../mage/sets/magic2010/GlacialFortress.java | 10 +++--- .../mage/sets/magic2010/GoblinChieftain.java | 3 +- .../sets/magic2010/HowlOfTheNightPack.java | 3 +- .../sets/magic2010/MasterOfTheWildHunt.java | 5 ++- .../mage/sets/magic2010/MerfolkSovereign.java | 5 +-- .../mage/sets/magic2010/RhoxPikemaster.java | 3 +- .../mage/sets/magic2010/RootboundCrag.java | 10 +++--- .../mage/sets/magic2010/SeismicStrike.java | 3 +- .../magic2010/SerpentOfTheEndlessSea.java | 5 +-- .../sets/magic2010/SiegeGangCommander.java | 5 ++- .../mage/sets/magic2010/SunpetalGrove.java | 10 +++--- .../sets/magic2010/TendrilsOfCorruption.java | 3 +- .../src/mage/sets/magic2010/UndeadSlayer.java | 11 +++--- .../mage/sets/magic2010/VampireNocturnus.java | 3 +- .../sets/magic2010/VeteranArmorsmith.java | 5 ++- .../sets/magic2010/VeteranSwordsmith.java | 5 ++- .../sets/magic2011/CaptivatingVampire.java | 5 +-- .../src/mage/sets/magic2011/Corrupt.java | 5 ++- .../src/mage/sets/magic2011/EarthServant.java | 3 +- .../mage/sets/magic2011/HarborSerpent.java | 3 +- .../mage/sets/magic2011/KnightExemplar.java | 3 +- .../src/mage/sets/magic2011/QuagSickness.java | 3 +- .../mage/sets/magic2012/ArachnusSpinner.java | 3 +- .../sets/magic2012/BloodlordOfVaasgoth.java | 4 +-- .../mage/sets/magic2012/CallToTheGrave.java | 5 +-- .../mage/sets/magic2012/CemeteryReaper.java | 5 ++- .../mage/sets/magic2012/DungroveElder.java | 3 +- .../mage/sets/magic2012/GoblinGrenade.java | 4 +-- .../src/mage/sets/magic2012/GriffinRider.java | 5 ++- .../mage/sets/magic2012/LordOfTheUnreal.java | 5 ++- .../src/mage/sets/magic2013/ArcticAven.java | 3 +- .../src/mage/sets/magic2013/ArmsDealer.java | 3 +- .../mage/sets/magic2013/CrimsonMuckwader.java | 5 ++- .../mage/sets/magic2013/FlinthoofBoar.java | 5 ++- .../mage/sets/magic2013/KrenkoMobBoss.java | 3 +- .../mage/sets/magic2013/LilianasShade.java | 3 +- .../magic2013/MasterOfThePearlTrident.java | 3 +- .../src/mage/sets/magic2013/Mutilate.java | 3 +- .../mage/sets/magic2013/PrizedElephant.java | 4 +-- .../src/mage/sets/magic2013/RangersPath.java | 3 +- .../sets/magic2013/TalrandSkySummoner.java | 2 -- .../src/mage/sets/mirrodin/NightmareLash.java | 3 +- .../src/mage/sets/mirrodin/RustsporeRam.java | 5 ++- .../src/mage/sets/mirrodin/TurnToDust.java | 5 ++- .../sets/mirrodinbesieged/BrassSquire.java | 3 +- .../sets/mirrodinbesieged/MyrTurbine.java | 5 +-- .../mirrodinbesieged/ThopterAssembly.java | 5 ++- .../mage/sets/morningtide/EverbarkShaman.java | 5 ++- .../sets/morningtide/FendeepSummoner.java | 3 +- .../mage/sets/morningtide/HeritageDruid.java | 6 ++-- .../mage/sets/morningtide/InspiredSprite.java | 5 ++- .../sets/morningtide/KinsbaileCavalier.java | 10 +++--- .../sets/morningtide/LysAlanaBowmaster.java | 5 ++- .../sets/morningtide/PreeminentCaptain.java | 34 +++++-------------- .../mage/sets/morningtide/RhysTheExiled.java | 5 ++- .../mage/sets/morningtide/ScarbladeElite.java | 5 ++- .../sets/morningtide/SeethingPathblazer.java | 5 ++- .../mage/sets/morningtide/SigilTracer.java | 4 +-- .../mage/sets/morningtide/WeirdingShaman.java | 5 ++- .../sets/newphyrexia/AuriokSurvivors.java | 5 ++- .../mage/sets/newphyrexia/BladeSplicer.java | 3 +- .../mage/sets/newphyrexia/BludgeonBrawl.java | 5 +-- .../src/mage/sets/newphyrexia/Lashwrithe.java | 3 +- .../mage/sets/newphyrexia/MasterSplicer.java | 3 +- .../mage/sets/newphyrexia/MaulSplicer.java | 3 +- .../sets/newphyrexia/PuresteelPaladin.java | 18 +++++----- .../mage/sets/newphyrexia/SensorSplicer.java | 3 +- .../mage/sets/newphyrexia/VitalSplicer.java | 3 +- .../mage/sets/newphyrexia/WingSplicer.java | 3 +- .../mage/sets/onslaught/WirewoodLodge.java | 3 +- .../mage/sets/planechase/CabalCoffers.java | 3 +- .../sets/planechase/SilvergladeElemental.java | 5 ++- .../mage/sets/ravnika/DarkHeartOfTheWood.java | 5 ++- Mage.Sets/src/mage/sets/ravnika/Farseek.java | 13 +++---- .../sets/riseoftheeldrazi/AuraGnarlid.java | 3 +- .../sets/riseoftheeldrazi/BroodBirthing.java | 7 ++-- .../sets/riseoftheeldrazi/Broodwarden.java | 7 ++-- .../riseoftheeldrazi/CoralhelmCommander.java | 3 +- .../riseoftheeldrazi/JoragaTreespeaker.java | 3 +- .../riseoftheeldrazi/KorSpiritdancer.java | 3 +- .../sets/riseoftheeldrazi/SarkhanTheMad.java | 3 +- .../riseoftheeldrazi/SurrakarSpellblade.java | 8 ++--- .../sets/riseoftheeldrazi/SurrealMemoir.java | 2 -- .../saviorsofkamigawa/IizukaTheRuthless.java | 5 ++- .../saviorsofkamigawa/KashiTribeElite.java | 5 ++- .../sets/saviorsofkamigawa/ManrikiGusari.java | 5 ++- .../sets/scarsofmirrodin/AcidWebSpider.java | 7 ++-- .../scarsofmirrodin/BlackcleaveCliffs.java | 8 +---- .../sets/scarsofmirrodin/CopperlineGorge.java | 8 +---- .../sets/scarsofmirrodin/DarkslickShores.java | 8 +---- .../scarsofmirrodin/EzuriRenegadeLeader.java | 12 +++---- .../sets/scarsofmirrodin/Glimmerpost.java | 7 ++-- .../sets/scarsofmirrodin/KothOfTheHammer.java | 5 +-- .../sets/scarsofmirrodin/MyrBattlesphere.java | 3 +- .../sets/scarsofmirrodin/MyrGalvanizer.java | 7 ++-- .../sets/scarsofmirrodin/MyrReservoir.java | 3 +- .../sets/scarsofmirrodin/PrecursorGolem.java | 8 ++--- .../scarsofmirrodin/RazorvergeThicket.java | 8 +---- .../sets/scarsofmirrodin/SeachromeCoast.java | 8 +---- .../src/mage/sets/shadowmoor/FlowOfIdeas.java | 3 +- .../sets/shadowmoor/LeechriddenSwamp.java | 20 +++++------ .../src/mage/sets/shadowmoor/ReaperKing.java | 3 +- .../mage/sets/shadowmoor/SafewrightQuest.java | 7 ++-- .../mage/sets/shardsofalara/BantPanorama.java | 11 +++--- .../mage/sets/shardsofalara/DeathBaron.java | 8 ++--- .../sets/shardsofalara/EsperPanorama.java | 11 +++--- .../sets/shardsofalara/GrixisPanorama.java | 11 +++--- .../mage/sets/shardsofalara/JundPanorama.java | 11 +++--- .../shardsofalara/KnightCaptainOfEos.java | 3 +- .../mage/sets/shardsofalara/NayaPanorama.java | 11 +++--- .../mage/sets/shardsofalara/WildNacatl.java | 8 ++--- .../src/mage/sets/tempest/ArmorSliver.java | 5 ++- .../src/mage/sets/tempest/BarbedSliver.java | 5 ++- .../src/mage/sets/tempest/ClotSliver.java | 5 ++- .../src/mage/sets/tempest/Earthcraft.java | 2 -- .../sets/tempest/EladamriLordOfLeaves.java | 8 ++--- .../src/mage/sets/tempest/HeartSliver.java | 5 ++- .../src/mage/sets/tempest/HeartwoodGiant.java | 5 ++- .../src/mage/sets/tempest/HornedSliver.java | 5 ++- .../src/mage/sets/tempest/MarshLurker.java | 5 ++- .../src/mage/sets/tempest/MnemonicSliver.java | 5 ++- .../src/mage/sets/tempest/MoggRaider.java | 5 ++- .../src/mage/sets/tempest/MuscleSliver.java | 5 ++- .../src/mage/sets/tempest/TalonSliver.java | 5 ++- .../src/mage/sets/tempest/WingedSliver.java | 5 ++- .../src/mage/sets/tenth/BlanchwoodArmor.java | 3 +- .../src/mage/sets/tenth/ElvishChampion.java | 5 ++- .../src/mage/sets/tenth/FieldMarshal.java | 5 ++- Mage.Sets/src/mage/sets/tenth/GoblinKing.java | 5 ++- .../src/mage/sets/tenth/LordOfTheUndead.java | 8 ++--- .../src/mage/sets/tenth/Mobilization.java | 5 ++- Mage.Sets/src/mage/sets/tenth/Nightmare.java | 3 +- .../src/mage/sets/tenth/SpittingEarth.java | 3 +- .../src/mage/sets/urzassaga/GaeasCradle.java | 2 -- .../mage/sets/urzassaga/PriestOfTitania.java | 3 +- .../mage/sets/urzassaga/SerrasSanctum.java | 2 -- .../sets/urzassaga/TreefolkSeedlings.java | 3 +- .../sets/worldwake/AkoumBattlesinger.java | 3 +- .../sets/worldwake/AnowonTheRuinSage.java | 5 +-- .../src/mage/sets/worldwake/ArborElf.java | 5 ++- .../sets/worldwake/AvengerOfZendikar.java | 3 +- .../mage/sets/worldwake/ClawsOfValakut.java | 3 +- .../mage/sets/worldwake/HalimarExcavator.java | 5 ++- .../src/mage/sets/worldwake/HammerOfRuin.java | 3 +- .../src/mage/sets/worldwake/HarabazDruid.java | 5 ++- .../src/mage/sets/worldwake/LoamLion.java | 5 ++- .../mage/sets/worldwake/SejiriMerfolk.java | 5 ++- .../mage/sets/worldwake/StoneforgeMystic.java | 3 +- .../mage/sets/zendikar/ArmamentMaster.java | 5 +-- .../src/mage/sets/zendikar/BloodTribute.java | 5 ++- .../mage/sets/zendikar/EmeriaTheSkyRuin.java | 5 ++- .../src/mage/sets/zendikar/FeastOfBlood.java | 5 ++- .../mage/sets/zendikar/HagraDiabolist.java | 5 ++- .../src/mage/sets/zendikar/HaloHunter.java | 3 +- .../mage/sets/zendikar/HighlandBerserker.java | 5 ++- .../src/mage/sets/zendikar/JoragaBard.java | 5 ++- .../src/mage/sets/zendikar/KazuulWarlord.java | 5 ++- .../mage/sets/zendikar/KorCartographer.java | 3 +- .../src/mage/sets/zendikar/KorOutfitter.java | 3 +- .../mage/sets/zendikar/LandbindRitual.java | 3 +- .../mage/sets/zendikar/MalakirBloodwitch.java | 3 +- .../src/mage/sets/zendikar/MindSludge.java | 3 +- .../src/mage/sets/zendikar/MindlessNull.java | 3 +- .../mage/sets/zendikar/MurasaPyromancer.java | 5 ++- .../src/mage/sets/zendikar/NissaRevane.java | 5 +-- .../src/mage/sets/zendikar/OnduCleric.java | 5 ++- .../src/mage/sets/zendikar/PrimalBellow.java | 3 +- .../sets/zendikar/QuestForTheHolyRelic.java | 3 +- .../mage/sets/zendikar/SeaGateLoremaster.java | 3 +- .../mage/sets/zendikar/SeascapeAerialist.java | 5 ++- .../src/mage/sets/zendikar/SpireBarrage.java | 3 +- .../src/mage/sets/zendikar/TajuruArcher.java | 5 ++- .../mage/sets/zendikar/TimbermawLarva.java | 3 +- .../mage/sets/zendikar/TrapmakersSnare.java | 3 +- .../zendikar/ValakutTheMoltenPinnacle.java | 5 ++- .../mage/sets/zendikar/WarrenInstigator.java | 3 +- .../common/FetchLandActivatedAbility.java | 18 ++++++---- .../abilities/keyword/ForestwalkAbility.java | 5 ++- .../abilities/keyword/IslandwalkAbility.java | 5 ++- .../keyword/MountainwalkAbility.java | 5 ++- .../abilities/keyword/PlainswalkAbility.java | 5 ++- .../abilities/keyword/SoulshiftAbility.java | 4 +-- .../abilities/keyword/SwampwalkAbility.java | 5 ++- Mage/src/mage/filter/FilterObject.java | 25 -------------- Mage/src/mage/filter/common/FilterAura.java | 3 +- .../mage/filter/common/FilterEquipment.java | 3 +- .../filter/common/FilterFortification.java | 3 +- .../common/FilterSpiritOrArcaneCard.java | 7 ++-- Mage/src/mage/game/GameImpl.java | 4 +-- 345 files changed, 874 insertions(+), 1032 deletions(-) diff --git a/Mage.Sets/src/mage/sets/alarareborn/LichLordOfUnx.java b/Mage.Sets/src/mage/sets/alarareborn/LichLordOfUnx.java index 0121629fa2..3144599e37 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/LichLordOfUnx.java +++ b/Mage.Sets/src/mage/sets/alarareborn/LichLordOfUnx.java @@ -43,8 +43,8 @@ import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.LoseLifeTargetEffect; import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.permanent.token.Token; import mage.target.TargetPlayer; @@ -56,8 +56,7 @@ public class LichLordOfUnx extends CardImpl { private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Zombies you control"); static { - filter.getSubtype().add("Zombie"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Zombie")); } public LichLordOfUnx (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/avacynrestored/AngelOfGlorysRise.java b/Mage.Sets/src/mage/sets/avacynrestored/AngelOfGlorysRise.java index 023424f856..cfc1e06f4c 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/AngelOfGlorysRise.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/AngelOfGlorysRise.java @@ -36,12 +36,12 @@ import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreatureCard; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.players.Player; import mage.game.permanent.Permanent; @@ -83,10 +83,8 @@ class AngelOfGlorysRiseEffect extends OneShotEffect { private static final FilterCreaturePermanent filterZombie = new FilterCreaturePermanent(); static { - filterZombie.getSubtype().add("Zombie"); - filterZombie.setScopeSubtype(Filter.ComparisonScope.Any); - filterHuman.getSubtype().add("Human"); - filterHuman.setScopeSubtype(Filter.ComparisonScope.Any); + filterZombie.add(new SubtypePredicate("Zombie")); + filterHuman.add(new SubtypePredicate("Human")); } public AngelOfGlorysRiseEffect() { diff --git a/Mage.Sets/src/mage/sets/avacynrestored/BrunaLightOfAlabaster.java b/Mage.Sets/src/mage/sets/avacynrestored/BrunaLightOfAlabaster.java index b9c00138cf..c94fdd094c 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/BrunaLightOfAlabaster.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/BrunaLightOfAlabaster.java @@ -40,6 +40,7 @@ import mage.cards.Card; import mage.cards.CardImpl; import mage.filter.FilterCard; import mage.filter.common.FilterAura; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -89,7 +90,7 @@ class BrunaLightOfAlabasterEffect extends OneShotEffect { player.revealCards("DescendantsPath", new CardsImpl(card), game); if (card.getCardType().contains(CardType.CREATURE)) { FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(); - filter.getSubtype().addAll(card.getSubtype()); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + + ArrayList> subtypes = new ArrayList>(); + for (String subtype: card.getSubtype()) { + subtypes.add(new SubtypePredicate(subtype)); + } + filter.add(Predicates.or(subtypes)); + int count = game.getBattlefield().getAllActivePermanents(filter, player.getId(), game).size(); if (count > 0) { game.informPlayers("DescendantsPath: Found a creature that shares a creature type with the revealed card."); diff --git a/Mage.Sets/src/mage/sets/avacynrestored/DevoutChaplain.java b/Mage.Sets/src/mage/sets/avacynrestored/DevoutChaplain.java index 9b5ed9f17b..c603cc5817 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/DevoutChaplain.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/DevoutChaplain.java @@ -40,6 +40,7 @@ import mage.cards.CardImpl; import mage.filter.Filter; import mage.filter.FilterPermanent; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.TargetPermanent; import mage.target.common.TargetControlledPermanent; @@ -63,8 +64,7 @@ public class DevoutChaplain extends CardImpl { static { humanFilter.setTapped(false); humanFilter.setUseTapped(true); - humanFilter.getSubtype().add("Human"); - humanFilter.setScopeSubtype(Filter.ComparisonScope.Any); + humanFilter.add(new SubtypePredicate("Human")); } public DevoutChaplain(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/avacynrestored/DiregrafEscort.java b/Mage.Sets/src/mage/sets/avacynrestored/DiregrafEscort.java index 4391325f2a..6b2a8de3d3 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/DiregrafEscort.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/DiregrafEscort.java @@ -38,6 +38,7 @@ import mage.abilities.keyword.SoulbondAbility; import mage.cards.CardImpl; import mage.filter.FilterPermanent; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import java.util.UUID; @@ -51,7 +52,7 @@ public class DiregrafEscort extends CardImpl { private static final FilterPermanent filter = new FilterCreaturePermanent("Zombies"); static { - filter.getSubtype().add("Zombie"); + filter.add(new SubtypePredicate("Zombie")); } public DiregrafEscort(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/avacynrestored/GallowsAtWillowHill.java b/Mage.Sets/src/mage/sets/avacynrestored/GallowsAtWillowHill.java index 4b4fed0ac7..b185d77d37 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/GallowsAtWillowHill.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/GallowsAtWillowHill.java @@ -37,8 +37,8 @@ import mage.abilities.costs.common.TapTargetCost; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.permanent.token.SpiritWhiteToken; @@ -59,8 +59,7 @@ public class GallowsAtWillowHill extends CardImpl { static { humanFilter.setTapped(false); humanFilter.setUseTapped(true); - humanFilter.getSubtype().add("Human"); - humanFilter.setScopeSubtype(Filter.ComparisonScope.Any); + humanFilter.add(new SubtypePredicate("Human")); } public GallowsAtWillowHill(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/avacynrestored/HumanFrailty.java b/Mage.Sets/src/mage/sets/avacynrestored/HumanFrailty.java index 1b9f47f7cb..4191073f00 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/HumanFrailty.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/HumanFrailty.java @@ -32,6 +32,7 @@ import mage.Constants.Rarity; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.TargetPermanent; import java.util.UUID; @@ -44,7 +45,7 @@ public class HumanFrailty extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Human creature"); static { - filter.getSubtype().add("Human"); + filter.add(new SubtypePredicate("Human")); } public HumanFrailty(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/avacynrestored/KessigMalcontents.java b/Mage.Sets/src/mage/sets/avacynrestored/KessigMalcontents.java index eea55571e7..07511f6b28 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/KessigMalcontents.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/KessigMalcontents.java @@ -36,6 +36,7 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.TargetPlayer; import java.util.UUID; @@ -48,7 +49,7 @@ public class KessigMalcontents extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("Humans you control"); static { - filter.getSubtype().add("Human"); + filter.add(new SubtypePredicate("Human")); } public KessigMalcontents(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/avacynrestored/MassAppeal.java b/Mage.Sets/src/mage/sets/avacynrestored/MassAppeal.java index 19f18344c1..e3a5721c38 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/MassAppeal.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/MassAppeal.java @@ -33,6 +33,7 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.DrawCardControllerEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import java.util.UUID; @@ -45,7 +46,7 @@ public class MassAppeal extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("Human you control"); static { - filter.getSubtype().add("Human"); + filter.add(new SubtypePredicate("Human")); } public MassAppeal(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/avacynrestored/MidnightDuelist.java b/Mage.Sets/src/mage/sets/avacynrestored/MidnightDuelist.java index 574259d599..d4abdaf93c 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/MidnightDuelist.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/MidnightDuelist.java @@ -32,9 +32,9 @@ import mage.Constants.Rarity; import mage.MageInt; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import java.util.UUID; @@ -48,8 +48,7 @@ public class MidnightDuelist extends CardImpl { private static final FilterPermanent filter = new FilterCreaturePermanent("Vampires"); static { - filter.getSubtype().add("Vampire"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Vampire")); } public MidnightDuelist(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/avacynrestored/RestorationAngel.java b/Mage.Sets/src/mage/sets/avacynrestored/RestorationAngel.java index 18fdc3845c..549c0a6b3e 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/RestorationAngel.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/RestorationAngel.java @@ -38,6 +38,8 @@ import mage.abilities.keyword.FlashAbility; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetControlledCreaturePermanent; import java.util.UUID; @@ -52,8 +54,7 @@ public class RestorationAngel extends CardImpl { private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("non-Angel"); static { - filter.getSubtype().add("Angel"); - filter.setNotSubtype(true); + filter.add(Predicates.not(new SubtypePredicate("Angel"))); } public RestorationAngel(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/avacynrestored/RidersOfGavony.java b/Mage.Sets/src/mage/sets/avacynrestored/RidersOfGavony.java index 1d2e634aa0..c092bf56b4 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/RidersOfGavony.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/RidersOfGavony.java @@ -43,6 +43,7 @@ import mage.choices.Choice; import mage.choices.ChoiceImpl; import mage.filter.FilterPermanent; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -124,7 +125,7 @@ class RidersOfGavonyGainAbilityControlledEffect extends ContinuousEffectImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Human creatures"); static { - filter.getSubtype().add("Human"); + filter.add(new SubtypePredicate("Human")); } public RiotRingleader(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/avacynrestored/ScrollOfAvacyn.java b/Mage.Sets/src/mage/sets/avacynrestored/ScrollOfAvacyn.java index adc5bd7052..a34aa00f90 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/ScrollOfAvacyn.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/ScrollOfAvacyn.java @@ -41,19 +41,18 @@ import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.effects.common.DrawCardControllerEffect; import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * * @author Loki */ public class ScrollOfAvacyn extends CardImpl { - private static FilterPermanent filter = new FilterPermanent("an Angel"); + private static final FilterPermanent filter = new FilterPermanent(); static { - filter.getSubtype().add("Angel"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Angel")); } public ScrollOfAvacyn(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/avacynrestored/ScrollOfGriselbrand.java b/Mage.Sets/src/mage/sets/avacynrestored/ScrollOfGriselbrand.java index d20284c2e4..a1833aaad8 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/ScrollOfGriselbrand.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/ScrollOfGriselbrand.java @@ -41,8 +41,8 @@ import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.effects.common.DiscardTargetEffect; import mage.abilities.effects.common.LoseLifeTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetOpponent; /** @@ -50,11 +50,10 @@ import mage.target.common.TargetOpponent; * @author Loki */ public class ScrollOfGriselbrand extends CardImpl { - private static FilterPermanent filter = new FilterPermanent("a Demon"); + private static final FilterPermanent filter = new FilterPermanent(); static { - filter.getSubtype().add("Demon"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Demon")); } public ScrollOfGriselbrand(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/IreOfKaminari.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/IreOfKaminari.java index c3c748d447..aa539c65a3 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/IreOfKaminari.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/IreOfKaminari.java @@ -33,8 +33,8 @@ import mage.Constants.Rarity; import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCreatureOrPlayer; /** @@ -46,8 +46,7 @@ public class IreOfKaminari extends CardImpl { private final static FilterCard filter = new FilterCard("Arcane"); static { - filter.getSubtype().add("Arcane"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Arcane")); } public IreOfKaminari(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/IsaoEnlightenedBushi.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/IsaoEnlightenedBushi.java index c43cc3c38f..8d4849c1b6 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/IsaoEnlightenedBushi.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/IsaoEnlightenedBushi.java @@ -40,8 +40,8 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.RegenerateTargetEffect; import mage.abilities.keyword.BushidoAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.TargetPermanent; /** @@ -53,8 +53,7 @@ public class IsaoEnlightenedBushi extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("Samurai"); static { - filter.getSubtype().add("Samurai"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Samurai")); } public IsaoEnlightenedBushi(UUID ownerId) { @@ -66,6 +65,7 @@ public class IsaoEnlightenedBushi extends CardImpl { this.color.setGreen(true); this.power = new MageInt(2); this.toughness = new MageInt(1); + // Isao, Enlightened Bushi can't be countered. this.addAbility(new CantCounterAbility()); this.addAbility(new BushidoAbility(2)); diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/NezumiShadowWatcher.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/NezumiShadowWatcher.java index 6b4cad4cc1..1ff953641f 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/NezumiShadowWatcher.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/NezumiShadowWatcher.java @@ -38,8 +38,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.SubtypePredicate; import mage.target.TargetPermanent; /** @@ -51,8 +51,7 @@ public class NezumiShadowWatcher extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("Ninja"); static { - filter.getSubtype().add("Ninja"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Ninja")); } public NezumiShadowWatcher(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/RibbonsOfTheReikai.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/RibbonsOfTheReikai.java index 0fb3cfd99f..62abcfffe7 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/RibbonsOfTheReikai.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/RibbonsOfTheReikai.java @@ -33,8 +33,8 @@ import mage.Constants.Rarity; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.DrawCardControllerEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -45,8 +45,7 @@ public class RibbonsOfTheReikai extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("Spirit you control"); static { - filter.getSubtype().add("Spirit"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Spirit")); } public RibbonsOfTheReikai(UUID ownerId) { @@ -54,6 +53,7 @@ public class RibbonsOfTheReikai extends CardImpl { this.expansionSetCode = "BOK"; this.subtype.add("Arcane"); this.color.setBlue(true); + // Draw a card for each Spirit you control. this.getSpellAbility().addEffect(new DrawCardControllerEffect(new PermanentsOnBattlefieldCount(filter))); } diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/TakenosCavalry.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/TakenosCavalry.java index 47076d893f..f0e729f4dc 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/TakenosCavalry.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/TakenosCavalry.java @@ -39,8 +39,8 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.keyword.BushidoAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterAttackingOrBlockingCreature; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetAttackingOrBlockingCreature; /** @@ -52,8 +52,7 @@ public class TakenosCavalry extends CardImpl { private final static FilterAttackingOrBlockingCreature filter = new FilterAttackingOrBlockingCreature("attacking or blocking Spirit"); static { - filter.getSubtype().add("Spirit"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Spirit")); } public TakenosCavalry(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/TraprootKami.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/TraprootKami.java index 52da1673cb..addb5a0d4b 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/TraprootKami.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/TraprootKami.java @@ -40,8 +40,8 @@ import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.abilities.keyword.DefenderAbility; import mage.abilities.keyword.ReachAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -52,8 +52,7 @@ public class TraprootKami extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("Forest"); static { - filter.getSubtype().add("Forest"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Forest")); } public TraprootKami(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/AzamiLadyOfScrolls.java b/Mage.Sets/src/mage/sets/championsofkamigawa/AzamiLadyOfScrolls.java index a86a412832..8c8840fc12 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/AzamiLadyOfScrolls.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/AzamiLadyOfScrolls.java @@ -38,8 +38,8 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapTargetCost; import mage.abilities.effects.common.DrawCardControllerEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetControlledPermanent; /** @@ -52,9 +52,7 @@ public class AzamiLadyOfScrolls extends CardImpl { static { filter.setTapped(false); filter.setUseTapped(true); - filter.getSubtype().add("Wizard"); - filter.setScopeCardType(Filter.ComparisonScope.Any); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Wizard")); } public AzamiLadyOfScrolls(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/BenBenAkkiHermit.java b/Mage.Sets/src/mage/sets/championsofkamigawa/BenBenAkkiHermit.java index 4fa9d1ee89..9bb1f03c70 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/BenBenAkkiHermit.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/BenBenAkkiHermit.java @@ -40,8 +40,8 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetAttackingCreature; /** @@ -55,8 +55,7 @@ public class BenBenAkkiHermit extends CardImpl { static { filter.setTapped(false); filter.setUseTapped(true); - filter.getSubtype().add("Mountain"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Mountain")); } public BenBenAkkiHermit (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/BloodthirstyOgre.java b/Mage.Sets/src/mage/sets/championsofkamigawa/BloodthirstyOgre.java index cfaf5d97d8..f3add9680c 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/BloodthirstyOgre.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/BloodthirstyOgre.java @@ -45,8 +45,8 @@ import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.counters.CounterType; import mage.counters.common.DevotionCounter; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -57,8 +57,7 @@ public class BloodthirstyOgre extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("Demon"); static { - filter.getSubtype().add("Demon"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Demon")); } public BloodthirstyOgre(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/CallToGlory.java b/Mage.Sets/src/mage/sets/championsofkamigawa/CallToGlory.java index 4a6a12ff5f..9c5afabdb9 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/CallToGlory.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/CallToGlory.java @@ -37,8 +37,8 @@ import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; 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.SubtypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -52,8 +52,7 @@ public class CallToGlory extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("Samurai"); static { - filter.getSubtype().add("Samurai"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Samurai")); } public CallToGlory(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/EerieProcession.java b/Mage.Sets/src/mage/sets/championsofkamigawa/EerieProcession.java index 254429b665..d470dd375b 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/EerieProcession.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/EerieProcession.java @@ -34,8 +34,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.SubtypePredicate; import mage.target.common.TargetCardInLibrary; /** @@ -46,8 +46,7 @@ public class EerieProcession extends CardImpl { private final static FilterCard filter = new FilterCard("Arcane card"); static { - filter.getSubtype().add("Arcane"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Arcane")); } public EerieProcession(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/HanaKami.java b/Mage.Sets/src/mage/sets/championsofkamigawa/HanaKami.java index f0b1e7e43e..99dd846930 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/HanaKami.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/HanaKami.java @@ -40,8 +40,8 @@ import mage.abilities.costs.common.SacrificeSourceCost; 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.SubtypePredicate; import mage.target.common.TargetCardInYourGraveyard; /** @@ -52,8 +52,7 @@ public class HanaKami extends CardImpl { private final static FilterCard filter = new FilterCard("Arcane card from your graveyard"); static { - filter.getSubtype().add("Arcane"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Arcane")); } public HanaKami(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/HeWhoHungers.java b/Mage.Sets/src/mage/sets/championsofkamigawa/HeWhoHungers.java index 32bf640094..e1264d318c 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/HeWhoHungers.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/HeWhoHungers.java @@ -45,8 +45,8 @@ import mage.abilities.effects.common.discard.DiscardCardYouChooseTargetOpponentE import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.SoulshiftAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetOpponent; @@ -60,8 +60,7 @@ public class HeWhoHungers extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("a Spirit"); static { - filter.getSubtype().add("Spirit"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Spirit")); } public HeWhoHungers(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/HisokasDefiance.java b/Mage.Sets/src/mage/sets/championsofkamigawa/HisokasDefiance.java index 5913a5e3a1..8c6c9e17a5 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/HisokasDefiance.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/HisokasDefiance.java @@ -34,8 +34,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.SubtypePredicate; import mage.target.TargetSpell; /** @@ -46,9 +47,7 @@ public class HisokasDefiance extends CardImpl { private final static FilterSpell filter = new FilterSpell("Spirit or Arcane spell"); static { - filter.getSubtype().add("Spirit"); - filter.getSubtype().add("Arcane"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(Predicates.or(new SubtypePredicate("Spirit"), new SubtypePredicate("Arcane"))); } public HisokasDefiance(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/HondenOfCleansingFire.java b/Mage.Sets/src/mage/sets/championsofkamigawa/HondenOfCleansingFire.java index 4f9bad4e8e..50cc6d0589 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/HondenOfCleansingFire.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/HondenOfCleansingFire.java @@ -37,8 +37,8 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @author Loki @@ -48,8 +48,7 @@ public class HondenOfCleansingFire extends CardImpl { final static FilterControlledPermanent filter = new FilterControlledPermanent("Shrine"); static { - filter.getSubtype().add("Shrine"); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Shrine")); } public HondenOfCleansingFire(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/HondenOfInfiniteRage.java b/Mage.Sets/src/mage/sets/championsofkamigawa/HondenOfInfiniteRage.java index e0dc86d120..e39e85aa3b 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/HondenOfInfiniteRage.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/HondenOfInfiniteRage.java @@ -37,8 +37,8 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCreatureOrPlayer; /** @@ -50,8 +50,7 @@ public class HondenOfInfiniteRage extends CardImpl { final static FilterControlledPermanent filter = new FilterControlledPermanent("Shrine"); static { - filter.getSubtype().add("Shrine"); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Shrine")); } public HondenOfInfiniteRage (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/HondenOfLifesWeb.java b/Mage.Sets/src/mage/sets/championsofkamigawa/HondenOfLifesWeb.java index df700d8ec7..f58957d541 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/HondenOfLifesWeb.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/HondenOfLifesWeb.java @@ -37,8 +37,8 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; 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.SubtypePredicate; import mage.game.permanent.token.SpiritToken; /** @@ -49,8 +49,7 @@ public class HondenOfLifesWeb extends CardImpl { final static FilterControlledPermanent filter = new FilterControlledPermanent("Shrine"); static { - filter.getSubtype().add("Shrine"); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Shrine")); } public HondenOfLifesWeb(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/HondenOfNightsReach.java b/Mage.Sets/src/mage/sets/championsofkamigawa/HondenOfNightsReach.java index 3807168487..1a49a50de9 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/HondenOfNightsReach.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/HondenOfNightsReach.java @@ -37,8 +37,8 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.DiscardTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetOpponent; /** @@ -49,8 +49,7 @@ public class HondenOfNightsReach extends CardImpl { final static FilterControlledPermanent filter = new FilterControlledPermanent("Shrine"); static { - filter.getSubtype().add("Shrine"); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Shrine")); } public HondenOfNightsReach(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/HondenOfSeeingWinds.java b/Mage.Sets/src/mage/sets/championsofkamigawa/HondenOfSeeingWinds.java index c4bc7fcc26..efdc9f1c2c 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/HondenOfSeeingWinds.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/HondenOfSeeingWinds.java @@ -37,8 +37,8 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.DrawCardControllerEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @author Loki @@ -48,8 +48,7 @@ public class HondenOfSeeingWinds extends CardImpl { final static FilterControlledPermanent filter = new FilterControlledPermanent("Shrine"); static { - filter.getSubtype().add("Shrine"); - filter.setScopeCardType(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Shrine")); } public HondenOfSeeingWinds(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/HorobiDeathsWail.java b/Mage.Sets/src/mage/sets/championsofkamigawa/HorobiDeathsWail.java index b303a97574..431444e350 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/HorobiDeathsWail.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/HorobiDeathsWail.java @@ -37,8 +37,8 @@ import mage.abilities.effects.Effect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -53,8 +53,7 @@ public class HorobiDeathsWail extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("Demon"); static { - filter.getSubtype().add("Demon"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Demon")); } public HorobiDeathsWail(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/InameDeathAspect.java b/Mage.Sets/src/mage/sets/championsofkamigawa/InameDeathAspect.java index 1ba17094e4..0ceace3cb9 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/InameDeathAspect.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/InameDeathAspect.java @@ -38,8 +38,8 @@ import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.SearchEffect; import mage.cards.Card; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreatureCard; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.players.Player; import mage.target.common.TargetCardInLibrary; @@ -76,8 +76,7 @@ class InameDeathAspectEffect extends SearchEffect { private final static FilterCreatureCard filter = new FilterCreatureCard(); static { - filter.getSubtype().add("Spirit"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Spirit")); } public InameDeathAspectEffect() { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/InameLifeAspect.java b/Mage.Sets/src/mage/sets/championsofkamigawa/InameLifeAspect.java index 33e091349e..58519681f7 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/InameLifeAspect.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/InameLifeAspect.java @@ -36,8 +36,8 @@ import mage.abilities.common.DiesTriggeredAbility; import mage.abilities.effects.common.ExileSourceEffect; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCardInYourGraveyard; /** @@ -49,8 +49,7 @@ public class InameLifeAspect extends CardImpl { private final static FilterCard filter = new FilterCard("Spirit cards from your graveyard"); static { - filter.getSubtype().add("Spirit"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Spirit")); } public InameLifeAspect(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/KitsuneDiviner.java b/Mage.Sets/src/mage/sets/championsofkamigawa/KitsuneDiviner.java index 41d911da17..d796ab0ff7 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/KitsuneDiviner.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/KitsuneDiviner.java @@ -39,8 +39,8 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.TapTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.TargetPermanent; /** @@ -52,8 +52,7 @@ public class KitsuneDiviner extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("Spirit"); static { - filter.getSubtype().add("Spirit"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Spirit")); } public KitsuneDiviner (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/KitsuneRiftwalker.java b/Mage.Sets/src/mage/sets/championsofkamigawa/KitsuneRiftwalker.java index c352a40e27..98697994e5 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/KitsuneRiftwalker.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/KitsuneRiftwalker.java @@ -33,8 +33,9 @@ import mage.Constants.Rarity; import mage.MageInt; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -45,9 +46,7 @@ public class KitsuneRiftwalker extends CardImpl { private final static FilterCard filter = new FilterCard("Spirits and from Arcane"); static { - filter.getSubtype().add("Arcane"); - filter.getSubtype().add("Spirit"); - filter.setScopeSubtype(ComparisonScope.Any); + filter.add(Predicates.or(new SubtypePredicate("Arcane"), new SubtypePredicate("Spirit"))); } public KitsuneRiftwalker(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/KondasHatamoto.java b/Mage.Sets/src/mage/sets/championsofkamigawa/KondasHatamoto.java index 156b05d871..03d549eb6f 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/KondasHatamoto.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/KondasHatamoto.java @@ -41,8 +41,8 @@ import mage.abilities.effects.common.continious.GainAbilitySourceEffect; import mage.abilities.keyword.BushidoAbility; import mage.abilities.keyword.VigilanceAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SupertypePredicate; /** @@ -57,8 +57,7 @@ public class KondasHatamoto extends CardImpl{ static { filter.add(new SupertypePredicate("Legendary")); - filter.getSubtype().add("Samurai"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Samurai")); } public KondasHatamoto (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/LongForgottenGohei.java b/Mage.Sets/src/mage/sets/championsofkamigawa/LongForgottenGohei.java index d7f1dc395b..6a0d2254a3 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/LongForgottenGohei.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/LongForgottenGohei.java @@ -44,6 +44,7 @@ import mage.abilities.effects.common.continious.BoostControlledEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.util.CardUtil; @@ -56,7 +57,7 @@ public class LongForgottenGohei extends CardImpl { private final static FilterCreaturePermanent spiritFilter = new FilterCreaturePermanent("Spirits"); static { - spiritFilter.getSubtype().add("Spirit"); + spiritFilter.add(new SubtypePredicate("Spirit")); } public LongForgottenGohei(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/MarrowGnawer.java b/Mage.Sets/src/mage/sets/championsofkamigawa/MarrowGnawer.java index 2f059f9ae5..886ddbc695 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/MarrowGnawer.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/MarrowGnawer.java @@ -47,6 +47,7 @@ import mage.abilities.keyword.FearAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.permanent.token.Token; import mage.target.common.TargetControlledPermanent; @@ -60,10 +61,11 @@ public class MarrowGnawer extends CardImpl { private static final FilterControlledCreaturePermanent filterSacrifice = new FilterControlledCreaturePermanent("a Rat"); private static final FilterControlledCreaturePermanent filter3 = new FilterControlledCreaturePermanent("Rats you control"); - static { - filterFear.getSubtype().add("Rat"); - filterSacrifice.getSubtype().add("Rat"); - filter3.getSubtype().add("Rat"); + { + SubtypePredicate ratPredicate = new SubtypePredicate("Rat"); + filterFear.add(ratPredicate); + filterSacrifice.add(ratPredicate); + filter3.add(ratPredicate); } public MarrowGnawer (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/NagaoBoundByHonor.java b/Mage.Sets/src/mage/sets/championsofkamigawa/NagaoBoundByHonor.java index f2f27b4ce7..7b976ef8a2 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/NagaoBoundByHonor.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/NagaoBoundByHonor.java @@ -37,8 +37,8 @@ import mage.abilities.common.AttacksTriggeredAbility; import mage.abilities.effects.common.continious.BoostControlledEffect; import mage.abilities.keyword.BushidoAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -49,8 +49,7 @@ public class NagaoBoundByHonor extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("Samurai creatures"); static { - filter.getSubtype().add("Samurai"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Samurai")); } public NagaoBoundByHonor(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/NineRingedBo.java b/Mage.Sets/src/mage/sets/championsofkamigawa/NineRingedBo.java index d2d2853053..2cd880c637 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/NineRingedBo.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/NineRingedBo.java @@ -40,8 +40,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.ComparisonScope; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -59,8 +59,7 @@ public class NineRingedBo extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("spirit"); static { - filter.getSubtype().add("Spirit"); - filter.setScopeSubtype(ComparisonScope.Any); + filter.add(new SubtypePredicate("Spirit")); } public NineRingedBo(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/PainwrackerOni.java b/Mage.Sets/src/mage/sets/championsofkamigawa/PainwrackerOni.java index 99c24f90f0..f851e35662 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/PainwrackerOni.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/PainwrackerOni.java @@ -40,6 +40,7 @@ import mage.abilities.effects.common.SacrificeTargetEffect; import mage.abilities.keyword.FearAbility; import mage.cards.CardImpl; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -56,7 +57,7 @@ public class PainwrackerOni extends CardImpl { this.expansionSetCode = "CHK"; this.subtype.add("Demon"); this.subtype.add("Spirit"); - this.color.setBlack(true); + this.color.setBlack(true); this.power = new MageInt(5); this.toughness = new MageInt(4); @@ -84,7 +85,7 @@ class PainwrackerOniTriggeredAbility1 extends TriggeredAbilityImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Non-Spirit"); static { - filter.getSubtype().add("Spirit"); - filter.setNotSubtype(true); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(Predicates.not(new SubtypePredicate("Spirit"))); } public RendFlesh(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/RendSpirit.java b/Mage.Sets/src/mage/sets/championsofkamigawa/RendSpirit.java index 790bd47bf1..7da25780c4 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/RendSpirit.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/RendSpirit.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.SubtypePredicate; import mage.target.TargetPermanent; /** @@ -46,8 +46,7 @@ public class RendSpirit extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("Spirit"); static { - filter.getSubtype().add("Spirit"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Spirit")); } public RendSpirit(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/SachiDaughterOfSeshiro.java b/Mage.Sets/src/mage/sets/championsofkamigawa/SachiDaughterOfSeshiro.java index 353bda2e05..53df292590 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/SachiDaughterOfSeshiro.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/SachiDaughterOfSeshiro.java @@ -43,6 +43,7 @@ import mage.abilities.effects.common.continious.BoostControlledEffect; import mage.abilities.effects.common.continious.GainAbilityControlledEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @author Loki @@ -54,8 +55,8 @@ public class SachiDaughterOfSeshiro extends CardImpl { private final static FilterCreaturePermanent shamanFilter = new FilterCreaturePermanent("Shamans"); static { - snakeFilter.getSubtype().add("Snake"); - shamanFilter.getSubtype().add("Shaman"); + snakeFilter.add(new SubtypePredicate("Snake")); + shamanFilter.add(new SubtypePredicate("Shaman")); } public SachiDaughterOfSeshiro(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/SeshiroTheAnointed.java b/Mage.Sets/src/mage/sets/championsofkamigawa/SeshiroTheAnointed.java index d20dc5264d..8dd767e9dd 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/SeshiroTheAnointed.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/SeshiroTheAnointed.java @@ -40,6 +40,7 @@ import mage.abilities.effects.common.DrawCardControllerEffect; import mage.abilities.effects.common.continious.BoostControlledEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; @@ -53,7 +54,7 @@ public class SeshiroTheAnointed extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("Snakes"); static { - filter.getSubtype().add("Snake"); + filter.add(new SubtypePredicate("Snake")); } public SeshiroTheAnointed(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/ShisatoWhisperingHunter.java b/Mage.Sets/src/mage/sets/championsofkamigawa/ShisatoWhisperingHunter.java index eb7c355864..ecde9c3458 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/ShisatoWhisperingHunter.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/ShisatoWhisperingHunter.java @@ -31,7 +31,6 @@ import java.util.UUID; import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; -import mage.Constants.TargetController; import mage.MageInt; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; @@ -39,6 +38,7 @@ import mage.abilities.effects.common.SacrificeControllerEffect; import mage.abilities.effects.common.SkipNextPlayerUntapStepEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -50,8 +50,7 @@ public class ShisatoWhisperingHunter extends CardImpl { private final static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Snake"); static { - filter.getSubtype().add("Snake"); - filter.setTargetController(TargetController.YOU); + filter.add(new SubtypePredicate("Snake")); } public ShisatoWhisperingHunter(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/SosukeSonOfSeshiro.java b/Mage.Sets/src/mage/sets/championsofkamigawa/SosukeSonOfSeshiro.java index e7d7dcc035..bd49e0201e 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/SosukeSonOfSeshiro.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/SosukeSonOfSeshiro.java @@ -41,8 +41,8 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DestroyTargetEffect; 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.SubtypePredicate; import mage.game.Game; import mage.game.events.DamagedCreatureEvent; import mage.game.events.GameEvent; @@ -58,8 +58,7 @@ public class SosukeSonOfSeshiro extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("Snake creatures"); static { - filter.getSubtype().add("Snake"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Snake")); } public SosukeSonOfSeshiro(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/TakenoSamuraiGeneral.java b/Mage.Sets/src/mage/sets/championsofkamigawa/TakenoSamuraiGeneral.java index 7c19560990..a5a8293b49 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/TakenoSamuraiGeneral.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/TakenoSamuraiGeneral.java @@ -37,8 +37,8 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.keyword.BushidoAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; @@ -74,11 +74,10 @@ public class TakenoSamuraiGeneral extends CardImpl { } class TakenoSamuraiGeneralEffect extends ContinuousEffectImpl { - private static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(); + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(); static { - filter.getSubtype().add("Samurai"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Samurai")); } public TakenoSamuraiGeneralEffect() { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/TheUnspeakable.java b/Mage.Sets/src/mage/sets/championsofkamigawa/TheUnspeakable.java index bbc741a1a1..dfa2e79ed9 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/TheUnspeakable.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/TheUnspeakable.java @@ -37,8 +37,8 @@ import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCardInYourGraveyard; /** @@ -50,8 +50,7 @@ public class TheUnspeakable extends CardImpl { private final static FilterCard filter = new FilterCard("Arcane card from your graveyard"); static { - filter.getSubtype().add("Arcane"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Arcane")); } public TheUnspeakable(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/VillainousOgre.java b/Mage.Sets/src/mage/sets/championsofkamigawa/VillainousOgre.java index 3398931020..e58ebb903e 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/VillainousOgre.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/VillainousOgre.java @@ -39,8 +39,8 @@ import mage.abilities.decorator.ConditionalActivatedAbility; import mage.abilities.effects.common.RegenerateSourceEffect; //import mage.abilities.effects.common.continious.GainAbilitySourceEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -51,8 +51,7 @@ public class VillainousOgre extends CardImpl { private static final String rule = "As long as you control a Demon, {this} has {B}: Regenerate Villainous Ogre"; private static final FilterControlledPermanent filter = new FilterControlledPermanent("Demon"); static { - filter.getSubtype().add("Demon"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Demon")); } public VillainousOgre(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/conflux/KnightOfTheReliquary.java b/Mage.Sets/src/mage/sets/conflux/KnightOfTheReliquary.java index 5f04d220b0..76fd668993 100644 --- a/Mage.Sets/src/mage/sets/conflux/KnightOfTheReliquary.java +++ b/Mage.Sets/src/mage/sets/conflux/KnightOfTheReliquary.java @@ -47,7 +47,8 @@ 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.SubtypePredicate; import mage.target.common.TargetCardInLibrary; import mage.target.common.TargetControlledPermanent; @@ -62,9 +63,7 @@ public class KnightOfTheReliquary extends CardImpl { static { filter.getCardType().add(CardType.LAND); filter.setScopeCardType(ComparisonScope.Any); - filter.getSubtype().add("Forest"); - filter.getSubtype().add("Plains"); - filter.setScopeSubtype(ComparisonScope.Any); + filter.add(Predicates.or(new SubtypePredicate("Forest"), new SubtypePredicate("Plains"))); } public KnightOfTheReliquary(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/darkascension/ArchdemonOfGreed.java b/Mage.Sets/src/mage/sets/darkascension/ArchdemonOfGreed.java index 5bb0c10f06..14ee45f8a9 100644 --- a/Mage.Sets/src/mage/sets/darkascension/ArchdemonOfGreed.java +++ b/Mage.Sets/src/mage/sets/darkascension/ArchdemonOfGreed.java @@ -39,6 +39,7 @@ import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; @@ -54,7 +55,7 @@ public class ArchdemonOfGreed extends CardImpl { private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Human"); static { - filter.getSubtype().add("Human"); + filter.add(new SubtypePredicate("Human")); filter.setTargetController(Constants.TargetController.YOU); } diff --git a/Mage.Sets/src/mage/sets/darkascension/CallToTheKindred.java b/Mage.Sets/src/mage/sets/darkascension/CallToTheKindred.java index 2fe999ad10..e54b1a5e2d 100644 --- a/Mage.Sets/src/mage/sets/darkascension/CallToTheKindred.java +++ b/Mage.Sets/src/mage/sets/darkascension/CallToTheKindred.java @@ -27,11 +27,13 @@ */ package mage.sets.darkascension; +import java.util.ArrayList; import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Outcome; import mage.Constants.Rarity; import mage.Constants.Zone; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.OnEventTriggeredAbility; import mage.abilities.effects.OneShotEffect; @@ -44,6 +46,9 @@ import mage.cards.CardsImpl; import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; import mage.filter.common.FilterCreatureCard; +import mage.filter.predicate.Predicate; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; @@ -129,11 +134,12 @@ class CallToTheKindredEffect extends OneShotEffect { FilterCreatureCard filter = new FilterCreatureCard(); StringBuilder sb = new StringBuilder("creature card with at least one subtype from: "); - for (String subType : creature.getSubtype()) { - filter.getSubtype().add(subType); - sb.append(subType).append(", "); + ArrayList> subtypes = new ArrayList>(); + for (String subtype : creature.getSubtype()) { + subtypes.add(new SubtypePredicate(subtype)); + sb.append(subtype).append(", "); } - filter.setScopeSubtype(ComparisonScope.Any); + filter.add(Predicates.or(subtypes)); sb.delete(sb.length() - 2, sb.length()); filter.setMessage(sb.toString()); diff --git a/Mage.Sets/src/mage/sets/darkascension/ChosenOfMarkov.java b/Mage.Sets/src/mage/sets/darkascension/ChosenOfMarkov.java index 99b0f07677..89d676b6de 100644 --- a/Mage.Sets/src/mage/sets/darkascension/ChosenOfMarkov.java +++ b/Mage.Sets/src/mage/sets/darkascension/ChosenOfMarkov.java @@ -40,8 +40,8 @@ import mage.abilities.costs.common.TapTargetCost; import mage.abilities.effects.common.TransformSourceEffect; import mage.abilities.keyword.TransformAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetControlledPermanent; /** @@ -54,8 +54,7 @@ public class ChosenOfMarkov extends CardImpl { static { filter.setUseTapped(true); filter.setTapped(false); - filter.getSubtype().add("Vampire"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Vampire")); } public ChosenOfMarkov(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/darkascension/CurseOfMisfortunes.java b/Mage.Sets/src/mage/sets/darkascension/CurseOfMisfortunes.java index 13b1a17b7c..5549efcb57 100644 --- a/Mage.Sets/src/mage/sets/darkascension/CurseOfMisfortunes.java +++ b/Mage.Sets/src/mage/sets/darkascension/CurseOfMisfortunes.java @@ -41,6 +41,7 @@ import mage.cards.CardImpl; import mage.filter.FilterCard; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.NamePredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; @@ -97,7 +98,7 @@ class CurseOfMisfortunesEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { FilterCard filter = new FilterCard("Curse card that doesn't have the same name as a Curse attached to enchanted player"); - filter.getSubtype().add("Curse"); + filter.add(new SubtypePredicate("Curse")); Permanent enchantment = game.getPermanent(source.getSourceId()); if (enchantment != null && enchantment.getAttachedTo() != null) { Player targetPlayer = game.getPlayer(enchantment.getAttachedTo()); diff --git a/Mage.Sets/src/mage/sets/darkascension/DerangedOutcast.java b/Mage.Sets/src/mage/sets/darkascension/DerangedOutcast.java index 7fafdd650e..80aee0290f 100644 --- a/Mage.Sets/src/mage/sets/darkascension/DerangedOutcast.java +++ b/Mage.Sets/src/mage/sets/darkascension/DerangedOutcast.java @@ -40,8 +40,8 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.counter.AddCountersTargetEffect; import mage.cards.CardImpl; import mage.counters.CounterType; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetCreaturePermanent; @@ -53,8 +53,7 @@ public class DerangedOutcast extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("a Human"); static { - filter.getSubtype().add("Human"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Human")); } public DerangedOutcast(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/darkascension/DiregrafCaptain.java b/Mage.Sets/src/mage/sets/darkascension/DiregrafCaptain.java index 1c28ff3ba8..6e70b7604a 100644 --- a/Mage.Sets/src/mage/sets/darkascension/DiregrafCaptain.java +++ b/Mage.Sets/src/mage/sets/darkascension/DiregrafCaptain.java @@ -37,8 +37,8 @@ import mage.abilities.effects.common.LoseLifeTargetEffect; import mage.abilities.effects.common.continious.BoostControlledEffect; import mage.abilities.keyword.DeathtouchAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.ZoneChangeEvent; @@ -56,8 +56,7 @@ public class DiregrafCaptain extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Zombie"); static { - filter.getSubtype().add("Zombie"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Zombie")); } public DiregrafCaptain(UUID ownerId) { @@ -93,8 +92,7 @@ class DiregrafCaptainTriggeredAbility extends TriggeredAbilityImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Spirit"); static { - filter.getSubtype().add("Spirit"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Spirit")); } public DrogskolCaptain(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/darkascension/FiendOfTheShadows.java b/Mage.Sets/src/mage/sets/darkascension/FiendOfTheShadows.java index 787a824584..c079135c1d 100644 --- a/Mage.Sets/src/mage/sets/darkascension/FiendOfTheShadows.java +++ b/Mage.Sets/src/mage/sets/darkascension/FiendOfTheShadows.java @@ -43,9 +43,9 @@ import mage.abilities.effects.common.RegenerateSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.Card; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterCard; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.ExileZone; import mage.game.Game; import mage.target.common.TargetControlledCreaturePermanent; @@ -61,8 +61,7 @@ public class FiendOfTheShadows extends CardImpl { private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("a human"); static { - filter.getSubtype().add("Human"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Human")); } public FiendOfTheShadows(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/darkascension/Gravecrawler.java b/Mage.Sets/src/mage/sets/darkascension/Gravecrawler.java index 37cb8735c2..22548bc993 100644 --- a/Mage.Sets/src/mage/sets/darkascension/Gravecrawler.java +++ b/Mage.Sets/src/mage/sets/darkascension/Gravecrawler.java @@ -38,8 +38,8 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.AsThoughEffectImpl; import mage.cards.Card; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import java.util.UUID; @@ -82,8 +82,7 @@ class GravecrawlerPlayEffect extends AsThoughEffectImpl private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("zombie"); static { - filter.getSubtype().add("Zombie"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Zombie")); } public GravecrawlerPlayEffect() { diff --git a/Mage.Sets/src/mage/sets/darkascension/HavengulRunebinder.java b/Mage.Sets/src/mage/sets/darkascension/HavengulRunebinder.java index ca508da5b3..9f5832ddf7 100644 --- a/Mage.Sets/src/mage/sets/darkascension/HavengulRunebinder.java +++ b/Mage.Sets/src/mage/sets/darkascension/HavengulRunebinder.java @@ -40,9 +40,9 @@ import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.counter.AddCountersAllEffect; import mage.cards.CardImpl; import mage.counters.CounterType; -import mage.filter.Filter; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterCreatureCard; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.permanent.token.ZombieToken; import mage.target.common.TargetCardInYourGraveyard; @@ -56,8 +56,7 @@ public class HavengulRunebinder extends CardImpl { private static final FilterControlledCreaturePermanent filterPermanent = new FilterControlledCreaturePermanent("Zombie creature you control"); static { - filterPermanent.getSubtype().add("Zombie"); - filterPermanent.setScopeSubtype(Filter.ComparisonScope.Any); + filterPermanent.add(new SubtypePredicate("Zombie")); } public HavengulRunebinder(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/darkascension/Immerwolf.java b/Mage.Sets/src/mage/sets/darkascension/Immerwolf.java index 7389c825ae..88d75da756 100644 --- a/Mage.Sets/src/mage/sets/darkascension/Immerwolf.java +++ b/Mage.Sets/src/mage/sets/darkascension/Immerwolf.java @@ -37,8 +37,9 @@ import mage.abilities.effects.ReplacementEffectImpl; import mage.abilities.effects.common.continious.BoostControlledEffect; import mage.abilities.keyword.IntimidateAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; @@ -54,9 +55,7 @@ public class Immerwolf extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("Wolf and Werewolf creatures"); static { - filter.getSubtype().add("Wolf"); - filter.getSubtype().add("Werewolf"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(Predicates.or(new SubtypePredicate("Wolf"), new SubtypePredicate("Werewolf"))); } public Immerwolf(UUID ownerId) { @@ -95,11 +94,8 @@ class ImmerwolfEffect extends ReplacementEffectImpl { private final static FilterCreaturePermanent filterNonhuman = new FilterCreaturePermanent("Non-human creature"); static { - filterWerewolf.getSubtype().add("Werewolf"); - filterWerewolf.setScopeSubtype(Filter.ComparisonScope.Any); - filterNonhuman.getSubtype().add("Human"); - filterNonhuman.setScopeSubtype(Filter.ComparisonScope.Any); - filterNonhuman.setNotFilter(true); + filterWerewolf.add(new SubtypePredicate("Werewolf")); + filterNonhuman.add(Predicates.not(new SubtypePredicate("Human"))); } public ImmerwolfEffect() { diff --git a/Mage.Sets/src/mage/sets/darkascension/MikaeusTheUnhallowed.java b/Mage.Sets/src/mage/sets/darkascension/MikaeusTheUnhallowed.java index 9e11ff19a9..c256c3c561 100644 --- a/Mage.Sets/src/mage/sets/darkascension/MikaeusTheUnhallowed.java +++ b/Mage.Sets/src/mage/sets/darkascension/MikaeusTheUnhallowed.java @@ -42,6 +42,8 @@ import mage.abilities.keyword.IntimidateAbility; import mage.abilities.keyword.UndyingAbility; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; @@ -56,8 +58,7 @@ public class MikaeusTheUnhallowed extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("non-Human creatures"); static { - filter.getSubtype().add("Human"); - filter.setNotSubtype(true); + filter.add(Predicates.not(new SubtypePredicate("Human"))); } public MikaeusTheUnhallowed(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/darkascension/RavenousDemon.java b/Mage.Sets/src/mage/sets/darkascension/RavenousDemon.java index 6f5da931ae..cd24f74ec7 100644 --- a/Mage.Sets/src/mage/sets/darkascension/RavenousDemon.java +++ b/Mage.Sets/src/mage/sets/darkascension/RavenousDemon.java @@ -35,22 +35,21 @@ import mage.MageInt; import mage.abilities.common.ActivateAsSorceryActivatedAbility; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.effects.common.TransformSourceEffect; -import mage.cards.CardImpl; import mage.abilities.keyword.TransformAbility; -import mage.filter.Filter; +import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetControlledPermanent; /** * - * @author anonymous + * @author intimidatingant */ public class RavenousDemon extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("Human"); static { - filter.getSubtype().add("Human"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Human")); } public RavenousDemon(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/darkascension/RequiemAngel.java b/Mage.Sets/src/mage/sets/darkascension/RequiemAngel.java index dc32eae6cc..113ae2309f 100644 --- a/Mage.Sets/src/mage/sets/darkascension/RequiemAngel.java +++ b/Mage.Sets/src/mage/sets/darkascension/RequiemAngel.java @@ -35,19 +35,20 @@ import mage.abilities.common.DiesAnotherCreatureYouControlTriggeredAbility; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.game.permanent.token.SpiritWhiteToken; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.permanent.token.SpiritWhiteToken; /** * * @author intimidatingant */ public class RequiemAngel extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Human creatures"); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("non-Spirit creature"); static { - filter.getSubtype().add("Spirit"); - filter.setNotSubtype(true); + filter.add(Predicates.not(new SubtypePredicate("Spirit"))); } public RequiemAngel(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/darkascension/ScorchTheFields.java b/Mage.Sets/src/mage/sets/darkascension/ScorchTheFields.java index b4d6577770..817d417cd7 100644 --- a/Mage.Sets/src/mage/sets/darkascension/ScorchTheFields.java +++ b/Mage.Sets/src/mage/sets/darkascension/ScorchTheFields.java @@ -34,6 +34,7 @@ import mage.abilities.effects.common.DamageAllEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetLandPermanent; /** @@ -45,7 +46,7 @@ public class ScorchTheFields extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Human creature"); static { - filter.getSubtype().add("Human"); + filter.add(new SubtypePredicate("Human")); } public ScorchTheFields(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/darkascension/SkirsdagFlayer.java b/Mage.Sets/src/mage/sets/darkascension/SkirsdagFlayer.java index bd3b96f201..11f32edef2 100644 --- a/Mage.Sets/src/mage/sets/darkascension/SkirsdagFlayer.java +++ b/Mage.Sets/src/mage/sets/darkascension/SkirsdagFlayer.java @@ -40,6 +40,7 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetCreaturePermanent; @@ -52,7 +53,7 @@ public class SkirsdagFlayer extends CardImpl { private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Human"); static { - filter.getSubtype().add("Human"); + filter.add(new SubtypePredicate("Human")); } public SkirsdagFlayer(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/darkascension/StromkirkCaptain.java b/Mage.Sets/src/mage/sets/darkascension/StromkirkCaptain.java index d993f7de9d..df1b768a3f 100644 --- a/Mage.Sets/src/mage/sets/darkascension/StromkirkCaptain.java +++ b/Mage.Sets/src/mage/sets/darkascension/StromkirkCaptain.java @@ -38,8 +38,8 @@ import mage.abilities.effects.common.continious.BoostControlledEffect; import mage.abilities.effects.common.continious.GainAbilityControlledEffect; import mage.abilities.keyword.FirstStrikeAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -49,8 +49,7 @@ public class StromkirkCaptain extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Vampire creatures"); static { - filter.getSubtype().add("Vampire"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Vampire")); } public StromkirkCaptain(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/darkascension/WolfhuntersQuiver.java b/Mage.Sets/src/mage/sets/darkascension/WolfhuntersQuiver.java index df2fd8218f..5381b8fab1 100644 --- a/Mage.Sets/src/mage/sets/darkascension/WolfhuntersQuiver.java +++ b/Mage.Sets/src/mage/sets/darkascension/WolfhuntersQuiver.java @@ -42,6 +42,7 @@ import mage.abilities.effects.common.continious.GainAbilityAttachedEffect; import mage.abilities.keyword.EquipAbility; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.Target; import mage.target.common.TargetCreatureOrPlayer; import mage.target.common.TargetCreaturePermanent; @@ -55,7 +56,7 @@ public class WolfhuntersQuiver extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Werewolf creature"); static { - filter.getSubtype().add("Werewolf"); + filter.add(new SubtypePredicate("Werewolf")); } public WolfhuntersQuiver(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/darkascension/ZombieApocalypse.java b/Mage.Sets/src/mage/sets/darkascension/ZombieApocalypse.java index db3acadfb3..477f82908f 100644 --- a/Mage.Sets/src/mage/sets/darkascension/ZombieApocalypse.java +++ b/Mage.Sets/src/mage/sets/darkascension/ZombieApocalypse.java @@ -35,9 +35,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.FilterCreatureCard; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -74,10 +74,8 @@ class ZombieApocalypseEffect extends OneShotEffect { private static final FilterCreaturePermanent filterHuman = new FilterCreaturePermanent(); static { - filterZombie.getSubtype().add("Zombie"); - filterZombie.setScopeSubtype(Filter.ComparisonScope.Any); - filterHuman.getSubtype().add("Human"); - filterHuman.setScopeSubtype(Filter.ComparisonScope.Any); + filterZombie.add(new SubtypePredicate("Zombie")); + filterHuman.add(new SubtypePredicate("Human")); } public ZombieApocalypseEffect() { diff --git a/Mage.Sets/src/mage/sets/darksteel/BlinkmothNexus.java b/Mage.Sets/src/mage/sets/darksteel/BlinkmothNexus.java index 76e43483ee..43ff17f0f0 100644 --- a/Mage.Sets/src/mage/sets/darksteel/BlinkmothNexus.java +++ b/Mage.Sets/src/mage/sets/darksteel/BlinkmothNexus.java @@ -44,8 +44,8 @@ import mage.abilities.effects.common.continious.BoostTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.abilities.mana.ColorlessManaAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.permanent.token.Token; import mage.target.TargetPermanent; @@ -57,8 +57,7 @@ public class BlinkmothNexus extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("Blinkmoth"); static { - filter.getSubtype().add("Blinkmoth"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Blinkmoth")); } public BlinkmothNexus(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/darksteel/MyrMatrix.java b/Mage.Sets/src/mage/sets/darksteel/MyrMatrix.java index 2027412da2..e35d951081 100644 --- a/Mage.Sets/src/mage/sets/darksteel/MyrMatrix.java +++ b/Mage.Sets/src/mage/sets/darksteel/MyrMatrix.java @@ -40,8 +40,8 @@ import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.continious.BoostAllEffect; import mage.abilities.keyword.IndestructibleAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.permanent.token.MyrToken; /** @@ -53,8 +53,7 @@ public class MyrMatrix extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("Myr"); static { - filter.getSubtype().add("Myr"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Myr")); } public MyrMatrix (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/darksteel/SteelshaperApprentice.java b/Mage.Sets/src/mage/sets/darksteel/SteelshaperApprentice.java index 2a22011844..a8c6e5f363 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.SubtypePredicate; import mage.target.common.TargetCardInLibrary; /** @@ -53,7 +54,7 @@ public class SteelshaperApprentice extends CardImpl { static { filter.getCardType().add(CardType.ARTIFACT); - filter.getSubtype().add("Equipment"); + filter.add(new SubtypePredicate("Equipment")); } public SteelshaperApprentice(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/darksteel/WandOfTheElements.java b/Mage.Sets/src/mage/sets/darksteel/WandOfTheElements.java index 02549c7449..428f6e92ba 100644 --- a/Mage.Sets/src/mage/sets/darksteel/WandOfTheElements.java +++ b/Mage.Sets/src/mage/sets/darksteel/WandOfTheElements.java @@ -41,8 +41,8 @@ import mage.abilities.costs.common.TapSourceCost; 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.SubtypePredicate; import mage.game.permanent.token.Token; import mage.target.common.TargetControlledPermanent; @@ -55,10 +55,8 @@ public class WandOfTheElements extends CardImpl { private static final FilterControlledPermanent mountainFilter = new FilterControlledPermanent("a Mountain"); static { - islandFilter.getSubtype().add("Island"); - islandFilter.setScopeSubtype(Filter.ComparisonScope.Any); - mountainFilter.getSubtype().add("Mountain"); - mountainFilter.setScopeSubtype(Filter.ComparisonScope.Any); + islandFilter.add(new SubtypePredicate("Island")); + mountainFilter.add(new SubtypePredicate("Mountain")); } public WandOfTheElements(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/dissension/HaazdaExonerator.java b/Mage.Sets/src/mage/sets/dissension/HaazdaExonerator.java index 04fa5c0c24..2fd8374f4c 100644 --- a/Mage.Sets/src/mage/sets/dissension/HaazdaExonerator.java +++ b/Mage.Sets/src/mage/sets/dissension/HaazdaExonerator.java @@ -39,8 +39,8 @@ import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.TargetPermanent; /** @@ -52,8 +52,7 @@ public class HaazdaExonerator extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("Aura"); static { - filter.getSubtype().add("Aura"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Aura")); } public HaazdaExonerator(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/elspethvstezzeret/DaruEncampment.java b/Mage.Sets/src/mage/sets/elspethvstezzeret/DaruEncampment.java index 5658df4fb1..88edc2d006 100644 --- a/Mage.Sets/src/mage/sets/elspethvstezzeret/DaruEncampment.java +++ b/Mage.Sets/src/mage/sets/elspethvstezzeret/DaruEncampment.java @@ -39,6 +39,7 @@ import mage.abilities.effects.common.continious.BoostTargetEffect; import mage.abilities.mana.ColorlessManaAbility; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -50,7 +51,7 @@ public class DaruEncampment extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Soldier creature"); static { - filter.getSubtype().add("Soldier"); + filter.add(new SubtypePredicate("Soldier")); } public DaruEncampment(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/elspethvstezzeret/MishrasFactory.java b/Mage.Sets/src/mage/sets/elspethvstezzeret/MishrasFactory.java index 3da3ca049d..ee67a7c42d 100644 --- a/Mage.Sets/src/mage/sets/elspethvstezzeret/MishrasFactory.java +++ b/Mage.Sets/src/mage/sets/elspethvstezzeret/MishrasFactory.java @@ -41,6 +41,7 @@ import mage.abilities.effects.common.continious.BoostTargetEffect; import mage.abilities.mana.ColorlessManaAbility; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.permanent.token.Token; import mage.target.common.TargetCreaturePermanent; @@ -53,7 +54,7 @@ public class MishrasFactory extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Assembly-Worker creature"); static { - filter.getSubtype().add("Assembly-Worker"); + filter.add(new SubtypePredicate("Assembly-Worker")); } public MishrasFactory(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/elspethvstezzeret/Pentavus.java b/Mage.Sets/src/mage/sets/elspethvstezzeret/Pentavus.java index 11639c3c1a..34cb33f0fd 100644 --- a/Mage.Sets/src/mage/sets/elspethvstezzeret/Pentavus.java +++ b/Mage.Sets/src/mage/sets/elspethvstezzeret/Pentavus.java @@ -44,8 +44,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.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.permanent.token.Token; import mage.target.common.TargetControlledPermanent; @@ -58,8 +58,7 @@ public class Pentavus extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("Pentavite"); static { - filter.getSubtype().add("Pentavite"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Pentavite")); } public Pentavus(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/fifthdawn/BeaconOfCreation.java b/Mage.Sets/src/mage/sets/fifthdawn/BeaconOfCreation.java index fe2255e82c..eb078641ec 100644 --- a/Mage.Sets/src/mage/sets/fifthdawn/BeaconOfCreation.java +++ b/Mage.Sets/src/mage/sets/fifthdawn/BeaconOfCreation.java @@ -34,8 +34,8 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.ShuffleSpellEffect; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.permanent.token.InsectToken; /** @@ -47,8 +47,7 @@ public class BeaconOfCreation extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("Forest you control"); static { - filter.getSubtype().add("Forest"); - filter.setScopeSubtype(ComparisonScope.Any); + filter.add(new SubtypePredicate("Forest")); } public BeaconOfCreation(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/guildpact/SkeletalVampire.java b/Mage.Sets/src/mage/sets/guildpact/SkeletalVampire.java index d16cbaf16d..8213fca664 100644 --- a/Mage.Sets/src/mage/sets/guildpact/SkeletalVampire.java +++ b/Mage.Sets/src/mage/sets/guildpact/SkeletalVampire.java @@ -42,8 +42,8 @@ import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.RegenerateSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.permanent.token.Token; import mage.target.common.TargetControlledCreaturePermanent; @@ -56,8 +56,7 @@ public class SkeletalVampire extends CardImpl { private final static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("a Bat"); static { - filter.getSubtype().add("Bat"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Bat")); } public SkeletalVampire(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/innistrad/AngelOfFlightAlabaster.java b/Mage.Sets/src/mage/sets/innistrad/AngelOfFlightAlabaster.java index 9fef330bc9..1d034ac5e7 100644 --- a/Mage.Sets/src/mage/sets/innistrad/AngelOfFlightAlabaster.java +++ b/Mage.Sets/src/mage/sets/innistrad/AngelOfFlightAlabaster.java @@ -7,8 +7,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.FilterCard; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.Target; import mage.target.common.TargetCardInYourGraveyard; @@ -18,8 +18,7 @@ public class AngelOfFlightAlabaster extends CardImpl { private static final FilterCard filter = new FilterCard("Spirit card from your graveyard"); static { - filter.getSubtype().add("Spirit"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Spirit")); } public AngelOfFlightAlabaster(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/innistrad/AngelicOverseer.java b/Mage.Sets/src/mage/sets/innistrad/AngelicOverseer.java index f51b69c8b6..e5520b3b08 100644 --- a/Mage.Sets/src/mage/sets/innistrad/AngelicOverseer.java +++ b/Mage.Sets/src/mage/sets/innistrad/AngelicOverseer.java @@ -38,8 +38,8 @@ import mage.abilities.decorator.ConditionalContinousEffect; import mage.abilities.effects.common.continious.GainAbilitySourceEffect; import mage.abilities.keyword.*; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -52,8 +52,7 @@ public class AngelicOverseer extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("Human"); static { - filter.getSubtype().add("Human"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Human")); } public AngelicOverseer(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/innistrad/AvacynianPriest.java b/Mage.Sets/src/mage/sets/innistrad/AvacynianPriest.java index 6f71933296..5c7c162d8e 100644 --- a/Mage.Sets/src/mage/sets/innistrad/AvacynianPriest.java +++ b/Mage.Sets/src/mage/sets/innistrad/AvacynianPriest.java @@ -39,6 +39,8 @@ import mage.abilities.effects.common.TapTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; import mage.target.common.TargetCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; import java.util.UUID; @@ -50,8 +52,7 @@ public class AvacynianPriest extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("non-Human creature"); static { - filter.getSubtype().add("Human"); - filter.setNotSubtype(true); + filter.add(Predicates.not(new SubtypePredicate("Human"))); } public AvacynianPriest(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/innistrad/BattlegroundGeist.java b/Mage.Sets/src/mage/sets/innistrad/BattlegroundGeist.java index 276c1d0fac..aa06760848 100644 --- a/Mage.Sets/src/mage/sets/innistrad/BattlegroundGeist.java +++ b/Mage.Sets/src/mage/sets/innistrad/BattlegroundGeist.java @@ -35,8 +35,8 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.continious.BoostControlledEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import java.util.UUID; @@ -48,8 +48,7 @@ public class BattlegroundGeist extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("Spirit creatures"); static { - filter.getSubtype().add("Spirit"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Spirit")); } public BattlegroundGeist(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/innistrad/BitterheartWitch.java b/Mage.Sets/src/mage/sets/innistrad/BitterheartWitch.java index 454703c382..c527061a7d 100644 --- a/Mage.Sets/src/mage/sets/innistrad/BitterheartWitch.java +++ b/Mage.Sets/src/mage/sets/innistrad/BitterheartWitch.java @@ -41,6 +41,7 @@ import mage.abilities.keyword.DeathtouchAbility; import mage.cards.Card; import mage.cards.CardImpl; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.players.Player; import mage.target.TargetPlayer; @@ -86,7 +87,7 @@ class BitterheartWitchEffect extends OneShotEffect { private final static FilterCard filter = new FilterCard("Curse card in your library"); static { - filter.getSubtype().add("Curse"); + filter.add(new SubtypePredicate("Curse")); } public BitterheartWitchEffect() { diff --git a/Mage.Sets/src/mage/sets/innistrad/BloodlineKeeper.java b/Mage.Sets/src/mage/sets/innistrad/BloodlineKeeper.java index e9dfbc7f36..4cfa8fbe55 100644 --- a/Mage.Sets/src/mage/sets/innistrad/BloodlineKeeper.java +++ b/Mage.Sets/src/mage/sets/innistrad/BloodlineKeeper.java @@ -43,8 +43,8 @@ import mage.abilities.effects.common.TransformSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.TransformAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.permanent.token.Token; @@ -102,8 +102,7 @@ class ControlFiveVampiresCost extends CostImpl { private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(); static { - filter.getSubtype().add("Vampire"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Vampire")); } public ControlFiveVampiresCost() { diff --git a/Mage.Sets/src/mage/sets/innistrad/CharmbreakerDevils.java b/Mage.Sets/src/mage/sets/innistrad/CharmbreakerDevils.java index 206473fb2e..f110b242a5 100644 --- a/Mage.Sets/src/mage/sets/innistrad/CharmbreakerDevils.java +++ b/Mage.Sets/src/mage/sets/innistrad/CharmbreakerDevils.java @@ -60,7 +60,6 @@ public class CharmbreakerDevils extends CardImpl { static { filter.getCardType().add(CardType.INSTANT); filter.getCardType().add(CardType.SORCERY); - filter.setScopeSubtype(ComparisonScope.Any); } public CharmbreakerDevils(UUID ownerId) { @@ -111,7 +110,6 @@ class CharmbreakerDevilsEffect extends OneShotEffect { FilterCard filter = new FilterCard("instant or sorcery card"); filter.getCardType().add(CardType.INSTANT); filter.getCardType().add(CardType.SORCERY); - filter.setScopeSubtype(ComparisonScope.Any); 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/ClifftopRetreat.java b/Mage.Sets/src/mage/sets/innistrad/ClifftopRetreat.java index 547b990c5b..bed121f05c 100644 --- a/Mage.Sets/src/mage/sets/innistrad/ClifftopRetreat.java +++ b/Mage.Sets/src/mage/sets/innistrad/ClifftopRetreat.java @@ -39,8 +39,9 @@ import mage.abilities.effects.common.TapSourceEffect; import mage.abilities.mana.RedManaAbility; import mage.abilities.mana.WhiteManaAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; import java.util.UUID; @@ -52,10 +53,7 @@ public class ClifftopRetreat extends CardImpl { private static final FilterLandPermanent filter = new FilterLandPermanent(); static { - filter.getSubtype().add("Mountain"); - filter.getSubtype().add("Plains"); - filter.setScopeSubtype(ComparisonScope.Any); - filter.setMessage("Mountain or a Plains"); + filter.add(Predicates.or(new SubtypePredicate("Mountain"), new SubtypePredicate("Plains"))); } public ClifftopRetreat(UUID ownerId) { @@ -63,7 +61,7 @@ public class ClifftopRetreat extends CardImpl { this.expansionSetCode = "ISD"; Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0)); - String abilityText = "tap it unless you control a " + filter.getMessage(); + String abilityText = "tap it unless you control a Mountain or a Plains"; this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); this.addAbility(new RedManaAbility()); this.addAbility(new WhiteManaAbility()); diff --git a/Mage.Sets/src/mage/sets/innistrad/DearlyDeparted.java b/Mage.Sets/src/mage/sets/innistrad/DearlyDeparted.java index e2bc697e54..0eac2d4f1c 100644 --- a/Mage.Sets/src/mage/sets/innistrad/DearlyDeparted.java +++ b/Mage.Sets/src/mage/sets/innistrad/DearlyDeparted.java @@ -41,8 +41,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.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import java.util.UUID; @@ -56,8 +56,7 @@ public class DearlyDeparted extends CardImpl { private static final String ruleText = "As long as Dearly Departed is in your graveyard, each Human creature you control enters the battlefield with an additional +1/+1 counter on it"; static { - filterHuman.getSubtype().add("Human"); - filterHuman.setScopeSubtype(Filter.ComparisonScope.Any); + filterHuman.add(new SubtypePredicate("Human")); } public DearlyDeparted(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/innistrad/EliteInquisitor.java b/Mage.Sets/src/mage/sets/innistrad/EliteInquisitor.java index 52cadf73b1..ee173983fd 100644 --- a/Mage.Sets/src/mage/sets/innistrad/EliteInquisitor.java +++ b/Mage.Sets/src/mage/sets/innistrad/EliteInquisitor.java @@ -34,9 +34,9 @@ import mage.abilities.keyword.FirstStrikeAbility; import mage.abilities.keyword.ProtectionAbility; import mage.abilities.keyword.VigilanceAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import java.util.UUID; @@ -50,12 +50,9 @@ public class EliteInquisitor extends CardImpl { private static final FilterPermanent filter3 = new FilterCreaturePermanent("Zombies"); static { - filter1.getSubtype().add("Vampire"); - filter2.getSubtype().add("Werewolf"); - filter3.getSubtype().add("Zombie"); - filter1.setScopeSubtype(Filter.ComparisonScope.Any); - filter2.setScopeSubtype(Filter.ComparisonScope.Any); - filter3.setScopeSubtype(Filter.ComparisonScope.Any); + filter1.add(new SubtypePredicate("Vampire")); + filter2.add(new SubtypePredicate("Werewolf")); + filter3.add(new SubtypePredicate("Zombie")); } public EliteInquisitor(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/innistrad/EndlessRanksOfTheDead.java b/Mage.Sets/src/mage/sets/innistrad/EndlessRanksOfTheDead.java index 4cbcb7e729..24392f4afd 100644 --- a/Mage.Sets/src/mage/sets/innistrad/EndlessRanksOfTheDead.java +++ b/Mage.Sets/src/mage/sets/innistrad/EndlessRanksOfTheDead.java @@ -36,6 +36,7 @@ import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.events.GameEvent.EventType; import mage.game.permanent.token.ZombieToken; @@ -73,7 +74,7 @@ class HalfZombiesCount implements DynamicValue { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); static { - filter.getSubtype().add("Zombie"); + filter.add(new SubtypePredicate("Zombie")); } public static HalfZombiesCount getInstance() { diff --git a/Mage.Sets/src/mage/sets/innistrad/FullMoonsRise.java b/Mage.Sets/src/mage/sets/innistrad/FullMoonsRise.java index 9db3301238..0d06301106 100644 --- a/Mage.Sets/src/mage/sets/innistrad/FullMoonsRise.java +++ b/Mage.Sets/src/mage/sets/innistrad/FullMoonsRise.java @@ -41,9 +41,9 @@ import mage.abilities.effects.common.continious.BoostControlledEffect; import mage.abilities.effects.common.continious.GainAbilityControlledEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; @@ -58,8 +58,7 @@ public class FullMoonsRise extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Werewolf creatures"); static { - filter.getSubtype().add("Werewolf"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Werewolf")); } public FullMoonsRise(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/innistrad/GallowsWarden.java b/Mage.Sets/src/mage/sets/innistrad/GallowsWarden.java index 08ce6d5641..03afa754d3 100644 --- a/Mage.Sets/src/mage/sets/innistrad/GallowsWarden.java +++ b/Mage.Sets/src/mage/sets/innistrad/GallowsWarden.java @@ -36,6 +36,7 @@ import mage.abilities.effects.common.continious.BoostControlledEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import java.util.UUID; @@ -47,7 +48,7 @@ public class GallowsWarden extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Spirit creatures"); static { - filter.getSubtype().add("Spirit"); + filter.add(new SubtypePredicate("Spirit")); } public GallowsWarden(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/innistrad/GhoulcallersChant.java b/Mage.Sets/src/mage/sets/innistrad/GhoulcallersChant.java index 4bd20936cd..81ed570938 100644 --- a/Mage.Sets/src/mage/sets/innistrad/GhoulcallersChant.java +++ b/Mage.Sets/src/mage/sets/innistrad/GhoulcallersChant.java @@ -33,9 +33,9 @@ import mage.Constants.Rarity; import mage.abilities.Mode; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; import mage.filter.common.FilterCreatureCard; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCardInYourGraveyard; /** @@ -47,8 +47,7 @@ public class GhoulcallersChant extends CardImpl { private static final FilterCard filter = new FilterCard("Zombie cards from your graveyard"); static { - filter.getSubtype().add("Zombie"); - filter.setScopeSubtype(ComparisonScope.Any); + filter.add(new SubtypePredicate("Zombie")); } public GhoulcallersChant(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/innistrad/Ghoulraiser.java b/Mage.Sets/src/mage/sets/innistrad/Ghoulraiser.java index 1b2f380b57..a6739fad25 100644 --- a/Mage.Sets/src/mage/sets/innistrad/Ghoulraiser.java +++ b/Mage.Sets/src/mage/sets/innistrad/Ghoulraiser.java @@ -39,8 +39,8 @@ import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.players.Player; @@ -94,8 +94,7 @@ class GhoulraiserEffect extends OneShotEffect { Player player = game.getPlayer(source.getControllerId()); if (player != null) { FilterCard filter = new FilterCard("Zombie card"); - filter.getSubtype().add("Zombie"); - filter.setScopeSubtype(ComparisonScope.Any); + filter.add(new SubtypePredicate("Zombie")); 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/GraveBramble.java b/Mage.Sets/src/mage/sets/innistrad/GraveBramble.java index fb8aab1aca..e3bc5a8461 100644 --- a/Mage.Sets/src/mage/sets/innistrad/GraveBramble.java +++ b/Mage.Sets/src/mage/sets/innistrad/GraveBramble.java @@ -34,9 +34,9 @@ import mage.MageInt; import mage.abilities.keyword.DefenderAbility; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterPermanent; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -47,8 +47,7 @@ public class GraveBramble extends CardImpl { private static final FilterPermanent filter = new FilterCreaturePermanent("Zombies"); static { - filter.getSubtype().add("Zombie"); - filter.setScopeSubtype(ComparisonScope.Any); + filter.add(new SubtypePredicate("Zombie")); } public GraveBramble(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/innistrad/HamletCaptain.java b/Mage.Sets/src/mage/sets/innistrad/HamletCaptain.java index 6ece35514e..0f8681a6de 100644 --- a/Mage.Sets/src/mage/sets/innistrad/HamletCaptain.java +++ b/Mage.Sets/src/mage/sets/innistrad/HamletCaptain.java @@ -36,6 +36,7 @@ import mage.abilities.common.AttacksOrBlocksTriggeredAbility; import mage.abilities.effects.common.continious.BoostControlledEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -46,7 +47,7 @@ public class HamletCaptain extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Human creatures you control"); static { - filter.getSubtype().add("Human"); + filter.add(new SubtypePredicate("Human")); } public HamletCaptain(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/innistrad/HinterlandHarbor.java b/Mage.Sets/src/mage/sets/innistrad/HinterlandHarbor.java index 85c80e4137..d144540628 100644 --- a/Mage.Sets/src/mage/sets/innistrad/HinterlandHarbor.java +++ b/Mage.Sets/src/mage/sets/innistrad/HinterlandHarbor.java @@ -39,8 +39,9 @@ import mage.abilities.effects.common.TapSourceEffect; import mage.abilities.mana.BlueManaAbility; import mage.abilities.mana.GreenManaAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; import java.util.UUID; @@ -52,10 +53,7 @@ public class HinterlandHarbor extends CardImpl { private static final FilterLandPermanent filter = new FilterLandPermanent(); static { - filter.getSubtype().add("Forest"); - filter.getSubtype().add("Island"); - filter.setScopeSubtype(ComparisonScope.Any); - filter.setMessage("Forest or an Island"); + filter.add(Predicates.or(new SubtypePredicate("Forest"), new SubtypePredicate("Island"))); } public HinterlandHarbor(UUID ownerId) { @@ -63,7 +61,7 @@ public class HinterlandHarbor extends CardImpl { this.expansionSetCode = "ISD"; Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0)); - String abilityText = "tap it unless you control a " + filter.getMessage(); + String abilityText = "tap it unless you control a Forest or an Island"; this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); this.addAbility(new GreenManaAbility()); this.addAbility(new BlueManaAbility()); diff --git a/Mage.Sets/src/mage/sets/innistrad/HowlpackAlpha.java b/Mage.Sets/src/mage/sets/innistrad/HowlpackAlpha.java index 96b0af4e35..7129c66e4d 100644 --- a/Mage.Sets/src/mage/sets/innistrad/HowlpackAlpha.java +++ b/Mage.Sets/src/mage/sets/innistrad/HowlpackAlpha.java @@ -41,8 +41,9 @@ import mage.abilities.effects.common.TransformSourceEffect; import mage.abilities.effects.common.continious.BoostControlledEffect; import mage.abilities.keyword.TransformAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.permanent.token.WolfToken; import java.util.UUID; @@ -58,9 +59,7 @@ public class HowlpackAlpha extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Werewolf and Wolf creatures"); static { - filter.getSubtype().add("Werewolf"); - filter.getSubtype().add("Wolf"); - filter.setScopeSubtype(ComparisonScope.Any); + filter.add(Predicates.or(new SubtypePredicate("Werewolf"), new SubtypePredicate("Wolf"))); } public HowlpackAlpha(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/innistrad/IsolatedChapel.java b/Mage.Sets/src/mage/sets/innistrad/IsolatedChapel.java index 6b3fce6221..e73f77fe64 100644 --- a/Mage.Sets/src/mage/sets/innistrad/IsolatedChapel.java +++ b/Mage.Sets/src/mage/sets/innistrad/IsolatedChapel.java @@ -39,8 +39,9 @@ import mage.abilities.effects.common.TapSourceEffect; import mage.abilities.mana.BlackManaAbility; import mage.abilities.mana.WhiteManaAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; import java.util.UUID; @@ -52,10 +53,7 @@ public class IsolatedChapel extends CardImpl { private static final FilterLandPermanent filter = new FilterLandPermanent(); static { - filter.getSubtype().add("Plains"); - filter.getSubtype().add("Swamp"); - filter.setScopeSubtype(ComparisonScope.Any); - filter.setMessage("Plains or a Swamp"); + filter.add(Predicates.or(new SubtypePredicate("Plains"), new SubtypePredicate("Swamp"))); } public IsolatedChapel(UUID ownerId) { @@ -63,7 +61,7 @@ public class IsolatedChapel extends CardImpl { this.expansionSetCode = "ISD"; Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0)); - String abilityText = "tap it unless you control a " + filter.getMessage(); + String abilityText = "tap it unless you control a Plains or a Swamp"; this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); this.addAbility(new WhiteManaAbility()); this.addAbility(new BlackManaAbility()); diff --git a/Mage.Sets/src/mage/sets/innistrad/LordOfLineage.java b/Mage.Sets/src/mage/sets/innistrad/LordOfLineage.java index 09e74e4c14..22a8618773 100644 --- a/Mage.Sets/src/mage/sets/innistrad/LordOfLineage.java +++ b/Mage.Sets/src/mage/sets/innistrad/LordOfLineage.java @@ -29,9 +29,10 @@ package mage.sets.innistrad; import java.util.UUID; -import mage.Constants; import mage.Constants.CardType; +import mage.Constants.Duration; import mage.Constants.Rarity; +import mage.Constants.Zone; import mage.MageInt; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleStaticAbility; @@ -40,8 +41,8 @@ import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.continious.BoostControlledEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -51,8 +52,7 @@ public class LordOfLineage extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); static { - filter.getSubtype().add("Vampire"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Vampire")); } public LordOfLineage(UUID ownerId) { @@ -69,10 +69,10 @@ public class LordOfLineage extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // Other Vampire creatures you control get +2/+2. - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostControlledEffect(2, 2, Constants.Duration.WhileOnBattlefield, filter, true))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(2, 2, Duration.WhileOnBattlefield, filter, true))); // {tap}: Put a 2/2 black Vampire creature token with flying onto the battlefield. // {tap}: Put a 2/2 black Vampire creature token with flying onto the battlefield. - this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new CreateTokenEffect(new VampireToken()), new TapSourceCost())); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new VampireToken()), new TapSourceCost())); } public LordOfLineage(final LordOfLineage card) { diff --git a/Mage.Sets/src/mage/sets/innistrad/MayorOfAvabruck.java b/Mage.Sets/src/mage/sets/innistrad/MayorOfAvabruck.java index be856ee285..d8c0b64d18 100644 --- a/Mage.Sets/src/mage/sets/innistrad/MayorOfAvabruck.java +++ b/Mage.Sets/src/mage/sets/innistrad/MayorOfAvabruck.java @@ -42,8 +42,8 @@ import mage.abilities.effects.common.TransformSourceEffect; import mage.abilities.effects.common.continious.BoostControlledEffect; import mage.abilities.keyword.TransformAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import java.util.UUID; @@ -58,8 +58,7 @@ public class MayorOfAvabruck extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Human creatures"); static { - filter.getSubtype().add("Human"); - filter.setScopeSubtype(ComparisonScope.Any); + filter.add(new SubtypePredicate("Human")); } public MayorOfAvabruck(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/innistrad/Moonmist.java b/Mage.Sets/src/mage/sets/innistrad/Moonmist.java index 1dfb629d2c..aad9110f40 100644 --- a/Mage.Sets/src/mage/sets/innistrad/Moonmist.java +++ b/Mage.Sets/src/mage/sets/innistrad/Moonmist.java @@ -36,8 +36,9 @@ import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.PreventAllDamageEffect; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; @@ -50,10 +51,8 @@ public class Moonmist extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures other than Werewolves and Wolves"); static { - filter.getSubtype().add("Werewolf"); - filter.getSubtype().add("Wolf"); - filter.setScopeSubtype(ComparisonScope.Any); - filter.setNotFilter(true); + filter.add(Predicates.not(new SubtypePredicate("Werewolf"))); + filter.add(Predicates.not(new SubtypePredicate("Wolf"))); } public Moonmist(UUID ownerId) { @@ -82,7 +81,7 @@ class MoonmistEffect extends OneShotEffect { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("humans"); static { - filter.getSubtype().add("Human"); + filter.add(new SubtypePredicate("Human")); } public MoonmistEffect() { diff --git a/Mage.Sets/src/mage/sets/innistrad/NightRevelers.java b/Mage.Sets/src/mage/sets/innistrad/NightRevelers.java index 0087477fdf..6c729374d2 100644 --- a/Mage.Sets/src/mage/sets/innistrad/NightRevelers.java +++ b/Mage.Sets/src/mage/sets/innistrad/NightRevelers.java @@ -43,6 +43,7 @@ import mage.game.Game; import java.util.Set; import java.util.UUID; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -83,7 +84,7 @@ class NightRevelersCondition implements Condition { public boolean apply(Game game, Ability source) { boolean conditionApplies = false; FilterPermanent filter = new FilterPermanent(); - filter.getSubtype().add("Human"); + filter.add(new SubtypePredicate("Human")); Set opponents = game.getOpponents(source.getControllerId()); for (UUID opponentId : opponents) { diff --git a/Mage.Sets/src/mage/sets/innistrad/OliviaVoldaren.java b/Mage.Sets/src/mage/sets/innistrad/OliviaVoldaren.java index 6a1d90c7c9..318df6de48 100644 --- a/Mage.Sets/src/mage/sets/innistrad/OliviaVoldaren.java +++ b/Mage.Sets/src/mage/sets/innistrad/OliviaVoldaren.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.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -53,14 +53,12 @@ import mage.target.common.TargetCreaturePermanent; */ public class OliviaVoldaren extends CardImpl { - private static FilterCreaturePermanent filter = new FilterCreaturePermanent("another creature"); - private static FilterCreaturePermanent vampireFilter = new FilterCreaturePermanent("Vampire"); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("another creature"); + private static final FilterCreaturePermanent vampireFilter = new FilterCreaturePermanent("Vampire"); static { filter.setAnother(true); - // - vampireFilter.getSubtype().add("Vampire"); - vampireFilter.setScopeSubtype(Filter.ComparisonScope.Any); + vampireFilter.add(new SubtypePredicate("Vampire")); } public OliviaVoldaren(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/innistrad/ReaperFromTheAbyss.java b/Mage.Sets/src/mage/sets/innistrad/ReaperFromTheAbyss.java index 39408dd3c2..2979058a8f 100644 --- a/Mage.Sets/src/mage/sets/innistrad/ReaperFromTheAbyss.java +++ b/Mage.Sets/src/mage/sets/innistrad/ReaperFromTheAbyss.java @@ -39,6 +39,8 @@ import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.target.common.TargetCreaturePermanent; @@ -50,11 +52,10 @@ import mage.watchers.Watcher; */ public class ReaperFromTheAbyss extends CardImpl { - private static FilterCreaturePermanent filter = new FilterCreaturePermanent("non-Demon creature"); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("non-Demon creature"); static { - filter.getSubtype().add("Demon"); - filter.setNotSubtype(true); + filter.add(Predicates.not(new SubtypePredicate("Demon"))); } public ReaperFromTheAbyss(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/innistrad/SlayerOfTheWicked.java b/Mage.Sets/src/mage/sets/innistrad/SlayerOfTheWicked.java index f76c88541a..1ee4d98002 100644 --- a/Mage.Sets/src/mage/sets/innistrad/SlayerOfTheWicked.java +++ b/Mage.Sets/src/mage/sets/innistrad/SlayerOfTheWicked.java @@ -35,8 +35,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.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -48,10 +49,10 @@ public class SlayerOfTheWicked extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Vampire, Werewolf, or Zombie"); static { - filter.getSubtype().add("Vampire"); - filter.getSubtype().add("Werewolf"); - filter.getSubtype().add("Zombie"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new SubtypePredicate("Vampire"), + new SubtypePredicate("Werewolf"), + new SubtypePredicate("Zombie"))); } public SlayerOfTheWicked(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/innistrad/SpareFromEvil.java b/Mage.Sets/src/mage/sets/innistrad/SpareFromEvil.java index 44b77571ca..625f694d8f 100644 --- a/Mage.Sets/src/mage/sets/innistrad/SpareFromEvil.java +++ b/Mage.Sets/src/mage/sets/innistrad/SpareFromEvil.java @@ -35,6 +35,8 @@ import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; import mage.filter.common.FilterCreatureCard; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; import java.util.UUID; @@ -46,8 +48,7 @@ public class SpareFromEvil extends CardImpl { private static final FilterCreatureCard filterNonHuman = new FilterCreatureCard("non-Human creatures"); static { - filterNonHuman.getSubtype().add("Human"); - filterNonHuman.setNotSubtype(true); + filterNonHuman.add(Predicates.not(new SubtypePredicate("Human"))); } public SpareFromEvil(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/innistrad/SulfurFalls.java b/Mage.Sets/src/mage/sets/innistrad/SulfurFalls.java index 4c9bf1c0f7..5e50d3fd10 100644 --- a/Mage.Sets/src/mage/sets/innistrad/SulfurFalls.java +++ b/Mage.Sets/src/mage/sets/innistrad/SulfurFalls.java @@ -39,8 +39,9 @@ import mage.abilities.effects.common.TapSourceEffect; import mage.abilities.mana.BlueManaAbility; import mage.abilities.mana.RedManaAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; import java.util.UUID; @@ -52,10 +53,7 @@ public class SulfurFalls extends CardImpl { private static final FilterLandPermanent filter = new FilterLandPermanent(); static { - filter.getSubtype().add("Island"); - filter.getSubtype().add("Mountain"); - filter.setScopeSubtype(ComparisonScope.Any); - filter.setMessage("Island or a Mountain"); + filter.add(Predicates.or(new SubtypePredicate("Island"), new SubtypePredicate("Mountain"))); } public SulfurFalls(UUID ownerId) { @@ -63,7 +61,7 @@ public class SulfurFalls extends CardImpl { this.expansionSetCode = "ISD"; Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0)); - String abilityText = "tap it unless you control a " + filter.getMessage(); + String abilityText = "tap it unless you control a Island or a Mountain"; this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); this.addAbility(new BlueManaAbility()); this.addAbility(new RedManaAbility()); diff --git a/Mage.Sets/src/mage/sets/innistrad/TerrorOfKruinPass.java b/Mage.Sets/src/mage/sets/innistrad/TerrorOfKruinPass.java index b6e22b32e9..0a2049c9ed 100644 --- a/Mage.Sets/src/mage/sets/innistrad/TerrorOfKruinPass.java +++ b/Mage.Sets/src/mage/sets/innistrad/TerrorOfKruinPass.java @@ -45,8 +45,8 @@ import mage.abilities.effects.common.continious.GainAbilityControlledEffect; import mage.abilities.keyword.DoubleStrikeAbility; import mage.abilities.keyword.TransformAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -57,8 +57,7 @@ public class TerrorOfKruinPass extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Werewolf"); static { - filter.getSubtype().add("Werewolf"); - filter.setScopeSubtype(ComparisonScope.Any); + filter.add(new SubtypePredicate("Werewolf")); } public TerrorOfKruinPass(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/innistrad/UnbreathingHorde.java b/Mage.Sets/src/mage/sets/innistrad/UnbreathingHorde.java index a9f9f1eda2..707a4cc21a 100644 --- a/Mage.Sets/src/mage/sets/innistrad/UnbreathingHorde.java +++ b/Mage.Sets/src/mage/sets/innistrad/UnbreathingHorde.java @@ -43,6 +43,7 @@ import mage.cards.CardImpl; import mage.counters.CounterType; import mage.filter.common.FilterCreatureCard; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; @@ -86,8 +87,8 @@ class UnbreathingHordeEffect1 extends OneShotEffect { private static final FilterCreatureCard filter2 = new FilterCreatureCard(); static { - filter1.getSubtype().add("Zombie"); - filter2.getSubtype().add("Zombie"); + filter1.add(new SubtypePredicate("Zombie")); + filter2.add(new SubtypePredicate("Zombie")); } public UnbreathingHordeEffect1() { diff --git a/Mage.Sets/src/mage/sets/innistrad/VampiricFury.java b/Mage.Sets/src/mage/sets/innistrad/VampiricFury.java index 649b965e4b..8017b76bb5 100644 --- a/Mage.Sets/src/mage/sets/innistrad/VampiricFury.java +++ b/Mage.Sets/src/mage/sets/innistrad/VampiricFury.java @@ -35,8 +35,8 @@ import mage.abilities.effects.common.continious.BoostControlledEffect; import mage.abilities.effects.common.continious.GainAbilityControlledEffect; import mage.abilities.keyword.FirstStrikeAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import java.util.UUID; @@ -48,8 +48,7 @@ public class VampiricFury extends CardImpl { private static final FilterCreaturePermanent vampires = new FilterCreaturePermanent("Vampire creatures"); static { - vampires.getSubtype().add("Vampire"); - vampires.setScopeSubtype(Filter.ComparisonScope.Any); + vampires.add(new SubtypePredicate("Vampire")); vampires.setTargetController(Constants.TargetController.YOU); } @@ -61,7 +60,7 @@ public class VampiricFury extends CardImpl { // Vampire creatures you control get +2/+0 and gain first strike until end of turn. this.getSpellAbility().addEffect(new BoostControlledEffect(2, 0, Constants.Duration.EndOfTurn, vampires)); - this.getSpellAbility().addEffect(new GainAbilityControlledEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn, vampires)); + this.getSpellAbility().addEffect(new GainAbilityControlledEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn, vampires)); } public VampiricFury(final VampiricFury card) { diff --git a/Mage.Sets/src/mage/sets/innistrad/VictimOfNight.java b/Mage.Sets/src/mage/sets/innistrad/VictimOfNight.java index 53b75c81d3..c9208076e2 100644 --- a/Mage.Sets/src/mage/sets/innistrad/VictimOfNight.java +++ b/Mage.Sets/src/mage/sets/innistrad/VictimOfNight.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.ComparisonScope; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -45,11 +46,9 @@ public class VictimOfNight extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("non-Vampire, non-Werewolf, non-Zombie creature"); static { - filter.getSubtype().add("Vampire"); - filter.getSubtype().add("Werewolf"); - filter.getSubtype().add("Zombie"); - filter.setNotSubtype(true); - filter.setScopeSubtype(ComparisonScope.Any); + filter.add(Predicates.not(new SubtypePredicate("Vampire"))); + filter.add(Predicates.not(new SubtypePredicate("Werewolf"))); + filter.add(Predicates.not(new SubtypePredicate("Zombie"))); } public VictimOfNight(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/innistrad/WoodlandCemetery.java b/Mage.Sets/src/mage/sets/innistrad/WoodlandCemetery.java index 2c4353ff1f..0c1f119eeb 100644 --- a/Mage.Sets/src/mage/sets/innistrad/WoodlandCemetery.java +++ b/Mage.Sets/src/mage/sets/innistrad/WoodlandCemetery.java @@ -39,8 +39,9 @@ import mage.abilities.effects.common.TapSourceEffect; import mage.abilities.mana.BlackManaAbility; import mage.abilities.mana.GreenManaAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; import java.util.UUID; @@ -52,10 +53,7 @@ public class WoodlandCemetery extends CardImpl { private static final FilterLandPermanent filter = new FilterLandPermanent(); static { - filter.getSubtype().add("Forest"); - filter.getSubtype().add("Swamp"); - filter.setScopeSubtype(ComparisonScope.Any); - filter.setMessage("Swamp or a Forest"); + filter.add(Predicates.or(new SubtypePredicate("Forest"), new SubtypePredicate("Swamp"))); } public WoodlandCemetery(UUID ownerId) { @@ -63,7 +61,7 @@ public class WoodlandCemetery extends CardImpl { this.expansionSetCode = "ISD"; Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0)); - String abilityText = "tap it unless you control a " + filter.getMessage(); + String abilityText = "tap it unless you control a Swamp or a Forest"; this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); this.addAbility(new BlackManaAbility()); this.addAbility(new GreenManaAbility()); diff --git a/Mage.Sets/src/mage/sets/lorwyn/Benthicore.java b/Mage.Sets/src/mage/sets/lorwyn/Benthicore.java index ac102946fe..47eb0b6932 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/Benthicore.java +++ b/Mage.Sets/src/mage/sets/lorwyn/Benthicore.java @@ -40,10 +40,10 @@ import mage.abilities.effects.common.UntapSourceEffect; import mage.abilities.effects.common.continious.GainAbilitySourceEffect; import mage.abilities.keyword.ShroudAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; import mage.game.permanent.token.MerfolkToken; import mage.target.common.TargetControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import java.util.UUID; @@ -58,8 +58,7 @@ public class Benthicore extends CardImpl { static { filter.setTapped(false); filter.setUseTapped(true); - filter.getSubtype().add("Merfolk"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Merfolk")); } public Benthicore(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/lorwyn/BlackPoplarShaman.java b/Mage.Sets/src/mage/sets/lorwyn/BlackPoplarShaman.java index 6d45ea36ba..9d3c42e6e2 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/BlackPoplarShaman.java +++ b/Mage.Sets/src/mage/sets/lorwyn/BlackPoplarShaman.java @@ -36,8 +36,8 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.RegenerateTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.TargetPermanent; import java.util.UUID; @@ -51,8 +51,7 @@ public class BlackPoplarShaman extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("Treefolk"); static { - filter.getSubtype().add("Treefolk"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Treefolk")); } public BlackPoplarShaman(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/lorwyn/BoggartBirthRite.java b/Mage.Sets/src/mage/sets/lorwyn/BoggartBirthRite.java index 8f6a693605..6e86e242fd 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/BoggartBirthRite.java +++ b/Mage.Sets/src/mage/sets/lorwyn/BoggartBirthRite.java @@ -31,9 +31,9 @@ import mage.Constants.CardType; import mage.Constants.Rarity; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterCard; import mage.target.common.TargetCardInYourGraveyard; +import mage.filter.predicate.mageobject.SubtypePredicate; import java.util.UUID; @@ -46,8 +46,7 @@ public class BoggartBirthRite extends CardImpl { private final static FilterCard filter = new FilterCard("Goblin card from your graveyard"); static { - filter.getSubtype().add("Goblin"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Goblin")); } public BoggartBirthRite(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/lorwyn/CloudgoatRanger.java b/Mage.Sets/src/mage/sets/lorwyn/CloudgoatRanger.java index cb45e2f35a..dcec8faa4d 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/CloudgoatRanger.java +++ b/Mage.Sets/src/mage/sets/lorwyn/CloudgoatRanger.java @@ -40,10 +40,10 @@ import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.abilities.effects.common.continious.GainAbilitySourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; import mage.game.permanent.token.KithkinToken; import mage.target.common.TargetControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import java.util.UUID; @@ -58,8 +58,7 @@ public class CloudgoatRanger extends CardImpl { static { filter.setTapped(false); filter.setUseTapped(true); - filter.getSubtype().add("Kithkin"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Kithkin")); } public CloudgoatRanger(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/lorwyn/ElvishEulogist.java b/Mage.Sets/src/mage/sets/lorwyn/ElvishEulogist.java index 8c8e532552..155d729527 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/ElvishEulogist.java +++ b/Mage.Sets/src/mage/sets/lorwyn/ElvishEulogist.java @@ -36,8 +36,8 @@ import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount; import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.SubtypePredicate; import java.util.UUID; @@ -50,8 +50,7 @@ public class ElvishEulogist extends CardImpl { private final static FilterCard filter = new FilterCard("Elf"); static { - filter.getSubtype().add("Elf"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Elf")); } public ElvishEulogist(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/lorwyn/ElvishHandservant.java b/Mage.Sets/src/mage/sets/lorwyn/ElvishHandservant.java index d849138a0f..9b031f136d 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/ElvishHandservant.java +++ b/Mage.Sets/src/mage/sets/lorwyn/ElvishHandservant.java @@ -37,6 +37,7 @@ import mage.cards.CardImpl; import mage.counters.CounterType; import mage.filter.Filter; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -47,8 +48,7 @@ public class ElvishHandservant extends CardImpl { private final static FilterSpell filter = new FilterSpell("Giant"); static { - filter.getSubtype().add("Giant"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Giant")); } public ElvishHandservant(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/lorwyn/ElvishPromenade.java b/Mage.Sets/src/mage/sets/lorwyn/ElvishPromenade.java index 0bdbb3cf1b..330d95a266 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/ElvishPromenade.java +++ b/Mage.Sets/src/mage/sets/lorwyn/ElvishPromenade.java @@ -32,8 +32,8 @@ import mage.Constants.Rarity; 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.SubtypePredicate; import mage.game.permanent.token.ElfToken; import java.util.UUID; @@ -47,8 +47,7 @@ public class ElvishPromenade extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("Elf you control"); static { - filter.getSubtype().add("Elf"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Elf")); } public ElvishPromenade(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/lorwyn/EyeblightsEnding.java b/Mage.Sets/src/mage/sets/lorwyn/EyeblightsEnding.java index 6ed2141584..c13185ffb1 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/EyeblightsEnding.java +++ b/Mage.Sets/src/mage/sets/lorwyn/EyeblightsEnding.java @@ -31,8 +31,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.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCreaturePermanent; import java.util.UUID; @@ -46,9 +47,7 @@ public class EyeblightsEnding extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("non-Elf creature"); static { - filter.getSubtype().add("Elf"); - filter.setNotSubtype(true); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(Predicates.not(new SubtypePredicate("Elf"))); } public EyeblightsEnding(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/lorwyn/Facevaulter.java b/Mage.Sets/src/mage/sets/lorwyn/Facevaulter.java index 6f8ed9ad79..d1fd6036ef 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/Facevaulter.java +++ b/Mage.Sets/src/mage/sets/lorwyn/Facevaulter.java @@ -37,8 +37,8 @@ import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.costs.mana.ColoredManaCost; 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.SubtypePredicate; import mage.target.common.TargetControlledPermanent; import java.util.UUID; @@ -52,8 +52,7 @@ public class Facevaulter extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("Goblin"); static { - filter.getSubtype().add("Goblin"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Goblin")); } public Facevaulter(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/lorwyn/FaerieTrickery.java b/Mage.Sets/src/mage/sets/lorwyn/FaerieTrickery.java index bafdf8c7f7..5d1a46b33b 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/FaerieTrickery.java +++ b/Mage.Sets/src/mage/sets/lorwyn/FaerieTrickery.java @@ -34,6 +34,8 @@ import mage.Constants.Zone; import mage.abilities.effects.common.CounterTargetWithReplacementEffect; import mage.cards.CardImpl; import mage.filter.FilterSpell; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.TargetSpell; /** @@ -45,8 +47,7 @@ public class FaerieTrickery extends CardImpl { private static final FilterSpell filter = new FilterSpell("non-Faerie spell"); static { - filter.getSubtype().add("Faerie"); - filter.setNotSubtype(true); + filter.add(Predicates.not(new SubtypePredicate("Faerie"))); } public FaerieTrickery(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/lorwyn/Goatnapper.java b/Mage.Sets/src/mage/sets/lorwyn/Goatnapper.java index b411370318..2f50da3838 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/Goatnapper.java +++ b/Mage.Sets/src/mage/sets/lorwyn/Goatnapper.java @@ -38,8 +38,8 @@ import mage.abilities.effects.common.continious.GainAbilityTargetEffect; import mage.abilities.effects.common.continious.GainControlTargetEffect; import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.TargetPermanent; import java.util.UUID; @@ -53,8 +53,7 @@ public class Goatnapper extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("Goat"); static { - filter.getSubtype().add("Goat"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Goat")); } public Goatnapper(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/lorwyn/GuardianOfCloverdell.java b/Mage.Sets/src/mage/sets/lorwyn/GuardianOfCloverdell.java index 401fd832c2..44459a42a7 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/GuardianOfCloverdell.java +++ b/Mage.Sets/src/mage/sets/lorwyn/GuardianOfCloverdell.java @@ -39,8 +39,8 @@ import mage.abilities.costs.mana.ColoredManaCost; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.permanent.token.KithkinToken; import mage.target.common.TargetControlledPermanent; @@ -55,8 +55,7 @@ public class GuardianOfCloverdell extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("Kithkin"); static { - filter.getSubtype().add("Kithkin"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Kithkin")); } public GuardianOfCloverdell(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/lorwyn/HarpoonSniper.java b/Mage.Sets/src/mage/sets/lorwyn/HarpoonSniper.java index ee0eb9dd75..b2aedc3e91 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/HarpoonSniper.java +++ b/Mage.Sets/src/mage/sets/lorwyn/HarpoonSniper.java @@ -38,8 +38,8 @@ import mage.abilities.costs.mana.ColoredManaCost; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetAttackingOrBlockingCreature; import java.util.UUID; @@ -53,8 +53,7 @@ public class HarpoonSniper extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("Merfolk you control"); static { - filter.getSubtype().add("Merfolk"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Merfolk")); } public HarpoonSniper(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/lorwyn/HearthcageGiant.java b/Mage.Sets/src/mage/sets/lorwyn/HearthcageGiant.java index 8c648c6aea..34fa51c5af 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/HearthcageGiant.java +++ b/Mage.Sets/src/mage/sets/lorwyn/HearthcageGiant.java @@ -38,9 +38,9 @@ import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.continious.BoostTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.permanent.token.Token; import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetCreaturePermanent; @@ -57,10 +57,8 @@ public class HearthcageGiant extends CardImpl { private final static FilterCreaturePermanent filterGiant = new FilterCreaturePermanent("Giant"); static { - filterElemental.getSubtype().add("Elemental"); - filterElemental.setScopeSubtype(Filter.ComparisonScope.Any); - filterGiant.getSubtype().add("Giant"); - filterGiant.setScopeSubtype(Filter.ComparisonScope.Any); + filterElemental.add(new SubtypePredicate("Elemental")); + filterGiant.add(new SubtypePredicate("Giant")); } public HearthcageGiant(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/lorwyn/ImmaculateMagistrate.java b/Mage.Sets/src/mage/sets/lorwyn/ImmaculateMagistrate.java index 21f5b4b24a..4d412f6ab2 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/ImmaculateMagistrate.java +++ b/Mage.Sets/src/mage/sets/lorwyn/ImmaculateMagistrate.java @@ -39,6 +39,7 @@ import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; import mage.counters.CounterType; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.common.TargetCreaturePermanent; @@ -82,7 +83,7 @@ public class ImmaculateMagistrate extends CardImpl { class ImmaculateMagistrateEffect extends OneShotEffect { static final FilterControlledPermanent filter = new FilterControlledPermanent("Elf"); static { - filter.getSubtype().add("Elf"); + filter.add(new SubtypePredicate("Elf")); } public ImmaculateMagistrateEffect() { super(Outcome.BoostCreature); diff --git a/Mage.Sets/src/mage/sets/lorwyn/ImperiousPerfect.java b/Mage.Sets/src/mage/sets/lorwyn/ImperiousPerfect.java index 8ba2b64b57..4b8324e96b 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/ImperiousPerfect.java +++ b/Mage.Sets/src/mage/sets/lorwyn/ImperiousPerfect.java @@ -39,8 +39,8 @@ import mage.abilities.costs.mana.ColoredManaCost; import mage.abilities.effects.common.CreateTokenEffect; 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.SubtypePredicate; import mage.game.permanent.token.ElfToken; import java.util.UUID; @@ -54,8 +54,7 @@ public class ImperiousPerfect extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("Elf creatures"); static { - filter.getSubtype().add("Elf"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Elf")); } public ImperiousPerfect(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/lorwyn/LysAlanaHuntmaster.java b/Mage.Sets/src/mage/sets/lorwyn/LysAlanaHuntmaster.java index 8255162ee8..f4b8f15810 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/LysAlanaHuntmaster.java +++ b/Mage.Sets/src/mage/sets/lorwyn/LysAlanaHuntmaster.java @@ -34,8 +34,8 @@ import mage.MageInt; import mage.abilities.common.SpellCastTriggeredAbility; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.permanent.token.ElfToken; /** @@ -47,8 +47,7 @@ public class LysAlanaHuntmaster extends CardImpl { private final static FilterSpell filter = new FilterSpell("Elf spell"); static { - filter.getSubtype().add("Elf"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Elf")); } public LysAlanaHuntmaster(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/lorwyn/MadAuntie.java b/Mage.Sets/src/mage/sets/lorwyn/MadAuntie.java index 98641bbc3f..0ddf4d51b0 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/MadAuntie.java +++ b/Mage.Sets/src/mage/sets/lorwyn/MadAuntie.java @@ -38,9 +38,9 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.RegenerateTargetEffect; import mage.abilities.effects.common.continious.BoostControlledEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetControlledCreaturePermanent; import java.util.UUID; @@ -55,11 +55,9 @@ public class MadAuntie extends CardImpl { private final static FilterCreaturePermanent filter2 = new FilterCreaturePermanent("Goblin creatures"); static { - filter1.getSubtype().add("Goblin"); + filter1.add(new SubtypePredicate("Goblin")); filter1.setAnother(true); - filter1.setScopeSubtype(Filter.ComparisonScope.Any); - filter2.getSubtype().add("Goblin"); - filter2.setScopeSubtype(Filter.ComparisonScope.Any); + filter2.add(new SubtypePredicate("Goblin")); } public MadAuntie(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/lorwyn/NectarFaerie.java b/Mage.Sets/src/mage/sets/lorwyn/NectarFaerie.java index 13caa1e57a..8f493370bf 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/NectarFaerie.java +++ b/Mage.Sets/src/mage/sets/lorwyn/NectarFaerie.java @@ -39,8 +39,9 @@ import mage.abilities.effects.common.continious.GainAbilityTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.LifelinkAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.TargetPermanent; import java.util.UUID; @@ -54,9 +55,7 @@ public class NectarFaerie extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("Faerie or Elf"); static { - filter.getSubtype().add("Faerie"); - filter.getSubtype().add("Elf"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(Predicates.or(new SubtypePredicate("Faerie"),new SubtypePredicate("Elf"))); } public NectarFaerie(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/lorwyn/ScarredVinebreeder.java b/Mage.Sets/src/mage/sets/lorwyn/ScarredVinebreeder.java index 01bcd6c776..aaed199ac2 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/ScarredVinebreeder.java +++ b/Mage.Sets/src/mage/sets/lorwyn/ScarredVinebreeder.java @@ -38,6 +38,7 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.cards.CardImpl; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCardInYourGraveyard; import java.util.UUID; @@ -51,7 +52,7 @@ public class ScarredVinebreeder extends CardImpl { private static final FilterCard filter = new FilterCard("Elf card from your graveyard"); static { - filter.getSubtype().add("Elf"); + filter.add(new SubtypePredicate("Elf")); } public ScarredVinebreeder(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/lorwyn/ScionOfOona.java b/Mage.Sets/src/mage/sets/lorwyn/ScionOfOona.java index 8fe1ffdcc4..2cb23a4672 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/ScionOfOona.java +++ b/Mage.Sets/src/mage/sets/lorwyn/ScionOfOona.java @@ -27,9 +27,12 @@ */ package mage.sets.lorwyn; -import mage.Constants; +import java.util.UUID; import mage.Constants.CardType; +import mage.Constants.Duration; import mage.Constants.Rarity; +import mage.Constants.TargetController; +import mage.Constants.Zone; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.continious.BoostControlledEffect; @@ -38,11 +41,8 @@ import mage.abilities.keyword.FlashAbility; 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.common.FilterCreaturePermanent; - -import java.util.UUID; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -50,14 +50,11 @@ import java.util.UUID; */ public class ScionOfOona extends CardImpl { - private final static FilterCreaturePermanent filter1 = new FilterCreaturePermanent("Faerie creatures"); - private final static FilterControlledPermanent filter2 = new FilterControlledPermanent("Faeries"); + private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("Faeries"); static { - filter1.getSubtype().add("Faerie"); - filter1.setScopeSubtype(Filter.ComparisonScope.Any); - filter2.getSubtype().add("Faerie"); - filter2.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Faerie")); + filter.setTargetController(TargetController.YOU); } public ScionOfOona(UUID ownerId) { @@ -70,10 +67,11 @@ public class ScionOfOona extends CardImpl { this.toughness = new MageInt(1); this.addAbility(FlashAbility.getInstance()); this.addAbility(FlyingAbility.getInstance()); + // Other Faerie creatures you control get +1/+1. - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Constants.Duration.WhileOnBattlefield, filter1, true))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, filter, true))); // Other Faeries you control have shroud. - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityControlledEffect(ShroudAbility.getInstance(), Constants.Duration.EndOfTurn, filter2, true))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(ShroudAbility.getInstance(), Duration.EndOfTurn, filter, true))); } public ScionOfOona(final ScionOfOona card) { diff --git a/Mage.Sets/src/mage/sets/lorwyn/SeedguideAsh.java b/Mage.Sets/src/mage/sets/lorwyn/SeedguideAsh.java index 5479e650fc..6fd8a87203 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/SeedguideAsh.java +++ b/Mage.Sets/src/mage/sets/lorwyn/SeedguideAsh.java @@ -34,8 +34,8 @@ import mage.MageInt; import mage.abilities.common.DiesTriggeredAbility; import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCardInLibrary; import java.util.UUID; @@ -49,8 +49,7 @@ public class SeedguideAsh extends CardImpl { private final static FilterCard filter = new FilterCard("Forest"); static { - filter.getSubtype().add("Forest"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Forest")); } public SeedguideAsh(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/lorwyn/SummonTheSchool.java b/Mage.Sets/src/mage/sets/lorwyn/SummonTheSchool.java index 87075b071b..9126ff904e 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/SummonTheSchool.java +++ b/Mage.Sets/src/mage/sets/lorwyn/SummonTheSchool.java @@ -35,8 +35,8 @@ import mage.abilities.costs.common.TapTargetCost; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.ReturnToHandSourceEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.permanent.token.MerfolkToken; import mage.target.common.TargetControlledPermanent; @@ -53,8 +53,7 @@ public class SummonTheSchool extends CardImpl { static { filter.setUseTapped(true); filter.setTapped(false); - filter.getSubtype().add("Merfolk"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Merfolk")); } public SummonTheSchool(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/lorwyn/SunriseSovereign.java b/Mage.Sets/src/mage/sets/lorwyn/SunriseSovereign.java index 563004f023..a654b17cbd 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/SunriseSovereign.java +++ b/Mage.Sets/src/mage/sets/lorwyn/SunriseSovereign.java @@ -36,8 +36,8 @@ import mage.abilities.effects.common.continious.BoostControlledEffect; import mage.abilities.effects.common.continious.GainAbilityControlledEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import java.util.UUID; @@ -50,8 +50,7 @@ public class SunriseSovereign extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("Giant"); static { - filter.getSubtype().add("Giant"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Giant")); } public SunriseSovereign(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/lorwyn/TarPitcher.java b/Mage.Sets/src/mage/sets/lorwyn/TarPitcher.java index 312e1d16bb..21f7a6f63f 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/TarPitcher.java +++ b/Mage.Sets/src/mage/sets/lorwyn/TarPitcher.java @@ -37,10 +37,10 @@ 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.FilterControlledCreaturePermanent; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreatureOrPlayer; +import mage.filter.predicate.mageobject.SubtypePredicate; import java.util.UUID; @@ -53,8 +53,7 @@ public class TarPitcher extends CardImpl { private final static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Goblin"); static { - filter.getSubtype().add("Goblin"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Goblin")); } public TarPitcher(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/lorwyn/ThorntoothWitch.java b/Mage.Sets/src/mage/sets/lorwyn/ThorntoothWitch.java index 2cdae44a86..9c230ccc1c 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/ThorntoothWitch.java +++ b/Mage.Sets/src/mage/sets/lorwyn/ThorntoothWitch.java @@ -36,8 +36,8 @@ import mage.abilities.Ability; import mage.abilities.common.SpellCastTriggeredAbility; import mage.abilities.effects.common.continious.BoostTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -49,8 +49,7 @@ public class ThorntoothWitch extends CardImpl { private final static FilterSpell filter = new FilterSpell("Treefolk"); static { - filter.getSubtype().add("Treefolk"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Treefolk")); } public ThorntoothWitch(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/lorwyn/TimberProtector.java b/Mage.Sets/src/mage/sets/lorwyn/TimberProtector.java index ecd747286c..9c6f9810ca 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/TimberProtector.java +++ b/Mage.Sets/src/mage/sets/lorwyn/TimberProtector.java @@ -36,9 +36,10 @@ import mage.abilities.effects.common.continious.BoostControlledEffect; 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.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; import java.util.UUID; @@ -52,11 +53,8 @@ public class TimberProtector extends CardImpl { private final static FilterControlledPermanent filterBoth = new FilterControlledPermanent("Treefolk and Forests"); static { - filterTreefolk.getSubtype().add("Treefolk"); - filterTreefolk.setScopeSubtype(Filter.ComparisonScope.Any); - filterBoth.getSubtype().add("Treefolk"); - filterBoth.getSubtype().add("Forest"); - filterBoth.setScopeSubtype(Filter.ComparisonScope.Any); + filterTreefolk.add(new SubtypePredicate("Treefolk")); + filterBoth.add(Predicates.or(new SubtypePredicate("Treefolk"),new SubtypePredicate("Forest"))); } diff --git a/Mage.Sets/src/mage/sets/lorwyn/WarrenScourgeElf.java b/Mage.Sets/src/mage/sets/lorwyn/WarrenScourgeElf.java index 364914c345..b026582989 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/WarrenScourgeElf.java +++ b/Mage.Sets/src/mage/sets/lorwyn/WarrenScourgeElf.java @@ -33,6 +33,7 @@ import mage.MageInt; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.SubtypePredicate; import java.util.UUID; @@ -45,7 +46,7 @@ public class WarrenScourgeElf extends CardImpl { private static final FilterCard filter = new FilterCard("Goblin"); static { - filter.getSubtype().add("Goblin"); + filter.add(new SubtypePredicate("Goblin")); } public WarrenScourgeElf(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/lorwyn/WizenedCenn.java b/Mage.Sets/src/mage/sets/lorwyn/WizenedCenn.java index 1a312bc70a..98b25573f3 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/WizenedCenn.java +++ b/Mage.Sets/src/mage/sets/lorwyn/WizenedCenn.java @@ -34,8 +34,8 @@ import mage.MageInt; 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.SubtypePredicate; import java.util.UUID; @@ -48,8 +48,7 @@ public class WizenedCenn extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("Kithkin creatures"); static { - filter.getSubtype().add("Kithkin"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Kithkin")); } public WizenedCenn(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/lorwyn/WortBoggartAuntie.java b/Mage.Sets/src/mage/sets/lorwyn/WortBoggartAuntie.java index dac17f2081..11549c60a3 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/WortBoggartAuntie.java +++ b/Mage.Sets/src/mage/sets/lorwyn/WortBoggartAuntie.java @@ -36,8 +36,8 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.keyword.FearAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCardInYourGraveyard; import java.util.UUID; @@ -51,8 +51,7 @@ public class WortBoggartAuntie extends CardImpl { private final static FilterCard filter = new FilterCard("Goblin card from your graveyard"); static { - filter.getSubtype().add("Goblin"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Goblin")); } public WortBoggartAuntie(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2010/ArmoredAscension.java b/Mage.Sets/src/mage/sets/magic2010/ArmoredAscension.java index 42a29d9070..e3e21882d7 100644 --- a/Mage.Sets/src/mage/sets/magic2010/ArmoredAscension.java +++ b/Mage.Sets/src/mage/sets/magic2010/ArmoredAscension.java @@ -44,6 +44,7 @@ import mage.abilities.keyword.EnchantAbility; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -56,7 +57,7 @@ public class ArmoredAscension extends CardImpl { private static final FilterLandPermanent filter = new FilterLandPermanent("Plains you control"); static { - filter.getSubtype().add("Plains"); + filter.add(new SubtypePredicate("Plains")); filter.setTargetController(TargetController.YOU); } diff --git a/Mage.Sets/src/mage/sets/magic2010/AwakenerDruid.java b/Mage.Sets/src/mage/sets/magic2010/AwakenerDruid.java index dd48a74eba..6e65ab9afc 100644 --- a/Mage.Sets/src/mage/sets/magic2010/AwakenerDruid.java +++ b/Mage.Sets/src/mage/sets/magic2010/AwakenerDruid.java @@ -38,6 +38,7 @@ import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.continious.BecomesCreatureTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.permanent.token.Token; import mage.target.common.TargetLandPermanent; @@ -50,7 +51,7 @@ public class AwakenerDruid extends CardImpl { private static final FilterLandPermanent filter = new FilterLandPermanent("Forest"); static { - filter.getSubtype().add("Forest"); + filter.add(new SubtypePredicate("Forest")); } public AwakenerDruid(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2010/BaneslayerAngel.java b/Mage.Sets/src/mage/sets/magic2010/BaneslayerAngel.java index 41f90e64e6..851c2534eb 100644 --- a/Mage.Sets/src/mage/sets/magic2010/BaneslayerAngel.java +++ b/Mage.Sets/src/mage/sets/magic2010/BaneslayerAngel.java @@ -37,9 +37,9 @@ import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.LifelinkAbility; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterPermanent; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -50,10 +50,8 @@ public class BaneslayerAngel extends CardImpl { private static final FilterPermanent filter2 = new FilterCreaturePermanent("Dragons"); static { - filter1.getSubtype().add("Demon"); - filter2.getSubtype().add("Dragon"); - filter1.setScopeSubtype(ComparisonScope.Any); - filter2.setScopeSubtype(ComparisonScope.Any); + filter1.add(new SubtypePredicate("Demon")); + filter2.add(new SubtypePredicate("Dragon")); } public BaneslayerAngel(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2010/CaptainOfTheWatch.java b/Mage.Sets/src/mage/sets/magic2010/CaptainOfTheWatch.java index 187d4146d6..823897fb5d 100644 --- a/Mage.Sets/src/mage/sets/magic2010/CaptainOfTheWatch.java +++ b/Mage.Sets/src/mage/sets/magic2010/CaptainOfTheWatch.java @@ -42,6 +42,7 @@ import mage.abilities.effects.common.continious.GainAbilityControlledEffect; import mage.abilities.keyword.VigilanceAbility; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.permanent.token.SoldierToken; /** @@ -52,7 +53,7 @@ public class CaptainOfTheWatch extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("Soldier creatures"); static { - filter.getSubtype().add("Soldier"); + filter.add(new SubtypePredicate("Soldier")); } public CaptainOfTheWatch(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2010/DragonskullSummit.java b/Mage.Sets/src/mage/sets/magic2010/DragonskullSummit.java index ada8d86863..d6f8441876 100644 --- a/Mage.Sets/src/mage/sets/magic2010/DragonskullSummit.java +++ b/Mage.Sets/src/mage/sets/magic2010/DragonskullSummit.java @@ -40,8 +40,9 @@ import mage.abilities.effects.common.TapSourceEffect; import mage.abilities.mana.BlackManaAbility; import mage.abilities.mana.RedManaAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -52,10 +53,7 @@ public class DragonskullSummit extends CardImpl { private static final FilterLandPermanent filter = new FilterLandPermanent(); static { - filter.getSubtype().add("Swamp"); - filter.getSubtype().add("Mountain"); - filter.setScopeSubtype(ComparisonScope.Any); - filter.setMessage("Swamp or a Mountain"); + filter.add(Predicates.or(new SubtypePredicate("Swamp"), new SubtypePredicate("Mountain"))); } public DragonskullSummit(UUID ownerId) { @@ -63,7 +61,7 @@ public class DragonskullSummit extends CardImpl { this.expansionSetCode = "M10"; Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0)); - String abilityText = "tap it unless you control a " + filter.getMessage(); + String abilityText = "tap it unless you control a Swamp or a Mountain"; this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); this.addAbility(new BlackManaAbility()); this.addAbility(new RedManaAbility()); diff --git a/Mage.Sets/src/mage/sets/magic2010/DrownedCatacomb.java b/Mage.Sets/src/mage/sets/magic2010/DrownedCatacomb.java index bde1eee84f..9bb8f99c46 100644 --- a/Mage.Sets/src/mage/sets/magic2010/DrownedCatacomb.java +++ b/Mage.Sets/src/mage/sets/magic2010/DrownedCatacomb.java @@ -40,8 +40,9 @@ import mage.abilities.effects.common.TapSourceEffect; import mage.abilities.mana.BlackManaAbility; import mage.abilities.mana.BlueManaAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -52,10 +53,7 @@ public class DrownedCatacomb extends CardImpl { private static final FilterLandPermanent filter = new FilterLandPermanent(); static { - filter.getSubtype().add("Swamp"); - filter.getSubtype().add("Island"); - filter.setScopeSubtype(ComparisonScope.Any); - filter.setMessage("Island or a Swamp"); + filter.add(Predicates.or(new SubtypePredicate("Swamp"), new SubtypePredicate("Island"))); } public DrownedCatacomb(UUID ownerId) { @@ -63,7 +61,7 @@ public class DrownedCatacomb extends CardImpl { this.expansionSetCode = "M10"; Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0)); - String abilityText = "tap it unless you control a " + filter.getMessage(); + String abilityText = "tap it unless you control a Island or a Swamp"; this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); this.addAbility(new BlackManaAbility()); this.addAbility(new BlueManaAbility()); diff --git a/Mage.Sets/src/mage/sets/magic2010/ElvishArchdruid.java b/Mage.Sets/src/mage/sets/magic2010/ElvishArchdruid.java index e9b7a9b0e5..fd84743364 100644 --- a/Mage.Sets/src/mage/sets/magic2010/ElvishArchdruid.java +++ b/Mage.Sets/src/mage/sets/magic2010/ElvishArchdruid.java @@ -42,6 +42,7 @@ import mage.abilities.mana.DynamicManaAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -53,8 +54,8 @@ public class ElvishArchdruid extends CardImpl { private static final FilterControlledCreaturePermanent filterCount = new FilterControlledCreaturePermanent("Elf you control"); static { - filter.getSubtype().add("Elf"); - filterCount.getSubtype().add("Elf"); + filter.add(new SubtypePredicate("Elf")); + filterCount.add(new SubtypePredicate("Elf")); } public ElvishArchdruid(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2010/GlacialFortress.java b/Mage.Sets/src/mage/sets/magic2010/GlacialFortress.java index 1aea23b5e1..1d9a2e5231 100644 --- a/Mage.Sets/src/mage/sets/magic2010/GlacialFortress.java +++ b/Mage.Sets/src/mage/sets/magic2010/GlacialFortress.java @@ -40,8 +40,9 @@ import mage.abilities.effects.common.TapSourceEffect; import mage.abilities.mana.BlueManaAbility; import mage.abilities.mana.WhiteManaAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -52,10 +53,7 @@ public class GlacialFortress extends CardImpl { private static final FilterLandPermanent filter = new FilterLandPermanent(); static { - filter.getSubtype().add("Plains"); - filter.getSubtype().add("Island"); - filter.setScopeSubtype(ComparisonScope.Any); - filter.setMessage("Plains or an Island"); + filter.add(Predicates.or(new SubtypePredicate("Plains"), new SubtypePredicate("Island"))); } public GlacialFortress(UUID ownerId) { @@ -63,7 +61,7 @@ public class GlacialFortress extends CardImpl { this.expansionSetCode = "M10"; Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0)); - String abilityText = "tap it unless you control a " + filter.getMessage(); + String abilityText = "tap it unless you control a Plains or an Island"; this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); this.addAbility(new BlueManaAbility()); this.addAbility(new WhiteManaAbility()); diff --git a/Mage.Sets/src/mage/sets/magic2010/GoblinChieftain.java b/Mage.Sets/src/mage/sets/magic2010/GoblinChieftain.java index d5beb5f1d9..ae6128b5b2 100644 --- a/Mage.Sets/src/mage/sets/magic2010/GoblinChieftain.java +++ b/Mage.Sets/src/mage/sets/magic2010/GoblinChieftain.java @@ -40,6 +40,7 @@ import mage.abilities.effects.common.continious.GainAbilityControlledEffect; import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -50,7 +51,7 @@ public class GoblinChieftain extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Goblin creatures"); static { - filter.getSubtype().add("Goblin"); + filter.add(new SubtypePredicate("Goblin")); } public GoblinChieftain(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2010/HowlOfTheNightPack.java b/Mage.Sets/src/mage/sets/magic2010/HowlOfTheNightPack.java index 8ebcc3a6c3..cd08cd917e 100644 --- a/Mage.Sets/src/mage/sets/magic2010/HowlOfTheNightPack.java +++ b/Mage.Sets/src/mage/sets/magic2010/HowlOfTheNightPack.java @@ -34,6 +34,7 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.permanent.token.WolfToken; /** @@ -45,7 +46,7 @@ public class HowlOfTheNightPack extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("for each Forest you control"); static { - filter.getSubtype().add("Forest"); + filter.add(new SubtypePredicate("Forest")); } public HowlOfTheNightPack(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2010/MasterOfTheWildHunt.java b/Mage.Sets/src/mage/sets/magic2010/MasterOfTheWildHunt.java index 84919fdacb..7cfe4dc5b4 100644 --- a/Mage.Sets/src/mage/sets/magic2010/MasterOfTheWildHunt.java +++ b/Mage.Sets/src/mage/sets/magic2010/MasterOfTheWildHunt.java @@ -40,8 +40,8 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; @@ -91,8 +91,7 @@ class MasterOfTheWildHuntEffect extends OneShotEffect private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); static { - filter.getSubtype().add("Wolf"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Wolf")); filter.setTapped(false); filter.setUseTapped(true); } diff --git a/Mage.Sets/src/mage/sets/magic2010/MerfolkSovereign.java b/Mage.Sets/src/mage/sets/magic2010/MerfolkSovereign.java index 32edd06aa0..234f2ad30a 100644 --- a/Mage.Sets/src/mage/sets/magic2010/MerfolkSovereign.java +++ b/Mage.Sets/src/mage/sets/magic2010/MerfolkSovereign.java @@ -43,6 +43,7 @@ import mage.abilities.effects.common.continious.GainAbilityTargetEffect; import mage.abilities.keyword.UnblockableAbility; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -55,8 +56,8 @@ public class MerfolkSovereign extends CardImpl { private static final FilterCreaturePermanent filter2 = new FilterCreaturePermanent("Merfolk creature"); static { - filter1.getSubtype().add("Merfolk"); - filter2.getSubtype().add("Merfolk"); + filter1.add(new SubtypePredicate("Merfolk")); + filter2.add(new SubtypePredicate("Merfolk")); } public MerfolkSovereign(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2010/RhoxPikemaster.java b/Mage.Sets/src/mage/sets/magic2010/RhoxPikemaster.java index bd1d99b0cf..08967cbe67 100644 --- a/Mage.Sets/src/mage/sets/magic2010/RhoxPikemaster.java +++ b/Mage.Sets/src/mage/sets/magic2010/RhoxPikemaster.java @@ -39,6 +39,7 @@ import mage.abilities.effects.common.continious.GainAbilityControlledEffect; import mage.abilities.keyword.FirstStrikeAbility; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -49,7 +50,7 @@ public class RhoxPikemaster extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Soldier creatures"); static { - filter.getSubtype().add("Soldier"); + filter.add(new SubtypePredicate("Soldier")); } public RhoxPikemaster(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2010/RootboundCrag.java b/Mage.Sets/src/mage/sets/magic2010/RootboundCrag.java index 9d6bff218b..d256f8b9a4 100644 --- a/Mage.Sets/src/mage/sets/magic2010/RootboundCrag.java +++ b/Mage.Sets/src/mage/sets/magic2010/RootboundCrag.java @@ -40,8 +40,9 @@ import mage.abilities.effects.common.TapSourceEffect; import mage.abilities.mana.GreenManaAbility; import mage.abilities.mana.RedManaAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -52,10 +53,7 @@ public class RootboundCrag extends CardImpl { private static final FilterLandPermanent filter = new FilterLandPermanent(); static { - filter.getSubtype().add("Mountain"); - filter.getSubtype().add("Forest"); - filter.setScopeSubtype(ComparisonScope.Any); - filter.setMessage("Mountain or a Forest"); + filter.add(Predicates.or(new SubtypePredicate("Mountain"), new SubtypePredicate("Forest"))); } public RootboundCrag(UUID ownerId) { @@ -63,7 +61,7 @@ public class RootboundCrag extends CardImpl { this.expansionSetCode = "M10"; Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0)); - String abilityText = "tap it unless you control a " + filter.getMessage(); + String abilityText = "tap it unless you control a Mountain or a Forest"; this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); this.addAbility(new RedManaAbility()); this.addAbility(new GreenManaAbility()); diff --git a/Mage.Sets/src/mage/sets/magic2010/SeismicStrike.java b/Mage.Sets/src/mage/sets/magic2010/SeismicStrike.java index 69915988bf..1f0b0b3ad2 100644 --- a/Mage.Sets/src/mage/sets/magic2010/SeismicStrike.java +++ b/Mage.Sets/src/mage/sets/magic2010/SeismicStrike.java @@ -34,6 +34,7 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -45,7 +46,7 @@ public class SeismicStrike extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("Mountains you control"); static { - filter.getSubtype().add("Mountain"); + filter.add(new SubtypePredicate("Mountain")); } public SeismicStrike(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2010/SerpentOfTheEndlessSea.java b/Mage.Sets/src/mage/sets/magic2010/SerpentOfTheEndlessSea.java index 05d2096a68..56814b786e 100644 --- a/Mage.Sets/src/mage/sets/magic2010/SerpentOfTheEndlessSea.java +++ b/Mage.Sets/src/mage/sets/magic2010/SerpentOfTheEndlessSea.java @@ -42,6 +42,7 @@ import mage.abilities.effects.common.continious.SetPowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.filter.FilterPermanent; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.events.GameEvent; @@ -54,7 +55,7 @@ public class SerpentOfTheEndlessSea extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("Islands you control"); static { - filter.getSubtype().add("Island"); + filter.add(new SubtypePredicate("Island")); } public SerpentOfTheEndlessSea(UUID ownerId) { @@ -112,7 +113,7 @@ class SerpentOfTheEndlessSeaEffect extends ReplacementEffectImpl { private final static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("a Goblin"); static { - filter.getSubtype().add("Goblin"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Goblin")); } public SiegeGangCommander(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2010/SunpetalGrove.java b/Mage.Sets/src/mage/sets/magic2010/SunpetalGrove.java index d70ca1e04b..34da2ec2ac 100644 --- a/Mage.Sets/src/mage/sets/magic2010/SunpetalGrove.java +++ b/Mage.Sets/src/mage/sets/magic2010/SunpetalGrove.java @@ -40,8 +40,9 @@ import mage.abilities.effects.common.TapSourceEffect; import mage.abilities.mana.GreenManaAbility; import mage.abilities.mana.WhiteManaAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -52,10 +53,7 @@ public class SunpetalGrove extends CardImpl { private static final FilterLandPermanent filter = new FilterLandPermanent(); static { - filter.getSubtype().add("Forest"); - filter.getSubtype().add("Plains"); - filter.setScopeSubtype(ComparisonScope.Any); - filter.setMessage("Forest or a Plains"); + filter.add(Predicates.or(new SubtypePredicate("Forest"), new SubtypePredicate("Plains"))); } public SunpetalGrove(UUID ownerId) { @@ -63,7 +61,7 @@ public class SunpetalGrove extends CardImpl { this.expansionSetCode = "M10"; Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0)); - String abilityText = "tap it unless you control a " + filter.getMessage(); + String abilityText = "tap it unless you control a Forest or a Plains"; this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); this.addAbility(new GreenManaAbility()); this.addAbility(new WhiteManaAbility()); diff --git a/Mage.Sets/src/mage/sets/magic2010/TendrilsOfCorruption.java b/Mage.Sets/src/mage/sets/magic2010/TendrilsOfCorruption.java index cbaad2bebc..034f785321 100644 --- a/Mage.Sets/src/mage/sets/magic2010/TendrilsOfCorruption.java +++ b/Mage.Sets/src/mage/sets/magic2010/TendrilsOfCorruption.java @@ -35,6 +35,7 @@ import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -46,7 +47,7 @@ public class TendrilsOfCorruption extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("Swamp you control"); static { - filter.getSubtype().add("Swamp"); + filter.add(new SubtypePredicate("Swamp")); } public TendrilsOfCorruption(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2010/UndeadSlayer.java b/Mage.Sets/src/mage/sets/magic2010/UndeadSlayer.java index 5314b03aa0..ea411f5d1b 100644 --- a/Mage.Sets/src/mage/sets/magic2010/UndeadSlayer.java +++ b/Mage.Sets/src/mage/sets/magic2010/UndeadSlayer.java @@ -39,8 +39,9 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ColoredManaCost; 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.SubtypePredicate; import mage.target.TargetPermanent; /** @@ -52,10 +53,10 @@ public class UndeadSlayer extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("Skeleton, Vampire, or Zombie"); static { - filter.getSubtype().add("Skeleton"); - filter.getSubtype().add("Vampire"); - filter.getSubtype().add("Zombie"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new SubtypePredicate("Skeleton"), + new SubtypePredicate("Vampire"), + new SubtypePredicate("Zombie"))); } public UndeadSlayer(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2010/VampireNocturnus.java b/Mage.Sets/src/mage/sets/magic2010/VampireNocturnus.java index 49ea4c50ec..e79534cd1e 100644 --- a/Mage.Sets/src/mage/sets/magic2010/VampireNocturnus.java +++ b/Mage.Sets/src/mage/sets/magic2010/VampireNocturnus.java @@ -42,6 +42,7 @@ import mage.abilities.effects.common.continious.*; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; /** @@ -80,7 +81,7 @@ class VampireNocturnusAbility extends StaticAbility { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); static { - filter.getSubtype().add("Vampire"); + filter.add(new SubtypePredicate("Vampire")); } public VampireNocturnusAbility() { diff --git a/Mage.Sets/src/mage/sets/magic2010/VeteranArmorsmith.java b/Mage.Sets/src/mage/sets/magic2010/VeteranArmorsmith.java index b782b5c209..df5c7f6d4b 100644 --- a/Mage.Sets/src/mage/sets/magic2010/VeteranArmorsmith.java +++ b/Mage.Sets/src/mage/sets/magic2010/VeteranArmorsmith.java @@ -36,8 +36,8 @@ import mage.MageInt; 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.SubtypePredicate; /** * @@ -48,8 +48,7 @@ public class VeteranArmorsmith extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("Soldier creatures"); static { - filter.getSubtype().add("Soldier"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Soldier")); } public VeteranArmorsmith(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2010/VeteranSwordsmith.java b/Mage.Sets/src/mage/sets/magic2010/VeteranSwordsmith.java index 7a36244336..1b52f18234 100644 --- a/Mage.Sets/src/mage/sets/magic2010/VeteranSwordsmith.java +++ b/Mage.Sets/src/mage/sets/magic2010/VeteranSwordsmith.java @@ -36,8 +36,8 @@ import mage.MageInt; 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.SubtypePredicate; /** * @author Loki @@ -47,8 +47,7 @@ public class VeteranSwordsmith extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("Soldier"); static { - filter.getSubtype().add("Soldier"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Soldier")); } public VeteranSwordsmith(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2011/CaptivatingVampire.java b/Mage.Sets/src/mage/sets/magic2011/CaptivatingVampire.java index 55a593ad8d..2a0b642b0d 100644 --- a/Mage.Sets/src/mage/sets/magic2011/CaptivatingVampire.java +++ b/Mage.Sets/src/mage/sets/magic2011/CaptivatingVampire.java @@ -46,6 +46,7 @@ import mage.abilities.effects.common.continious.BoostControlledEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.common.TargetControlledCreaturePermanent; @@ -61,8 +62,8 @@ public class CaptivatingVampire extends CardImpl { private static final FilterControlledCreaturePermanent filter2 = new FilterControlledCreaturePermanent("untapped Vampires you control"); static { - filter1.getSubtype().add("Vampire"); - filter2.getSubtype().add("Vampire"); + filter1.add(new SubtypePredicate("Vampire")); + filter2.add(new SubtypePredicate("Vampire")); filter2.setTapped(false); filter2.setUseTapped(true); } diff --git a/Mage.Sets/src/mage/sets/magic2011/Corrupt.java b/Mage.Sets/src/mage/sets/magic2011/Corrupt.java index 6606250b64..1595d2fd7f 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Corrupt.java +++ b/Mage.Sets/src/mage/sets/magic2011/Corrupt.java @@ -36,8 +36,8 @@ import mage.Constants.TargetController; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -73,8 +73,7 @@ class CorruptEffect extends OneShotEffect { private static final FilterLandPermanent filter = new FilterLandPermanent("Swamps"); static { - filter.getSubtype().add("Swamp"); - filter.setScopeSubtype(ComparisonScope.Any); + filter.add(new SubtypePredicate("Swamp")); filter.setTargetController(TargetController.YOU); } diff --git a/Mage.Sets/src/mage/sets/magic2011/EarthServant.java b/Mage.Sets/src/mage/sets/magic2011/EarthServant.java index a86565b6bf..1870c47865 100644 --- a/Mage.Sets/src/mage/sets/magic2011/EarthServant.java +++ b/Mage.Sets/src/mage/sets/magic2011/EarthServant.java @@ -40,6 +40,7 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.cards.CardImpl; import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -50,7 +51,7 @@ public class EarthServant extends CardImpl { private static final FilterLandPermanent filter = new FilterLandPermanent("Mountain you control"); static { - filter.getSubtype().add("Mountain"); + filter.add(new SubtypePredicate("Mountain")); filter.setTargetController(TargetController.YOU); } diff --git a/Mage.Sets/src/mage/sets/magic2011/HarborSerpent.java b/Mage.Sets/src/mage/sets/magic2011/HarborSerpent.java index a72cf06d21..603da979d0 100644 --- a/Mage.Sets/src/mage/sets/magic2011/HarborSerpent.java +++ b/Mage.Sets/src/mage/sets/magic2011/HarborSerpent.java @@ -39,6 +39,7 @@ import mage.abilities.effects.RestrictionEffect; import mage.abilities.keyword.IslandwalkAbility; import mage.cards.CardImpl; import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; @@ -77,7 +78,7 @@ class HarborSerpentEffect extends RestrictionEffect { public HarborSerpentEffect() { super(Duration.WhileOnBattlefield); - filter.getSubtype().add("Island"); + filter.add(new SubtypePredicate("Island")); staticText = "{this} can't attack unless there are five or more Islands on the battlefield"; } diff --git a/Mage.Sets/src/mage/sets/magic2011/KnightExemplar.java b/Mage.Sets/src/mage/sets/magic2011/KnightExemplar.java index ea1f1a5a6d..d2aa5d40bf 100644 --- a/Mage.Sets/src/mage/sets/magic2011/KnightExemplar.java +++ b/Mage.Sets/src/mage/sets/magic2011/KnightExemplar.java @@ -41,6 +41,7 @@ import mage.abilities.keyword.FirstStrikeAbility; import mage.abilities.keyword.IndestructibleAbility; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -51,7 +52,7 @@ public class KnightExemplar extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Knight creatures"); static { - filter.getSubtype().add("Knight"); + filter.add(new SubtypePredicate("Knight")); } public KnightExemplar(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2011/QuagSickness.java b/Mage.Sets/src/mage/sets/magic2011/QuagSickness.java index 2bf71153b9..f5bbfd10d8 100644 --- a/Mage.Sets/src/mage/sets/magic2011/QuagSickness.java +++ b/Mage.Sets/src/mage/sets/magic2011/QuagSickness.java @@ -42,6 +42,7 @@ import mage.abilities.effects.common.continious.BoostEnchantedEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -54,7 +55,7 @@ public class QuagSickness extends CardImpl { private static final FilterLandPermanent filter = new FilterLandPermanent("Swamp you control"); static { - filter.getSubtype().add("Swamp"); + filter.add(new SubtypePredicate("Swamp")); filter.setTargetController(TargetController.YOU); } diff --git a/Mage.Sets/src/mage/sets/magic2012/ArachnusSpinner.java b/Mage.Sets/src/mage/sets/magic2012/ArachnusSpinner.java index 564f5cdd1b..6b17b3d4bc 100644 --- a/Mage.Sets/src/mage/sets/magic2012/ArachnusSpinner.java +++ b/Mage.Sets/src/mage/sets/magic2012/ArachnusSpinner.java @@ -43,6 +43,7 @@ import mage.cards.CardImpl; import mage.filter.FilterCard; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.mageobject.NamePredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -60,7 +61,7 @@ public class ArachnusSpinner extends CardImpl { private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped Spider"); static { - filter.getSubtype().add("Spider"); + filter.add(new SubtypePredicate("Spider")); filter.setTapped(false); filter.setUseTapped(true); } diff --git a/Mage.Sets/src/mage/sets/magic2012/BloodlordOfVaasgoth.java b/Mage.Sets/src/mage/sets/magic2012/BloodlordOfVaasgoth.java index 6ed92cf2e5..bf38bd4395 100644 --- a/Mage.Sets/src/mage/sets/magic2012/BloodlordOfVaasgoth.java +++ b/Mage.Sets/src/mage/sets/magic2012/BloodlordOfVaasgoth.java @@ -40,6 +40,7 @@ import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.filter.Filter; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.stack.Spell; @@ -54,8 +55,7 @@ public class BloodlordOfVaasgoth extends CardImpl { static { filter.getCardType().add(CardType.CREATURE); filter.setScopeCardType(Filter.ComparisonScope.Any); - filter.getSubtype().add("Vampire"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Vampire")); } public BloodlordOfVaasgoth(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2012/CallToTheGrave.java b/Mage.Sets/src/mage/sets/magic2012/CallToTheGrave.java index 1464234739..9a3755b718 100644 --- a/Mage.Sets/src/mage/sets/magic2012/CallToTheGrave.java +++ b/Mage.Sets/src/mage/sets/magic2012/CallToTheGrave.java @@ -42,6 +42,8 @@ import mage.abilities.effects.common.SacrificeEffect; import mage.abilities.effects.common.SacrificeSourceEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.events.GameEvent; /** @@ -54,8 +56,7 @@ public class CallToTheGrave extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("a non-Zombie creature"); static { - filter.getSubtype().add("Zombie"); - filter.setNotSubtype(true); + filter.add(Predicates.not(new SubtypePredicate("Zombie"))); } public CallToTheGrave(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2012/CemeteryReaper.java b/Mage.Sets/src/mage/sets/magic2012/CemeteryReaper.java index 78e8935aab..bda14ed1c9 100644 --- a/Mage.Sets/src/mage/sets/magic2012/CemeteryReaper.java +++ b/Mage.Sets/src/mage/sets/magic2012/CemeteryReaper.java @@ -43,9 +43,9 @@ import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.ExileTargetEffect; import mage.abilities.effects.common.continious.BoostControlledEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreatureCard; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.permanent.token.ZombieToken; import mage.target.common.TargetCardInGraveyard; @@ -56,8 +56,7 @@ public class CemeteryReaper extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("Zombie creatures"); static { - filter.getSubtype().add("Zombie"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Zombie")); } public CemeteryReaper(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2012/DungroveElder.java b/Mage.Sets/src/mage/sets/magic2012/DungroveElder.java index aa3305c358..c2dc0f7545 100644 --- a/Mage.Sets/src/mage/sets/magic2012/DungroveElder.java +++ b/Mage.Sets/src/mage/sets/magic2012/DungroveElder.java @@ -41,6 +41,7 @@ import mage.abilities.effects.common.continious.SetPowerToughnessSourceEffect; import mage.abilities.keyword.HexproofAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -51,7 +52,7 @@ public class DungroveElder extends CardImpl { final static FilterControlledPermanent filterLands = new FilterControlledPermanent("Forests you control"); static { - filterLands.getSubtype().add("Forest"); + filterLands.add(new SubtypePredicate("Forest")); } public DungroveElder (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2012/GoblinGrenade.java b/Mage.Sets/src/mage/sets/magic2012/GoblinGrenade.java index a2c3bcad9a..e02033f465 100644 --- a/Mage.Sets/src/mage/sets/magic2012/GoblinGrenade.java +++ b/Mage.Sets/src/mage/sets/magic2012/GoblinGrenade.java @@ -37,6 +37,7 @@ import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; import mage.filter.Filter; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreatureOrPlayer; @@ -48,8 +49,7 @@ public class GoblinGrenade extends CardImpl { private final static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Goblin"); static { - filter.getSubtype().add("Goblin"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Goblin")); } public GoblinGrenade(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2012/GriffinRider.java b/Mage.Sets/src/mage/sets/magic2012/GriffinRider.java index 5ec9409c03..1fb6b719bf 100644 --- a/Mage.Sets/src/mage/sets/magic2012/GriffinRider.java +++ b/Mage.Sets/src/mage/sets/magic2012/GriffinRider.java @@ -40,9 +40,9 @@ import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.abilities.effects.common.continious.GainAbilitySourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -55,8 +55,7 @@ public class GriffinRider extends CardImpl { private static final FilterPermanent filterGriffinCard = new FilterCreaturePermanent(); static { - filterGriffinCard.getSubtype().add("Griffin"); - filterGriffinCard.setScopeSubtype(Filter.ComparisonScope.Any); + filterGriffinCard.add(new SubtypePredicate("Griffin")); } public GriffinRider(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2012/LordOfTheUnreal.java b/Mage.Sets/src/mage/sets/magic2012/LordOfTheUnreal.java index d1ec5d001c..e6674bb80e 100644 --- a/Mage.Sets/src/mage/sets/magic2012/LordOfTheUnreal.java +++ b/Mage.Sets/src/mage/sets/magic2012/LordOfTheUnreal.java @@ -40,8 +40,8 @@ import mage.abilities.effects.common.continious.BoostControlledEffect; import mage.abilities.effects.common.continious.GainAbilityControlledEffect; import mage.abilities.keyword.HexproofAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @author Loki @@ -51,8 +51,7 @@ public class LordOfTheUnreal extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("Illusion creatures"); static { - filter.getSubtype().add("Illusion"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Illusion")); } public LordOfTheUnreal(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2013/ArcticAven.java b/Mage.Sets/src/mage/sets/magic2013/ArcticAven.java index 9b9b0b2f4f..a36287308a 100644 --- a/Mage.Sets/src/mage/sets/magic2013/ArcticAven.java +++ b/Mage.Sets/src/mage/sets/magic2013/ArcticAven.java @@ -42,6 +42,7 @@ import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.LifelinkAbility; import mage.cards.CardImpl; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -52,7 +53,7 @@ public class ArcticAven extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("Plains"); static { - filter.getSubtype().add("Plains"); + filter.add(new SubtypePredicate("Plains")); } public ArcticAven(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2013/ArmsDealer.java b/Mage.Sets/src/mage/sets/magic2013/ArmsDealer.java index 61f558f460..fea029c16c 100644 --- a/Mage.Sets/src/mage/sets/magic2013/ArmsDealer.java +++ b/Mage.Sets/src/mage/sets/magic2013/ArmsDealer.java @@ -38,6 +38,7 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetCreaturePermanent; @@ -50,7 +51,7 @@ public class ArmsDealer extends CardImpl { private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Goblin"); static { - filter.getSubtype().add("Goblin"); + filter.add(new SubtypePredicate("Goblin")); } public ArmsDealer(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2013/CrimsonMuckwader.java b/Mage.Sets/src/mage/sets/magic2013/CrimsonMuckwader.java index 227bcb084d..ab6d1d5ca5 100644 --- a/Mage.Sets/src/mage/sets/magic2013/CrimsonMuckwader.java +++ b/Mage.Sets/src/mage/sets/magic2013/CrimsonMuckwader.java @@ -38,8 +38,8 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.RegenerateSourceEffect; import mage.abilities.effects.common.continious.BoostSourceWhileControlsEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -50,8 +50,7 @@ public class CrimsonMuckwader extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("Swamp"); static { - filter.getSubtype().add("Swamp"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Swamp")); } public CrimsonMuckwader(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2013/FlinthoofBoar.java b/Mage.Sets/src/mage/sets/magic2013/FlinthoofBoar.java index 838ebc7af9..a7e8788f35 100644 --- a/Mage.Sets/src/mage/sets/magic2013/FlinthoofBoar.java +++ b/Mage.Sets/src/mage/sets/magic2013/FlinthoofBoar.java @@ -40,8 +40,8 @@ import mage.abilities.effects.common.continious.BoostSourceWhileControlsEffect; import mage.abilities.effects.common.continious.GainAbilitySourceEffect; import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -52,8 +52,7 @@ public class FlinthoofBoar extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("Mountain"); static { - filter.getSubtype().add("Mountain"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Mountain")); } public FlinthoofBoar(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2013/KrenkoMobBoss.java b/Mage.Sets/src/mage/sets/magic2013/KrenkoMobBoss.java index 1c7e334447..5e78511927 100644 --- a/Mage.Sets/src/mage/sets/magic2013/KrenkoMobBoss.java +++ b/Mage.Sets/src/mage/sets/magic2013/KrenkoMobBoss.java @@ -38,6 +38,7 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.permanent.token.GoblinToken; /** @@ -49,7 +50,7 @@ public class KrenkoMobBoss extends CardImpl { private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Goblin you control"); static { - filter.getSubtype().add("Goblin"); + filter.add(new SubtypePredicate("Goblin")); } public KrenkoMobBoss(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2013/LilianasShade.java b/Mage.Sets/src/mage/sets/magic2013/LilianasShade.java index 657520fc14..a39a54136e 100644 --- a/Mage.Sets/src/mage/sets/magic2013/LilianasShade.java +++ b/Mage.Sets/src/mage/sets/magic2013/LilianasShade.java @@ -40,6 +40,7 @@ import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.abilities.effects.common.search.SearchLibraryRevealPutInHandEffect; import mage.cards.CardImpl; import mage.filter.common.FilterLandCard; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCardInLibrary; /** @@ -51,7 +52,7 @@ public class LilianasShade extends CardImpl { private static final FilterLandCard filter = new FilterLandCard("Swamp"); static { - filter.getSubtype().add("Swamp"); + filter.add(new SubtypePredicate("Swamp")); } public LilianasShade(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2013/MasterOfThePearlTrident.java b/Mage.Sets/src/mage/sets/magic2013/MasterOfThePearlTrident.java index 56614e19a0..e8fdcdeeea 100644 --- a/Mage.Sets/src/mage/sets/magic2013/MasterOfThePearlTrident.java +++ b/Mage.Sets/src/mage/sets/magic2013/MasterOfThePearlTrident.java @@ -39,6 +39,7 @@ import mage.abilities.effects.common.continious.GainAbilityControlledEffect; import mage.abilities.keyword.IslandwalkAbility; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -49,7 +50,7 @@ public class MasterOfThePearlTrident extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Merfolk creatures"); static { - filter.getSubtype().add("Merfolk"); + filter.add(new SubtypePredicate("Merfolk")); } public MasterOfThePearlTrident(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2013/Mutilate.java b/Mage.Sets/src/mage/sets/magic2013/Mutilate.java index 784191bc6d..3518d18e92 100644 --- a/Mage.Sets/src/mage/sets/magic2013/Mutilate.java +++ b/Mage.Sets/src/mage/sets/magic2013/Mutilate.java @@ -36,6 +36,7 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.continious.BoostAllEffect; import mage.cards.CardImpl; import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -46,7 +47,7 @@ public class Mutilate extends CardImpl { private static final FilterLandPermanent filter = new FilterLandPermanent("Swamp you control"); static { - filter.getSubtype().add("Swamp"); + filter.add(new SubtypePredicate("Swamp")); filter.setTargetController(Constants.TargetController.YOU); } diff --git a/Mage.Sets/src/mage/sets/magic2013/PrizedElephant.java b/Mage.Sets/src/mage/sets/magic2013/PrizedElephant.java index 598c01d4e0..0da215ecaf 100644 --- a/Mage.Sets/src/mage/sets/magic2013/PrizedElephant.java +++ b/Mage.Sets/src/mage/sets/magic2013/PrizedElephant.java @@ -44,6 +44,7 @@ import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; import mage.filter.Filter; import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -55,8 +56,7 @@ public class PrizedElephant extends CardImpl { private static final FilterLandPermanent filter = new FilterLandPermanent("a Forest"); static { - filter.getSubtype().add("Forest"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Forest")); } public PrizedElephant(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2013/RangersPath.java b/Mage.Sets/src/mage/sets/magic2013/RangersPath.java index 53dcae2450..58097c6137 100644 --- a/Mage.Sets/src/mage/sets/magic2013/RangersPath.java +++ b/Mage.Sets/src/mage/sets/magic2013/RangersPath.java @@ -33,6 +33,7 @@ import mage.Constants.Rarity; import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.cards.CardImpl; import mage.filter.common.FilterLandCard; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCardInLibrary; /** @@ -44,7 +45,7 @@ public class RangersPath extends CardImpl { private static final FilterLandCard filter = new FilterLandCard("Forest cards"); static { - filter.getSubtype().add("Forest"); + filter.add(new SubtypePredicate("Forest")); } public RangersPath(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2013/TalrandSkySummoner.java b/Mage.Sets/src/mage/sets/magic2013/TalrandSkySummoner.java index c5321dc8e3..b7dff246ff 100644 --- a/Mage.Sets/src/mage/sets/magic2013/TalrandSkySummoner.java +++ b/Mage.Sets/src/mage/sets/magic2013/TalrandSkySummoner.java @@ -34,7 +34,6 @@ import mage.MageInt; import mage.abilities.common.SpellCastTriggeredAbility; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterSpell; import mage.game.permanent.token.DrakeToken; @@ -49,7 +48,6 @@ public class TalrandSkySummoner extends CardImpl { static { filter.getCardType().add(CardType.INSTANT); filter.getCardType().add(CardType.SORCERY); - filter.setScopeSubtype(Filter.ComparisonScope.Any); } public TalrandSkySummoner(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/mirrodin/NightmareLash.java b/Mage.Sets/src/mage/sets/mirrodin/NightmareLash.java index 02e25dcbb1..40071ecac8 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/NightmareLash.java +++ b/Mage.Sets/src/mage/sets/mirrodin/NightmareLash.java @@ -39,6 +39,7 @@ import mage.abilities.effects.common.continious.BoostEquippedEffect; import mage.abilities.keyword.EquipAbility; import mage.cards.CardImpl; import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -48,7 +49,7 @@ public class NightmareLash extends CardImpl { private static final FilterLandPermanent filter = new FilterLandPermanent("Swamp you control"); static { - filter.getSubtype().add("Swamp"); + filter.add(new SubtypePredicate("Swamp")); filter.setTargetController(Constants.TargetController.YOU); } diff --git a/Mage.Sets/src/mage/sets/mirrodin/RustsporeRam.java b/Mage.Sets/src/mage/sets/mirrodin/RustsporeRam.java index 8555eb4ac1..0c596f8cb3 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/RustsporeRam.java +++ b/Mage.Sets/src/mage/sets/mirrodin/RustsporeRam.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.SubtypePredicate; import mage.target.TargetPermanent; /** @@ -48,8 +48,7 @@ public class RustsporeRam extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("Equipment"); static { - filter.getSubtype().add("Equipment"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Equipment")); } public RustsporeRam(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/mirrodin/TurnToDust.java b/Mage.Sets/src/mage/sets/mirrodin/TurnToDust.java index 7c3a4092d3..db78511f34 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/TurnToDust.java +++ b/Mage.Sets/src/mage/sets/mirrodin/TurnToDust.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.SubtypePredicate; import mage.target.TargetPermanent; /** @@ -47,8 +47,7 @@ public class TurnToDust extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("Equipment"); static { - filter.getSubtype().add("Equipment"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Equipment")); } public TurnToDust(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/BrassSquire.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/BrassSquire.java index 40717d0b67..03879d466d 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/BrassSquire.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/BrassSquire.java @@ -39,6 +39,7 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.common.TargetControlledCreaturePermanent; @@ -53,7 +54,7 @@ public class BrassSquire extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("Equipment you control"); static { - filter.getSubtype().add("Equipment"); + filter.add(new SubtypePredicate("Equipment")); } public BrassSquire(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/MyrTurbine.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/MyrTurbine.java index f5e7d5db1e..82510a0e9f 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/MyrTurbine.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/MyrTurbine.java @@ -39,6 +39,7 @@ import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; import mage.filter.common.FilterCreatureCard; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.permanent.token.MyrToken; import mage.target.common.TargetCardInLibrary; import mage.target.common.TargetControlledPermanent; @@ -53,8 +54,8 @@ public class MyrTurbine extends CardImpl { private static final FilterControlledPermanent filterMyr = new FilterControlledPermanent("Myr you control"); static { - filterCard.getSubtype().add("Myr"); - filterMyr.getSubtype().add("Myr"); + filterCard.add(new SubtypePredicate("Myr")); + filterMyr.add(new SubtypePredicate("Myr")); } diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/ThopterAssembly.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/ThopterAssembly.java index 032ef26aac..432a90a843 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/ThopterAssembly.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/ThopterAssembly.java @@ -36,8 +36,8 @@ import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.ReturnToHandSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.permanent.token.Token; @@ -91,8 +91,7 @@ class ThopterAssemblyTriggeredAbility extends TriggeredAbilityImpl { static { filterForest.add(new NamePredicate("Forest")); - filterTreefolk.getSubtype().add("Treefolk"); - filterTreefolk.setScopeSubtype(Filter.ComparisonScope.Any); + filterTreefolk.add(new SubtypePredicate("Treefolk")); } public EverbarkShaman(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/morningtide/FendeepSummoner.java b/Mage.Sets/src/mage/sets/morningtide/FendeepSummoner.java index c3f5797ce6..957d00d58a 100644 --- a/Mage.Sets/src/mage/sets/morningtide/FendeepSummoner.java +++ b/Mage.Sets/src/mage/sets/morningtide/FendeepSummoner.java @@ -39,6 +39,7 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.continious.BecomesCreatureTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.permanent.token.Token; import mage.target.common.TargetLandPermanent; @@ -50,7 +51,7 @@ public class FendeepSummoner extends CardImpl { static final FilterLandPermanent filter = new FilterLandPermanent("Swamp"); static { - filter.getSubtype().add("Swamp"); + filter.add(new SubtypePredicate("Swamp")); } public FendeepSummoner(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/morningtide/HeritageDruid.java b/Mage.Sets/src/mage/sets/morningtide/HeritageDruid.java index 0331ade123..fd51ab7dff 100644 --- a/Mage.Sets/src/mage/sets/morningtide/HeritageDruid.java +++ b/Mage.Sets/src/mage/sets/morningtide/HeritageDruid.java @@ -38,8 +38,8 @@ import mage.abilities.costs.common.TapTargetCost; import mage.abilities.effects.common.BasicManaEffect; import mage.abilities.mana.SimpleManaAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -53,9 +53,7 @@ public class HeritageDruid extends CardImpl { static { filter.setTapped(false); filter.setUseTapped(true); - filter.getSubtype().add("Elf"); - filter.setScopeCardType(Filter.ComparisonScope.Any); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Elf")); } public HeritageDruid(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/morningtide/InspiredSprite.java b/Mage.Sets/src/mage/sets/morningtide/InspiredSprite.java index 5c6f70752b..6d261c5efe 100644 --- a/Mage.Sets/src/mage/sets/morningtide/InspiredSprite.java +++ b/Mage.Sets/src/mage/sets/morningtide/InspiredSprite.java @@ -40,8 +40,8 @@ import mage.abilities.effects.common.UntapSourceEffect; import mage.abilities.keyword.FlashAbility; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -52,8 +52,7 @@ public class InspiredSprite extends CardImpl { private final static FilterSpell filter = new FilterSpell("Wizard"); static { - filter.getSubtype().add("Wizard"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Wizard")); } public InspiredSprite(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/morningtide/KinsbaileCavalier.java b/Mage.Sets/src/mage/sets/morningtide/KinsbaileCavalier.java index bd8ca231ca..edf106fad9 100644 --- a/Mage.Sets/src/mage/sets/morningtide/KinsbaileCavalier.java +++ b/Mage.Sets/src/mage/sets/morningtide/KinsbaileCavalier.java @@ -29,16 +29,17 @@ package mage.sets.morningtide; import java.util.UUID; -import mage.Constants; import mage.Constants.CardType; +import mage.Constants.Duration; import mage.Constants.Rarity; +import mage.Constants.Zone; import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.continious.GainAbilityControlledEffect; import mage.abilities.keyword.DoubleStrikeAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -49,8 +50,7 @@ public class KinsbaileCavalier extends CardImpl { private final static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Knight"); static { - filter.getSubtype().add("Knight"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Knight")); } public KinsbaileCavalier(UUID ownerId) { @@ -61,7 +61,7 @@ public class KinsbaileCavalier extends CardImpl { this.color.setWhite(true); this.power = new MageInt(2); this.toughness = new MageInt(2); - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityControlledEffect(DoubleStrikeAbility.getInstance(), Constants.Duration.WhileOnBattlefield, filter, false))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(DoubleStrikeAbility.getInstance(), Duration.WhileOnBattlefield, filter, false))); } public KinsbaileCavalier(final KinsbaileCavalier card) { diff --git a/Mage.Sets/src/mage/sets/morningtide/LysAlanaBowmaster.java b/Mage.Sets/src/mage/sets/morningtide/LysAlanaBowmaster.java index 157c37e321..b066360250 100644 --- a/Mage.Sets/src/mage/sets/morningtide/LysAlanaBowmaster.java +++ b/Mage.Sets/src/mage/sets/morningtide/LysAlanaBowmaster.java @@ -37,9 +37,9 @@ import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.ReachAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterSpell; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -52,8 +52,7 @@ public class LysAlanaBowmaster extends CardImpl { private final static FilterCreaturePermanent filterFlying = new FilterCreaturePermanent("creature with flying"); static { - filterElf.getSubtype().add("Elf"); - filterElf.setScopeSubtype(Filter.ComparisonScope.Any); + filterElf.add(new SubtypePredicate("Elf")); filterFlying.getAbilities().add(FlyingAbility.getInstance()); } diff --git a/Mage.Sets/src/mage/sets/morningtide/PreeminentCaptain.java b/Mage.Sets/src/mage/sets/morningtide/PreeminentCaptain.java index c94d105f8b..c832e751b6 100644 --- a/Mage.Sets/src/mage/sets/morningtide/PreeminentCaptain.java +++ b/Mage.Sets/src/mage/sets/morningtide/PreeminentCaptain.java @@ -39,7 +39,8 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.FirstStrikeAbility; import mage.cards.Card; import mage.cards.CardImpl; -import mage.filter.FilterCard; +import mage.filter.common.FilterCreatureCard; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -83,6 +84,12 @@ public class PreeminentCaptain extends CardImpl { class PreeminentCaptainEffect extends OneShotEffect { + private static final FilterCreatureCard filter = new FilterCreatureCard("a soldier creature card"); + + static { + filter.add(new SubtypePredicate("Soldier")); + } + public PreeminentCaptainEffect() { super(Outcome.PutCreatureInPlay); this.staticText = "put a Soldier creature card from your hand onto the battlefield tapped and attacking."; @@ -95,7 +102,7 @@ class PreeminentCaptainEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); - TargetCardInHand target = new TargetCardInHand(new FilterSoldierCard()); + TargetCardInHand target = new TargetCardInHand(filter); if (target.canChoose(player.getId(), game) && target.choose(getOutcome(), player.getId(), source.getSourceId(), game)) { if (target.getTargets().size() > 0) { UUID cardId = target.getFirstTarget(); @@ -130,26 +137,3 @@ class PreeminentCaptainEffect extends OneShotEffect { } } - -class FilterSoldierCard extends FilterCard { - - public FilterSoldierCard() { - this("a soldier creature card."); - } - - public FilterSoldierCard(String name) { - super(name); - cardType.add(CardType.CREATURE); - subtype.add("Soldier"); - } - - public FilterSoldierCard(final FilterSoldierCard filter) { - super(filter); - } - - @Override - public FilterSoldierCard copy() { - return new FilterSoldierCard(this); - } - -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/morningtide/RhysTheExiled.java b/Mage.Sets/src/mage/sets/morningtide/RhysTheExiled.java index 01008538b7..8efe7fb77b 100644 --- a/Mage.Sets/src/mage/sets/morningtide/RhysTheExiled.java +++ b/Mage.Sets/src/mage/sets/morningtide/RhysTheExiled.java @@ -42,8 +42,8 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.effects.common.RegenerateSourceEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -55,8 +55,7 @@ public class RhysTheExiled extends CardImpl { private final static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Elf"); static { - filter.getSubtype().add("Elf"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Elf")); } public RhysTheExiled(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/morningtide/ScarbladeElite.java b/Mage.Sets/src/mage/sets/morningtide/ScarbladeElite.java index 42c2acbb73..7554df945a 100644 --- a/Mage.Sets/src/mage/sets/morningtide/ScarbladeElite.java +++ b/Mage.Sets/src/mage/sets/morningtide/ScarbladeElite.java @@ -39,8 +39,8 @@ import mage.abilities.costs.common.ExileFromGraveCost; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCardInYourGraveyard; import mage.target.common.TargetCreaturePermanent; @@ -53,8 +53,7 @@ public class ScarbladeElite extends CardImpl { private final static FilterCard filter = new FilterCard("Assassin card from your graveyard"); static { - filter.getSubtype().add("Assassin"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Assassin")); } public ScarbladeElite(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/morningtide/SeethingPathblazer.java b/Mage.Sets/src/mage/sets/morningtide/SeethingPathblazer.java index 22cab03f64..17d554d637 100644 --- a/Mage.Sets/src/mage/sets/morningtide/SeethingPathblazer.java +++ b/Mage.Sets/src/mage/sets/morningtide/SeethingPathblazer.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.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -53,8 +53,7 @@ public class SeethingPathblazer extends CardImpl { private final static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Elemental"); static { - filter.getSubtype().add("Elemental"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Elemental")); } public SeethingPathblazer(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/morningtide/SigilTracer.java b/Mage.Sets/src/mage/sets/morningtide/SigilTracer.java index a56c11a7b4..2c04f151ff 100644 --- a/Mage.Sets/src/mage/sets/morningtide/SigilTracer.java +++ b/Mage.Sets/src/mage/sets/morningtide/SigilTracer.java @@ -42,6 +42,7 @@ import mage.cards.CardImpl; import mage.filter.Filter; import mage.filter.FilterSpell; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.TargetSpell; import mage.target.common.TargetControlledCreaturePermanent; @@ -56,8 +57,7 @@ public class SigilTracer extends CardImpl { static { filter.setTapped(false); filter.setUseTapped(true); - filter.getSubtype().add("Wizard"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Wizard")); filterInstorSorc.getCardType().add(CardType.INSTANT); filterInstorSorc.getCardType().add(CardType.SORCERY); filterInstorSorc.setScopeCardType(Filter.ComparisonScope.Any); diff --git a/Mage.Sets/src/mage/sets/morningtide/WeirdingShaman.java b/Mage.Sets/src/mage/sets/morningtide/WeirdingShaman.java index 2a70296037..e48ba4defb 100644 --- a/Mage.Sets/src/mage/sets/morningtide/WeirdingShaman.java +++ b/Mage.Sets/src/mage/sets/morningtide/WeirdingShaman.java @@ -39,8 +39,8 @@ import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.permanent.token.Token; import mage.target.common.TargetControlledPermanent; @@ -53,8 +53,7 @@ public class WeirdingShaman extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("Goblin"); static { - filter.getSubtype().add("Goblin"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Goblin")); } public WeirdingShaman(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/AuriokSurvivors.java b/Mage.Sets/src/mage/sets/newphyrexia/AuriokSurvivors.java index ab8834bc00..1be8109269 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/AuriokSurvivors.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/AuriokSurvivors.java @@ -38,8 +38,8 @@ import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -53,8 +53,7 @@ public class AuriokSurvivors extends CardImpl { private static final FilterCard filter = new FilterCard("Equipment card from your graveyard"); static { - filter.getSubtype().add("Equipment"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Equipment")); } public AuriokSurvivors(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/BladeSplicer.java b/Mage.Sets/src/mage/sets/newphyrexia/BladeSplicer.java index ef848ab207..7e1ccb81d7 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.SubtypePredicate; import mage.game.permanent.token.GolemToken; /** @@ -53,7 +54,7 @@ public class BladeSplicer extends CardImpl { static { filter.getCardType().add(CardType.CREATURE); - filter.getSubtype().add("Golem"); + filter.add(new SubtypePredicate("Golem")); } public BladeSplicer (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/BludgeonBrawl.java b/Mage.Sets/src/mage/sets/newphyrexia/BludgeonBrawl.java index 6eb4cb4fcd..e66749fe36 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/BludgeonBrawl.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/BludgeonBrawl.java @@ -46,6 +46,8 @@ import mage.abilities.effects.common.continious.BoostEquippedEffect; import mage.abilities.keyword.EquipAbility; import mage.cards.CardImpl; import mage.filter.common.FilterArtifactPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; @@ -111,8 +113,7 @@ class BludgeonBrawlAddSubtypeEffect extends ContinuousEffectImpl affectedPermanents = new ArrayList(); List permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game); diff --git a/Mage.Sets/src/mage/sets/newphyrexia/Lashwrithe.java b/Mage.Sets/src/mage/sets/newphyrexia/Lashwrithe.java index f7740c39cf..1349b224a2 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/Lashwrithe.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/Lashwrithe.java @@ -41,6 +41,7 @@ import mage.abilities.keyword.EquipAbility; import mage.abilities.keyword.LivingWeaponAbility; import mage.cards.CardImpl; import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -51,7 +52,7 @@ public class Lashwrithe extends CardImpl { private static final FilterLandPermanent filter = new FilterLandPermanent("Swamp you control"); static { - filter.getSubtype().add("Swamp"); + filter.add(new SubtypePredicate("Swamp")); filter.setTargetController(TargetController.YOU); } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/MasterSplicer.java b/Mage.Sets/src/mage/sets/newphyrexia/MasterSplicer.java index 426e1b969e..b96512b061 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/MasterSplicer.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/MasterSplicer.java @@ -39,6 +39,7 @@ import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.continious.BoostControlledEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.permanent.token.GolemToken; /** @@ -50,7 +51,7 @@ public class MasterSplicer extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Golem creatures"); static { - filter.getSubtype().add("Golem"); + filter.add(new SubtypePredicate("Golem")); } public MasterSplicer(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/MaulSplicer.java b/Mage.Sets/src/mage/sets/newphyrexia/MaulSplicer.java index da713268fe..bce9d591c6 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.SubtypePredicate; import mage.game.permanent.token.GolemToken; /** @@ -52,7 +53,7 @@ public class MaulSplicer extends CardImpl { static { filter.getCardType().add(CardType.CREATURE); - filter.getSubtype().add("Golem"); + filter.add(new SubtypePredicate("Golem")); } public MaulSplicer(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/PuresteelPaladin.java b/Mage.Sets/src/mage/sets/newphyrexia/PuresteelPaladin.java index 7c8fdcddda..ddaef509ce 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/PuresteelPaladin.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/PuresteelPaladin.java @@ -32,6 +32,8 @@ import java.util.UUID; import mage.Constants; import mage.Constants.CardType; +import mage.Constants.Duration; +import mage.Constants.Outcome; import mage.Constants.Rarity; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; @@ -43,8 +45,8 @@ import mage.abilities.effects.common.DrawCardControllerEffect; import mage.abilities.effects.common.continious.GainAbilityControlledEffect; import mage.abilities.keyword.EquipAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.ZoneChangeEvent; @@ -57,8 +59,7 @@ public class PuresteelPaladin extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("Equipment"); static { - filter.getSubtype().add("Equipment"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Equipment")); } public PuresteelPaladin(UUID ownerId) { @@ -70,13 +71,10 @@ public class PuresteelPaladin extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(2); this.addAbility(new PuresteelPaladinTriggeredAbility()); - this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, - new ConditionalContinousEffect( - new GainAbilityControlledEffect( - new EquipAbility(Constants.Outcome.AddAbility, new GenericManaCost(0)), - Constants.Duration.WhileOnBattlefield, filter), - MetalcraftCondition.getInstance(), - "Metalcraft - Equipment you control have equip {0} as long as you control three or more artifacts"))); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new ConditionalContinousEffect( + new GainAbilityControlledEffect(new EquipAbility(Outcome.AddAbility, new GenericManaCost(0)), Duration.WhileOnBattlefield, filter), + MetalcraftCondition.getInstance(), + "Metalcraft - Equipment you control have equip {0} as long as you control three or more artifacts"))); } public PuresteelPaladin(final PuresteelPaladin card) { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/SensorSplicer.java b/Mage.Sets/src/mage/sets/newphyrexia/SensorSplicer.java index 4b86c8ddce..5490e004fb 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.SubtypePredicate; import mage.game.permanent.token.GolemToken; /** @@ -52,7 +53,7 @@ public class SensorSplicer extends CardImpl { static { filter.getCardType().add(CardType.CREATURE); - filter.getSubtype().add("Golem"); + filter.add(new SubtypePredicate("Golem")); } public SensorSplicer(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/VitalSplicer.java b/Mage.Sets/src/mage/sets/newphyrexia/VitalSplicer.java index 88ae5d66a1..13d8dfe38e 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.SubtypePredicate; import mage.game.permanent.token.GolemToken; import mage.target.common.TargetCreaturePermanent; @@ -54,7 +55,7 @@ public class VitalSplicer extends CardImpl { static { filter.getCardType().add(CardType.CREATURE); - filter.getSubtype().add("Golem"); + filter.add(new SubtypePredicate("Golem")); filter.setTargetController(TargetController.YOU); } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/WingSplicer.java b/Mage.Sets/src/mage/sets/newphyrexia/WingSplicer.java index 40831a7916..3abee59fad 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.SubtypePredicate; import mage.game.permanent.token.GolemToken; /** @@ -52,7 +53,7 @@ public class WingSplicer extends CardImpl { static { filter.getCardType().add(CardType.CREATURE); - filter.getSubtype().add("Golem"); + filter.add(new SubtypePredicate("Golem")); } public WingSplicer(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/onslaught/WirewoodLodge.java b/Mage.Sets/src/mage/sets/onslaught/WirewoodLodge.java index e9a385b6bb..c36bd9d581 100644 --- a/Mage.Sets/src/mage/sets/onslaught/WirewoodLodge.java +++ b/Mage.Sets/src/mage/sets/onslaught/WirewoodLodge.java @@ -41,6 +41,7 @@ import mage.abilities.effects.common.UntapTargetEffect; import mage.abilities.mana.GreenManaAbility; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -50,7 +51,7 @@ import mage.target.common.TargetCreaturePermanent; public class WirewoodLodge extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("Elf"); static { - filter.getSubtype().add("Elf"); + filter.add(new SubtypePredicate("Elf")); } public WirewoodLodge(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/planechase/CabalCoffers.java b/Mage.Sets/src/mage/sets/planechase/CabalCoffers.java index 3cccedc82f..2d08a4c9c0 100644 --- a/Mage.Sets/src/mage/sets/planechase/CabalCoffers.java +++ b/Mage.Sets/src/mage/sets/planechase/CabalCoffers.java @@ -40,6 +40,7 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.DynamicManaEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -50,7 +51,7 @@ public class CabalCoffers extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("Swamp you control"); static { - filter.getSubtype().add("Swamp"); + filter.add(new SubtypePredicate("Swamp")); } public CabalCoffers(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/planechase/SilvergladeElemental.java b/Mage.Sets/src/mage/sets/planechase/SilvergladeElemental.java index 09fb8f5128..255de2e5a4 100644 --- a/Mage.Sets/src/mage/sets/planechase/SilvergladeElemental.java +++ b/Mage.Sets/src/mage/sets/planechase/SilvergladeElemental.java @@ -34,8 +34,8 @@ import mage.MageInt; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterLandCard; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCardInLibrary; /** @@ -47,8 +47,7 @@ public class SilvergladeElemental extends CardImpl { private final static FilterLandCard filter = new FilterLandCard("Forest card"); static { - filter.getSubtype().add("Forest"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Forest")); } public SilvergladeElemental(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/ravnika/DarkHeartOfTheWood.java b/Mage.Sets/src/mage/sets/ravnika/DarkHeartOfTheWood.java index 6daca7d321..8f256d158c 100644 --- a/Mage.Sets/src/mage/sets/ravnika/DarkHeartOfTheWood.java +++ b/Mage.Sets/src/mage/sets/ravnika/DarkHeartOfTheWood.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.SubtypePredicate; import mage.target.common.TargetControlledPermanent; /** @@ -49,8 +49,7 @@ public class DarkHeartOfTheWood extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("Forest"); static { - filter.getSubtype().add("Forest"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Forest")); } public DarkHeartOfTheWood(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/ravnika/Farseek.java b/Mage.Sets/src/mage/sets/ravnika/Farseek.java index 46efdc8ca2..b0ef57fbc1 100644 --- a/Mage.Sets/src/mage/sets/ravnika/Farseek.java +++ b/Mage.Sets/src/mage/sets/ravnika/Farseek.java @@ -34,8 +34,9 @@ import mage.Constants.CardType; import mage.Constants.Rarity; import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCardInLibrary; /** @@ -47,11 +48,11 @@ public class Farseek extends CardImpl { private final static FilterCard filter = new FilterCard("Plains, Island, Swamp, or Mountain card"); static { - filter.getSubtype().add("Plains"); - filter.getSubtype().add("Island"); - filter.getSubtype().add("Swamp"); - filter.getSubtype().add("Mountain"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new SubtypePredicate("Plains"), + new SubtypePredicate("Island"), + new SubtypePredicate("Swamp"), + new SubtypePredicate("Mountain"))); } public Farseek(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/AuraGnarlid.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/AuraGnarlid.java index 4ec695438f..07440dc801 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/AuraGnarlid.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/AuraGnarlid.java @@ -39,6 +39,7 @@ import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.abilities.effects.common.continious.CantBeBlockedByCreaturesWithLessPowerEffect; import mage.cards.CardImpl; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -49,7 +50,7 @@ public class AuraGnarlid extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("Aura on the battlefield"); static { - filter.getSubtype().add("Aura"); + filter.add(new SubtypePredicate("Aura")); } public AuraGnarlid(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/BroodBirthing.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/BroodBirthing.java index 7ece7867d7..9caf8050c0 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/BroodBirthing.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/BroodBirthing.java @@ -34,8 +34,8 @@ import mage.Constants.Rarity; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.permanent.token.EldraziSpawnToken; @@ -83,9 +83,8 @@ class BroodBirthingEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Eldrazi Spawn"); - filter.getSubtype().add("Eldrazi"); - filter.getSubtype().add("Spawn"); - filter.setScopeSubtype(ComparisonScope.All); + filter.add(new SubtypePredicate("Eldrazi")); + filter.add(new SubtypePredicate("Spawn")); EldraziSpawnToken token = new EldraziSpawnToken(); int count = game.getBattlefield().countAll(filter, source.getControllerId(), game) > 0 ? 3 : 1; diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Broodwarden.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Broodwarden.java index e0d21851e0..fa96ecd52f 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Broodwarden.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Broodwarden.java @@ -36,8 +36,8 @@ import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.continious.BoostControlledEffect; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -48,9 +48,8 @@ public class Broodwarden extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Eldrazi Spawn creatures you control"); static { - filter.getSubtype().add("Eldrazi"); - filter.getSubtype().add("Spawn"); - filter.setScopeSubtype(ComparisonScope.All); + filter.add(new SubtypePredicate("Eldrazi")); + filter.add(new SubtypePredicate("Spawn")); } public Broodwarden(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/CoralhelmCommander.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/CoralhelmCommander.java index 32f1dc8dc2..1742e1911b 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/CoralhelmCommander.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/CoralhelmCommander.java @@ -43,6 +43,7 @@ import mage.abilities.keyword.LevelUpAbility; import mage.abilities.keyword.LevelerCardBuilder; import mage.cards.LevelerCard; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import java.util.UUID; @@ -55,7 +56,7 @@ public class CoralhelmCommander extends LevelerCard { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Merfolk creatures"); static { - filter.getSubtype().add("Merfolk"); + filter.add(new SubtypePredicate("Merfolk")); } public CoralhelmCommander(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/JoragaTreespeaker.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/JoragaTreespeaker.java index fe16dc77f7..06e28c9faa 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/JoragaTreespeaker.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/JoragaTreespeaker.java @@ -48,6 +48,7 @@ import mage.abilities.keyword.LevelerCardBuilder; import mage.abilities.mana.SimpleManaAbility; import mage.cards.LevelerCard; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import java.util.UUID; @@ -60,7 +61,7 @@ public class JoragaTreespeaker extends LevelerCard { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Elves"); static { - filter.getSubtype().add("Elf"); + filter.add(new SubtypePredicate("Elf")); } public JoragaTreespeaker(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/KorSpiritdancer.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/KorSpiritdancer.java index 626aedb022..4202e7c796 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/KorSpiritdancer.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/KorSpiritdancer.java @@ -40,6 +40,7 @@ import mage.abilities.effects.common.DrawCardControllerEffect; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.cards.CardImpl; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -50,7 +51,7 @@ public class KorSpiritdancer extends CardImpl { private static final FilterSpell filter = new FilterSpell("an Aura spell"); static { - filter.getSubtype().add("Aura"); + filter.add(new SubtypePredicate("Aura")); } public KorSpiritdancer(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/SarkhanTheMad.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/SarkhanTheMad.java index 180e881b6c..0403b26e86 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.SubtypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.permanent.token.Token; @@ -166,7 +167,7 @@ class SarkhanTheMadDragonDamageEffect extends OneShotEffect { static { filter.getCardType().add(CardType.INSTANT); filter.getCardType().add(CardType.SORCERY); - filter.setScopeSubtype(Filter.ComparisonScope.Any); } 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 3a57f24dd7..f8c67c577e 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/SurrealMemoir.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/SurrealMemoir.java @@ -38,7 +38,6 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.ReboundAbility; import mage.cards.Card; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; import mage.game.Game; import mage.players.Player; @@ -92,7 +91,6 @@ class SurrealMemoirEffect extends OneShotEffect { if (player != null) { FilterCard filter = new FilterCard("instant card"); filter.getCardType().add(CardType.INSTANT); - filter.setScopeSubtype(ComparisonScope.Any); 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/IizukaTheRuthless.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/IizukaTheRuthless.java index 4714fff0e0..12b47ed6f0 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/IizukaTheRuthless.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/IizukaTheRuthless.java @@ -41,8 +41,8 @@ import mage.abilities.effects.common.continious.GainAbilityControlledEffect; import mage.abilities.keyword.BushidoAbility; import mage.abilities.keyword.DoubleStrikeAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -54,8 +54,7 @@ public class IizukaTheRuthless extends CardImpl { private final static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Samurai"); static { - filter.getSubtype().add("Samurai"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Samurai")); } public IizukaTheRuthless(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/KashiTribeElite.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/KashiTribeElite.java index db31a3a8e6..efd1fc5402 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/KashiTribeElite.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/KashiTribeElite.java @@ -40,8 +40,8 @@ import mage.abilities.effects.common.TapTargetEffect; import mage.abilities.effects.common.continious.GainAbilityControlledEffect; import mage.abilities.keyword.ShroudAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SupertypePredicate; /** @@ -54,8 +54,7 @@ public class KashiTribeElite extends CardImpl { static { filter.add(new SupertypePredicate("Legendary")); - filter.getSubtype().add("Snake"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Snake")); } public KashiTribeElite(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/ManrikiGusari.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/ManrikiGusari.java index 7daeb47c65..500aeff7f5 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/ManrikiGusari.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/ManrikiGusari.java @@ -42,8 +42,8 @@ import mage.abilities.effects.common.continious.BoostEquippedEffect; import mage.abilities.effects.common.continious.GainAbilityAttachedEffect; import mage.abilities.keyword.EquipAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.TargetPermanent; /** @@ -55,8 +55,7 @@ public class ManrikiGusari extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("Equipment"); static { - filter.getSubtype().add("Equipment"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Equipment")); } public ManrikiGusari(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/AcidWebSpider.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/AcidWebSpider.java index 2ec9e8caf3..2aeb1b40a5 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/AcidWebSpider.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/AcidWebSpider.java @@ -37,8 +37,8 @@ import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.keyword.ReachAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.TargetPermanent; /** @@ -46,11 +46,10 @@ import mage.target.TargetPermanent; * @author Loki */ public class AcidWebSpider extends CardImpl { - private static FilterPermanent filter = new FilterPermanent("Equipment"); + private static final FilterPermanent filter = new FilterPermanent("Equipment"); static { - filter.getSubtype().add("Equipment"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Equipment")); } public AcidWebSpider (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/BlackcleaveCliffs.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/BlackcleaveCliffs.java index be18ff0f2f..afc26d507b 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/BlackcleaveCliffs.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/BlackcleaveCliffs.java @@ -40,7 +40,6 @@ import mage.abilities.effects.common.TapSourceEffect; import mage.abilities.mana.BlackManaAbility; import mage.abilities.mana.RedManaAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.common.FilterLandPermanent; /** @@ -51,17 +50,12 @@ public class BlackcleaveCliffs extends CardImpl { private static final FilterLandPermanent filter = new FilterLandPermanent(); - static { - filter.setScopeSubtype(ComparisonScope.Any); - filter.setMessage("lands"); - } - public BlackcleaveCliffs (UUID ownerId) { super(ownerId, 224, "Blackcleave Cliffs", Rarity.RARE, new CardType[]{CardType.LAND}, null); this.expansionSetCode = "SOM"; Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.FEWER_THAN, 4)); - String abilityText = "tap it unless you control fewer than 3 " + filter.getMessage(); + String abilityText = "tap it unless you control fewer than 3 lands"; this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); this.addAbility(new BlackManaAbility()); this.addAbility(new RedManaAbility()); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/CopperlineGorge.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/CopperlineGorge.java index 1d35b8d77a..db070610f7 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/CopperlineGorge.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/CopperlineGorge.java @@ -40,7 +40,6 @@ import mage.abilities.effects.common.TapSourceEffect; import mage.abilities.mana.GreenManaAbility; import mage.abilities.mana.RedManaAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.common.FilterLandPermanent; /** @@ -51,17 +50,12 @@ public class CopperlineGorge extends CardImpl { private static FilterLandPermanent filter = new FilterLandPermanent(); - static { - filter.setScopeSubtype(ComparisonScope.Any); - filter.setMessage("lands"); - } - public CopperlineGorge (UUID ownerId) { super(ownerId, 225, "Copperline Gorge", Rarity.RARE, new CardType[]{CardType.LAND}, null); this.expansionSetCode = "SOM"; Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.FEWER_THAN, 4)); - String abilityText = "tap it unless you control fewer than 3 " + filter.getMessage(); + String abilityText = "tap it unless you control fewer than 3 lands"; this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); this.addAbility(new RedManaAbility()); this.addAbility(new GreenManaAbility()); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/DarkslickShores.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/DarkslickShores.java index 478c7a8d9b..20df23f42e 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/DarkslickShores.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/DarkslickShores.java @@ -40,7 +40,6 @@ import mage.abilities.effects.common.TapSourceEffect; import mage.abilities.mana.BlackManaAbility; import mage.abilities.mana.BlueManaAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.common.FilterLandPermanent; /** @@ -51,17 +50,12 @@ public class DarkslickShores extends CardImpl { private static FilterLandPermanent filter = new FilterLandPermanent(); - static { - filter.setScopeSubtype(ComparisonScope.Any); - filter.setMessage("lands"); - } - public DarkslickShores (UUID ownerId) { super(ownerId, 226, "Darkslick Shores", Rarity.RARE, new CardType[]{CardType.LAND}, null); this.expansionSetCode = "SOM"; Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.FEWER_THAN, 4)); - String abilityText = "tap it unless you control fewer than 3 " + filter.getMessage(); + String abilityText = "tap it unless you control fewer than 3 lands"; this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); this.addAbility(new BlueManaAbility()); this.addAbility(new BlackManaAbility()); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/EzuriRenegadeLeader.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/EzuriRenegadeLeader.java index 7f7b893775..e5b96466ec 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/EzuriRenegadeLeader.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/EzuriRenegadeLeader.java @@ -45,6 +45,7 @@ import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.NamePredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -53,14 +54,13 @@ import mage.target.common.TargetControlledCreaturePermanent; */ public class EzuriRenegadeLeader extends CardImpl { - private static final FilterCreaturePermanent elfFilter = new FilterCreaturePermanent(); + private static final FilterCreaturePermanent elfFilter = new FilterCreaturePermanent("Elf creatures"); private static final FilterControlledCreaturePermanent notEzuri = new FilterControlledCreaturePermanent(); static { - elfFilter.getSubtype().add("Elf"); - elfFilter.setMessage("Elf creatures"); + elfFilter.add(new SubtypePredicate("Elf")); - notEzuri.getSubtype().add("Elf"); + notEzuri.add(new SubtypePredicate("Elf")); notEzuri.add(Predicates.not(new NamePredicate("Ezuri, Renegade Leader"))); } @@ -82,8 +82,8 @@ public class EzuriRenegadeLeader extends CardImpl { this.addAbility(ezuriRegen); Ability ezuriBoost = new SimpleActivatedAbility(Zone.BATTLEFIELD, - new BoostControlledEffect(3, 3, Duration.EndOfTurn, elfFilter, false), - new ManaCostsImpl("{2}{G}{G}{G}")); + new BoostControlledEffect(3, 3, Duration.EndOfTurn, elfFilter, false), + new ManaCostsImpl("{2}{G}{G}{G}")); ezuriBoost.addEffect(new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.EndOfTurn, elfFilter)); this.addAbility(ezuriBoost); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/Glimmerpost.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/Glimmerpost.java index 77958b78b0..e273892a1b 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/Glimmerpost.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/Glimmerpost.java @@ -38,8 +38,8 @@ import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.mana.ColorlessManaAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.players.Player; @@ -69,11 +69,10 @@ public class Glimmerpost extends CardImpl { } class GlimmerpostEffect extends OneShotEffect { - private static FilterPermanent filter = new FilterPermanent(); + private static final FilterPermanent filter = new FilterPermanent(); static { - filter.getSubtype().add("Locus"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Locus")); } public GlimmerpostEffect() { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/KothOfTheHammer.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/KothOfTheHammer.java index 7ed188c138..7481e0364f 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/KothOfTheHammer.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/KothOfTheHammer.java @@ -52,6 +52,7 @@ import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.counters.CounterType; import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.permanent.token.Token; @@ -67,9 +68,9 @@ public class KothOfTheHammer extends CardImpl { private static final FilterLandPermanent filterCount = new FilterLandPermanent("Mountain you control"); static { - filter.getSubtype().add("Mountain"); + filter.add(new SubtypePredicate("Mountain")); filter.setTargetController(Constants.TargetController.YOU); - filterCount.getSubtype().add("Mountain"); + filterCount.add(new SubtypePredicate("Mountain")); filterCount.setTargetController(Constants.TargetController.YOU); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/MyrBattlesphere.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/MyrBattlesphere.java index 9caf986191..eb5161d6ec 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/MyrBattlesphere.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/MyrBattlesphere.java @@ -46,6 +46,7 @@ import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -87,7 +88,7 @@ class MyrBattlesphereAbility extends TriggeredAbilityImpl { - static FilterCreaturePermanent filter = new FilterCreaturePermanent(); + static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); static { - filter.getSubtype().add("Myr"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Myr")); } public MyrGalvanizer (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/MyrReservoir.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/MyrReservoir.java index 89f9bb8167..2555a0cd49 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/MyrReservoir.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/MyrReservoir.java @@ -43,6 +43,7 @@ import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.mana.BasicManaAbility; import mage.cards.CardImpl; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.target.common.TargetCardInYourGraveyard; @@ -56,7 +57,7 @@ public class MyrReservoir extends CardImpl { private static final FilterCard myrCardFilter = new FilterCard("Myr card from your graveyard"); static { - myrCardFilter.getSubtype().add("Myr"); + myrCardFilter.add(new SubtypePredicate("Myr")); } public MyrReservoir(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/PrecursorGolem.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/PrecursorGolem.java index 71babb7534..bb1756fee7 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/PrecursorGolem.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/PrecursorGolem.java @@ -42,6 +42,7 @@ import mage.cards.CardImpl; import mage.filter.Filter; import mage.filter.FilterPermanent; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; @@ -83,7 +84,7 @@ public class PrecursorGolem extends CardImpl { class PrecursorGolemCopyTriggeredAbility extends TriggeredAbilityImpl { - private static FilterSpell filter = new FilterSpell(); + private static final FilterSpell filter = new FilterSpell(); static { filter.getCardType().add(CardType.INSTANT); @@ -153,11 +154,10 @@ class PrecursorGolemCopyTriggeredAbility extends TriggeredAbilityImpl { - private static FilterPermanent filterGolem = new FilterPermanent(); + private static final FilterPermanent filterGolem = new FilterPermanent(); static { - filterGolem.getSubtype().add("Golem"); - filterGolem.setScopeSubtype(Filter.ComparisonScope.Any); + filterGolem.add(new SubtypePredicate("Golem")); } public PrecursorGolemCopySpellEffect() { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/RazorvergeThicket.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/RazorvergeThicket.java index 9f3aa217df..33094a17bb 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/RazorvergeThicket.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/RazorvergeThicket.java @@ -40,7 +40,6 @@ import mage.abilities.effects.common.TapSourceEffect; import mage.abilities.mana.GreenManaAbility; import mage.abilities.mana.WhiteManaAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.common.FilterLandPermanent; /** @@ -51,17 +50,12 @@ public class RazorvergeThicket extends CardImpl { private static FilterLandPermanent filter = new FilterLandPermanent(); - static { - filter.setScopeSubtype(ComparisonScope.Any); - filter.setMessage("lands"); - } - public RazorvergeThicket (UUID ownerId) { super(ownerId, 228, "Razorverge Thicket", Rarity.RARE, new CardType[]{CardType.LAND}, null); this.expansionSetCode = "SOM"; Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.FEWER_THAN, 4)); - String abilityText = "tap it unless you control fewer than 3 " + filter.getMessage(); + String abilityText = "tap it unless you control fewer than 3 lands"; this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); this.addAbility(new GreenManaAbility()); this.addAbility(new WhiteManaAbility()); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/SeachromeCoast.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/SeachromeCoast.java index 42cb6f4c77..acfb25e03d 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/SeachromeCoast.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/SeachromeCoast.java @@ -40,7 +40,6 @@ import mage.abilities.effects.common.TapSourceEffect; import mage.abilities.mana.BlueManaAbility; import mage.abilities.mana.WhiteManaAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.common.FilterLandPermanent; /** @@ -51,17 +50,12 @@ public class SeachromeCoast extends CardImpl { private static FilterLandPermanent filter = new FilterLandPermanent(); - static { - filter.setScopeSubtype(ComparisonScope.Any); - filter.setMessage("lands"); - } - public SeachromeCoast (UUID ownerId) { super(ownerId, 229, "Seachrome Coast", Rarity.RARE, new CardType[]{CardType.LAND}, null); this.expansionSetCode = "SOM"; Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.FEWER_THAN, 4)); - String abilityText = "tap it unless you control fewer than 3 " + filter.getMessage(); + String abilityText = "tap it unless you control fewer than 3 lands"; this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); this.addAbility(new WhiteManaAbility()); this.addAbility(new BlueManaAbility()); diff --git a/Mage.Sets/src/mage/sets/shadowmoor/FlowOfIdeas.java b/Mage.Sets/src/mage/sets/shadowmoor/FlowOfIdeas.java index 9274c116f2..2367cce4be 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/FlowOfIdeas.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/FlowOfIdeas.java @@ -34,6 +34,7 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.DrawCardControllerEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -44,7 +45,7 @@ public class FlowOfIdeas extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("Island you control"); static { - filter.getSubtype().add("Island"); + filter.add(new SubtypePredicate("Island")); } public FlowOfIdeas(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/shadowmoor/LeechriddenSwamp.java b/Mage.Sets/src/mage/sets/shadowmoor/LeechriddenSwamp.java index 28a61608cc..92cf92d346 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/LeechriddenSwamp.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/LeechriddenSwamp.java @@ -28,26 +28,25 @@ package mage.sets.shadowmoor; import java.util.UUID; -import mage.Constants.CardType; -import mage.Constants.Rarity; -import mage.cards.CardImpl; -import mage.abilities.mana.SimpleManaAbility; -import mage.abilities.costs.common.TapSourceCost; -import mage.abilities.effects.common.BasicManaEffect; -import mage.Mana; import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.Mana; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTappedAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.CostImpl; +import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.filter.Filter; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.BasicManaEffect; +import mage.abilities.mana.SimpleManaAbility; +import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; import mage.game.Game; -import mage.abilities.effects.OneShotEffect; import mage.players.Player; import mage.players.Players; -import mage.Constants.Outcome; /** * @@ -89,7 +88,6 @@ class ControlTwoOrMoreBlackPermanentsCost extends CostImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Scarecrow creatures"); static { - filter.getSubtype().add("Scarecrow"); + filter.add(new SubtypePredicate("Scarecrow")); } public ReaperKing(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/shadowmoor/SafewrightQuest.java b/Mage.Sets/src/mage/sets/shadowmoor/SafewrightQuest.java index 96b755d702..d1092053c6 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/SafewrightQuest.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/SafewrightQuest.java @@ -32,8 +32,9 @@ import mage.Constants.CardType; import mage.Constants.Rarity; import mage.abilities.effects.common.search.SearchLibraryRevealPutInHandEffect; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCardInLibrary; /** @@ -45,9 +46,7 @@ public class SafewrightQuest extends CardImpl { private static final FilterCard filter = new FilterCard("Forest or Plains card"); static { - filter.getSubtype().add("Forest"); - filter.getSubtype().add("Plains"); - filter.setScopeSubtype(ComparisonScope.Any); + filter.add(Predicates.or(new SubtypePredicate("Forest"), new SubtypePredicate("Plains"))); } public SafewrightQuest(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/shardsofalara/BantPanorama.java b/Mage.Sets/src/mage/sets/shardsofalara/BantPanorama.java index fd05a5c92e..54ac1989f3 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/BantPanorama.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/BantPanorama.java @@ -40,8 +40,9 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.abilities.mana.ColorlessManaAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SupertypePredicate; import mage.target.common.TargetCardInLibrary; @@ -56,10 +57,10 @@ public class BantPanorama extends CardImpl { static { filter.getCardType().add(CardType.LAND); filter.add(new SupertypePredicate("Basic")); - filter.getSubtype().add("Forest"); - filter.getSubtype().add("Plains"); - filter.getSubtype().add("Island"); - filter.setScopeSubtype(ComparisonScope.Any); + filter.add(Predicates.or( + new SubtypePredicate("Forest"), + new SubtypePredicate("Plains"), + new SubtypePredicate("Island"))); } public BantPanorama(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/shardsofalara/DeathBaron.java b/Mage.Sets/src/mage/sets/shardsofalara/DeathBaron.java index 05524e4a0a..b2c931da7f 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/DeathBaron.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/DeathBaron.java @@ -39,8 +39,8 @@ import mage.abilities.effects.common.continious.BoostControlledEffect; import mage.abilities.effects.common.continious.GainAbilityControlledEffect; import mage.abilities.keyword.DeathtouchAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -52,10 +52,8 @@ public class DeathBaron extends CardImpl { private final static FilterCreaturePermanent filterZombie = new FilterCreaturePermanent("Zombie creatures"); static { - filterSkeletons.getSubtype().add("Skeleton"); - filterSkeletons.setScopeSubtype(Filter.ComparisonScope.Any); - filterZombie.getSubtype().add("Zombie"); - filterZombie.setScopeSubtype(Filter.ComparisonScope.Any); + filterSkeletons.add(new SubtypePredicate("Skeleton")); + filterZombie.add(new SubtypePredicate("Zombie")); } public DeathBaron(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/shardsofalara/EsperPanorama.java b/Mage.Sets/src/mage/sets/shardsofalara/EsperPanorama.java index 6a5e55cb78..0503cb4c44 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/EsperPanorama.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/EsperPanorama.java @@ -40,8 +40,9 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.abilities.mana.ColorlessManaAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SupertypePredicate; import mage.target.common.TargetCardInLibrary; @@ -56,10 +57,10 @@ public class EsperPanorama extends CardImpl { static { filter.getCardType().add(CardType.LAND); filter.add(new SupertypePredicate("Basic")); - filter.getSubtype().add("Plains"); - filter.getSubtype().add("Island"); - filter.getSubtype().add("Swamp"); - filter.setScopeSubtype(ComparisonScope.Any); + filter.add(Predicates.or( + new SubtypePredicate("Plains"), + new SubtypePredicate("Island"), + new SubtypePredicate("Swamp"))); } public EsperPanorama(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/shardsofalara/GrixisPanorama.java b/Mage.Sets/src/mage/sets/shardsofalara/GrixisPanorama.java index 918869453a..0320971444 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/GrixisPanorama.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/GrixisPanorama.java @@ -40,8 +40,9 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.abilities.mana.ColorlessManaAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SupertypePredicate; import mage.target.common.TargetCardInLibrary; @@ -56,10 +57,10 @@ public class GrixisPanorama extends CardImpl { static { filter.getCardType().add(CardType.LAND); filter.add(new SupertypePredicate("Basic")); - filter.getSubtype().add("Island"); - filter.getSubtype().add("Swamp"); - filter.getSubtype().add("Mountain"); - filter.setScopeSubtype(ComparisonScope.Any); + filter.add(Predicates.or( + new SubtypePredicate("Island"), + new SubtypePredicate("Swamp"), + new SubtypePredicate("Mountain"))); } public GrixisPanorama(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/shardsofalara/JundPanorama.java b/Mage.Sets/src/mage/sets/shardsofalara/JundPanorama.java index 2f705be1fa..8bd1f54365 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/JundPanorama.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/JundPanorama.java @@ -41,8 +41,9 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.abilities.mana.ColorlessManaAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SupertypePredicate; import mage.target.common.TargetCardInLibrary; @@ -57,10 +58,10 @@ public class JundPanorama extends CardImpl { static { filter.getCardType().add(CardType.LAND); filter.add(new SupertypePredicate("Basic")); - filter.getSubtype().add("Swamp"); - filter.getSubtype().add("Mountain"); - filter.getSubtype().add("Forest"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new SubtypePredicate("Swamp"), + new SubtypePredicate("Mountain"), + new SubtypePredicate("Forest"))); } public JundPanorama(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/shardsofalara/KnightCaptainOfEos.java b/Mage.Sets/src/mage/sets/shardsofalara/KnightCaptainOfEos.java index e5f69df79c..3192c4b68c 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/KnightCaptainOfEos.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/KnightCaptainOfEos.java @@ -41,6 +41,7 @@ import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.PreventAllDamageEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.permanent.token.SoldierToken; import mage.target.common.TargetControlledCreaturePermanent; @@ -53,7 +54,7 @@ public class KnightCaptainOfEos extends CardImpl { private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("a Soldier"); static { - filter.getSubtype().add("Soldier"); + filter.add(new SubtypePredicate("Soldier")); } public KnightCaptainOfEos(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/shardsofalara/NayaPanorama.java b/Mage.Sets/src/mage/sets/shardsofalara/NayaPanorama.java index 265ff508e2..841592f228 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/NayaPanorama.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/NayaPanorama.java @@ -40,8 +40,9 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.abilities.mana.ColorlessManaAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SupertypePredicate; import mage.target.common.TargetCardInLibrary; @@ -56,10 +57,10 @@ public class NayaPanorama extends CardImpl { static { filter.getCardType().add(CardType.LAND); filter.add(new SupertypePredicate("Basic")); - filter.getSubtype().add("Mountain"); - filter.getSubtype().add("Forest"); - filter.getSubtype().add("Plains"); - filter.setScopeSubtype(ComparisonScope.Any); + filter.add(Predicates.or( + new SubtypePredicate("Mountain"), + new SubtypePredicate("Forest"), + new SubtypePredicate("Plains"))); } public NayaPanorama(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/shardsofalara/WildNacatl.java b/Mage.Sets/src/mage/sets/shardsofalara/WildNacatl.java index 84c1483b6f..0fa14b9dd4 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/WildNacatl.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/WildNacatl.java @@ -36,8 +36,8 @@ import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.continious.BoostSourceWhileControlsEffect; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -49,10 +49,8 @@ public class WildNacatl extends CardImpl { private static final FilterPermanent filter2 = new FilterPermanent("Plains"); static { - filter1.getSubtype().add("Mountain"); - filter1.setScopeSubtype(ComparisonScope.Any); - filter2.getSubtype().add("Plains"); - filter2.setScopeSubtype(ComparisonScope.Any); + filter1.add(new SubtypePredicate("Mountain")); + filter2.add(new SubtypePredicate("Plains")); } public WildNacatl(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tempest/ArmorSliver.java b/Mage.Sets/src/mage/sets/tempest/ArmorSliver.java index 8adabe14c3..a07c834af0 100644 --- a/Mage.Sets/src/mage/sets/tempest/ArmorSliver.java +++ b/Mage.Sets/src/mage/sets/tempest/ArmorSliver.java @@ -39,8 +39,8 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.abilities.effects.common.continious.GainAbilityAllEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -51,8 +51,7 @@ public class ArmorSliver extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("Sliver creatures"); static { - filter.getSubtype().add("Sliver"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Sliver")); } public ArmorSliver(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tempest/BarbedSliver.java b/Mage.Sets/src/mage/sets/tempest/BarbedSliver.java index 15b90aa62b..deb270cb19 100644 --- a/Mage.Sets/src/mage/sets/tempest/BarbedSliver.java +++ b/Mage.Sets/src/mage/sets/tempest/BarbedSliver.java @@ -39,8 +39,8 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.abilities.effects.common.continious.GainAbilityAllEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -51,8 +51,7 @@ public class BarbedSliver extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("Sliver creatures"); static { - filter.getSubtype().add("Sliver"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Sliver")); } public BarbedSliver(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tempest/ClotSliver.java b/Mage.Sets/src/mage/sets/tempest/ClotSliver.java index 271c1ef3f8..0e5935fe62 100644 --- a/Mage.Sets/src/mage/sets/tempest/ClotSliver.java +++ b/Mage.Sets/src/mage/sets/tempest/ClotSliver.java @@ -39,8 +39,8 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.RegenerateSourceEffect; import mage.abilities.effects.common.continious.GainAbilityAllEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @author Loki @@ -50,8 +50,7 @@ public class ClotSliver extends CardImpl { private final static FilterPermanent filter = new FilterPermanent("Slivers"); static { - filter.getSubtype().add("Sliver"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Sliver")); } public ClotSliver(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tempest/Earthcraft.java b/Mage.Sets/src/mage/sets/tempest/Earthcraft.java index fb4a9cedeb..909fed63ec 100644 --- a/Mage.Sets/src/mage/sets/tempest/Earthcraft.java +++ b/Mage.Sets/src/mage/sets/tempest/Earthcraft.java @@ -55,8 +55,6 @@ public class Earthcraft extends CardImpl { static { filterCreature.setUseTapped(true); filterCreature.setTapped(false); - filterCreature.setScopeCardType(Filter.ComparisonScope.Any); - filterCreature.setScopeSubtype(Filter.ComparisonScope.Any); filterLand.getCardType().add(CardType.LAND); filterLand.setScopeCardType(Filter.ComparisonScope.Any); filterLand.add(new SupertypePredicate("Basic")); diff --git a/Mage.Sets/src/mage/sets/tempest/EladamriLordOfLeaves.java b/Mage.Sets/src/mage/sets/tempest/EladamriLordOfLeaves.java index 6a86965b7c..24f778d012 100644 --- a/Mage.Sets/src/mage/sets/tempest/EladamriLordOfLeaves.java +++ b/Mage.Sets/src/mage/sets/tempest/EladamriLordOfLeaves.java @@ -38,9 +38,9 @@ import mage.abilities.effects.common.continious.GainAbilityAllEffect; import mage.abilities.keyword.ForestwalkAbility; import mage.abilities.keyword.ShroudAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -52,10 +52,8 @@ public class EladamriLordOfLeaves extends CardImpl { private final static FilterPermanent filterPermanents = new FilterPermanent("Elves"); static { - filterCreatures.getSubtype().add("Elf"); - filterCreatures.setScopeSubtype(Filter.ComparisonScope.Any); - filterPermanents.getSubtype().add("Elf"); - filterPermanents.setScopeSubtype(Filter.ComparisonScope.Any); + filterCreatures.add(new SubtypePredicate("Elf")); + filterPermanents.add(new SubtypePredicate("Elf")); } public EladamriLordOfLeaves(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tempest/HeartSliver.java b/Mage.Sets/src/mage/sets/tempest/HeartSliver.java index 1d40253651..86bf91920b 100644 --- a/Mage.Sets/src/mage/sets/tempest/HeartSliver.java +++ b/Mage.Sets/src/mage/sets/tempest/HeartSliver.java @@ -37,8 +37,8 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.continious.GainAbilityAllEffect; import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @author Loki @@ -48,8 +48,7 @@ public class HeartSliver extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("All sliver creatures"); static { - filter.getSubtype().add("Sliver"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Sliver")); } public HeartSliver(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tempest/HeartwoodGiant.java b/Mage.Sets/src/mage/sets/tempest/HeartwoodGiant.java index 5a81cc6afa..1654fda330 100644 --- a/Mage.Sets/src/mage/sets/tempest/HeartwoodGiant.java +++ b/Mage.Sets/src/mage/sets/tempest/HeartwoodGiant.java @@ -39,8 +39,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.SubtypePredicate; import mage.target.TargetPlayer; import mage.target.common.TargetControlledPermanent; @@ -53,8 +53,7 @@ public class HeartwoodGiant extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("a Forest"); static { - filter.getSubtype().add("Forest"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Forest")); } public HeartwoodGiant(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tempest/HornedSliver.java b/Mage.Sets/src/mage/sets/tempest/HornedSliver.java index 7650a069a9..72e1bead98 100644 --- a/Mage.Sets/src/mage/sets/tempest/HornedSliver.java +++ b/Mage.Sets/src/mage/sets/tempest/HornedSliver.java @@ -37,8 +37,8 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.continious.GainAbilityAllEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @author Loki @@ -48,8 +48,7 @@ public class HornedSliver extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("All Sliver creatures"); static { - filter.getSubtype().add("Sliver"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Sliver")); } public HornedSliver(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tempest/MarshLurker.java b/Mage.Sets/src/mage/sets/tempest/MarshLurker.java index a7aa3ce98c..f1cf8b0dc0 100644 --- a/Mage.Sets/src/mage/sets/tempest/MarshLurker.java +++ b/Mage.Sets/src/mage/sets/tempest/MarshLurker.java @@ -38,8 +38,8 @@ import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.effects.common.continious.GainAbilitySourceEffect; import mage.abilities.keyword.FearAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetControlledPermanent; /** @@ -51,8 +51,7 @@ public class MarshLurker extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("a Swamp"); static { - filter.getSubtype().add("Swamp"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Swamp")); } public MarshLurker(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tempest/MnemonicSliver.java b/Mage.Sets/src/mage/sets/tempest/MnemonicSliver.java index 71fe48ce51..278fcbdaf4 100644 --- a/Mage.Sets/src/mage/sets/tempest/MnemonicSliver.java +++ b/Mage.Sets/src/mage/sets/tempest/MnemonicSliver.java @@ -41,8 +41,8 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.DrawCardControllerEffect; import mage.abilities.effects.common.continious.GainAbilityAllEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @author Loki @@ -52,8 +52,7 @@ public class MnemonicSliver extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("Sliver creatures"); static { - filter.getSubtype().add("Sliver"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Sliver")); } public MnemonicSliver(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tempest/MoggRaider.java b/Mage.Sets/src/mage/sets/tempest/MoggRaider.java index 27c6bf0c37..98375c6c13 100644 --- a/Mage.Sets/src/mage/sets/tempest/MoggRaider.java +++ b/Mage.Sets/src/mage/sets/tempest/MoggRaider.java @@ -38,8 +38,8 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeTargetCost; 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.SubtypePredicate; import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetCreaturePermanent; @@ -52,8 +52,7 @@ public class MoggRaider extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("a Goblin"); static { - filter.getSubtype().add("Goblin"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Goblin")); } public MoggRaider(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tempest/MuscleSliver.java b/Mage.Sets/src/mage/sets/tempest/MuscleSliver.java index 4981380749..9bf6ef1509 100644 --- a/Mage.Sets/src/mage/sets/tempest/MuscleSliver.java +++ b/Mage.Sets/src/mage/sets/tempest/MuscleSliver.java @@ -36,8 +36,8 @@ import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.continious.BoostAllEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @author Loki @@ -47,8 +47,7 @@ public class MuscleSliver extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("All Sliver creatures"); static { - filter.getSubtype().add("Sliver"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Sliver")); } public MuscleSliver(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tempest/TalonSliver.java b/Mage.Sets/src/mage/sets/tempest/TalonSliver.java index 4899189f44..df54db958a 100644 --- a/Mage.Sets/src/mage/sets/tempest/TalonSliver.java +++ b/Mage.Sets/src/mage/sets/tempest/TalonSliver.java @@ -37,8 +37,8 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.continious.GainAbilityAllEffect; import mage.abilities.keyword.FirstStrikeAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @author Loki @@ -48,8 +48,7 @@ public class TalonSliver extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("All Sliver creatures"); static { - filter.getSubtype().add("Sliver"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Sliver")); } public TalonSliver(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tempest/WingedSliver.java b/Mage.Sets/src/mage/sets/tempest/WingedSliver.java index 7e5dd85750..4670cf81e8 100644 --- a/Mage.Sets/src/mage/sets/tempest/WingedSliver.java +++ b/Mage.Sets/src/mage/sets/tempest/WingedSliver.java @@ -37,8 +37,8 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.continious.GainAbilityAllEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @author Loki @@ -48,8 +48,7 @@ public class WingedSliver extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("All sliver creatures"); static { - filter.getSubtype().add("Sliver"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Sliver")); } public WingedSliver(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tenth/BlanchwoodArmor.java b/Mage.Sets/src/mage/sets/tenth/BlanchwoodArmor.java index 2ffd677e2a..a32b9cf49c 100644 --- a/Mage.Sets/src/mage/sets/tenth/BlanchwoodArmor.java +++ b/Mage.Sets/src/mage/sets/tenth/BlanchwoodArmor.java @@ -40,6 +40,7 @@ import mage.abilities.effects.common.continious.BoostEnchantedEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -52,7 +53,7 @@ public class BlanchwoodArmor extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("Forest you control"); static { - filter.getSubtype().add("Forest"); + filter.add(new SubtypePredicate("Forest")); } public BlanchwoodArmor(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tenth/ElvishChampion.java b/Mage.Sets/src/mage/sets/tenth/ElvishChampion.java index 280e00f060..5f900f7b1c 100644 --- a/Mage.Sets/src/mage/sets/tenth/ElvishChampion.java +++ b/Mage.Sets/src/mage/sets/tenth/ElvishChampion.java @@ -38,8 +38,8 @@ import mage.abilities.effects.common.continious.BoostAllEffect; import mage.abilities.effects.common.continious.GainAbilityAllEffect; import mage.abilities.keyword.ForestwalkAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -50,8 +50,7 @@ public class ElvishChampion extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("Elf creatures"); static { - filter.getSubtype().add("Elf"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Elf")); } public ElvishChampion(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tenth/FieldMarshal.java b/Mage.Sets/src/mage/sets/tenth/FieldMarshal.java index 75ff1c87e1..2c0eb5ca93 100644 --- a/Mage.Sets/src/mage/sets/tenth/FieldMarshal.java +++ b/Mage.Sets/src/mage/sets/tenth/FieldMarshal.java @@ -38,8 +38,8 @@ import mage.abilities.effects.common.continious.BoostAllEffect; import mage.abilities.effects.common.continious.GainAbilityAllEffect; import mage.abilities.keyword.FirstStrikeAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @author anonymous @@ -49,8 +49,7 @@ public class FieldMarshal extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("Soldier creatures"); static { - filter.getSubtype().add("Soldier"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Soldier")); } public FieldMarshal(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tenth/GoblinKing.java b/Mage.Sets/src/mage/sets/tenth/GoblinKing.java index 25ed1089ba..706859479f 100644 --- a/Mage.Sets/src/mage/sets/tenth/GoblinKing.java +++ b/Mage.Sets/src/mage/sets/tenth/GoblinKing.java @@ -38,8 +38,8 @@ import mage.abilities.effects.common.continious.BoostAllEffect; import mage.abilities.effects.common.continious.GainAbilityAllEffect; import mage.abilities.keyword.MountainwalkAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @author Loki @@ -49,8 +49,7 @@ public class GoblinKing extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("Goblin creatures"); static { - filter.getSubtype().add("Goblin"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Goblin")); } public GoblinKing(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tenth/LordOfTheUndead.java b/Mage.Sets/src/mage/sets/tenth/LordOfTheUndead.java index e108949f80..ee2d3b8037 100644 --- a/Mage.Sets/src/mage/sets/tenth/LordOfTheUndead.java +++ b/Mage.Sets/src/mage/sets/tenth/LordOfTheUndead.java @@ -41,9 +41,9 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.effects.common.continious.BoostControlledEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterCard; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCardInYourGraveyard; /** @@ -55,10 +55,8 @@ public class LordOfTheUndead extends CardImpl { private final static FilterCard filterCard = new FilterCard("Zombie card from your graveyard"); static { - filter.getSubtype().add("Zombie"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); - filterCard.getSubtype().add("Zombie"); - filterCard.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Zombie")); + filterCard.add(new SubtypePredicate("Zombie")); } public LordOfTheUndead(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tenth/Mobilization.java b/Mage.Sets/src/mage/sets/tenth/Mobilization.java index e6080f9ae4..ee3c6246f1 100644 --- a/Mage.Sets/src/mage/sets/tenth/Mobilization.java +++ b/Mage.Sets/src/mage/sets/tenth/Mobilization.java @@ -39,8 +39,8 @@ import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.continious.GainAbilityAllEffect; import mage.abilities.keyword.VigilanceAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.permanent.token.SoldierToken; /** @@ -52,8 +52,7 @@ public class Mobilization extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("Soldier creatures"); static { - filter.getSubtype().add("Soldier"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Soldier")); } public Mobilization(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tenth/Nightmare.java b/Mage.Sets/src/mage/sets/tenth/Nightmare.java index 92c8fa0cd6..0a39f463fb 100644 --- a/Mage.Sets/src/mage/sets/tenth/Nightmare.java +++ b/Mage.Sets/src/mage/sets/tenth/Nightmare.java @@ -39,6 +39,7 @@ import mage.abilities.effects.common.continious.SetPowerToughnessSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -49,7 +50,7 @@ public class Nightmare extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("Swamps you control"); static { - filter.getSubtype().add("Swamp"); + filter.add(new SubtypePredicate("Swamp")); } public Nightmare(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tenth/SpittingEarth.java b/Mage.Sets/src/mage/sets/tenth/SpittingEarth.java index 24e7809001..17556f9698 100644 --- a/Mage.Sets/src/mage/sets/tenth/SpittingEarth.java +++ b/Mage.Sets/src/mage/sets/tenth/SpittingEarth.java @@ -34,6 +34,7 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -45,7 +46,7 @@ public class SpittingEarth extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("Mountain you control"); static { - filter.getSubtype().add("Mountain"); + filter.add(new SubtypePredicate("Mountain")); } public SpittingEarth(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/urzassaga/GaeasCradle.java b/Mage.Sets/src/mage/sets/urzassaga/GaeasCradle.java index ed8eb6ea64..a9f57346ff 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/GaeasCradle.java +++ b/Mage.Sets/src/mage/sets/urzassaga/GaeasCradle.java @@ -35,7 +35,6 @@ 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; /** @@ -49,7 +48,6 @@ public class GaeasCradle extends CardImpl { static { filter.getCardType().add(CardType.CREATURE); - filter.setScopeSubtype(Filter.ComparisonScope.Any); } public GaeasCradle(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/urzassaga/PriestOfTitania.java b/Mage.Sets/src/mage/sets/urzassaga/PriestOfTitania.java index 988aa26db0..7bcb053b01 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/PriestOfTitania.java +++ b/Mage.Sets/src/mage/sets/urzassaga/PriestOfTitania.java @@ -37,6 +37,7 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.mana.DynamicManaAbility; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -47,7 +48,7 @@ public class PriestOfTitania extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Elf creatures"); static { - filter.getSubtype().add("Elf"); + filter.add(new SubtypePredicate("Elf")); } public PriestOfTitania(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/urzassaga/SerrasSanctum.java b/Mage.Sets/src/mage/sets/urzassaga/SerrasSanctum.java index ad54a4c616..26f8e8a2a0 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/SerrasSanctum.java +++ b/Mage.Sets/src/mage/sets/urzassaga/SerrasSanctum.java @@ -35,7 +35,6 @@ 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; /** @@ -49,7 +48,6 @@ public class SerrasSanctum extends CardImpl { static { filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeSubtype(Filter.ComparisonScope.Any); } public SerrasSanctum(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/urzassaga/TreefolkSeedlings.java b/Mage.Sets/src/mage/sets/urzassaga/TreefolkSeedlings.java index 49b447f130..e5f4828135 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/TreefolkSeedlings.java +++ b/Mage.Sets/src/mage/sets/urzassaga/TreefolkSeedlings.java @@ -40,6 +40,7 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.continious.SetToughnessSourceEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -50,7 +51,7 @@ public class TreefolkSeedlings extends CardImpl { final static FilterControlledPermanent filterLands = new FilterControlledPermanent("Forests you control"); static { - filterLands.getSubtype().add("Forest"); + filterLands.add(new SubtypePredicate("Forest")); } public TreefolkSeedlings (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/worldwake/AkoumBattlesinger.java b/Mage.Sets/src/mage/sets/worldwake/AkoumBattlesinger.java index 2c659c6c45..6d0003eb74 100644 --- a/Mage.Sets/src/mage/sets/worldwake/AkoumBattlesinger.java +++ b/Mage.Sets/src/mage/sets/worldwake/AkoumBattlesinger.java @@ -37,6 +37,7 @@ import mage.abilities.common.AllyEntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.continious.BoostControlledEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -47,7 +48,7 @@ public class AkoumBattlesinger extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Ally creatures you control"); static { - filter.getSubtype().add("Ally"); + filter.add(new SubtypePredicate("Ally")); filter.setTargetController(TargetController.YOU); } diff --git a/Mage.Sets/src/mage/sets/worldwake/AnowonTheRuinSage.java b/Mage.Sets/src/mage/sets/worldwake/AnowonTheRuinSage.java index f54a39daf8..efb96a0a32 100644 --- a/Mage.Sets/src/mage/sets/worldwake/AnowonTheRuinSage.java +++ b/Mage.Sets/src/mage/sets/worldwake/AnowonTheRuinSage.java @@ -36,6 +36,8 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.effects.common.SacrificeAllEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -46,8 +48,7 @@ public class AnowonTheRuinSage extends CardImpl { private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("non-Vampire creature"); static { - filter.getSubtype().add("Vampire"); - filter.setNotSubtype(true); + filter.add(Predicates.not(new SubtypePredicate("Vampire"))); } public AnowonTheRuinSage(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/worldwake/ArborElf.java b/Mage.Sets/src/mage/sets/worldwake/ArborElf.java index 2ceab27786..9cd43480e6 100644 --- a/Mage.Sets/src/mage/sets/worldwake/ArborElf.java +++ b/Mage.Sets/src/mage/sets/worldwake/ArborElf.java @@ -38,8 +38,8 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.UntapTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetLandPermanent; /** @@ -51,8 +51,7 @@ public class ArborElf extends CardImpl { private static final FilterLandPermanent filter = new FilterLandPermanent(); static { - filter.getSubtype().add("Forest"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Forest")); } public ArborElf(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/worldwake/AvengerOfZendikar.java b/Mage.Sets/src/mage/sets/worldwake/AvengerOfZendikar.java index 574b59d1c1..4304125a6e 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.SubtypePredicate; import mage.game.permanent.token.PlantToken; /** @@ -53,7 +54,7 @@ public class AvengerOfZendikar extends CardImpl { static { filter.getCardType().add(CardType.CREATURE); - filter.getSubtype().add("Plant"); + filter.add(new SubtypePredicate("Plant")); filterLand.getCardType().add(CardType.LAND); } diff --git a/Mage.Sets/src/mage/sets/worldwake/ClawsOfValakut.java b/Mage.Sets/src/mage/sets/worldwake/ClawsOfValakut.java index 90f62e439c..b22a223fc0 100644 --- a/Mage.Sets/src/mage/sets/worldwake/ClawsOfValakut.java +++ b/Mage.Sets/src/mage/sets/worldwake/ClawsOfValakut.java @@ -44,6 +44,7 @@ import mage.abilities.keyword.EnchantAbility; import mage.abilities.keyword.FirstStrikeAbility; import mage.cards.CardImpl; import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -56,7 +57,7 @@ public class ClawsOfValakut extends CardImpl { private static final FilterLandPermanent filter = new FilterLandPermanent("Mountain you control"); static { - filter.getSubtype().add("Mountain"); + filter.add(new SubtypePredicate("Mountain")); filter.setTargetController(Constants.TargetController.YOU); } diff --git a/Mage.Sets/src/mage/sets/worldwake/HalimarExcavator.java b/Mage.Sets/src/mage/sets/worldwake/HalimarExcavator.java index 8909ed067b..54e486e830 100644 --- a/Mage.Sets/src/mage/sets/worldwake/HalimarExcavator.java +++ b/Mage.Sets/src/mage/sets/worldwake/HalimarExcavator.java @@ -38,8 +38,8 @@ import mage.abilities.common.AllyEntersBattlefieldTriggeredAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.TargetPlayer; /** @@ -51,8 +51,7 @@ public class HalimarExcavator extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Allies you control"); static { - filter.getSubtype().add("Ally"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Ally")); filter.setTargetController(TargetController.YOU); } diff --git a/Mage.Sets/src/mage/sets/worldwake/HammerOfRuin.java b/Mage.Sets/src/mage/sets/worldwake/HammerOfRuin.java index 29c00495cf..f580b796d1 100644 --- a/Mage.Sets/src/mage/sets/worldwake/HammerOfRuin.java +++ b/Mage.Sets/src/mage/sets/worldwake/HammerOfRuin.java @@ -42,6 +42,7 @@ import mage.abilities.effects.common.continious.BoostEquippedEffect; import mage.abilities.keyword.EquipAbility; import mage.cards.CardImpl; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; @@ -79,7 +80,7 @@ class HammerOfRuinTriggeredAbility extends TriggeredAbilityImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent(); static { - filter.getSubtype().add("Ally"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Ally")); } HarabazDruidManaEffect() { diff --git a/Mage.Sets/src/mage/sets/worldwake/LoamLion.java b/Mage.Sets/src/mage/sets/worldwake/LoamLion.java index 004545be4d..4a2451fc49 100644 --- a/Mage.Sets/src/mage/sets/worldwake/LoamLion.java +++ b/Mage.Sets/src/mage/sets/worldwake/LoamLion.java @@ -38,8 +38,8 @@ import mage.abilities.condition.common.ControlsPermanentCondition; import mage.abilities.decorator.ConditionalContinousEffect; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -51,8 +51,7 @@ public class LoamLion extends CardImpl { private static final FilterLandPermanent filter = new FilterLandPermanent("a Forest"); static { - filter.getSubtype().add("Forest"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Forest")); } public LoamLion(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/worldwake/SejiriMerfolk.java b/Mage.Sets/src/mage/sets/worldwake/SejiriMerfolk.java index 8a9613c083..cec7f6676a 100644 --- a/Mage.Sets/src/mage/sets/worldwake/SejiriMerfolk.java +++ b/Mage.Sets/src/mage/sets/worldwake/SejiriMerfolk.java @@ -39,8 +39,8 @@ import mage.abilities.effects.common.continious.GainAbilitySourceEffect; import mage.abilities.keyword.FirstStrikeAbility; import mage.abilities.keyword.LifelinkAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -54,8 +54,7 @@ public class SejiriMerfolk extends CardImpl { static { filter.getCardType().add(CardType.LAND); - filter.getSubtype().add("Plains"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Plains")); } public SejiriMerfolk(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/worldwake/StoneforgeMystic.java b/Mage.Sets/src/mage/sets/worldwake/StoneforgeMystic.java index 0e198b89eb..a92c4278b3 100644 --- a/Mage.Sets/src/mage/sets/worldwake/StoneforgeMystic.java +++ b/Mage.Sets/src/mage/sets/worldwake/StoneforgeMystic.java @@ -40,6 +40,7 @@ import mage.abilities.effects.common.PlayTargetWithoutPayingManaEffect; import mage.abilities.effects.common.search.SearchLibraryRevealPutInHandEffect; import mage.cards.CardImpl; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCardInHand; import mage.target.common.TargetCardInLibrary; @@ -55,7 +56,7 @@ public class StoneforgeMystic extends CardImpl { static { filter.getCardType().add(CardType.ARTIFACT); - filter.getSubtype().add("Equipment"); + filter.add(new SubtypePredicate("Equipment")); } public StoneforgeMystic(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/zendikar/ArmamentMaster.java b/Mage.Sets/src/mage/sets/zendikar/ArmamentMaster.java index 5df251c5b5..21928a6f67 100644 --- a/Mage.Sets/src/mage/sets/zendikar/ArmamentMaster.java +++ b/Mage.Sets/src/mage/sets/zendikar/ArmamentMaster.java @@ -40,6 +40,7 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ContinuousEffectImpl; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; @@ -55,7 +56,7 @@ public class ArmamentMaster extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Other Kor creatures you control"); static { - filter.getSubtype().add("Kor"); + filter.add(new SubtypePredicate("Kor")); } public ArmamentMaster(UUID ownerId) { @@ -86,7 +87,7 @@ class ArmamentMasterEffect extends ContinuousEffectImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Other Kor creatures you control"); static { - filter.getSubtype().add("Kor"); + filter.add(new SubtypePredicate("Kor")); } public ArmamentMasterEffect() { diff --git a/Mage.Sets/src/mage/sets/zendikar/BloodTribute.java b/Mage.Sets/src/mage/sets/zendikar/BloodTribute.java index 56673a045c..72ea521d82 100644 --- a/Mage.Sets/src/mage/sets/zendikar/BloodTribute.java +++ b/Mage.Sets/src/mage/sets/zendikar/BloodTribute.java @@ -36,8 +36,8 @@ import mage.abilities.costs.common.TapTargetCost; import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.KickerAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.players.Player; import mage.target.common.TargetControlledCreaturePermanent; @@ -54,8 +54,7 @@ public class BloodTribute extends CardImpl { static { filter.setTapped(false); filter.setUseTapped(true); - filter.getSubtype().add("Vampire"); - filter.setScopeSubtype(ComparisonScope.Any); + filter.add(new SubtypePredicate("Vampire")); } public BloodTribute(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/zendikar/EmeriaTheSkyRuin.java b/Mage.Sets/src/mage/sets/zendikar/EmeriaTheSkyRuin.java index 63f6271ae9..b074d3965c 100644 --- a/Mage.Sets/src/mage/sets/zendikar/EmeriaTheSkyRuin.java +++ b/Mage.Sets/src/mage/sets/zendikar/EmeriaTheSkyRuin.java @@ -35,9 +35,9 @@ import mage.abilities.common.EntersBattlefieldTappedAbility; import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect; import mage.abilities.mana.WhiteManaAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.common.FilterCreatureCard; import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.target.common.TargetCardInYourGraveyard; @@ -78,8 +78,7 @@ class EmeriaTheSkyRuinTriggeredAbility extends TriggeredAbilityImpl { private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(); static { - filter.getSubtype().add("Vampire"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Vampire")); } public FeastOfBloodCost() { diff --git a/Mage.Sets/src/mage/sets/zendikar/HagraDiabolist.java b/Mage.Sets/src/mage/sets/zendikar/HagraDiabolist.java index 6a3c141809..9834cb3c34 100644 --- a/Mage.Sets/src/mage/sets/zendikar/HagraDiabolist.java +++ b/Mage.Sets/src/mage/sets/zendikar/HagraDiabolist.java @@ -38,8 +38,8 @@ import mage.abilities.common.AllyEntersBattlefieldTriggeredAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.LoseLifeTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.TargetPlayer; /** @@ -51,8 +51,7 @@ public class HagraDiabolist extends CardImpl { private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Allies you control"); static { - filter.getSubtype().add("Ally"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Ally")); filter.setTargetController(Constants.TargetController.YOU); } diff --git a/Mage.Sets/src/mage/sets/zendikar/HaloHunter.java b/Mage.Sets/src/mage/sets/zendikar/HaloHunter.java index 9c1e284feb..31adead90a 100644 --- a/Mage.Sets/src/mage/sets/zendikar/HaloHunter.java +++ b/Mage.Sets/src/mage/sets/zendikar/HaloHunter.java @@ -37,6 +37,7 @@ import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.keyword.IntimidateAbility; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -48,7 +49,7 @@ public class HaloHunter extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Angel"); static { - filter.getSubtype().add("Angel"); + filter.add(new SubtypePredicate("Angel")); } public HaloHunter(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/zendikar/HighlandBerserker.java b/Mage.Sets/src/mage/sets/zendikar/HighlandBerserker.java index af73f7fbf5..7e7032695e 100644 --- a/Mage.Sets/src/mage/sets/zendikar/HighlandBerserker.java +++ b/Mage.Sets/src/mage/sets/zendikar/HighlandBerserker.java @@ -38,8 +38,8 @@ import mage.abilities.common.AllyEntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.continious.GainAbilityAllEffect; import mage.abilities.keyword.FirstStrikeAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -50,8 +50,7 @@ public class HighlandBerserker extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Ally creatures you control"); static { - filter.getSubtype().add("Ally"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Ally")); filter.setTargetController(Constants.TargetController.YOU); } diff --git a/Mage.Sets/src/mage/sets/zendikar/JoragaBard.java b/Mage.Sets/src/mage/sets/zendikar/JoragaBard.java index 5e7a65b4eb..b6618ef7fb 100644 --- a/Mage.Sets/src/mage/sets/zendikar/JoragaBard.java +++ b/Mage.Sets/src/mage/sets/zendikar/JoragaBard.java @@ -38,8 +38,8 @@ import mage.abilities.common.AllyEntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.continious.GainAbilityAllEffect; import mage.abilities.keyword.VigilanceAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -50,8 +50,7 @@ public class JoragaBard extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Ally creatures you control"); static { - filter.getSubtype().add("Ally"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Ally")); filter.setTargetController(Constants.TargetController.YOU); } diff --git a/Mage.Sets/src/mage/sets/zendikar/KazuulWarlord.java b/Mage.Sets/src/mage/sets/zendikar/KazuulWarlord.java index 348312ef81..8a1f897f84 100644 --- a/Mage.Sets/src/mage/sets/zendikar/KazuulWarlord.java +++ b/Mage.Sets/src/mage/sets/zendikar/KazuulWarlord.java @@ -37,8 +37,8 @@ import mage.abilities.common.AllyEntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.counter.AddCountersAllEffect; import mage.cards.CardImpl; import mage.counters.CounterType; -import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -49,8 +49,7 @@ public class KazuulWarlord extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Ally creatures you control"); static { - filter.getSubtype().add("Ally"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Ally")); filter.setTargetController(TargetController.YOU); } diff --git a/Mage.Sets/src/mage/sets/zendikar/KorCartographer.java b/Mage.Sets/src/mage/sets/zendikar/KorCartographer.java index 0cf281df66..1c4af00c6c 100644 --- a/Mage.Sets/src/mage/sets/zendikar/KorCartographer.java +++ b/Mage.Sets/src/mage/sets/zendikar/KorCartographer.java @@ -35,6 +35,7 @@ import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.cards.CardImpl; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCardInLibrary; /** @@ -46,7 +47,7 @@ public class KorCartographer extends CardImpl { private static final FilterCard filter = new FilterCard("Plains card"); static { - filter.getSubtype().add("Plains"); + filter.add(new SubtypePredicate("Plains")); } public KorCartographer(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/zendikar/KorOutfitter.java b/Mage.Sets/src/mage/sets/zendikar/KorOutfitter.java index 3055a03c5b..ed343a9981 100644 --- a/Mage.Sets/src/mage/sets/zendikar/KorOutfitter.java +++ b/Mage.Sets/src/mage/sets/zendikar/KorOutfitter.java @@ -37,6 +37,7 @@ import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.common.TargetControlledCreaturePermanent; @@ -51,7 +52,7 @@ public class KorOutfitter extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("Equipment you control"); static { - filter.getSubtype().add("Equipment"); + filter.add(new SubtypePredicate("Equipment")); } public KorOutfitter(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/zendikar/LandbindRitual.java b/Mage.Sets/src/mage/sets/zendikar/LandbindRitual.java index 765bb9bf74..849b7650ed 100644 --- a/Mage.Sets/src/mage/sets/zendikar/LandbindRitual.java +++ b/Mage.Sets/src/mage/sets/zendikar/LandbindRitual.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.FilterLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -45,7 +46,7 @@ public class LandbindRitual extends CardImpl { private static final FilterLandPermanent filter = new FilterLandPermanent("Plains you control"); static { - filter.getSubtype().add("Plains"); + filter.add(new SubtypePredicate("Plains")); filter.setTargetController(TargetController.YOU); } diff --git a/Mage.Sets/src/mage/sets/zendikar/MalakirBloodwitch.java b/Mage.Sets/src/mage/sets/zendikar/MalakirBloodwitch.java index f21ca4c9b7..e3543da6db 100644 --- a/Mage.Sets/src/mage/sets/zendikar/MalakirBloodwitch.java +++ b/Mage.Sets/src/mage/sets/zendikar/MalakirBloodwitch.java @@ -41,6 +41,7 @@ import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; import mage.filter.FilterCard; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.players.Player; @@ -106,7 +107,7 @@ class MalakirBloodwitchEffect extends OneShotEffect { } FilterControlledPermanent filter = new FilterControlledPermanent("Vampire"); - filter.getSubtype().add("Vampire"); + filter.add(new SubtypePredicate("Vampire")); int amount = game.getBattlefield().countAll(filter, source.getControllerId(), game); Set opponents = game.getOpponents(source.getControllerId()); diff --git a/Mage.Sets/src/mage/sets/zendikar/MindSludge.java b/Mage.Sets/src/mage/sets/zendikar/MindSludge.java index ea97505675..3d4ecdab11 100644 --- a/Mage.Sets/src/mage/sets/zendikar/MindSludge.java +++ b/Mage.Sets/src/mage/sets/zendikar/MindSludge.java @@ -35,6 +35,7 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.DiscardTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.TargetPlayer; /** @@ -46,7 +47,7 @@ public class MindSludge extends CardImpl { private static final FilterLandPermanent filter = new FilterLandPermanent("Swamp you control"); static { - filter.getSubtype().add("Swamp"); + filter.add(new SubtypePredicate("Swamp")); filter.setTargetController(TargetController.YOU); } diff --git a/Mage.Sets/src/mage/sets/zendikar/MindlessNull.java b/Mage.Sets/src/mage/sets/zendikar/MindlessNull.java index 217fbd38b3..be1ff974fd 100644 --- a/Mage.Sets/src/mage/sets/zendikar/MindlessNull.java +++ b/Mage.Sets/src/mage/sets/zendikar/MindlessNull.java @@ -38,6 +38,7 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.RestrictionEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; @@ -75,7 +76,7 @@ class MindlessNullEffect extends RestrictionEffect { public MindlessNullEffect() { super(Duration.WhileOnBattlefield); - filter.getSubtype().add("Vampire"); + filter.add(new SubtypePredicate("Vampire")); staticText = "{this} can't block unless you control a Vampire"; } diff --git a/Mage.Sets/src/mage/sets/zendikar/MurasaPyromancer.java b/Mage.Sets/src/mage/sets/zendikar/MurasaPyromancer.java index 5fd84a5a5e..10fd44006c 100644 --- a/Mage.Sets/src/mage/sets/zendikar/MurasaPyromancer.java +++ b/Mage.Sets/src/mage/sets/zendikar/MurasaPyromancer.java @@ -38,8 +38,8 @@ import mage.abilities.common.AllyEntersBattlefieldTriggeredAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -51,8 +51,7 @@ public class MurasaPyromancer extends CardImpl { private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Ally you control"); static { - filter.getSubtype().add("Ally"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Ally")); filter.setTargetController(Constants.TargetController.YOU); } diff --git a/Mage.Sets/src/mage/sets/zendikar/NissaRevane.java b/Mage.Sets/src/mage/sets/zendikar/NissaRevane.java index 41654ed5cb..49775937c8 100644 --- a/Mage.Sets/src/mage/sets/zendikar/NissaRevane.java +++ b/Mage.Sets/src/mage/sets/zendikar/NissaRevane.java @@ -42,6 +42,7 @@ import mage.counters.CounterType; import mage.filter.FilterCard; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.mageobject.NamePredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.players.Player; import mage.target.common.TargetCardInLibrary; @@ -57,7 +58,7 @@ public class NissaRevane extends CardImpl { static { nissasChosenFilter.add(new NamePredicate("Nissa's Chosen")); - elfFilter.getSubtype().add("Elf"); + elfFilter.add(new SubtypePredicate("Elf")); } public NissaRevane(UUID ownerId) { @@ -93,7 +94,7 @@ class NissaRevaneGainLifeEffect extends OneShotEffect private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(); static { - filter.getSubtype().add("Elf"); + filter.add(new SubtypePredicate("Elf")); } public NissaRevaneGainLifeEffect() { diff --git a/Mage.Sets/src/mage/sets/zendikar/OnduCleric.java b/Mage.Sets/src/mage/sets/zendikar/OnduCleric.java index 0218a187ee..74c1400d40 100644 --- a/Mage.Sets/src/mage/sets/zendikar/OnduCleric.java +++ b/Mage.Sets/src/mage/sets/zendikar/OnduCleric.java @@ -37,8 +37,8 @@ import mage.abilities.common.AllyEntersBattlefieldTriggeredAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -49,8 +49,7 @@ public class OnduCleric extends CardImpl { private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Allies you control"); static { - filter.getSubtype().add("Ally"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Ally")); filter.setTargetController(Constants.TargetController.YOU); } diff --git a/Mage.Sets/src/mage/sets/zendikar/PrimalBellow.java b/Mage.Sets/src/mage/sets/zendikar/PrimalBellow.java index 4658bf29d0..60682f8d85 100644 --- a/Mage.Sets/src/mage/sets/zendikar/PrimalBellow.java +++ b/Mage.Sets/src/mage/sets/zendikar/PrimalBellow.java @@ -36,6 +36,7 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.continious.BoostTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -47,7 +48,7 @@ public class PrimalBellow extends CardImpl { private static final FilterLandPermanent filter = new FilterLandPermanent("Forest you control"); static { - filter.getSubtype().add("Forest"); + filter.add(new SubtypePredicate("Forest")); filter.setTargetController(TargetController.YOU); } diff --git a/Mage.Sets/src/mage/sets/zendikar/QuestForTheHolyRelic.java b/Mage.Sets/src/mage/sets/zendikar/QuestForTheHolyRelic.java index 34b12a80e6..2d2ccf3dc6 100644 --- a/Mage.Sets/src/mage/sets/zendikar/QuestForTheHolyRelic.java +++ b/Mage.Sets/src/mage/sets/zendikar/QuestForTheHolyRelic.java @@ -47,6 +47,7 @@ import mage.counters.CounterType; import mage.filter.Filter; import mage.filter.FilterCard; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -114,7 +115,7 @@ class QuestForTheHolyRelicEffect extends OneShotEffect { private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Ally you control"); static { - filter.getSubtype().add("Ally"); + filter.add(new SubtypePredicate("Ally")); } public SeaGateLoremaster(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/zendikar/SeascapeAerialist.java b/Mage.Sets/src/mage/sets/zendikar/SeascapeAerialist.java index 0fe1846dc9..2a665e439a 100644 --- a/Mage.Sets/src/mage/sets/zendikar/SeascapeAerialist.java +++ b/Mage.Sets/src/mage/sets/zendikar/SeascapeAerialist.java @@ -38,8 +38,8 @@ import mage.abilities.common.AllyEntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.continious.GainAbilityAllEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -50,8 +50,7 @@ public class SeascapeAerialist extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Ally creatures you control"); static { - filter.getSubtype().add("Ally"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Ally")); filter.setTargetController(Constants.TargetController.YOU); } diff --git a/Mage.Sets/src/mage/sets/zendikar/SpireBarrage.java b/Mage.Sets/src/mage/sets/zendikar/SpireBarrage.java index 440ea810c6..df2a5b9047 100644 --- a/Mage.Sets/src/mage/sets/zendikar/SpireBarrage.java +++ b/Mage.Sets/src/mage/sets/zendikar/SpireBarrage.java @@ -34,6 +34,7 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCreatureOrPlayer; import java.util.UUID; @@ -47,7 +48,7 @@ public class SpireBarrage extends CardImpl { private static final FilterLandPermanent filter = new FilterLandPermanent("Mountains"); static { - filter.getSubtype().add("Mountain"); + filter.add(new SubtypePredicate("Mountain")); filter.setTargetController(TargetController.YOU); } diff --git a/Mage.Sets/src/mage/sets/zendikar/TajuruArcher.java b/Mage.Sets/src/mage/sets/zendikar/TajuruArcher.java index 5c9fbab0a7..7a79aa3dad 100644 --- a/Mage.Sets/src/mage/sets/zendikar/TajuruArcher.java +++ b/Mage.Sets/src/mage/sets/zendikar/TajuruArcher.java @@ -39,8 +39,8 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -53,8 +53,7 @@ public class TajuruArcher extends CardImpl { private static final FilterCreaturePermanent filterTarget = new FilterCreaturePermanent("creature with flying"); static { - filter.getSubtype().add("Ally"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Ally")); filter.setTargetController(Constants.TargetController.YOU); filterTarget.getAbilities().add(FlyingAbility.getInstance()); } diff --git a/Mage.Sets/src/mage/sets/zendikar/TimbermawLarva.java b/Mage.Sets/src/mage/sets/zendikar/TimbermawLarva.java index e5c917bead..6d06aa061b 100644 --- a/Mage.Sets/src/mage/sets/zendikar/TimbermawLarva.java +++ b/Mage.Sets/src/mage/sets/zendikar/TimbermawLarva.java @@ -38,6 +38,7 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.cards.CardImpl; import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -48,7 +49,7 @@ public class TimbermawLarva extends CardImpl { private static final FilterLandPermanent filter = new FilterLandPermanent("Forest you control"); static { - filter.getSubtype().add("Forest"); + filter.add(new SubtypePredicate("Forest")); filter.setTargetController(TargetController.YOU); } diff --git a/Mage.Sets/src/mage/sets/zendikar/TrapmakersSnare.java b/Mage.Sets/src/mage/sets/zendikar/TrapmakersSnare.java index 20ac72a138..44c49fe8bf 100644 --- a/Mage.Sets/src/mage/sets/zendikar/TrapmakersSnare.java +++ b/Mage.Sets/src/mage/sets/zendikar/TrapmakersSnare.java @@ -33,6 +33,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.SubtypePredicate; import mage.target.common.TargetCardInLibrary; /** @@ -44,7 +45,7 @@ public class TrapmakersSnare extends CardImpl { private static final FilterCard filter = new FilterCard("Trap card"); static { - filter.getSubtype().add("Trap"); + filter.add(new SubtypePredicate("Trap")); } public TrapmakersSnare(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/zendikar/ValakutTheMoltenPinnacle.java b/Mage.Sets/src/mage/sets/zendikar/ValakutTheMoltenPinnacle.java index d5c0c5da5c..d25f1c40e2 100644 --- a/Mage.Sets/src/mage/sets/zendikar/ValakutTheMoltenPinnacle.java +++ b/Mage.Sets/src/mage/sets/zendikar/ValakutTheMoltenPinnacle.java @@ -37,8 +37,8 @@ import mage.abilities.common.EntersBattlefieldTappedAbility; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.mana.RedManaAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -55,8 +55,7 @@ public class ValakutTheMoltenPinnacle extends CardImpl static final FilterLandPermanent filter = new FilterLandPermanent("Mountain"); static { - filter.getSubtype().add("Mountain"); - filter.setScopeSubtype(ComparisonScope.Any); + filter.add(new SubtypePredicate("Mountain")); } public ValakutTheMoltenPinnacle(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/zendikar/WarrenInstigator.java b/Mage.Sets/src/mage/sets/zendikar/WarrenInstigator.java index d75990f5d9..bdebe1c000 100644 --- a/Mage.Sets/src/mage/sets/zendikar/WarrenInstigator.java +++ b/Mage.Sets/src/mage/sets/zendikar/WarrenInstigator.java @@ -40,6 +40,7 @@ import mage.abilities.keyword.DoubleStrikeAbility; import mage.cards.Card; import mage.cards.CardImpl; import mage.filter.common.FilterCreatureCard; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.players.Player; @@ -129,7 +130,7 @@ class WarrenInstigatorEffect extends OneShotEffect { } FilterCreatureCard filter = new FilterCreatureCard("Goblin creature card from your hand"); - filter.getSubtype().add("Goblin"); + filter.add(new SubtypePredicate("Goblin")); TargetCardInHand target = new TargetCardInHand(filter); if (player.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) { Card card = game.getCard(target.getFirstTarget()); diff --git a/Mage/src/mage/abilities/common/FetchLandActivatedAbility.java b/Mage/src/mage/abilities/common/FetchLandActivatedAbility.java index 859ce39acb..89a7337549 100644 --- a/Mage/src/mage/abilities/common/FetchLandActivatedAbility.java +++ b/Mage/src/mage/abilities/common/FetchLandActivatedAbility.java @@ -28,17 +28,20 @@ package mage.abilities.common; -import java.util.Arrays; +import java.util.ArrayList; import mage.Constants.CardType; import mage.Constants.Outcome; import mage.Constants.Zone; +import mage.MageObject; import mage.abilities.ActivatedAbilityImpl; import mage.abilities.costs.common.PayLifeCost; import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; +import mage.filter.predicate.Predicate; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCardInLibrary; /** @@ -47,15 +50,18 @@ import mage.target.common.TargetCardInLibrary; */ public class FetchLandActivatedAbility extends ActivatedAbilityImpl { - public FetchLandActivatedAbility(String[] subTypes) { + public FetchLandActivatedAbility(String[] subtypes) { super(Zone.BATTLEFIELD, null); addCost(new TapSourceCost()); addCost(new PayLifeCost(1)); addCost(new SacrificeSourceCost()); - FilterCard filter = new FilterCard(subTypeNames(subTypes)); + FilterCard filter = new FilterCard(subTypeNames(subtypes)); filter.getCardType().add(CardType.LAND); - filter.getSubtype().addAll(Arrays.asList(subTypes)); - filter.setScopeSubtype(ComparisonScope.Any); + ArrayList> subtypePredicates = new ArrayList>(); + for(int i = 0; i < subtypes.length; i++){ + subtypePredicates.add(new SubtypePredicate(subtypes[i])); + } + filter.add(Predicates.or(subtypePredicates)); TargetCardInLibrary target = new TargetCardInLibrary(filter); addEffect(new SearchLibraryPutInPlayEffect(target, false, true, Outcome.PutLandInPlay)); } diff --git a/Mage/src/mage/abilities/keyword/ForestwalkAbility.java b/Mage/src/mage/abilities/keyword/ForestwalkAbility.java index 057a1bb480..a6f6d1545b 100644 --- a/Mage/src/mage/abilities/keyword/ForestwalkAbility.java +++ b/Mage/src/mage/abilities/keyword/ForestwalkAbility.java @@ -28,8 +28,8 @@ package mage.abilities.keyword; -import mage.filter.Filter.ComparisonScope; import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -40,8 +40,7 @@ public class ForestwalkAbility extends LandwalkAbility { private static final FilterLandPermanent filter = new FilterLandPermanent("Forest"); static { - filter.getSubtype().add("Forest"); - filter.setScopeSubtype(ComparisonScope.Any); + filter.add(new SubtypePredicate("Forest")); } public ForestwalkAbility() { diff --git a/Mage/src/mage/abilities/keyword/IslandwalkAbility.java b/Mage/src/mage/abilities/keyword/IslandwalkAbility.java index 1243e77078..cdd8da7a4c 100644 --- a/Mage/src/mage/abilities/keyword/IslandwalkAbility.java +++ b/Mage/src/mage/abilities/keyword/IslandwalkAbility.java @@ -28,8 +28,8 @@ package mage.abilities.keyword; -import mage.filter.Filter.ComparisonScope; import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -40,8 +40,7 @@ public class IslandwalkAbility extends LandwalkAbility { private static final FilterLandPermanent filter = new FilterLandPermanent("Island"); static { - filter.getSubtype().add("Island"); - filter.setScopeSubtype(ComparisonScope.Any); + filter.add(new SubtypePredicate("Island")); } public IslandwalkAbility() { diff --git a/Mage/src/mage/abilities/keyword/MountainwalkAbility.java b/Mage/src/mage/abilities/keyword/MountainwalkAbility.java index ad9a9cc412..4bb1b8c498 100644 --- a/Mage/src/mage/abilities/keyword/MountainwalkAbility.java +++ b/Mage/src/mage/abilities/keyword/MountainwalkAbility.java @@ -28,8 +28,8 @@ package mage.abilities.keyword; -import mage.filter.Filter.ComparisonScope; import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -40,8 +40,7 @@ public class MountainwalkAbility extends LandwalkAbility { private static final FilterLandPermanent filter = new FilterLandPermanent("Mountain"); static { - filter.getSubtype().add("Mountain"); - filter.setScopeSubtype(ComparisonScope.Any); + filter.add(new SubtypePredicate("Mountain")); } public MountainwalkAbility() { diff --git a/Mage/src/mage/abilities/keyword/PlainswalkAbility.java b/Mage/src/mage/abilities/keyword/PlainswalkAbility.java index f10b9db822..bdd8b688d2 100644 --- a/Mage/src/mage/abilities/keyword/PlainswalkAbility.java +++ b/Mage/src/mage/abilities/keyword/PlainswalkAbility.java @@ -28,8 +28,8 @@ package mage.abilities.keyword; -import mage.filter.Filter.ComparisonScope; import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -40,8 +40,7 @@ public class PlainswalkAbility extends LandwalkAbility { private static final FilterLandPermanent filter = new FilterLandPermanent("Plains"); static { - filter.getSubtype().add("Plains"); - filter.setScopeSubtype(ComparisonScope.Any); + filter.add(new SubtypePredicate("Plains")); } public PlainswalkAbility() { diff --git a/Mage/src/mage/abilities/keyword/SoulshiftAbility.java b/Mage/src/mage/abilities/keyword/SoulshiftAbility.java index c9e0c183cc..c202e050fe 100644 --- a/Mage/src/mage/abilities/keyword/SoulshiftAbility.java +++ b/Mage/src/mage/abilities/keyword/SoulshiftAbility.java @@ -5,6 +5,7 @@ import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.filter.Filter; import mage.filter.FilterCard; import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCardInYourGraveyard; public class SoulshiftAbility extends DiesTriggeredAbility { @@ -14,8 +15,7 @@ public class SoulshiftAbility extends DiesTriggeredAbility { super(new ReturnToHandTargetEffect()); FilterCard filter = new FilterCard("Spirit card with converted mana cost " + amount + " or less from your graveyard"); filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.LessThan, amount + 1)); - filter.getSubtype().add("Spirit"); - filter.setScopeSubtype(Filter.ComparisonScope.Any); + filter.add(new SubtypePredicate("Spirit")); this.addTarget(new TargetCardInYourGraveyard(filter)); this.amount = amount; } diff --git a/Mage/src/mage/abilities/keyword/SwampwalkAbility.java b/Mage/src/mage/abilities/keyword/SwampwalkAbility.java index 792ff6fda5..4da6260675 100644 --- a/Mage/src/mage/abilities/keyword/SwampwalkAbility.java +++ b/Mage/src/mage/abilities/keyword/SwampwalkAbility.java @@ -28,8 +28,8 @@ package mage.abilities.keyword; -import mage.filter.Filter.ComparisonScope; import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -40,8 +40,7 @@ public class SwampwalkAbility extends LandwalkAbility { private static final FilterLandPermanent filter = new FilterLandPermanent("Swamp"); static { - filter.getSubtype().add("Swamp"); - filter.setScopeSubtype(ComparisonScope.Any); + filter.add(new SubtypePredicate("Swamp")); } public SwampwalkAbility() { diff --git a/Mage/src/mage/filter/FilterObject.java b/Mage/src/mage/filter/FilterObject.java index 2104264777..a3f9b6b9a0 100644 --- a/Mage/src/mage/filter/FilterObject.java +++ b/Mage/src/mage/filter/FilterObject.java @@ -58,9 +58,6 @@ public class FilterObject> ex protected ObjectColor color; protected ComparisonScope scopeColor = ComparisonScope.Any; protected boolean notColor; - protected List subtype = new ArrayList(); - protected ComparisonScope scopeSubtype = ComparisonScope.All; - protected boolean notSubtype; /** * Indicates that filter shouldn't match the source. @@ -92,9 +89,6 @@ public class FilterObject> ex this.color = filter.color.copy(); this.scopeColor = filter.scopeColor; this.notColor = filter.notColor; - this.subtype.addAll(filter.subtype); - this.scopeSubtype = filter.scopeSubtype; - this.notSubtype = filter.notSubtype; this.another = filter.another; } @@ -135,13 +129,6 @@ public class FilterObject> ex return notFilter; } - if (subtype.size() > 0) { - if (!object.getAbilities().contains(ChangelingAbility.getInstance())) { - if (!compString.compare(subtype, object.getSubtype(), scopeSubtype, notSubtype)) - return notFilter; - } - } - if (abilities.size() > 0) { List test = new ArrayList(abilities); for (Ability ability: object.getAbilities()) { @@ -199,18 +186,6 @@ public class FilterObject> ex this.notColor = notColor; } - public List getSubtype() { - return this.subtype; - } - - public void setScopeSubtype(ComparisonScope scopeSubtype) { - this.scopeSubtype = scopeSubtype; - } - - public void setNotSubtype(boolean notSubtype) { - this.notSubtype = notSubtype; - } - public void setUseColor(boolean useColor) { this.useColor = useColor; } diff --git a/Mage/src/mage/filter/common/FilterAura.java b/Mage/src/mage/filter/common/FilterAura.java index 5d80317edc..83d137aaff 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.SubtypePredicate; /** * @@ -44,7 +45,7 @@ public class FilterAura extends FilterPermanent { public FilterAura(String name) { super(name); this.cardType.add(CardType.ENCHANTMENT); - this.getSubtype().add("Aura"); + this.add(new SubtypePredicate("Aura")); } public FilterAura(final FilterAura filter) { diff --git a/Mage/src/mage/filter/common/FilterEquipment.java b/Mage/src/mage/filter/common/FilterEquipment.java index 0cc822db56..3a01d8d7af 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.SubtypePredicate; /** * @@ -44,7 +45,7 @@ public class FilterEquipment extends FilterPermanent { public FilterEquipment(String name) { super(name); this.cardType.add(CardType.ARTIFACT); - this.getSubtype().add("Equipment"); + this.add(new SubtypePredicate("Equipment")); } public FilterEquipment(final FilterEquipment filter) { diff --git a/Mage/src/mage/filter/common/FilterFortification.java b/Mage/src/mage/filter/common/FilterFortification.java index 241aa4cb64..5107d33fed 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.SubtypePredicate; /** * @@ -44,7 +45,7 @@ public class FilterFortification extends FilterPermanent { public FilterFortification(String name) { super(name); this.cardType.add(CardType.ARTIFACT); - this.getSubtype().add("Fortification"); + this.add(new SubtypePredicate("Fortification")); } public FilterFortification(final FilterFortification filter) { diff --git a/Mage/src/mage/filter/common/FilterSpiritOrArcaneCard.java b/Mage/src/mage/filter/common/FilterSpiritOrArcaneCard.java index 7a37670528..c7739d165b 100644 --- a/Mage/src/mage/filter/common/FilterSpiritOrArcaneCard.java +++ b/Mage/src/mage/filter/common/FilterSpiritOrArcaneCard.java @@ -1,7 +1,8 @@ package mage.filter.common; -import mage.filter.Filter; import mage.filter.FilterSpell; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; public class FilterSpiritOrArcaneCard extends FilterSpell { @@ -11,9 +12,7 @@ public class FilterSpiritOrArcaneCard extends FilterSpell { public FilterSpiritOrArcaneCard(String name) { super(name); - this.getSubtype().add("Spirit"); - this.getSubtype().add("Arcane"); - this.setScopeSubtype(Filter.ComparisonScope.Any); + this.add(Predicates.or(new SubtypePredicate("Spirit"),new SubtypePredicate("Arcane"))); } public FilterSpiritOrArcaneCard(final FilterSpiritOrArcaneCard filter) { diff --git a/Mage/src/mage/game/GameImpl.java b/Mage/src/mage/game/GameImpl.java index f8c408f85f..d546af2381 100644 --- a/Mage/src/mage/game/GameImpl.java +++ b/Mage/src/mage/game/GameImpl.java @@ -85,6 +85,7 @@ import org.apache.log4j.Logger; import java.io.IOException; import java.io.Serializable; import java.util.*; +import mage.filter.predicate.mageobject.SubtypePredicate; public abstract class GameImpl> implements Game, Serializable { @@ -1036,8 +1037,7 @@ public abstract class GameImpl> implements Game, Serializa for (Permanent planeswalker: planeswalkers) { for (String planeswalkertype: planeswalker.getSubtype()) { FilterPlaneswalkerPermanent filterPlaneswalker = new FilterPlaneswalkerPermanent(); - filterPlaneswalker.getSubtype().add(planeswalkertype); - filterPlaneswalker.setScopeSubtype(ComparisonScope.Any); + filterPlaneswalker.add(new SubtypePredicate(planeswalkertype)); if (getBattlefield().contains(filterPlaneswalker, planeswalker.getControllerId(), this, 2)) { for (Permanent perm: getBattlefield().getActivePermanents(filterPlaneswalker, planeswalker.getControllerId(), this)) { perm.moveToZone(Zone.GRAVEYARD, null, this, false);