From 13f744f09fefedf2dea584ee32680f869126a254 Mon Sep 17 00:00:00 2001 From: North Date: Fri, 13 Jul 2012 22:46:45 +0300 Subject: [PATCH] [filters] Replaced color conditions with Predicates --- .../alarareborn/SphinxOfTheSteelWind.java | 13 ++-- .../src/mage/sets/apocalypse/BogGnarr.java | 4 +- .../src/mage/sets/apocalypse/GladeGnarr.java | 4 +- .../avacynrestored/AngelOfJubilation.java | 6 +- .../mage/sets/avacynrestored/CallToServe.java | 9 ++- .../sets/betrayersofkamigawa/PusKami.java | 7 +- .../championsofkamigawa/AkkiLavarunner.java | 5 +- .../EightAndAHalfTale.java | 4 +- .../championsofkamigawa/TenzaGodosMaul.java | 7 +- .../src/mage/sets/conflux/BloodhallOoze.java | 10 +-- .../src/mage/sets/conflux/CelestialPurge.java | 12 +-- .../sets/conflux/CliffrunnerBehemoth.java | 8 +- .../sets/conflux/ControlledInstincts.java | 11 +-- .../src/mage/sets/conflux/DarkTemper.java | 5 +- .../src/mage/sets/conflux/EmberWeaver.java | 5 +- .../mage/sets/conflux/GoblinOutlander.java | 7 +- .../mage/sets/conflux/NacatlOutlander.java | 7 +- .../src/mage/sets/conflux/ToxicIguanar.java | 5 +- .../mage/sets/conflux/ValeronOutlander.java | 7 +- .../mage/sets/conflux/VedalkenOutlander.java | 7 +- .../src/mage/sets/conflux/ViewFromAbove.java | 5 +- .../mage/sets/conflux/ZombieOutlander.java | 7 +- .../mage/sets/darkascension/FaithsShield.java | 6 +- .../sets/darksteel/SwordOfFireAndIce.java | 11 +-- .../sets/darksteel/SwordOfLightAndShadow.java | 11 +-- .../src/mage/sets/dissension/SealOfDoom.java | 6 +- .../elspethvstezzeret/CelestialCrusader.java | 5 +- .../mage/sets/elspethvstezzeret/Crusade.java | 5 +- .../src/mage/sets/eventide/BalefireLiege.java | 13 ++-- .../mage/sets/eventide/BallynockTrapper.java | 4 +- .../sets/eventide/BelligerentHatchling.java | 7 +- .../mage/sets/eventide/CinderPyromancer.java | 5 +- .../mage/sets/eventide/CreakwoodLiege.java | 7 +- .../mage/sets/eventide/DeathbringerLiege.java | 14 ++-- .../mage/sets/eventide/FableOfWolfAndOwl.java | 7 +- .../src/mage/sets/eventide/FangSkulkin.java | 4 +- .../src/mage/sets/eventide/HoofSkulkin.java | 4 +- .../mage/sets/eventide/JawboneSkulkin.java | 4 +- .../mage/sets/eventide/MerrowLevitator.java | 4 +- .../mage/sets/eventide/NoxiousHatchling.java | 7 +- .../src/mage/sets/eventide/ShellSkulkin.java | 4 +- .../mage/sets/eventide/SturdyHatchling.java | 7 +- .../sets/eventide/VoraciousHatchling.java | 7 +- .../sets/eventide/WildernessHypnotist.java | 9 ++- .../src/mage/sets/fifthedition/BadMoon.java | 5 +- .../src/mage/sets/guildpact/Frazzle.java | 7 +- .../mage/sets/guildpact/TiborAndLumia.java | 8 +- .../mage/sets/guildpact/WurmweaverCoil.java | 4 +- .../src/mage/sets/magic2010/BlackKnight.java | 7 +- .../src/mage/sets/magic2010/DoomBlade.java | 7 +- .../mage/sets/magic2010/GreatSableStag.java | 11 +-- .../mage/sets/magic2010/HonorOfThePure.java | 5 +- .../mage/sets/magic2010/IgniteDisorder.java | 9 ++- .../sets/magic2010/LightwielderPaladin.java | 11 +-- .../src/mage/sets/magic2010/MoldAdder.java | 11 +-- .../src/mage/sets/magic2010/WhiteKnight.java | 7 +- .../src/mage/sets/magic2011/AutumnsVeil.java | 10 ++- .../src/mage/sets/magic2011/Combust.java | 11 +-- .../sets/magic2011/DemonOfDeathsGate.java | 5 +- .../src/mage/sets/magic2011/GaeasRevenge.java | 7 +- Mage.Sets/src/mage/sets/magic2011/Incite.java | 40 +--------- .../mage/sets/magic2012/GuardiansPledge.java | 5 +- .../mage/sets/magic2013/AkromasMemorial.java | 11 +-- .../sets/magic2013/GoblinBattleJester.java | 5 +- .../mage/sets/magic2013/KnightOfGlory.java | 9 +-- .../mage/sets/magic2013/KnightOfInfamy.java | 7 +- Mage.Sets/src/mage/sets/magic2013/Revive.java | 5 +- .../mage/sets/mirrodin/TrollsOfTelJilad.java | 5 +- .../mirrodinbesieged/GreenSunsZenith.java | 7 +- .../sets/mirrodinbesieged/MirranCrusader.java | 16 ++-- .../mirrodinbesieged/PhyrexianCrusader.java | 8 +- .../SwordOfFeastAndFamine.java | 9 ++- .../sets/morningtide/ChameleonColossus.java | 5 +- .../src/mage/sets/morningtide/VioletPall.java | 6 +- .../sets/newphyrexia/ApostlesBlessing.java | 6 +- .../newphyrexia/ShrineOfBoundlessGrowth.java | 5 +- .../sets/newphyrexia/ShrineOfBurningRage.java | 7 +- .../newphyrexia/ShrineOfLimitlessPower.java | 5 +- .../newphyrexia/ShrineOfLoyalLegions.java | 5 +- .../newphyrexia/ShrineOfPiercingVision.java | 5 +- .../sets/newphyrexia/SwordOfWarAndPeace.java | 11 +-- .../mage/sets/newphyrexia/VulshokRefugee.java | 7 +- .../sets/planarchaos/CrovaxAscendantHero.java | 14 ++-- .../sets/planarchaos/DuneriderOutlaw.java | 4 +- .../sets/planechase/AscendantEvincar.java | 10 +-- .../sets/ravnika/AgrusKosWojekVeteran.java | 7 +- .../src/mage/sets/ravnika/HuntedHorror.java | 4 +- .../riseoftheeldrazi/AncientStirrings.java | 4 +- .../sets/riseoftheeldrazi/Corpsehatch.java | 7 +- .../riseoftheeldrazi/EmrakulTheAeonsTorn.java | 5 +- .../sets/riseoftheeldrazi/KhalniHydra.java | 4 +- .../mage/sets/riseoftheeldrazi/Vendetta.java | 5 +- .../saviorsofkamigawa/EiganjoFreeRiders.java | 5 +- .../sets/saviorsofkamigawa/HandOfCruelty.java | 5 +- .../sets/saviorsofkamigawa/HandOfHonor.java | 5 +- .../saviorsofkamigawa/OniOfWildPlaces.java | 5 +- .../saviorsofkamigawa/SkullCollector.java | 5 +- .../saviorsofkamigawa/StampedingSerow.java | 5 +- .../scarsofmirrodin/BellowingTanglewurm.java | 5 +- .../sets/scarsofmirrodin/EtchedChampion.java | 17 +++-- .../sets/scarsofmirrodin/GrandArchitect.java | 8 +- .../scarsofmirrodin/SwordOfBodyAndMind.java | 11 +-- .../mage/sets/shadowmoor/BloodmarkMentor.java | 5 +- .../mage/sets/shadowmoor/BoartuskLiege.java | 8 +- .../mage/sets/shadowmoor/CorrosiveMentor.java | 5 +- .../mage/sets/shadowmoor/CrowdOfCinders.java | 5 +- .../sets/shadowmoor/DeepchannelMentor.java | 5 +- .../mage/sets/shadowmoor/DroveOfElves.java | 5 +- .../mage/sets/shadowmoor/EmberstrikeDuo.java | 8 +- .../src/mage/sets/shadowmoor/FaerieSwarm.java | 5 +- .../sets/shadowmoor/GlenElendraLiege.java | 8 +- .../mage/sets/shadowmoor/GravelgillDuo.java | 8 +- .../sets/shadowmoor/GutturalResponse.java | 5 +- .../mage/sets/shadowmoor/HordeOfBoggarts.java | 5 +- .../mage/sets/shadowmoor/KithkinRabble.java | 5 +- .../sets/shadowmoor/LeechriddenSwamp.java | 5 +- .../src/mage/sets/shadowmoor/MassCalcify.java | 7 +- .../mage/sets/shadowmoor/MidnightBanshee.java | 7 +- .../mage/sets/shadowmoor/OversoulOfDusk.java | 13 ++-- .../sets/shadowmoor/ResplendentMentor.java | 5 +- .../mage/sets/shadowmoor/RoughshodMentor.java | 5 +- .../src/mage/sets/shadowmoor/SafeholdDuo.java | 8 +- .../sets/shadowmoor/SootstokeKindler.java | 11 +-- .../mage/sets/shadowmoor/TattermungeDuo.java | 8 +- .../mage/sets/shadowmoor/ThistledownDuo.java | 8 +- .../sets/shadowmoor/ThistledownLiege.java | 8 +- .../mage/sets/shardsofalara/AngelsHerald.java | 11 ++- .../shardsofalara/ExecutionersCapsule.java | 7 +- .../src/mage/sets/tempest/DarkBanishing.java | 7 +- .../src/mage/sets/tempest/DreadOfNight.java | 5 +- Mage.Sets/src/mage/sets/tempest/Perish.java | 5 +- .../src/mage/sets/tempest/RecklessSpite.java | 7 +- Mage.Sets/src/mage/sets/tenth/Deathmark.java | 11 +-- .../src/mage/sets/tenth/Flashfreeze.java | 11 +-- Mage.Sets/src/mage/sets/tenth/HateWeaver.java | 11 +-- .../src/mage/sets/tenth/MightWeaver.java | 11 +-- .../src/mage/sets/tenth/QuirionDryad.java | 15 ++-- Mage.Sets/src/mage/sets/tenth/RageWeaver.java | 11 +-- Mage.Sets/src/mage/sets/tenth/SkyWeaver.java | 11 +-- .../src/mage/sets/tenth/SpiritWeaver.java | 11 +-- Mage.Sets/src/mage/sets/tenth/Terror.java | 6 +- .../sets/timeshifted/AkromaAngelOfWrath.java | 15 ++-- .../sets/timeshifted/WhirlingDervish.java | 4 +- .../mage/sets/urzaslegacy/BloatedToad.java | 7 +- .../mage/sets/urzaslegacy/BoneShredder.java | 6 +- .../mage/sets/urzaslegacy/DarkwatchElves.java | 7 +- .../sets/urzaslegacy/DefenderOfChaos.java | 7 +- .../mage/sets/urzaslegacy/DefenderOfLaw.java | 7 +- .../mage/sets/urzassaga/AbsoluteGrace.java | 7 +- .../src/mage/sets/urzassaga/AbsoluteLaw.java | 7 +- .../mage/sets/urzassaga/DiscipleOfGrace.java | 7 +- .../mage/sets/urzassaga/DiscipleOfLaw.java | 7 +- .../mage/sets/urzassaga/EasternPaladin.java | 7 +- Mage.Sets/src/mage/sets/urzassaga/Guma.java | 7 +- .../src/mage/sets/urzassaga/VoiceOfGrace.java | 7 +- .../src/mage/sets/urzassaga/VoiceOfLaw.java | 7 +- .../mage/sets/urzassaga/WesternPaladin.java | 7 +- .../src/mage/sets/worldwake/EyeOfUgin.java | 4 +- .../mage/sets/worldwake/KorFirewalker.java | 9 +-- .../mage/sets/zendikar/BraveTheElements.java | 11 +-- .../src/mage/sets/zendikar/ChandraAblaze.java | 4 +- .../mage/sets/zendikar/CryptOfAgadeem.java | 4 +- .../mage/sets/zendikar/DevoutLightcaster.java | 10 +-- .../src/mage/sets/zendikar/HideousEnd.java | 7 +- .../mage/sets/zendikar/MalakirBloodwitch.java | 5 +- .../sets/zendikar/OranRiefTheVastwood.java | 7 +- .../GainProtectionFromColorTargetEffect.java | 6 +- Mage/src/mage/filter/FilterObject.java | 75 +------------------ 168 files changed, 618 insertions(+), 697 deletions(-) diff --git a/Mage.Sets/src/mage/sets/alarareborn/SphinxOfTheSteelWind.java b/Mage.Sets/src/mage/sets/alarareborn/SphinxOfTheSteelWind.java index 538606f427..d29a577a1a 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/SphinxOfTheSteelWind.java +++ b/Mage.Sets/src/mage/sets/alarareborn/SphinxOfTheSteelWind.java @@ -32,23 +32,24 @@ import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.keyword.*; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; /** * * @author Loki */ public class SphinxOfTheSteelWind extends CardImpl { - private static FilterCard filter = new FilterCard("red and from green"); + private static final FilterCard filter = new FilterCard("red and from green"); static { - filter.setUseColor(true); - filter.getColor().setRed(true); - filter.getColor().setGreen(true); - filter.setScopeColor(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new ColorPredicate(ObjectColor.RED), + new ColorPredicate(ObjectColor.GREEN))); } public SphinxOfTheSteelWind (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/apocalypse/BogGnarr.java b/Mage.Sets/src/mage/sets/apocalypse/BogGnarr.java index 4495bb4600..5aef251731 100644 --- a/Mage.Sets/src/mage/sets/apocalypse/BogGnarr.java +++ b/Mage.Sets/src/mage/sets/apocalypse/BogGnarr.java @@ -39,6 +39,7 @@ import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.cards.CardImpl; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.stack.Spell; @@ -74,8 +75,7 @@ class BogGnarrTriggeredAbility extends TriggeredAbilityImpl { private final static FilterCreaturePermanent filterNonBlack = new FilterCreaturePermanent("nonblack creatures"); static { - filterNonBlack.setUseColor(true); - filterNonBlack.setColor(ObjectColor.BLACK); - filterNonBlack.setNotColor(true); + filterNonBlack.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); } public AngelOfJubilation(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/avacynrestored/CallToServe.java b/Mage.Sets/src/mage/sets/avacynrestored/CallToServe.java index e1aff94eec..8a09669bff 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/CallToServe.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/CallToServe.java @@ -32,6 +32,7 @@ import java.util.UUID; import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.AttachEffect; @@ -42,6 +43,8 @@ import mage.abilities.keyword.EnchantAbility; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -50,12 +53,10 @@ import mage.target.common.TargetCreaturePermanent; * @author Loki */ public class CallToServe extends CardImpl { - private static FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature"); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature"); static { - filter.setUseColor(true); - filter.setNotColor(true); - filter.getColor().setBlack(true); + filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); } public CallToServe(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/PusKami.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/PusKami.java index 31829446d5..2e5b0c6400 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/PusKami.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/PusKami.java @@ -33,6 +33,7 @@ import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeSourceCost; @@ -41,6 +42,8 @@ import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.keyword.SoulshiftAbility; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -52,9 +55,7 @@ public class PusKami extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature"); static { - filter.setUseColor(true); - filter.getColor().setBlack(true); - filter.setNotColor(true); + filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); } public PusKami(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/AkkiLavarunner.java b/Mage.Sets/src/mage/sets/championsofkamigawa/AkkiLavarunner.java index 1eb8644725..0e64c865b7 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/AkkiLavarunner.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/AkkiLavarunner.java @@ -15,8 +15,8 @@ import mage.abilities.keyword.HasteAbility; import mage.abilities.keyword.ProtectionAbility; import mage.cards.Card; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; @@ -90,8 +90,7 @@ class TokTokVolcanoBorn extends Token { private final static FilterCard filter = new FilterCard("red"); static { - filter.setColor(ObjectColor.RED); - filter.setScopeColor(Filter.ComparisonScope.Any); + filter.add(new ColorPredicate(ObjectColor.RED)); } TokTokVolcanoBorn() { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/EightAndAHalfTale.java b/Mage.Sets/src/mage/sets/championsofkamigawa/EightAndAHalfTale.java index 10047d3074..04aee3d3bf 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/EightAndAHalfTale.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/EightAndAHalfTale.java @@ -43,6 +43,7 @@ import mage.abilities.effects.common.continious.SetCardColorTargetEffect; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetSpellOrPermanent; @@ -55,8 +56,7 @@ public class EightAndAHalfTale extends CardImpl { private final static FilterCard filter = new FilterCard("white"); static { - filter.setUseColor(true); - filter.getColor().setWhite(true); + filter.add(new ColorPredicate(ObjectColor.WHITE)); } public EightAndAHalfTale(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/TenzaGodosMaul.java b/Mage.Sets/src/mage/sets/championsofkamigawa/TenzaGodosMaul.java index 9ed66d7f53..2eaf3ad180 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/TenzaGodosMaul.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/TenzaGodosMaul.java @@ -35,6 +35,7 @@ import mage.Constants.AttachmentType; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.Constants.Zone; +import mage.ObjectColor; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.EquippedMatchesFilterCondition; import mage.abilities.costs.mana.GenericManaCost; @@ -44,8 +45,8 @@ import mage.abilities.effects.common.continious.GainAbilityAttachedEffect; import mage.abilities.keyword.EquipAbility; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.filter.predicate.mageobject.SupertypePredicate; import mage.target.common.TargetControlledCreaturePermanent; @@ -64,9 +65,7 @@ public class TenzaGodosMaul extends CardImpl { static { legendaryFilter.add(new SupertypePredicate("Legendary")); - redFilter.getColor().setRed(true); - redFilter.setUseColor(true); - redFilter.setScopeColor(Filter.ComparisonScope.Any); + redFilter.add(new ColorPredicate(ObjectColor.RED)); } public TenzaGodosMaul(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/conflux/BloodhallOoze.java b/Mage.Sets/src/mage/sets/conflux/BloodhallOoze.java index cd5f5f017a..ec74f91b4b 100644 --- a/Mage.Sets/src/mage/sets/conflux/BloodhallOoze.java +++ b/Mage.Sets/src/mage/sets/conflux/BloodhallOoze.java @@ -32,12 +32,14 @@ import mage.Constants.CardType; import mage.Constants.Rarity; import mage.Constants.Zone; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.counters.CounterType; import mage.filter.FilterPermanent; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -56,7 +58,7 @@ public class BloodhallOoze extends CardImpl { this.color.setRed(true); this.subtype.add("Ooze"); this.power = new MageInt(1); - this.toughness = new MageInt(1); + this.toughness = new MageInt(1); this.addAbility(new BloodhallOozeTriggeredAbility1()); this.addAbility(new BloodhallOozeTriggeredAbility2()); } @@ -77,8 +79,7 @@ class BloodhallOozeTriggeredAbility1 extends TriggeredAbilityImpl { private static final FilterPermanent filter = new FilterPermanent("black or red permanent"); static { - filter.setUseColor(true); - filter.setScopeColor(ComparisonScope.Any); - filter.getColor().setBlack(true); - filter.getColor().setRed(true); + filter.add(Predicates.or( + new ColorPredicate(ObjectColor.BLACK), + new ColorPredicate(ObjectColor.RED))); } public CelestialPurge(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/conflux/CliffrunnerBehemoth.java b/Mage.Sets/src/mage/sets/conflux/CliffrunnerBehemoth.java index b355856890..f8940938c8 100644 --- a/Mage.Sets/src/mage/sets/conflux/CliffrunnerBehemoth.java +++ b/Mage.Sets/src/mage/sets/conflux/CliffrunnerBehemoth.java @@ -33,6 +33,7 @@ import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.ControlsPermanentCondition; import mage.abilities.decorator.ConditionalContinousEffect; @@ -41,6 +42,7 @@ import mage.abilities.keyword.HasteAbility; import mage.abilities.keyword.LifelinkAbility; import mage.cards.CardImpl; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -51,10 +53,8 @@ public class CliffrunnerBehemoth extends CardImpl { private static final FilterPermanent whitePermanentFilter = new FilterPermanent("white"); static { - redPermanentFilter.setUseColor(true); - redPermanentFilter.getColor().setRed(true); - whitePermanentFilter.setUseColor(true); - whitePermanentFilter.getColor().setWhite(true); + redPermanentFilter.add(new ColorPredicate(ObjectColor.RED)); + whitePermanentFilter.add(new ColorPredicate(ObjectColor.WHITE)); } diff --git a/Mage.Sets/src/mage/sets/conflux/ControlledInstincts.java b/Mage.Sets/src/mage/sets/conflux/ControlledInstincts.java index ae92fc8c99..efcd0361d2 100644 --- a/Mage.Sets/src/mage/sets/conflux/ControlledInstincts.java +++ b/Mage.Sets/src/mage/sets/conflux/ControlledInstincts.java @@ -32,13 +32,15 @@ import mage.Constants.CardType; import mage.Constants.Outcome; import mage.Constants.Rarity; import mage.Constants.Zone; +import mage.ObjectColor; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.SkipEnchantedUntapEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -51,10 +53,9 @@ public class ControlledInstincts extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("red or green creature"); static { - filter.getColor().setRed(true); - filter.getColor().setGreen(true); - filter.setUseColor(true); - filter.setScopeColor(ComparisonScope.Any); + filter.add(Predicates.or( + new ColorPredicate(ObjectColor.RED), + new ColorPredicate(ObjectColor.GREEN))); } public ControlledInstincts(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/conflux/DarkTemper.java b/Mage.Sets/src/mage/sets/conflux/DarkTemper.java index 44e40703c9..324cd2bd63 100644 --- a/Mage.Sets/src/mage/sets/conflux/DarkTemper.java +++ b/Mage.Sets/src/mage/sets/conflux/DarkTemper.java @@ -30,10 +30,12 @@ package mage.sets.conflux; import mage.Constants.CardType; import mage.Constants.Outcome; import mage.Constants.Rarity; +import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.common.TargetCreaturePermanent; @@ -91,8 +93,7 @@ class DarkTemperEffect extends OneShotEffect { } FilterPermanent filter = new FilterPermanent("black permanent"); - filter.getColor().setBlack(true); - filter.setUseColor(true); + filter.add(new ColorPredicate(ObjectColor.BLACK)); if (game.getBattlefield().countAll(filter, source.getControllerId(), game) == 0) { permanent.damage(2, source.getSourceId(), game, true, false); diff --git a/Mage.Sets/src/mage/sets/conflux/EmberWeaver.java b/Mage.Sets/src/mage/sets/conflux/EmberWeaver.java index fac732b158..9d8a11dfb8 100644 --- a/Mage.Sets/src/mage/sets/conflux/EmberWeaver.java +++ b/Mage.Sets/src/mage/sets/conflux/EmberWeaver.java @@ -33,6 +33,7 @@ import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.ControlsPermanentCondition; import mage.abilities.decorator.ConditionalContinousEffect; @@ -42,6 +43,7 @@ import mage.abilities.keyword.FirstStrikeAbility; import mage.abilities.keyword.ReachAbility; import mage.cards.CardImpl; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @author Loki @@ -50,8 +52,7 @@ public class EmberWeaver extends CardImpl { private static final FilterPermanent redPermanentFilter = new FilterPermanent("red"); static { - redPermanentFilter.setUseColor(true); - redPermanentFilter.getColor().setRed(true); + redPermanentFilter.add(new ColorPredicate(ObjectColor.RED)); } public EmberWeaver(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/conflux/GoblinOutlander.java b/Mage.Sets/src/mage/sets/conflux/GoblinOutlander.java index fe74e52122..20624cf7f7 100644 --- a/Mage.Sets/src/mage/sets/conflux/GoblinOutlander.java +++ b/Mage.Sets/src/mage/sets/conflux/GoblinOutlander.java @@ -32,10 +32,11 @@ import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -45,9 +46,7 @@ public class GoblinOutlander extends CardImpl { private static final FilterCard filter = new FilterCard("white"); static { - filter.setUseColor(true); - filter.getColor().setWhite(true); - filter.setScopeColor(ComparisonScope.Any); + filter.add(new ColorPredicate(ObjectColor.WHITE)); } public GoblinOutlander(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/conflux/NacatlOutlander.java b/Mage.Sets/src/mage/sets/conflux/NacatlOutlander.java index 1bc54d3d9e..50ba65c968 100644 --- a/Mage.Sets/src/mage/sets/conflux/NacatlOutlander.java +++ b/Mage.Sets/src/mage/sets/conflux/NacatlOutlander.java @@ -32,10 +32,11 @@ import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -45,9 +46,7 @@ public class NacatlOutlander extends CardImpl { private static final FilterCard filter = new FilterCard("blue"); static { - filter.setUseColor(true); - filter.getColor().setBlue(true); - filter.setScopeColor(ComparisonScope.Any); + filter.add(new ColorPredicate(ObjectColor.BLUE)); } public NacatlOutlander(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/conflux/ToxicIguanar.java b/Mage.Sets/src/mage/sets/conflux/ToxicIguanar.java index cf95751024..7334c19b7f 100644 --- a/Mage.Sets/src/mage/sets/conflux/ToxicIguanar.java +++ b/Mage.Sets/src/mage/sets/conflux/ToxicIguanar.java @@ -33,6 +33,7 @@ import mage.Constants.Duration; import mage.Constants.Rarity; import mage.Constants.Zone; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.ControlsPermanentCondition; import mage.abilities.decorator.ConditionalContinousEffect; @@ -40,6 +41,7 @@ import mage.abilities.effects.common.continious.GainAbilitySourceEffect; import mage.abilities.keyword.DeathtouchAbility; import mage.cards.CardImpl; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -50,8 +52,7 @@ public class ToxicIguanar extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("green"); static { - filter.setUseColor(true); - filter.getColor().setGreen(true); + filter.add(new ColorPredicate(ObjectColor.GREEN)); } public ToxicIguanar(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/conflux/ValeronOutlander.java b/Mage.Sets/src/mage/sets/conflux/ValeronOutlander.java index 9d1bfd9866..9d1e07e7bb 100644 --- a/Mage.Sets/src/mage/sets/conflux/ValeronOutlander.java +++ b/Mage.Sets/src/mage/sets/conflux/ValeronOutlander.java @@ -32,10 +32,11 @@ import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -45,9 +46,7 @@ public class ValeronOutlander extends CardImpl { private static final FilterCard filter = new FilterCard("black"); static { - filter.setUseColor(true); - filter.getColor().setBlack(true); - filter.setScopeColor(ComparisonScope.Any); + filter.add(new ColorPredicate(ObjectColor.BLACK)); } public ValeronOutlander(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/conflux/VedalkenOutlander.java b/Mage.Sets/src/mage/sets/conflux/VedalkenOutlander.java index a5e7b23d9b..7377aef051 100644 --- a/Mage.Sets/src/mage/sets/conflux/VedalkenOutlander.java +++ b/Mage.Sets/src/mage/sets/conflux/VedalkenOutlander.java @@ -32,10 +32,11 @@ import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -45,9 +46,7 @@ public class VedalkenOutlander extends CardImpl { private static final FilterCard filter = new FilterCard("red"); static { - filter.setUseColor(true); - filter.getColor().setRed(true); - filter.setScopeColor(ComparisonScope.Any); + filter.add(new ColorPredicate(ObjectColor.RED)); } public VedalkenOutlander(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/conflux/ViewFromAbove.java b/Mage.Sets/src/mage/sets/conflux/ViewFromAbove.java index aa736581b4..776318bc1d 100644 --- a/Mage.Sets/src/mage/sets/conflux/ViewFromAbove.java +++ b/Mage.Sets/src/mage/sets/conflux/ViewFromAbove.java @@ -31,6 +31,7 @@ import mage.Constants.CardType; import mage.Constants.Duration; import mage.Constants.Rarity; import mage.Constants.Zone; +import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.effects.PostResolveEffect; import mage.abilities.effects.common.continious.GainAbilityTargetEffect; @@ -38,6 +39,7 @@ import mage.abilities.keyword.FlyingAbility; import mage.cards.Card; import mage.cards.CardImpl; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; import mage.target.common.TargetCreaturePermanent; @@ -90,8 +92,7 @@ class ViewFromAboveEffect extends PostResolveEffect { @Override public void postResolve(Card card, Ability source, UUID controllerId, Game game) { FilterPermanent filter = new FilterPermanent("white permanent"); - filter.getColor().setWhite(true); - filter.setUseColor(true); + filter.add(new ColorPredicate(ObjectColor.WHITE)); if (game.getBattlefield().countAll(filter, source.getControllerId(), game) > 0) { card.moveToZone(Zone.HAND, source.getId(), game, false); diff --git a/Mage.Sets/src/mage/sets/conflux/ZombieOutlander.java b/Mage.Sets/src/mage/sets/conflux/ZombieOutlander.java index 6aeb8214ac..d0456ebf2a 100644 --- a/Mage.Sets/src/mage/sets/conflux/ZombieOutlander.java +++ b/Mage.Sets/src/mage/sets/conflux/ZombieOutlander.java @@ -32,10 +32,11 @@ import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -45,9 +46,7 @@ public class ZombieOutlander extends CardImpl { private static final FilterCard filter = new FilterCard("green"); static { - filter.setUseColor(true); - filter.getColor().setGreen(true); - filter.setScopeColor(ComparisonScope.Any); + filter.add(new ColorPredicate(ObjectColor.GREEN)); } public ZombieOutlander(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/darkascension/FaithsShield.java b/Mage.Sets/src/mage/sets/darkascension/FaithsShield.java index 314a5f0a20..dd214182e1 100644 --- a/Mage.Sets/src/mage/sets/darkascension/FaithsShield.java +++ b/Mage.Sets/src/mage/sets/darkascension/FaithsShield.java @@ -40,8 +40,8 @@ import mage.abilities.effects.common.continious.GainProtectionFromColorTargetEff import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; import mage.choices.ChoiceColor; -import mage.filter.Filter; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; import mage.target.common.TargetControlledPermanent; @@ -93,10 +93,8 @@ class FaithsShieldEffect extends OneShotEffect { if (FatefulHourCondition.getInstance().apply(game, source)) { ChoiceColor choice = (ChoiceColor) source.getChoices().get(0); FilterCard filter = new FilterCard(); - filter.setUseColor(true); - filter.setColor(choice.getColor()); + filter.add(new ColorPredicate(choice.getColor())); filter.setMessage(choice.getChoice()); - filter.setScopeColor(Filter.ComparisonScope.Any); Ability ability = new ProtectionAbility(filter) ; game.addEffect(new GainAbilityControlledEffect(ability, Duration.EndOfTurn), source); diff --git a/Mage.Sets/src/mage/sets/darksteel/SwordOfFireAndIce.java b/Mage.Sets/src/mage/sets/darksteel/SwordOfFireAndIce.java index 02a1e8ff4a..b802bf6d94 100644 --- a/Mage.Sets/src/mage/sets/darksteel/SwordOfFireAndIce.java +++ b/Mage.Sets/src/mage/sets/darksteel/SwordOfFireAndIce.java @@ -35,6 +35,7 @@ import mage.Constants.CardType; import mage.Constants.Outcome; import mage.Constants.Rarity; import mage.Constants.Zone; +import mage.ObjectColor; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.GenericManaCost; @@ -45,8 +46,9 @@ import mage.abilities.effects.common.continious.GainAbilityAttachedEffect; import mage.abilities.keyword.EquipAbility; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; @@ -61,10 +63,9 @@ public class SwordOfFireAndIce extends CardImpl { private static final FilterCard filter = new FilterCard("red and from blue"); static { - filter.setUseColor(true); - filter.getColor().setRed(true); - filter.getColor().setGreen(true); - filter.setScopeColor(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new ColorPredicate(ObjectColor.RED), + new ColorPredicate(ObjectColor.BLUE))); } diff --git a/Mage.Sets/src/mage/sets/darksteel/SwordOfLightAndShadow.java b/Mage.Sets/src/mage/sets/darksteel/SwordOfLightAndShadow.java index 1b7059f9ad..074ab282e4 100644 --- a/Mage.Sets/src/mage/sets/darksteel/SwordOfLightAndShadow.java +++ b/Mage.Sets/src/mage/sets/darksteel/SwordOfLightAndShadow.java @@ -35,6 +35,7 @@ import mage.Constants.CardType; import mage.Constants.Outcome; import mage.Constants.Rarity; import mage.Constants.Zone; +import mage.ObjectColor; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.GenericManaCost; @@ -45,9 +46,10 @@ import mage.abilities.effects.common.continious.GainAbilityAttachedEffect; import mage.abilities.keyword.EquipAbility; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterCard; import mage.filter.common.FilterCreatureCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; @@ -62,10 +64,9 @@ public class SwordOfLightAndShadow extends CardImpl { private static final FilterCard filter = new FilterCard("white and from black"); static { - filter.setUseColor(true); - filter.getColor().setWhite(true); - filter.getColor().setBlack(true); - filter.setScopeColor(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new ColorPredicate(ObjectColor.WHITE), + new ColorPredicate(ObjectColor.BLACK))); } public SwordOfLightAndShadow(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/dissension/SealOfDoom.java b/Mage.Sets/src/mage/sets/dissension/SealOfDoom.java index 12f9cfd017..c8ea6dd038 100644 --- a/Mage.Sets/src/mage/sets/dissension/SealOfDoom.java +++ b/Mage.Sets/src/mage/sets/dissension/SealOfDoom.java @@ -39,6 +39,8 @@ import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -49,9 +51,7 @@ public class SealOfDoom extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature"); static { - filter.setUseColor(true); - filter.setColor(ObjectColor.BLACK); - filter.setNotColor(true); + filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); } public SealOfDoom(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/elspethvstezzeret/CelestialCrusader.java b/Mage.Sets/src/mage/sets/elspethvstezzeret/CelestialCrusader.java index 7e0eacff9e..93fdb81743 100644 --- a/Mage.Sets/src/mage/sets/elspethvstezzeret/CelestialCrusader.java +++ b/Mage.Sets/src/mage/sets/elspethvstezzeret/CelestialCrusader.java @@ -33,6 +33,7 @@ import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.continious.BoostControlledEffect; import mage.abilities.keyword.FlashAbility; @@ -40,6 +41,7 @@ import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.SplitSecondAbility; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -49,8 +51,7 @@ public class CelestialCrusader extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("white creatures"); static { - filter.setUseColor(true); - filter.getColor().setWhite(true); + filter.add(new ColorPredicate(ObjectColor.WHITE)); } public CelestialCrusader(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/elspethvstezzeret/Crusade.java b/Mage.Sets/src/mage/sets/elspethvstezzeret/Crusade.java index 992fc27275..dc1738338c 100644 --- a/Mage.Sets/src/mage/sets/elspethvstezzeret/Crusade.java +++ b/Mage.Sets/src/mage/sets/elspethvstezzeret/Crusade.java @@ -32,10 +32,12 @@ import mage.Constants.CardType; import mage.Constants.Duration; import mage.Constants.Rarity; import mage.Constants.Zone; +import mage.ObjectColor; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.continious.BoostAllEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -46,8 +48,7 @@ public class Crusade extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("White creatures"); static { - filter.getColor().setWhite(true); - filter.setUseColor(true); + filter.add(new ColorPredicate(ObjectColor.WHITE)); } public Crusade(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/eventide/BalefireLiege.java b/Mage.Sets/src/mage/sets/eventide/BalefireLiege.java index 2f0818af03..60aec5c0e7 100644 --- a/Mage.Sets/src/mage/sets/eventide/BalefireLiege.java +++ b/Mage.Sets/src/mage/sets/eventide/BalefireLiege.java @@ -42,6 +42,7 @@ import mage.abilities.effects.common.continious.BoostControlledEffect; import mage.cards.CardImpl; import mage.filter.FilterSpell; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.TargetPlayer; /** @@ -55,14 +56,10 @@ public class BalefireLiege extends CardImpl { private final static FilterSpell filterWhiteSpell = new FilterSpell("a white spell"); static { - filterRedCreature.setUseColor(true); - filterRedCreature.setColor(ObjectColor.RED); - filterWhiteCreature.setUseColor(true); - filterWhiteCreature.setColor(ObjectColor.WHITE); - filterRedSpell.setUseColor(true); - filterRedSpell.setColor(ObjectColor.RED); - filterWhiteSpell.setUseColor(true); - filterWhiteSpell.setColor(ObjectColor.WHITE); + filterRedCreature.add(new ColorPredicate(ObjectColor.RED)); + filterWhiteCreature.add(new ColorPredicate(ObjectColor.WHITE)); + filterRedSpell.add(new ColorPredicate(ObjectColor.RED)); + filterWhiteSpell.add(new ColorPredicate(ObjectColor.WHITE)); } public BalefireLiege(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/eventide/BallynockTrapper.java b/Mage.Sets/src/mage/sets/eventide/BallynockTrapper.java index 513f2354b9..79e12d50ae 100644 --- a/Mage.Sets/src/mage/sets/eventide/BallynockTrapper.java +++ b/Mage.Sets/src/mage/sets/eventide/BallynockTrapper.java @@ -41,6 +41,7 @@ import mage.abilities.effects.common.TapTargetEffect; import mage.abilities.effects.common.UntapSourceEffect; import mage.cards.CardImpl; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -51,8 +52,7 @@ public class BallynockTrapper extends CardImpl { private final static FilterSpell filterWhiteSpell = new FilterSpell("a white spell"); static { - filterWhiteSpell.setUseColor(true); - filterWhiteSpell.setColor(ObjectColor.WHITE); + filterWhiteSpell.add(new ColorPredicate(ObjectColor.WHITE)); } public BallynockTrapper(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/eventide/BelligerentHatchling.java b/Mage.Sets/src/mage/sets/eventide/BelligerentHatchling.java index 246ba9dc6e..089fb43225 100644 --- a/Mage.Sets/src/mage/sets/eventide/BelligerentHatchling.java +++ b/Mage.Sets/src/mage/sets/eventide/BelligerentHatchling.java @@ -40,6 +40,7 @@ import mage.abilities.keyword.FirstStrikeAbility; import mage.cards.CardImpl; import mage.counters.CounterType; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @author Loki @@ -50,10 +51,8 @@ public class BelligerentHatchling extends CardImpl { private final static FilterSpell filterWhiteSpell = new FilterSpell("a white spell"); static { - filterRedSpell.setUseColor(true); - filterRedSpell.setColor(ObjectColor.RED); - filterWhiteSpell.setUseColor(true); - filterWhiteSpell.setColor(ObjectColor.WHITE); + filterRedSpell.add(new ColorPredicate(ObjectColor.RED)); + filterWhiteSpell.add(new ColorPredicate(ObjectColor.WHITE)); } public BelligerentHatchling(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/eventide/CinderPyromancer.java b/Mage.Sets/src/mage/sets/eventide/CinderPyromancer.java index 43a06a1407..a14932f242 100644 --- a/Mage.Sets/src/mage/sets/eventide/CinderPyromancer.java +++ b/Mage.Sets/src/mage/sets/eventide/CinderPyromancer.java @@ -33,6 +33,7 @@ import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SpellCastTriggeredAbility; @@ -41,6 +42,7 @@ import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.UntapSourceEffect; import mage.cards.CardImpl; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.TargetPlayer; /** @@ -51,8 +53,7 @@ public class CinderPyromancer extends CardImpl { private static final FilterSpell filter = new FilterSpell("a red spell"); static { - filter.getColor().setRed(true); - filter.setUseColor(true); + filter.add(new ColorPredicate(ObjectColor.RED)); } public CinderPyromancer (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/eventide/CreakwoodLiege.java b/Mage.Sets/src/mage/sets/eventide/CreakwoodLiege.java index beea25f93a..9b2d776557 100644 --- a/Mage.Sets/src/mage/sets/eventide/CreakwoodLiege.java +++ b/Mage.Sets/src/mage/sets/eventide/CreakwoodLiege.java @@ -40,6 +40,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.ColorPredicate; import mage.game.permanent.token.Token; /** @@ -52,10 +53,8 @@ public class CreakwoodLiege extends CardImpl { private final static FilterCreaturePermanent filterGreenCreature = new FilterCreaturePermanent("green creatures"); static { - filterBlackCreature.setUseColor(true); - filterBlackCreature.setColor(ObjectColor.BLACK); - filterGreenCreature.setUseColor(true); - filterGreenCreature.setColor(ObjectColor.GREEN); + filterBlackCreature.add(new ColorPredicate(ObjectColor.BLACK)); + filterGreenCreature.add(new ColorPredicate(ObjectColor.GREEN)); } diff --git a/Mage.Sets/src/mage/sets/eventide/DeathbringerLiege.java b/Mage.Sets/src/mage/sets/eventide/DeathbringerLiege.java index e210fc13c0..a285ab1554 100644 --- a/Mage.Sets/src/mage/sets/eventide/DeathbringerLiege.java +++ b/Mage.Sets/src/mage/sets/eventide/DeathbringerLiege.java @@ -33,6 +33,7 @@ import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SpellCastTriggeredAbility; @@ -42,6 +43,7 @@ import mage.abilities.effects.common.continious.BoostControlledEffect; import mage.cards.CardImpl; import mage.filter.FilterSpell; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.common.TargetCreaturePermanent; @@ -57,14 +59,10 @@ public class DeathbringerLiege extends CardImpl { private final static FilterSpell filterBlackSpellCard = new FilterSpell("a black spell"); static { - filterWhite.setUseColor(true); - filterWhite.getColor().setWhite(true); - filterBlack.setUseColor(true); - filterBlack.getColor().setBlack(true); - filterWhiteSpellCard.setUseColor(true); - filterWhiteSpellCard.getColor().setWhite(true); - filterBlackSpellCard.setUseColor(true); - filterBlackSpellCard.getColor().setBlack(true); + filterWhite.add(new ColorPredicate(ObjectColor.WHITE)); + filterBlack.add(new ColorPredicate(ObjectColor.BLACK)); + filterWhiteSpellCard.add(new ColorPredicate(ObjectColor.WHITE)); + filterBlackSpellCard.add(new ColorPredicate(ObjectColor.BLACK)); } public DeathbringerLiege (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/eventide/FableOfWolfAndOwl.java b/Mage.Sets/src/mage/sets/eventide/FableOfWolfAndOwl.java index 34327b6f81..756eaffd34 100644 --- a/Mage.Sets/src/mage/sets/eventide/FableOfWolfAndOwl.java +++ b/Mage.Sets/src/mage/sets/eventide/FableOfWolfAndOwl.java @@ -37,6 +37,7 @@ import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.permanent.token.Token; import mage.game.permanent.token.WolfToken; @@ -49,10 +50,8 @@ public class FableOfWolfAndOwl extends CardImpl { private final static FilterSpell filterBlueSpell = new FilterSpell("a blue spell"); static { - filterGreenSpell.setUseColor(true); - filterGreenSpell.setColor(ObjectColor.GREEN); - filterBlueSpell.setUseColor(true); - filterBlueSpell.setColor(ObjectColor.BLUE); + filterGreenSpell.add(new ColorPredicate(ObjectColor.GREEN)); + filterBlueSpell.add(new ColorPredicate(ObjectColor.BLUE)); } public FableOfWolfAndOwl(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/eventide/FangSkulkin.java b/Mage.Sets/src/mage/sets/eventide/FangSkulkin.java index c2dad3df18..e5017d4f82 100644 --- a/Mage.Sets/src/mage/sets/eventide/FangSkulkin.java +++ b/Mage.Sets/src/mage/sets/eventide/FangSkulkin.java @@ -41,6 +41,7 @@ import mage.abilities.effects.common.continious.GainAbilityTargetEffect; import mage.abilities.keyword.WitherAbility; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -51,8 +52,7 @@ public class FangSkulkin extends CardImpl { private final static FilterCreaturePermanent filterBlackCreature = new FilterCreaturePermanent("black creature"); static { - filterBlackCreature.setUseColor(true); - filterBlackCreature.setColor(ObjectColor.BLACK); + filterBlackCreature.add(new ColorPredicate(ObjectColor.BLACK)); } public FangSkulkin(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/eventide/HoofSkulkin.java b/Mage.Sets/src/mage/sets/eventide/HoofSkulkin.java index e6e8960129..cece2b9d8d 100644 --- a/Mage.Sets/src/mage/sets/eventide/HoofSkulkin.java +++ b/Mage.Sets/src/mage/sets/eventide/HoofSkulkin.java @@ -40,6 +40,7 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.continious.BoostTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -50,8 +51,7 @@ public class HoofSkulkin extends CardImpl { private final static FilterCreaturePermanent filterGreenCreature = new FilterCreaturePermanent("green creature"); static { - filterGreenCreature.setUseColor(true); - filterGreenCreature.setColor(ObjectColor.GREEN); + filterGreenCreature.add(new ColorPredicate(ObjectColor.GREEN)); } public HoofSkulkin(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/eventide/JawboneSkulkin.java b/Mage.Sets/src/mage/sets/eventide/JawboneSkulkin.java index 8b97bcfe76..127ebd74d3 100644 --- a/Mage.Sets/src/mage/sets/eventide/JawboneSkulkin.java +++ b/Mage.Sets/src/mage/sets/eventide/JawboneSkulkin.java @@ -41,6 +41,7 @@ import mage.abilities.effects.common.continious.GainAbilityTargetEffect; import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -51,8 +52,7 @@ public class JawboneSkulkin extends CardImpl { private final static FilterCreaturePermanent filterRedCreature = new FilterCreaturePermanent("red creature"); static { - filterRedCreature.setUseColor(true); - filterRedCreature.setColor(ObjectColor.RED); + filterRedCreature.add(new ColorPredicate(ObjectColor.RED)); } public JawboneSkulkin(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/eventide/MerrowLevitator.java b/Mage.Sets/src/mage/sets/eventide/MerrowLevitator.java index 4270664178..93b6cbd86d 100644 --- a/Mage.Sets/src/mage/sets/eventide/MerrowLevitator.java +++ b/Mage.Sets/src/mage/sets/eventide/MerrowLevitator.java @@ -42,6 +42,7 @@ import mage.abilities.effects.common.continious.GainAbilityTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -54,8 +55,7 @@ public class MerrowLevitator extends CardImpl { private final static FilterSpell filterBlueSpell = new FilterSpell("a blue spell"); static { - filterBlueSpell.setUseColor(true); - filterBlueSpell.setColor(ObjectColor.BLUE); + filterBlueSpell.add(new ColorPredicate(ObjectColor.BLUE)); } public MerrowLevitator(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/eventide/NoxiousHatchling.java b/Mage.Sets/src/mage/sets/eventide/NoxiousHatchling.java index 58fe830f7f..4e64bddc70 100644 --- a/Mage.Sets/src/mage/sets/eventide/NoxiousHatchling.java +++ b/Mage.Sets/src/mage/sets/eventide/NoxiousHatchling.java @@ -40,6 +40,7 @@ import mage.abilities.keyword.WitherAbility; import mage.cards.CardImpl; import mage.counters.CounterType; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -51,10 +52,8 @@ public class NoxiousHatchling extends CardImpl { private final static FilterSpell filterGreenSpell = new FilterSpell("a green spell"); static { - filterBlackSpell.setUseColor(true); - filterBlackSpell.setColor(ObjectColor.BLACK); - filterGreenSpell.setUseColor(true); - filterGreenSpell.setColor(ObjectColor.GREEN); + filterBlackSpell.add(new ColorPredicate(ObjectColor.BLACK)); + filterGreenSpell.add(new ColorPredicate(ObjectColor.GREEN)); } public NoxiousHatchling(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/eventide/ShellSkulkin.java b/Mage.Sets/src/mage/sets/eventide/ShellSkulkin.java index 8a8ce56845..116922b91c 100644 --- a/Mage.Sets/src/mage/sets/eventide/ShellSkulkin.java +++ b/Mage.Sets/src/mage/sets/eventide/ShellSkulkin.java @@ -41,6 +41,7 @@ import mage.abilities.effects.common.continious.GainAbilityTargetEffect; import mage.abilities.keyword.ShroudAbility; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -51,8 +52,7 @@ public class ShellSkulkin extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("blue creature"); static { - filter.setUseColor(true); - filter.setColor(ObjectColor.BLUE); + filter.add(new ColorPredicate(ObjectColor.BLUE)); } public ShellSkulkin(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/eventide/SturdyHatchling.java b/Mage.Sets/src/mage/sets/eventide/SturdyHatchling.java index 4b5c9f67b2..a0e2851cba 100644 --- a/Mage.Sets/src/mage/sets/eventide/SturdyHatchling.java +++ b/Mage.Sets/src/mage/sets/eventide/SturdyHatchling.java @@ -44,6 +44,7 @@ import mage.abilities.keyword.ShroudAbility; import mage.cards.CardImpl; import mage.counters.CounterType; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @author Loki @@ -54,10 +55,8 @@ public class SturdyHatchling extends CardImpl { private final static FilterSpell filterBlueSpell = new FilterSpell("a blue spell"); static { - filterGreenSpell.setUseColor(true); - filterGreenSpell.setColor(ObjectColor.GREEN); - filterBlueSpell.setUseColor(true); - filterBlueSpell.setColor(ObjectColor.BLUE); + filterGreenSpell.add(new ColorPredicate(ObjectColor.GREEN)); + filterBlueSpell.add(new ColorPredicate(ObjectColor.BLUE)); } public SturdyHatchling(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/eventide/VoraciousHatchling.java b/Mage.Sets/src/mage/sets/eventide/VoraciousHatchling.java index 2ff0d7cc46..ceaec8c70f 100644 --- a/Mage.Sets/src/mage/sets/eventide/VoraciousHatchling.java +++ b/Mage.Sets/src/mage/sets/eventide/VoraciousHatchling.java @@ -40,6 +40,7 @@ import mage.abilities.keyword.LifelinkAbility; import mage.cards.CardImpl; import mage.counters.CounterType; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @author Loki @@ -50,10 +51,8 @@ public class VoraciousHatchling extends CardImpl { private final static FilterSpell filterBlackSpell = new FilterSpell("a black spell"); static { - filterWhiteSpell.setUseColor(true); - filterWhiteSpell.setColor(ObjectColor.WHITE); - filterBlackSpell.setUseColor(true); - filterBlackSpell.setColor(ObjectColor.BLACK); + filterWhiteSpell.add(new ColorPredicate(ObjectColor.WHITE)); + filterBlackSpell.add(new ColorPredicate(ObjectColor.BLACK)); } public VoraciousHatchling(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/eventide/WildernessHypnotist.java b/Mage.Sets/src/mage/sets/eventide/WildernessHypnotist.java index 276f2f756a..9d62dc0d2d 100644 --- a/Mage.Sets/src/mage/sets/eventide/WildernessHypnotist.java +++ b/Mage.Sets/src/mage/sets/eventide/WildernessHypnotist.java @@ -33,12 +33,15 @@ import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.continious.BoostTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -49,9 +52,9 @@ public class WildernessHypnotist extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("red or green creature"); static { - filter.setUseColor(true); - filter.getColor().setRed(true); - filter.getColor().setGreen(true); + filter.add(Predicates.or( + new ColorPredicate(ObjectColor.RED), + new ColorPredicate(ObjectColor.GREEN))); } public WildernessHypnotist(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/fifthedition/BadMoon.java b/Mage.Sets/src/mage/sets/fifthedition/BadMoon.java index c34fe8bcaf..7308e3a3a1 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/BadMoon.java +++ b/Mage.Sets/src/mage/sets/fifthedition/BadMoon.java @@ -31,10 +31,12 @@ import java.util.UUID; import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.ObjectColor; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.continious.BoostAllEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -45,8 +47,7 @@ public class BadMoon extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Black creatures"); static { - filter.getColor().setBlack(true); - filter.setUseColor(true); + filter.add(new ColorPredicate(ObjectColor.BLACK)); } public BadMoon(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/guildpact/Frazzle.java b/Mage.Sets/src/mage/sets/guildpact/Frazzle.java index d160cfb538..b8d45cf565 100644 --- a/Mage.Sets/src/mage/sets/guildpact/Frazzle.java +++ b/Mage.Sets/src/mage/sets/guildpact/Frazzle.java @@ -30,9 +30,12 @@ package mage.sets.guildpact; import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.ObjectColor; import mage.abilities.effects.common.CounterTargetEffect; import mage.cards.CardImpl; import mage.filter.FilterSpell; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.TargetSpell; /** @@ -43,9 +46,7 @@ public class Frazzle extends CardImpl { private final static FilterSpell filter = new FilterSpell("nonblue spell"); static { - filter.setUseColor(true); - filter.getColor().setBlue(true); - filter.setNotColor(true); + filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLUE))); } public Frazzle(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/guildpact/TiborAndLumia.java b/Mage.Sets/src/mage/sets/guildpact/TiborAndLumia.java index 8c55596652..9769243b36 100644 --- a/Mage.Sets/src/mage/sets/guildpact/TiborAndLumia.java +++ b/Mage.Sets/src/mage/sets/guildpact/TiborAndLumia.java @@ -32,6 +32,7 @@ import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.SpellCastTriggeredAbility; import mage.abilities.effects.common.DamageAllEffect; @@ -42,6 +43,7 @@ import mage.filter.FilterSpell; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -55,11 +57,9 @@ public class TiborAndLumia extends CardImpl { private final static FilterSpell filterRed = new FilterSpell("a red spell"); static { - filterBlue.setUseColor(true); - filterBlue.getColor().setBlue(true); + filterBlue.add(new ColorPredicate(ObjectColor.BLUE)); filter.add(Predicates.not(new AbilityPredicate(FlyingAbility.class))); - filterRed.setUseColor(true); - filterRed.getColor().setRed(true); + filterRed.add(new ColorPredicate(ObjectColor.RED)); } public TiborAndLumia(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/guildpact/WurmweaverCoil.java b/Mage.Sets/src/mage/sets/guildpact/WurmweaverCoil.java index 95b5da8a96..30a18758db 100644 --- a/Mage.Sets/src/mage/sets/guildpact/WurmweaverCoil.java +++ b/Mage.Sets/src/mage/sets/guildpact/WurmweaverCoil.java @@ -44,6 +44,7 @@ import mage.abilities.effects.common.continious.BoostEnchantedEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.permanent.token.Token; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -57,8 +58,7 @@ public class WurmweaverCoil extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("green creature"); static { - filter.setUseColor(true); - filter.getColor().setGreen(true); + filter.add(new ColorPredicate(ObjectColor.GREEN)); } public WurmweaverCoil(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2010/BlackKnight.java b/Mage.Sets/src/mage/sets/magic2010/BlackKnight.java index 996d08e1cf..a3a7c28418 100644 --- a/Mage.Sets/src/mage/sets/magic2010/BlackKnight.java +++ b/Mage.Sets/src/mage/sets/magic2010/BlackKnight.java @@ -32,11 +32,12 @@ import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.keyword.FirstStrikeAbility; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -47,9 +48,7 @@ public class BlackKnight extends CardImpl { private static final FilterCard filter = new FilterCard("White"); static { - filter.setUseColor(true); - filter.getColor().setWhite(true); - filter.setScopeColor(ComparisonScope.Any); + filter.add(new ColorPredicate(ObjectColor.WHITE)); } public BlackKnight(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2010/DoomBlade.java b/Mage.Sets/src/mage/sets/magic2010/DoomBlade.java index fbaf5aa223..1c2b7dbb70 100644 --- a/Mage.Sets/src/mage/sets/magic2010/DoomBlade.java +++ b/Mage.Sets/src/mage/sets/magic2010/DoomBlade.java @@ -31,9 +31,12 @@ package mage.sets.magic2010; import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.ObjectColor; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -45,9 +48,7 @@ public class DoomBlade extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature"); static { - filter.setUseColor(true); - filter.getColor().setBlack(true); - filter.setNotColor(true); + filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); } public DoomBlade(UUID ownerId){ diff --git a/Mage.Sets/src/mage/sets/magic2010/GreatSableStag.java b/Mage.Sets/src/mage/sets/magic2010/GreatSableStag.java index 1eba9ab2c9..ca32771f3b 100644 --- a/Mage.Sets/src/mage/sets/magic2010/GreatSableStag.java +++ b/Mage.Sets/src/mage/sets/magic2010/GreatSableStag.java @@ -33,12 +33,13 @@ import mage.Constants.CardType; import mage.Constants.Rarity; import mage.Constants.Zone; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.CantCounterSourceEffect; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -49,12 +50,8 @@ public class GreatSableStag extends CardImpl { private static final FilterCard filter2 = new FilterCard("Black"); static { - filter1.setUseColor(true); - filter1.getColor().setBlue(true); - filter1.setScopeColor(ComparisonScope.Any); - filter2.setUseColor(true); - filter2.getColor().setBlack(true); - filter2.setScopeColor(ComparisonScope.Any); + filter1.add(new ColorPredicate(ObjectColor.BLUE)); + filter2.add(new ColorPredicate(ObjectColor.BLACK)); } public GreatSableStag(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2010/HonorOfThePure.java b/Mage.Sets/src/mage/sets/magic2010/HonorOfThePure.java index 699e61e6ba..e634236f04 100644 --- a/Mage.Sets/src/mage/sets/magic2010/HonorOfThePure.java +++ b/Mage.Sets/src/mage/sets/magic2010/HonorOfThePure.java @@ -33,10 +33,12 @@ import mage.Constants.CardType; import mage.Constants.Duration; import mage.Constants.Rarity; import mage.Constants.Zone; +import mage.ObjectColor; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.continious.BoostControlledEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -47,8 +49,7 @@ public class HonorOfThePure extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("White creatures"); static { - filter.setUseColor(true); - filter.getColor().setWhite(true); + filter.add(new ColorPredicate(ObjectColor.WHITE)); } public HonorOfThePure(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2010/IgniteDisorder.java b/Mage.Sets/src/mage/sets/magic2010/IgniteDisorder.java index c59d8afb07..38bb2b2bbf 100644 --- a/Mage.Sets/src/mage/sets/magic2010/IgniteDisorder.java +++ b/Mage.Sets/src/mage/sets/magic2010/IgniteDisorder.java @@ -30,9 +30,12 @@ package mage.sets.magic2010; import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.ObjectColor; import mage.abilities.effects.common.DamageMultiEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.common.TargetCreaturePermanentAmount; /** @@ -44,9 +47,9 @@ public class IgniteDisorder extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("white and/or blue creatures"); static { - filter.getColor().setWhite(true); - filter.getColor().setBlue(true); - filter.setUseColor(true); + filter.add(Predicates.or( + new ColorPredicate(ObjectColor.WHITE), + new ColorPredicate(ObjectColor.BLUE))); } public IgniteDisorder(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2010/LightwielderPaladin.java b/Mage.Sets/src/mage/sets/magic2010/LightwielderPaladin.java index c6e011a716..fc46abfc62 100644 --- a/Mage.Sets/src/mage/sets/magic2010/LightwielderPaladin.java +++ b/Mage.Sets/src/mage/sets/magic2010/LightwielderPaladin.java @@ -32,12 +32,14 @@ import mage.Constants.CardType; import mage.Constants.Rarity; import mage.Constants.Zone; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.ExileTargetEffect; import mage.abilities.keyword.FirstStrikeAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; @@ -94,10 +96,9 @@ class LightwielderPaladinTriggeredAbility extends TriggeredAbilityImpl { private static final FilterCard filter = new FilterCard("blue or black spell"); static { - filter.getColor().setBlue(true); - filter.getColor().setBlack(true); - filter.setUseColor(true); - filter.setScopeColor(ComparisonScope.Any); + filter.add(Predicates.or( + new ColorPredicate(ObjectColor.BLUE), + new ColorPredicate(ObjectColor.BLACK))); } public MoldAdder(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2010/WhiteKnight.java b/Mage.Sets/src/mage/sets/magic2010/WhiteKnight.java index a067c49120..1285a51abf 100644 --- a/Mage.Sets/src/mage/sets/magic2010/WhiteKnight.java +++ b/Mage.Sets/src/mage/sets/magic2010/WhiteKnight.java @@ -32,11 +32,12 @@ import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.keyword.FirstStrikeAbility; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -47,9 +48,7 @@ public class WhiteKnight extends CardImpl { private static final FilterCard filter = new FilterCard("Black"); static { - filter.setUseColor(true); - filter.getColor().setBlack(true); - filter.setScopeColor(ComparisonScope.Any); + filter.add(new ColorPredicate(ObjectColor.BLACK)); } public WhiteKnight(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2011/AutumnsVeil.java b/Mage.Sets/src/mage/sets/magic2011/AutumnsVeil.java index 90ecf57766..558982ab81 100644 --- a/Mage.Sets/src/mage/sets/magic2011/AutumnsVeil.java +++ b/Mage.Sets/src/mage/sets/magic2011/AutumnsVeil.java @@ -32,13 +32,15 @@ import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Duration; import mage.Constants.Rarity; +import mage.ObjectColor; import mage.abilities.effects.common.CantCounterControlledEffect; import mage.abilities.effects.common.CantTargetControlledEffect; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterSpell; import mage.filter.FilterStackObject; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -51,9 +53,9 @@ public class AutumnsVeil extends CardImpl { private static final FilterStackObject filterSource = new FilterStackObject("blue or black spells"); static { - filterSource.getColor().setBlue(true); - filterSource.getColor().setBlack(true); - filterSource.setScopeColor(ComparisonScope.Any); + filterSource.add(Predicates.or( + new ColorPredicate(ObjectColor.BLUE), + new ColorPredicate(ObjectColor.BLACK))); } public AutumnsVeil(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2011/Combust.java b/Mage.Sets/src/mage/sets/magic2011/Combust.java index 36dbc01936..55aba73dba 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Combust.java +++ b/Mage.Sets/src/mage/sets/magic2011/Combust.java @@ -32,12 +32,14 @@ import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.Constants.Zone; +import mage.ObjectColor; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.CantCounterSourceEffect; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -49,10 +51,9 @@ public class Combust extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("white or blue creature"); static { - filter.getColor().setWhite(true); - filter.getColor().setBlue(true); - filter.setUseColor(true); - filter.setScopeColor(ComparisonScope.Any); + filter.add(Predicates.or( + new ColorPredicate(ObjectColor.WHITE), + new ColorPredicate(ObjectColor.BLUE))); } public Combust(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2011/DemonOfDeathsGate.java b/Mage.Sets/src/mage/sets/magic2011/DemonOfDeathsGate.java index f5d9fdf329..db30158ff2 100644 --- a/Mage.Sets/src/mage/sets/magic2011/DemonOfDeathsGate.java +++ b/Mage.Sets/src/mage/sets/magic2011/DemonOfDeathsGate.java @@ -31,6 +31,7 @@ package mage.sets.magic2011; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.costs.AlternativeCostImpl; import mage.abilities.costs.common.PayLifeCost; import mage.abilities.costs.common.SacrificeTargetCost; @@ -38,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.ColorPredicate; import mage.target.common.TargetControlledPermanent; import java.util.UUID; @@ -76,8 +78,7 @@ class DemonOfDeathsGateAlternativeCost extends AlternativeCostImpl { private static final FilterStackObject filter = new FilterStackObject("nongreen spells or abilities from nongreen sources"); static { - filter.getColor().setGreen(true); - filter.setNotColor(true); - filter.setUseColor(true); + filter.add(Predicates.not(new ColorPredicate(ObjectColor.GREEN))); } public GaeasRevenge(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2011/Incite.java b/Mage.Sets/src/mage/sets/magic2011/Incite.java index 7c563d0ccc..c627bc8edc 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Incite.java +++ b/Mage.Sets/src/mage/sets/magic2011/Incite.java @@ -49,10 +49,10 @@ public class Incite extends CardImpl { super(ownerId, 145, "Incite", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{R}"); this.expansionSetCode = "M11"; this.color.setRed(true); - // Target creature becomes red until end of turn and attacks this turn if able. - this.getSpellAbility().addTarget(new TargetCreaturePermanent()); -// this.getSpellAbility().addEffect(new InciteEffect()); - this.getSpellAbility().addEffect(new SetCardColorTargetEffect(ObjectColor.RED, Constants.Duration.EndOfTurn, "Target creature becomes red until end of turn")); + + // Target creature becomes red until end of turn and attacks this turn if able. + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect(new SetCardColorTargetEffect(ObjectColor.RED, Constants.Duration.EndOfTurn, "Target creature becomes red until end of turn")); this.getSpellAbility().addEffect(new AttacksIfAbleTargetEffect(Duration.EndOfTurn)); } @@ -65,35 +65,3 @@ public class Incite extends CardImpl { return new Incite(this); } } - -//class InciteEffect extends ContinuousEffectImpl { -// -// public InciteEffect() { -// super(Duration.EndOfTurn, Layer.ColorChangingEffects_5, SubLayer.NA, Outcome.Detriment); -// staticText = "Target creature becomes red until end of turn"; -// } -// -// public InciteEffect(final InciteEffect effect) { -// super(effect); -// } -// -// @Override -// public InciteEffect copy() { -// return new InciteEffect(this); -// } -// -// @Override -// public boolean apply(Game game, Ability source) { -// Permanent permanent = game.getPermanent(source.getFirstTarget()); -// if (permanent != null) { -// permanent.getColor().setRed(true); -// permanent.getColor().setWhite(false); -// permanent.getColor().setGreen(false); -// permanent.getColor().setBlue(false); -// permanent.getColor().setBlack(false); -// return true; -// } -// return false; -// } -// -//} diff --git a/Mage.Sets/src/mage/sets/magic2012/GuardiansPledge.java b/Mage.Sets/src/mage/sets/magic2012/GuardiansPledge.java index 2f38ea6fbf..815e972539 100644 --- a/Mage.Sets/src/mage/sets/magic2012/GuardiansPledge.java +++ b/Mage.Sets/src/mage/sets/magic2012/GuardiansPledge.java @@ -33,9 +33,11 @@ import java.util.UUID; import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.ObjectColor; import mage.abilities.effects.common.continious.BoostControlledEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -46,8 +48,7 @@ public class GuardiansPledge extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("White creatures"); static { - filter.setUseColor(true); - filter.getColor().setWhite(true); + filter.add(new ColorPredicate(ObjectColor.WHITE)); } public GuardiansPledge (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2013/AkromasMemorial.java b/Mage.Sets/src/mage/sets/magic2013/AkromasMemorial.java index 01433b0521..7d30bde7f1 100644 --- a/Mage.Sets/src/mage/sets/magic2013/AkromasMemorial.java +++ b/Mage.Sets/src/mage/sets/magic2013/AkromasMemorial.java @@ -30,14 +30,15 @@ package mage.sets.magic2013; import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.ObjectColor; import mage.abilities.CompoundAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.continious.GainAbilityControlledEffect; import mage.abilities.keyword.*; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterCard; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; import java.util.UUID; @@ -49,12 +50,8 @@ public class AkromasMemorial extends CardImpl { private static final FilterCard filterRed = new FilterCard("Red"); static { - filterBlack.setUseColor(true); - filterBlack.getColor().setBlack(true); - filterBlack.setScopeColor(Filter.ComparisonScope.Any); - filterRed.setUseColor(true); - filterRed.getColor().setRed(true); - filterRed.setScopeColor(Filter.ComparisonScope.Any); + filterBlack.add(new ColorPredicate(ObjectColor.BLACK)); + filterRed.add(new ColorPredicate(ObjectColor.RED)); } public AkromasMemorial(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2013/GoblinBattleJester.java b/Mage.Sets/src/mage/sets/magic2013/GoblinBattleJester.java index fbcf09cd43..70976bc94b 100644 --- a/Mage.Sets/src/mage/sets/magic2013/GoblinBattleJester.java +++ b/Mage.Sets/src/mage/sets/magic2013/GoblinBattleJester.java @@ -32,11 +32,13 @@ import mage.Constants.CardType; import mage.Constants.Duration; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.SpellCastTriggeredAbility; import mage.abilities.effects.common.CantBlockTargetEffect; import mage.cards.CardImpl; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -48,8 +50,7 @@ public class GoblinBattleJester extends CardImpl { private static final FilterSpell filter = new FilterSpell("a red spell"); static { - filter.getColor().setRed(true); - filter.setUseColor(true); + filter.add(new ColorPredicate(ObjectColor.RED)); } public GoblinBattleJester(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2013/KnightOfGlory.java b/Mage.Sets/src/mage/sets/magic2013/KnightOfGlory.java index 118b29a84c..bf99203a8c 100644 --- a/Mage.Sets/src/mage/sets/magic2013/KnightOfGlory.java +++ b/Mage.Sets/src/mage/sets/magic2013/KnightOfGlory.java @@ -31,11 +31,12 @@ import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.keyword.ExaltedAbility; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -43,12 +44,10 @@ import mage.filter.FilterCard; */ public class KnightOfGlory extends CardImpl { - private static FilterCard filter = new FilterCard("Black"); + private static final FilterCard filter = new FilterCard("Black"); static { - filter.setUseColor(true); - filter.getColor().setBlack(true); - filter.setScopeColor(Filter.ComparisonScope.Any); + filter.add(new ColorPredicate(ObjectColor.BLACK)); } public KnightOfGlory(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2013/KnightOfInfamy.java b/Mage.Sets/src/mage/sets/magic2013/KnightOfInfamy.java index c544f6711a..16c71b2a5e 100644 --- a/Mage.Sets/src/mage/sets/magic2013/KnightOfInfamy.java +++ b/Mage.Sets/src/mage/sets/magic2013/KnightOfInfamy.java @@ -31,11 +31,12 @@ import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.keyword.ExaltedAbility; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -46,9 +47,7 @@ public class KnightOfInfamy extends CardImpl { private static final FilterCard filter = new FilterCard("white"); static { - filter.getColor().setWhite(true); - filter.setUseColor(true); - filter.setScopeColor(Filter.ComparisonScope.Any); + filter.add(new ColorPredicate(ObjectColor.WHITE)); } public KnightOfInfamy(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2013/Revive.java b/Mage.Sets/src/mage/sets/magic2013/Revive.java index cc125701ad..083c5ece5f 100644 --- a/Mage.Sets/src/mage/sets/magic2013/Revive.java +++ b/Mage.Sets/src/mage/sets/magic2013/Revive.java @@ -30,9 +30,11 @@ package mage.sets.magic2013; import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.ObjectColor; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.cards.CardImpl; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.common.TargetCardInYourGraveyard; /** @@ -44,8 +46,7 @@ public class Revive extends CardImpl { private static final FilterCard filter = new FilterCard("green card from your graveyard"); static { - filter.getColor().setGreen(true); - filter.setUseColor(true); + filter.add(new ColorPredicate(ObjectColor.GREEN)); } public Revive(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/mirrodin/TrollsOfTelJilad.java b/Mage.Sets/src/mage/sets/mirrodin/TrollsOfTelJilad.java index 6e4e34f812..3128e818da 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/TrollsOfTelJilad.java +++ b/Mage.Sets/src/mage/sets/mirrodin/TrollsOfTelJilad.java @@ -33,12 +33,14 @@ import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.RegenerateTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -50,8 +52,7 @@ public class TrollsOfTelJilad extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("green creature"); static { - filter.setUseColor(true); - filter.getColor().setGreen(true); + filter.add(new ColorPredicate(ObjectColor.GREEN)); } public TrollsOfTelJilad(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/GreenSunsZenith.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/GreenSunsZenith.java index 8f2605c1b4..3567f4ca4d 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/GreenSunsZenith.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/GreenSunsZenith.java @@ -31,6 +31,7 @@ package mage.sets.mirrodinbesieged; import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.ShuffleSpellEffect; @@ -38,13 +39,14 @@ import mage.cards.Card; import mage.cards.CardImpl; import mage.filter.Filter; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; import mage.game.Game; import mage.players.Player; import mage.target.common.TargetCardInLibrary; import java.util.UUID; -import mage.filter.predicate.mageobject.CardTypePredicate; /** * @author Loki @@ -86,8 +88,7 @@ class GreenSunsZenithSearchEffect extends OneShotEffect { - private static FilterCard filter = new FilterCard("Black"); - private static FilterCard filter2 = new FilterCard("Green"); + private static final FilterCard filter = new FilterCard("Black"); + private static final FilterCard filter2 = new FilterCard("Green"); static { - filter.setUseColor(true); - filter.getColor().setBlack(true); - filter.setScopeColor(ComparisonScope.Any); - - filter2.setUseColor(true); - filter2.getColor().setGreen(true); - filter2.setScopeColor(ComparisonScope.Any); + filter.add(new ColorPredicate(ObjectColor.BLACK)); + filter2.add(new ColorPredicate(ObjectColor.GREEN)); } public MirranCrusader (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/PhyrexianCrusader.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/PhyrexianCrusader.java index 362ee145ce..71c03cca12 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/PhyrexianCrusader.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/PhyrexianCrusader.java @@ -32,11 +32,13 @@ import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.keyword.FirstStrikeAbility; import mage.abilities.keyword.InfectAbility; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -48,11 +50,9 @@ public class PhyrexianCrusader extends CardImpl { private static final FilterCard filter2 = new FilterCard("White"); static { - filter.setUseColor(true); - filter.getColor().setRed(true); + filter.add(new ColorPredicate(ObjectColor.RED)); - filter2.setUseColor(true); - filter2.getColor().setWhite(true); + filter2.add(new ColorPredicate(ObjectColor.WHITE)); } public PhyrexianCrusader (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/SwordOfFeastAndFamine.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/SwordOfFeastAndFamine.java index 8a68328bbe..a721b98f43 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/SwordOfFeastAndFamine.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/SwordOfFeastAndFamine.java @@ -34,6 +34,7 @@ import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.Constants.Zone; +import mage.ObjectColor; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.GenericManaCost; @@ -46,6 +47,8 @@ import mage.abilities.keyword.EquipAbility; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; @@ -60,9 +63,9 @@ public class SwordOfFeastAndFamine extends CardImpl { private static final FilterCard filter = new FilterCard("green and from black"); static { - filter.setUseColor(true); - filter.getColor().setBlack(true); - filter.getColor().setGreen(true); + filter.add(Predicates.or( + new ColorPredicate(ObjectColor.GREEN), + new ColorPredicate(ObjectColor.BLACK))); } diff --git a/Mage.Sets/src/mage/sets/morningtide/ChameleonColossus.java b/Mage.Sets/src/mage/sets/morningtide/ChameleonColossus.java index 42f887c962..671b1b165e 100644 --- a/Mage.Sets/src/mage/sets/morningtide/ChameleonColossus.java +++ b/Mage.Sets/src/mage/sets/morningtide/ChameleonColossus.java @@ -33,6 +33,7 @@ import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; @@ -41,6 +42,7 @@ import mage.abilities.keyword.ChangelingAbility; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; import mage.game.permanent.Permanent; @@ -53,8 +55,7 @@ public class ChameleonColossus extends CardImpl { private final static FilterCard filter = new FilterCard("black"); static { - filter.setUseColor(true); - filter.getColor().setBlack(true); + filter.add(new ColorPredicate(ObjectColor.BLACK)); } public ChameleonColossus(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/morningtide/VioletPall.java b/Mage.Sets/src/mage/sets/morningtide/VioletPall.java index 1826c6fd64..08b3a1a9ae 100644 --- a/Mage.Sets/src/mage/sets/morningtide/VioletPall.java +++ b/Mage.Sets/src/mage/sets/morningtide/VioletPall.java @@ -35,6 +35,8 @@ import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -46,9 +48,7 @@ public class VioletPall extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature"); static { - filter.setUseColor(true); - filter.setColor(ObjectColor.BLACK); - filter.setNotColor(true); + filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); } public VioletPall(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ApostlesBlessing.java b/Mage.Sets/src/mage/sets/newphyrexia/ApostlesBlessing.java index 9193c900eb..6123ba82ce 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/ApostlesBlessing.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/ApostlesBlessing.java @@ -39,11 +39,11 @@ import mage.abilities.effects.common.continious.GainAbilityTargetEffect; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; import mage.choices.ChoiceColorOrArtifact; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.common.TargetControlledPermanent; @@ -103,9 +103,7 @@ class ApostlesBlessingEffect extends GainAbilityTargetEffect { if (choice.isArtifactSelected()) { protectionFilter.add(new CardTypePredicate(Constants.CardType.ARTIFACT)); } else { - protectionFilter.setColor(choice.getColor()); - protectionFilter.setUseColor(true); - protectionFilter.setScopeColor(ComparisonScope.Any); + protectionFilter.add(new ColorPredicate(choice.getColor())); } protectionFilter.setMessage(choice.getChoice()); diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ShrineOfBoundlessGrowth.java b/Mage.Sets/src/mage/sets/newphyrexia/ShrineOfBoundlessGrowth.java index 7fda603841..38cefe8ec0 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/ShrineOfBoundlessGrowth.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/ShrineOfBoundlessGrowth.java @@ -34,6 +34,7 @@ import mage.Constants.Rarity; import mage.Constants.TargetController; import mage.Constants.Zone; import mage.Mana; +import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; @@ -46,6 +47,7 @@ import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.counters.CounterType; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -56,8 +58,7 @@ public class ShrineOfBoundlessGrowth extends CardImpl { private static final FilterSpell filter = new FilterSpell("a green spell"); static { - filter.getColor().setGreen(true); - filter.setUseColor(true); + filter.add(new ColorPredicate(ObjectColor.GREEN)); } public ShrineOfBoundlessGrowth (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ShrineOfBurningRage.java b/Mage.Sets/src/mage/sets/newphyrexia/ShrineOfBurningRage.java index 3438400e95..af30d44642 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/ShrineOfBurningRage.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/ShrineOfBurningRage.java @@ -32,6 +32,7 @@ import java.util.UUID; import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; @@ -45,18 +46,18 @@ import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.counters.CounterType; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.common.TargetCreatureOrPlayer; /** * - * @author + * @author BetaSteward */ public class ShrineOfBurningRage extends CardImpl { private final static FilterSpell filter = new FilterSpell("a red spell"); static { - filter.getColor().setRed(true); - filter.setUseColor(true); + filter.add(new ColorPredicate(ObjectColor.RED)); } public ShrineOfBurningRage (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ShrineOfLimitlessPower.java b/Mage.Sets/src/mage/sets/newphyrexia/ShrineOfLimitlessPower.java index a8089f0b6a..9029b4a277 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/ShrineOfLimitlessPower.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/ShrineOfLimitlessPower.java @@ -32,6 +32,7 @@ import mage.Constants.CardType; import mage.Constants.Rarity; import mage.Constants.TargetController; import mage.Constants.Zone; +import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; @@ -45,6 +46,7 @@ import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.counters.CounterType; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.TargetPlayer; /** @@ -56,8 +58,7 @@ public class ShrineOfLimitlessPower extends CardImpl { private static final FilterSpell filter = new FilterSpell("a black spell"); static { - filter.getColor().setBlack(true); - filter.setUseColor(true); + filter.add(new ColorPredicate(ObjectColor.BLACK)); } public ShrineOfLimitlessPower(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ShrineOfLoyalLegions.java b/Mage.Sets/src/mage/sets/newphyrexia/ShrineOfLoyalLegions.java index 810ddd9219..ad0825f50e 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/ShrineOfLoyalLegions.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/ShrineOfLoyalLegions.java @@ -32,6 +32,7 @@ import mage.Constants.CardType; import mage.Constants.Rarity; import mage.Constants.TargetController; import mage.Constants.Zone; +import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; @@ -45,6 +46,7 @@ import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.counters.CounterType; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.permanent.token.MyrToken; /** @@ -56,8 +58,7 @@ public class ShrineOfLoyalLegions extends CardImpl { private static final FilterSpell filter = new FilterSpell("a white spell"); static { - filter.getColor().setWhite(true); - filter.setUseColor(true); + filter.add(new ColorPredicate(ObjectColor.WHITE)); } public ShrineOfLoyalLegions(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ShrineOfPiercingVision.java b/Mage.Sets/src/mage/sets/newphyrexia/ShrineOfPiercingVision.java index 88f8076efd..25be90ac34 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/ShrineOfPiercingVision.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/ShrineOfPiercingVision.java @@ -33,6 +33,7 @@ import mage.Constants.Outcome; import mage.Constants.Rarity; import mage.Constants.TargetController; import mage.Constants.Zone; +import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; @@ -48,6 +49,7 @@ import mage.cards.CardsImpl; import mage.counters.CounterType; import mage.filter.FilterCard; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -62,8 +64,7 @@ public class ShrineOfPiercingVision extends CardImpl { private static final FilterSpell filter = new FilterSpell("a blue spell"); static { - filter.getColor().setBlue(true); - filter.setUseColor(true); + filter.add(new ColorPredicate(ObjectColor.BLUE)); } public ShrineOfPiercingVision(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/SwordOfWarAndPeace.java b/Mage.Sets/src/mage/sets/newphyrexia/SwordOfWarAndPeace.java index e8403806af..eb2733d6da 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/SwordOfWarAndPeace.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/SwordOfWarAndPeace.java @@ -35,6 +35,7 @@ import mage.Constants.CardType; import mage.Constants.Outcome; import mage.Constants.Rarity; import mage.Constants.Zone; +import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SimpleStaticAbility; @@ -47,8 +48,9 @@ import mage.abilities.effects.common.continious.GainAbilityAttachedEffect; import mage.abilities.keyword.EquipAbility; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; @@ -64,10 +66,9 @@ public class SwordOfWarAndPeace extends CardImpl { private static final FilterCard filter = new FilterCard("red and from white"); static { - filter.setUseColor(true); - filter.getColor().setRed(true); - filter.getColor().setWhite(true); - filter.setScopeColor(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new ColorPredicate(ObjectColor.RED), + new ColorPredicate(ObjectColor.WHITE))); } public SwordOfWarAndPeace (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/VulshokRefugee.java b/Mage.Sets/src/mage/sets/newphyrexia/VulshokRefugee.java index ac76c58328..86cae6ddd2 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/VulshokRefugee.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/VulshokRefugee.java @@ -31,10 +31,11 @@ import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -45,9 +46,7 @@ public class VulshokRefugee extends CardImpl { private static final FilterCard filter = new FilterCard("Red"); static { - filter.setUseColor(true); - filter.getColor().setRed(true); - filter.setScopeColor(ComparisonScope.Any); + filter.add(new ColorPredicate(ObjectColor.RED)); } public VulshokRefugee(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/planarchaos/CrovaxAscendantHero.java b/Mage.Sets/src/mage/sets/planarchaos/CrovaxAscendantHero.java index afe3a2ccde..b6d3bb0df8 100644 --- a/Mage.Sets/src/mage/sets/planarchaos/CrovaxAscendantHero.java +++ b/Mage.Sets/src/mage/sets/planarchaos/CrovaxAscendantHero.java @@ -33,6 +33,7 @@ import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.common.PayLifeCost; @@ -40,21 +41,20 @@ import mage.abilities.effects.common.ReturnToHandSourceEffect; import mage.abilities.effects.common.continious.BoostAllEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; /** * * @author Loki */ public class CrovaxAscendantHero extends CardImpl { - private static FilterCreaturePermanent filter1 = new FilterCreaturePermanent("white creatures"); - private static FilterCreaturePermanent filter2 = new FilterCreaturePermanent("Nonwhite creatures"); + private static final FilterCreaturePermanent filter1 = new FilterCreaturePermanent("white creatures"); + private static final FilterCreaturePermanent filter2 = new FilterCreaturePermanent("Nonwhite creatures"); static { - filter1.getColor().setWhite(true); - filter1.setUseColor(true); - filter2.getColor().setWhite(true); - filter2.setUseColor(true); - filter2.setNotColor(true); + filter1.add(new ColorPredicate(ObjectColor.WHITE)); + filter2.add(Predicates.not(new ColorPredicate(ObjectColor.WHITE))); } public CrovaxAscendantHero(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/planarchaos/DuneriderOutlaw.java b/Mage.Sets/src/mage/sets/planarchaos/DuneriderOutlaw.java index c84cd388ab..24a9a94d63 100644 --- a/Mage.Sets/src/mage/sets/planarchaos/DuneriderOutlaw.java +++ b/Mage.Sets/src/mage/sets/planarchaos/DuneriderOutlaw.java @@ -41,6 +41,7 @@ import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; import mage.counters.CounterType; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.events.GameEvent; /** @@ -53,8 +54,7 @@ public class DuneriderOutlaw extends CardImpl { private static final FilterCard filter = new FilterCard("green"); static { - filter.setColor(ObjectColor.GREEN); - filter.setUseColor(true); + filter.add(new ColorPredicate(ObjectColor.GREEN)); } public DuneriderOutlaw(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/planechase/AscendantEvincar.java b/Mage.Sets/src/mage/sets/planechase/AscendantEvincar.java index 809c433318..7655791591 100644 --- a/Mage.Sets/src/mage/sets/planechase/AscendantEvincar.java +++ b/Mage.Sets/src/mage/sets/planechase/AscendantEvincar.java @@ -33,11 +33,14 @@ import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.continious.BoostAllEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -49,11 +52,8 @@ public class AscendantEvincar extends CardImpl { private final static FilterCreaturePermanent filterNonBlack = new FilterCreaturePermanent("Nonblack creatures"); static { - filterBlack.setUseColor(true); - filterBlack.getColor().setBlack(true); - filterNonBlack.setUseColor(true); - filterNonBlack.getColor().setBlack(true); - filterNonBlack.setNotColor(true); + filterBlack.add(new ColorPredicate(ObjectColor.BLACK)); + filterNonBlack.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); } public AscendantEvincar(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/ravnika/AgrusKosWojekVeteran.java b/Mage.Sets/src/mage/sets/ravnika/AgrusKosWojekVeteran.java index 11420666e4..8f3015172b 100644 --- a/Mage.Sets/src/mage/sets/ravnika/AgrusKosWojekVeteran.java +++ b/Mage.Sets/src/mage/sets/ravnika/AgrusKosWojekVeteran.java @@ -38,6 +38,7 @@ import mage.abilities.common.AttacksTriggeredAbility; import mage.abilities.effects.common.continious.BoostAllEffect; import mage.cards.CardImpl; import mage.filter.common.FilterAttackingCreature; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -49,10 +50,8 @@ public class AgrusKosWojekVeteran extends CardImpl { private final static FilterAttackingCreature filterWhite = new FilterAttackingCreature("attacking white creatures"); static { - filterRed.setUseColor(true); - filterRed.setColor(ObjectColor.RED); - filterWhite.setUseColor(true); - filterWhite.setColor(ObjectColor.WHITE); + filterRed.add(new ColorPredicate(ObjectColor.RED)); + filterWhite.add(new ColorPredicate(ObjectColor.WHITE)); } diff --git a/Mage.Sets/src/mage/sets/ravnika/HuntedHorror.java b/Mage.Sets/src/mage/sets/ravnika/HuntedHorror.java index 71efa5d653..0615936415 100644 --- a/Mage.Sets/src/mage/sets/ravnika/HuntedHorror.java +++ b/Mage.Sets/src/mage/sets/ravnika/HuntedHorror.java @@ -40,6 +40,7 @@ import mage.abilities.keyword.ProtectionAbility; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.permanent.token.Token; import mage.target.Target; import mage.target.common.TargetOpponent; @@ -83,8 +84,7 @@ class CentaurToken extends Token { private final static FilterCard filter = new FilterCard("black"); static { - filter.setUseColor(true); - filter.setColor(ObjectColor.BLACK); + filter.add(new ColorPredicate(ObjectColor.BLACK)); } CentaurToken() { diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/AncientStirrings.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/AncientStirrings.java index 4204df0d2b..b671b1390b 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/AncientStirrings.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/AncientStirrings.java @@ -34,6 +34,7 @@ import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.common.LookLibraryAndPickControllerEffect; import mage.cards.CardImpl; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorlessPredicate; import java.util.UUID; @@ -45,8 +46,7 @@ public class AncientStirrings extends CardImpl { private final static FilterCard filter = new FilterCard("colorless card"); static { - filter.setColorless(true); - filter.setUseColorless(true); + filter.add(new ColorlessPredicate()); } diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Corpsehatch.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Corpsehatch.java index 97c76865c0..cd83e19ab2 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Corpsehatch.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Corpsehatch.java @@ -30,10 +30,13 @@ package mage.sets.riseoftheeldrazi; import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.ObjectColor; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.permanent.token.EldraziSpawnToken; import mage.target.common.TargetCreaturePermanent; @@ -46,9 +49,7 @@ public class Corpsehatch extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature"); static { - filter.setUseColor(true); - filter.getColor().setBlack(true); - filter.setNotColor(true); + filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); } public Corpsehatch(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/EmrakulTheAeonsTorn.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/EmrakulTheAeonsTorn.java index c40fa85f7c..8ffc9e61db 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/EmrakulTheAeonsTorn.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/EmrakulTheAeonsTorn.java @@ -44,6 +44,8 @@ import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; import mage.filter.FilterSpell; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorlessPredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.stack.Spell; @@ -59,8 +61,7 @@ public class EmrakulTheAeonsTorn extends CardImpl { private static final FilterSpell filter = new FilterSpell("colored spells"); static { - filter.setColorless(false); - filter.setUseColorless(true); + filter.add(Predicates.not(new ColorlessPredicate())); } public EmrakulTheAeonsTorn(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/KhalniHydra.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/KhalniHydra.java index 8eee232eb6..3bf9beaf41 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/KhalniHydra.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/KhalniHydra.java @@ -42,6 +42,7 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; /** @@ -54,8 +55,7 @@ public class KhalniHydra extends CardImpl { static { filter = new FilterControlledCreaturePermanent(); - filter.setUseColor(true); - filter.setColor(ObjectColor.GREEN); + filter.add(new ColorPredicate(ObjectColor.GREEN)); } public KhalniHydra(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Vendetta.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Vendetta.java index 9d5a255354..388e40dbe3 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Vendetta.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Vendetta.java @@ -39,6 +39,8 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -53,8 +55,7 @@ public class Vendetta extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature"); static { - filter.setColor(ObjectColor.BLACK); - filter.setNotColor(true); + filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); } public Vendetta(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/EiganjoFreeRiders.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/EiganjoFreeRiders.java index eb9cdd8b7d..84c797c387 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/EiganjoFreeRiders.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/EiganjoFreeRiders.java @@ -33,12 +33,14 @@ import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -49,8 +51,7 @@ public class EiganjoFreeRiders extends CardImpl { private final static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("white creature you control"); static { - filter.setUseColor(true); - filter.getColor().setWhite(true); + filter.add(new ColorPredicate(ObjectColor.WHITE)); } public EiganjoFreeRiders(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/HandOfCruelty.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/HandOfCruelty.java index 2bcf308c5e..ef341181c2 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/HandOfCruelty.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/HandOfCruelty.java @@ -31,10 +31,12 @@ import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.keyword.BushidoAbility; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -45,8 +47,7 @@ public class HandOfCruelty extends CardImpl { private final static FilterCard filter = new FilterCard("white"); static { - filter.setUseColor(true); - filter.getColor().setWhite(true); + filter.add(new ColorPredicate(ObjectColor.WHITE)); } public HandOfCruelty(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/HandOfHonor.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/HandOfHonor.java index 7a52a90cb8..a14fcf9238 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/HandOfHonor.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/HandOfHonor.java @@ -32,10 +32,12 @@ import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.keyword.BushidoAbility; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @author anonymous @@ -45,8 +47,7 @@ public class HandOfHonor extends CardImpl { private final static FilterCard filter = new FilterCard("black"); static { - filter.setUseColor(true); - filter.getColor().setBlack(true); + filter.add(new ColorPredicate(ObjectColor.BLACK)); } public HandOfHonor(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/OniOfWildPlaces.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/OniOfWildPlaces.java index 26b54c992d..c5237cf1cd 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/OniOfWildPlaces.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/OniOfWildPlaces.java @@ -33,12 +33,14 @@ import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -50,8 +52,7 @@ public class OniOfWildPlaces extends CardImpl { private final static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("red creature you control"); static { - filter.setUseColor(true); - filter.getColor().setRed(true); + filter.add(new ColorPredicate(ObjectColor.RED)); } public OniOfWildPlaces(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/SkullCollector.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/SkullCollector.java index cc8d75004f..36f6b37322 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/SkullCollector.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/SkullCollector.java @@ -33,6 +33,7 @@ import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; @@ -41,6 +42,7 @@ import mage.abilities.effects.common.RegenerateSourceEffect; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -52,8 +54,7 @@ public class SkullCollector extends CardImpl { private final static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("black creature you control"); static { - filter.setUseColor(true); - filter.getColor().setBlack(true); + filter.add(new ColorPredicate(ObjectColor.BLACK)); } public SkullCollector(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/StampedingSerow.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/StampedingSerow.java index e21c48c9de..68966f84bc 100644 --- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/StampedingSerow.java +++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/StampedingSerow.java @@ -31,12 +31,14 @@ import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.Target; import mage.target.common.TargetControlledCreaturePermanent; @@ -50,8 +52,7 @@ public class StampedingSerow extends CardImpl { private final static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("green creature you control"); static { - filter.setUseColor(true); - filter.getColor().setGreen(true); + filter.add(new ColorPredicate(ObjectColor.GREEN)); } public StampedingSerow(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/BellowingTanglewurm.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/BellowingTanglewurm.java index ea4472cb6b..56ea3791cd 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/BellowingTanglewurm.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/BellowingTanglewurm.java @@ -34,12 +34,14 @@ import mage.Constants.Duration; import mage.Constants.Rarity; import mage.Constants.Zone; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.continious.GainAbilityControlledEffect; import mage.abilities.keyword.IntimidateAbility; import mage.cards.CardImpl; import mage.filter.FilterPermanent; import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -50,8 +52,7 @@ public class BellowingTanglewurm extends CardImpl { static { filter.add(new CardTypePredicate(CardType.CREATURE)); - filter.setUseColor(true); - filter.getColor().setGreen(true); + filter.add(new ColorPredicate(ObjectColor.GREEN)); } public BellowingTanglewurm (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/EtchedChampion.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/EtchedChampion.java index 5a9ba173c3..075d25c34e 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/EtchedChampion.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/EtchedChampion.java @@ -33,6 +33,7 @@ import mage.Constants.Duration; import mage.Constants.Rarity; import mage.Constants.Zone; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.MetalcraftCondition; import mage.abilities.decorator.ConditionalContinousEffect; @@ -40,8 +41,9 @@ import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.common.continious.GainAbilitySourceEffect; 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.ColorPredicate; /** * @@ -53,13 +55,12 @@ public class EtchedChampion extends CardImpl { private static final FilterCard filter = new FilterCard("all colors"); static { - filter.setUseColor(true); - filter.getColor().setBlack(true); - filter.getColor().setBlue(true); - filter.getColor().setGreen(true); - filter.getColor().setRed(true); - filter.getColor().setWhite(true); - filter.setScopeColor(ComparisonScope.Any); + filter.add(Predicates.or( + new ColorPredicate(ObjectColor.BLACK), + new ColorPredicate(ObjectColor.BLUE), + new ColorPredicate(ObjectColor.GREEN), + new ColorPredicate(ObjectColor.RED), + new ColorPredicate(ObjectColor.WHITE))); } public EtchedChampion(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/GrandArchitect.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/GrandArchitect.java index c4374447de..07353e3ed0 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/GrandArchitect.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/GrandArchitect.java @@ -41,6 +41,7 @@ import mage.Constants.Zone; import mage.MageInt; import mage.MageObject; import mage.Mana; +import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleStaticAbility; @@ -55,6 +56,7 @@ import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.TargetPermanent; @@ -70,8 +72,7 @@ public class GrandArchitect extends CardImpl { private static final FilterCreaturePermanent targetFilter = new FilterCreaturePermanent("artifact creature"); static { - boostFilter.getColor().setBlue(true); - boostFilter.setUseColor(true); + boostFilter.add(new ColorPredicate(ObjectColor.BLUE)); targetFilter.add(new CardTypePredicate(CardType.ARTIFACT)); } @@ -139,8 +140,7 @@ class GrandArchitectManaAbility extends ManaAbility { private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped blue creature"); static { - filter.getColor().setBlue(true); - filter.setUseColor(true); + filter.add(new ColorPredicate(ObjectColor.BLUE)); filter.setTapped(false); filter.setUseTapped(true); } diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/SwordOfBodyAndMind.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/SwordOfBodyAndMind.java index c397b2cd39..5a0f8a0800 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/SwordOfBodyAndMind.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/SwordOfBodyAndMind.java @@ -33,6 +33,7 @@ import mage.Constants.CardType; import mage.Constants.Outcome; import mage.Constants.Rarity; import mage.Constants.Zone; +import mage.ObjectColor; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.GenericManaCost; @@ -44,8 +45,9 @@ import mage.abilities.effects.common.continious.GainAbilityAttachedEffect; import mage.abilities.keyword.EquipAbility; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; import mage.game.events.DamagedPlayerEvent; import mage.game.events.GameEvent; @@ -64,10 +66,9 @@ public class SwordOfBodyAndMind extends CardImpl { private static final FilterCard filter = new FilterCard("green and from blue"); static { - filter.setUseColor(true); - filter.getColor().setBlue(true); - filter.getColor().setGreen(true); - filter.setScopeColor(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new ColorPredicate(ObjectColor.GREEN), + new ColorPredicate(ObjectColor.BLUE))); } diff --git a/Mage.Sets/src/mage/sets/shadowmoor/BloodmarkMentor.java b/Mage.Sets/src/mage/sets/shadowmoor/BloodmarkMentor.java index 8445f07582..269811790d 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/BloodmarkMentor.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/BloodmarkMentor.java @@ -33,11 +33,13 @@ import mage.Constants.Duration; import mage.Constants.Rarity; import mage.Constants.Zone; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.common.SimpleStaticAbility; 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.ColorPredicate; /** * @@ -48,8 +50,7 @@ public class BloodmarkMentor extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("Red creatures"); static { - filter.getColor().setRed(true); - filter.setUseColor(true); + filter.add(new ColorPredicate(ObjectColor.RED)); } public BloodmarkMentor(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/shadowmoor/BoartuskLiege.java b/Mage.Sets/src/mage/sets/shadowmoor/BoartuskLiege.java index 9ea630f380..061f7b059c 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/BoartuskLiege.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/BoartuskLiege.java @@ -33,11 +33,13 @@ import mage.Constants.Duration; import mage.Constants.Rarity; import mage.Constants.Zone; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.continious.BoostControlledEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -49,10 +51,8 @@ public class BoartuskLiege extends CardImpl { private static final FilterCreaturePermanent filterGreen = new FilterCreaturePermanent("green creatures"); static { - filterRed.getColor().setRed(true); - filterRed.setUseColor(true); - filterGreen.getColor().setGreen(true); - filterGreen.setUseColor(true); + filterRed.add(new ColorPredicate(ObjectColor.RED)); + filterGreen.add(new ColorPredicate(ObjectColor.GREEN)); } public BoartuskLiege(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/shadowmoor/CorrosiveMentor.java b/Mage.Sets/src/mage/sets/shadowmoor/CorrosiveMentor.java index 6a165348bb..7cfb64c9b6 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/CorrosiveMentor.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/CorrosiveMentor.java @@ -33,11 +33,13 @@ import mage.Constants.Duration; import mage.Constants.Rarity; import mage.Constants.Zone; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.continious.GainAbilityControlledEffect; import mage.abilities.keyword.WitherAbility; import mage.cards.CardImpl; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -48,8 +50,7 @@ public class CorrosiveMentor extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("Black creatures"); static { - filter.getColor().setBlack(true); - filter.setUseColor(true); + filter.add(new ColorPredicate(ObjectColor.BLACK)); } public CorrosiveMentor(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/shadowmoor/CrowdOfCinders.java b/Mage.Sets/src/mage/sets/shadowmoor/CrowdOfCinders.java index b3e2af188c..6f18305f52 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/CrowdOfCinders.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/CrowdOfCinders.java @@ -33,12 +33,14 @@ import mage.Constants.Duration; import mage.Constants.Rarity; import mage.Constants.Zone; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.continious.SetPowerToughnessSourceEffect; import mage.abilities.keyword.FearAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -49,8 +51,7 @@ public class CrowdOfCinders extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("black permanents you control"); static { - filter.getColor().setBlack(true); - filter.setUseColor(true); + filter.add(new ColorPredicate(ObjectColor.BLACK)); } public CrowdOfCinders(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/shadowmoor/DeepchannelMentor.java b/Mage.Sets/src/mage/sets/shadowmoor/DeepchannelMentor.java index 2c28c50e93..04477c78d4 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/DeepchannelMentor.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/DeepchannelMentor.java @@ -33,11 +33,13 @@ import mage.Constants.Duration; import mage.Constants.Rarity; import mage.Constants.Zone; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.continious.GainAbilityControlledEffect; import mage.abilities.keyword.UnblockableAbility; import mage.cards.CardImpl; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -48,8 +50,7 @@ public class DeepchannelMentor extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("Blue creatures"); static { - filter.getColor().setBlue(true); - filter.setUseColor(true); + filter.add(new ColorPredicate(ObjectColor.BLUE)); } public DeepchannelMentor(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/shadowmoor/DroveOfElves.java b/Mage.Sets/src/mage/sets/shadowmoor/DroveOfElves.java index c750720eb4..cf9813a902 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/DroveOfElves.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/DroveOfElves.java @@ -33,12 +33,14 @@ import mage.Constants.Duration; import mage.Constants.Rarity; import mage.Constants.Zone; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; 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.ColorPredicate; /** * @@ -49,8 +51,7 @@ public class DroveOfElves extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("green permanents you control"); static { - filter.getColor().setGreen(true); - filter.setUseColor(true); + filter.add(new ColorPredicate(ObjectColor.GREEN)); } public DroveOfElves(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/shadowmoor/EmberstrikeDuo.java b/Mage.Sets/src/mage/sets/shadowmoor/EmberstrikeDuo.java index 52ecf38d01..c330a45f7a 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/EmberstrikeDuo.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/EmberstrikeDuo.java @@ -32,12 +32,14 @@ import mage.Constants.CardType; import mage.Constants.Duration; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.common.SpellCastTriggeredAbility; 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.FilterSpell; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -49,10 +51,8 @@ public class EmberstrikeDuo extends CardImpl { private static final FilterSpell redFilter = new FilterSpell("a red spell"); static { - blackFilter.getColor().setBlack(true); - blackFilter.setUseColor(true); - redFilter.getColor().setRed(true); - redFilter.setUseColor(true); + blackFilter.add(new ColorPredicate(ObjectColor.BLACK)); + redFilter.add(new ColorPredicate(ObjectColor.RED)); } public EmberstrikeDuo(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/shadowmoor/FaerieSwarm.java b/Mage.Sets/src/mage/sets/shadowmoor/FaerieSwarm.java index 257f942320..c33b3d7bcd 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/FaerieSwarm.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/FaerieSwarm.java @@ -33,12 +33,14 @@ import mage.Constants.Duration; import mage.Constants.Rarity; import mage.Constants.Zone; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; 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.ColorPredicate; /** * @@ -49,8 +51,7 @@ public class FaerieSwarm extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("blue permanents you control"); static { - filter.getColor().setBlue(true); - filter.setUseColor(true); + filter.add(new ColorPredicate(ObjectColor.BLUE)); } public FaerieSwarm(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/shadowmoor/GlenElendraLiege.java b/Mage.Sets/src/mage/sets/shadowmoor/GlenElendraLiege.java index c3d3b03e2f..7a1e3603c8 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/GlenElendraLiege.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/GlenElendraLiege.java @@ -33,11 +33,13 @@ import mage.Constants.Duration; import mage.Constants.Rarity; import mage.Constants.Zone; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.common.SimpleStaticAbility; 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.ColorPredicate; /** * @@ -49,10 +51,8 @@ public class GlenElendraLiege extends CardImpl { private static final FilterCreaturePermanent filterBlack = new FilterCreaturePermanent("black creatures"); static { - filterBlue.getColor().setBlue(true); - filterBlue.setUseColor(true); - filterBlack.getColor().setBlack(true); - filterBlack.setUseColor(true); + filterBlue.add(new ColorPredicate(ObjectColor.BLUE)); + filterBlack.add(new ColorPredicate(ObjectColor.BLACK)); } public GlenElendraLiege(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/shadowmoor/GravelgillDuo.java b/Mage.Sets/src/mage/sets/shadowmoor/GravelgillDuo.java index 379d84cc32..b19145a859 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/GravelgillDuo.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/GravelgillDuo.java @@ -32,12 +32,14 @@ import mage.Constants.CardType; import mage.Constants.Duration; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.common.SpellCastTriggeredAbility; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.abilities.effects.common.continious.GainAbilitySourceEffect; import mage.abilities.keyword.FearAbility; import mage.cards.CardImpl; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -49,10 +51,8 @@ public class GravelgillDuo extends CardImpl { private static final FilterSpell blackFilter = new FilterSpell("a black spell"); static { - blueFilter.getColor().setBlue(true); - blueFilter.setUseColor(true); - blackFilter.getColor().setBlack(true); - blackFilter.setUseColor(true); + blueFilter.add(new ColorPredicate(ObjectColor.BLUE)); + blackFilter.add(new ColorPredicate(ObjectColor.BLACK)); } public GravelgillDuo(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/shadowmoor/GutturalResponse.java b/Mage.Sets/src/mage/sets/shadowmoor/GutturalResponse.java index b34b20069d..19be1d2dab 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/GutturalResponse.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/GutturalResponse.java @@ -30,10 +30,12 @@ package mage.sets.shadowmoor; import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.ObjectColor; import mage.abilities.effects.common.CounterTargetEffect; import mage.cards.CardImpl; import mage.filter.FilterSpell; import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.TargetSpell; /** @@ -46,8 +48,7 @@ public class GutturalResponse extends CardImpl { static { filter.add(new CardTypePredicate(CardType.INSTANT)); - filter.getColor().setBlue(true); - filter.setUseColor(true); + filter.add(new ColorPredicate(ObjectColor.BLUE)); } public GutturalResponse(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/shadowmoor/HordeOfBoggarts.java b/Mage.Sets/src/mage/sets/shadowmoor/HordeOfBoggarts.java index a46be0365f..803e5b7bcc 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/HordeOfBoggarts.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/HordeOfBoggarts.java @@ -33,12 +33,14 @@ import mage.Constants.Duration; import mage.Constants.Rarity; import mage.Constants.Zone; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.continious.CantBeBlockedByOneEffect; import mage.abilities.effects.common.continious.SetPowerToughnessSourceEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -49,8 +51,7 @@ public class HordeOfBoggarts extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("red permanents you control"); static { - filter.getColor().setRed(true); - filter.setUseColor(true); + filter.add(new ColorPredicate(ObjectColor.RED)); } public HordeOfBoggarts(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/shadowmoor/KithkinRabble.java b/Mage.Sets/src/mage/sets/shadowmoor/KithkinRabble.java index 1425bed9f4..6d20637f54 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/KithkinRabble.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/KithkinRabble.java @@ -33,12 +33,14 @@ import mage.Constants.Duration; import mage.Constants.Rarity; import mage.Constants.Zone; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.continious.SetPowerToughnessSourceEffect; import mage.abilities.keyword.VigilanceAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -49,8 +51,7 @@ public class KithkinRabble extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("white permanents you control"); static { - filter.getColor().setWhite(true); - filter.setUseColor(true); + filter.add(new ColorPredicate(ObjectColor.WHITE)); } public KithkinRabble(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/shadowmoor/LeechriddenSwamp.java b/Mage.Sets/src/mage/sets/shadowmoor/LeechriddenSwamp.java index 92cf92d346..0448b777dd 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/LeechriddenSwamp.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/LeechriddenSwamp.java @@ -33,6 +33,7 @@ import mage.Constants.CardType; import mage.Constants.Outcome; import mage.Constants.Rarity; import mage.Mana; +import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTappedAbility; import mage.abilities.common.SimpleActivatedAbility; @@ -44,6 +45,7 @@ import mage.abilities.effects.common.BasicManaEffect; import mage.abilities.mana.SimpleManaAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; import mage.players.Player; import mage.players.Players; @@ -86,8 +88,7 @@ class ControlTwoOrMoreBlackPermanentsCost extends CostImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonwhite creatures"); static { - filter.getColor().setWhite(true); - filter.setUseColor(true); - filter.setNotColor(true); + filter.add(Predicates.not(new ColorPredicate(ObjectColor.WHITE))); } public MassCalcify(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/shadowmoor/MidnightBanshee.java b/Mage.Sets/src/mage/sets/shadowmoor/MidnightBanshee.java index bbc7d15056..28044a471b 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/MidnightBanshee.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/MidnightBanshee.java @@ -32,12 +32,15 @@ import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.effects.common.counter.AddCountersAllEffect; import mage.abilities.keyword.WitherAbility; import mage.cards.CardImpl; import mage.counters.CounterType; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -48,9 +51,7 @@ public class MidnightBanshee extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature"); static { - filter.getColor().setBlack(true); - filter.setUseColor(true); - filter.setNotColor(true); + filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); } public MidnightBanshee(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/shadowmoor/OversoulOfDusk.java b/Mage.Sets/src/mage/sets/shadowmoor/OversoulOfDusk.java index 4c32e38cdd..7ef3c628eb 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/OversoulOfDusk.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/OversoulOfDusk.java @@ -31,10 +31,12 @@ import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; 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.ColorPredicate; /** * @@ -45,11 +47,10 @@ public class OversoulOfDusk extends CardImpl { private static final FilterCard filter = new FilterCard("blue, from black, and from red"); static { - filter.getColor().setBlue(true); - filter.getColor().setBlack(true); - filter.getColor().setRed(true); - filter.setUseColor(true); - filter.setScopeColor(ComparisonScope.Any); + filter.add(Predicates.or( + new ColorPredicate(ObjectColor.BLUE), + new ColorPredicate(ObjectColor.BLACK), + new ColorPredicate(ObjectColor.RED))); } public OversoulOfDusk(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/shadowmoor/ResplendentMentor.java b/Mage.Sets/src/mage/sets/shadowmoor/ResplendentMentor.java index cc9c55d0d6..72ccf405b0 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/ResplendentMentor.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/ResplendentMentor.java @@ -33,6 +33,7 @@ import mage.Constants.Duration; import mage.Constants.Rarity; import mage.Constants.Zone; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.common.TapSourceCost; @@ -40,6 +41,7 @@ import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.effects.common.continious.GainAbilityControlledEffect; import mage.cards.CardImpl; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -50,8 +52,7 @@ public class ResplendentMentor extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("White creatures"); static { - filter.getColor().setWhite(true); - filter.setUseColor(true); + filter.add(new ColorPredicate(ObjectColor.WHITE)); } public ResplendentMentor(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/shadowmoor/RoughshodMentor.java b/Mage.Sets/src/mage/sets/shadowmoor/RoughshodMentor.java index 078abf3ec0..d784563561 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/RoughshodMentor.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/RoughshodMentor.java @@ -33,11 +33,13 @@ import mage.Constants.Duration; import mage.Constants.Rarity; import mage.Constants.Zone; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.common.SimpleStaticAbility; 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.ColorPredicate; /** * @@ -48,8 +50,7 @@ public class RoughshodMentor extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("Green creatures"); static { - filter.getColor().setGreen(true); - filter.setUseColor(true); + filter.add(new ColorPredicate(ObjectColor.GREEN)); } public RoughshodMentor(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/shadowmoor/SafeholdDuo.java b/Mage.Sets/src/mage/sets/shadowmoor/SafeholdDuo.java index d4df8f4c0d..0149814754 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/SafeholdDuo.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/SafeholdDuo.java @@ -32,12 +32,14 @@ import mage.Constants.CardType; import mage.Constants.Duration; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.common.SpellCastTriggeredAbility; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.abilities.effects.common.continious.GainAbilitySourceEffect; import mage.abilities.keyword.VigilanceAbility; import mage.cards.CardImpl; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -49,10 +51,8 @@ public class SafeholdDuo extends CardImpl { private static final FilterSpell greenFilter = new FilterSpell("a green spell"); static { - whiteFilter.getColor().setWhite(true); - whiteFilter.setUseColor(true); - greenFilter.getColor().setGreen(true); - greenFilter.setUseColor(true); + whiteFilter.add(new ColorPredicate(ObjectColor.WHITE)); + greenFilter.add(new ColorPredicate(ObjectColor.GREEN)); } public SafeholdDuo(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/shadowmoor/SootstokeKindler.java b/Mage.Sets/src/mage/sets/shadowmoor/SootstokeKindler.java index 77df9aea7c..e80d0ddd81 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/SootstokeKindler.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/SootstokeKindler.java @@ -33,13 +33,15 @@ import mage.Constants.Duration; import mage.Constants.Rarity; import mage.Constants.Zone; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.continious.GainAbilityTargetEffect; import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -51,10 +53,9 @@ public class SootstokeKindler extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("black or red creature"); static { - filter.getColor().setBlack(true); - filter.getColor().setRed(true); - filter.setUseColor(true); - filter.setScopeColor(ComparisonScope.Any); + filter.add(Predicates.or( + new ColorPredicate(ObjectColor.BLACK), + new ColorPredicate(ObjectColor.RED))); } public SootstokeKindler(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/shadowmoor/TattermungeDuo.java b/Mage.Sets/src/mage/sets/shadowmoor/TattermungeDuo.java index 7fa28e33c3..1527f27818 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/TattermungeDuo.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/TattermungeDuo.java @@ -32,12 +32,14 @@ import mage.Constants.CardType; import mage.Constants.Duration; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.common.SpellCastTriggeredAbility; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.abilities.effects.common.continious.GainAbilitySourceEffect; import mage.abilities.keyword.ForestwalkAbility; import mage.cards.CardImpl; import mage.filter.FilterSpell; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -49,10 +51,8 @@ public class TattermungeDuo extends CardImpl { private static final FilterSpell greenFilter = new FilterSpell("a green spell"); static { - redFilter.getColor().setRed(true); - redFilter.setUseColor(true); - greenFilter.getColor().setGreen(true); - greenFilter.setUseColor(true); + redFilter.add(new ColorPredicate(ObjectColor.RED)); + greenFilter.add(new ColorPredicate(ObjectColor.GREEN)); } public TattermungeDuo(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/shadowmoor/ThistledownDuo.java b/Mage.Sets/src/mage/sets/shadowmoor/ThistledownDuo.java index 370198640f..5338d148e4 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/ThistledownDuo.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/ThistledownDuo.java @@ -32,12 +32,14 @@ import mage.Constants.CardType; import mage.Constants.Duration; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.common.SpellCastTriggeredAbility; 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.FilterSpell; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -49,10 +51,8 @@ public class ThistledownDuo extends CardImpl { private static final FilterSpell blueFilter = new FilterSpell("a blue spell"); static { - whiteFilter.getColor().setWhite(true); - whiteFilter.setUseColor(true); - blueFilter.getColor().setBlue(true); - blueFilter.setUseColor(true); + whiteFilter.add(new ColorPredicate(ObjectColor.WHITE)); + blueFilter.add(new ColorPredicate(ObjectColor.BLUE)); } public ThistledownDuo(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/shadowmoor/ThistledownLiege.java b/Mage.Sets/src/mage/sets/shadowmoor/ThistledownLiege.java index 5c8ce0a973..f334c1c1f8 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/ThistledownLiege.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/ThistledownLiege.java @@ -33,11 +33,13 @@ import mage.Constants.Duration; import mage.Constants.Rarity; import mage.Constants.Zone; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.continious.BoostControlledEffect; import mage.abilities.keyword.FlashAbility; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -49,10 +51,8 @@ public class ThistledownLiege extends CardImpl { private static final FilterCreaturePermanent filterBlue = new FilterCreaturePermanent("blue creatures"); static { - filterWhite.getColor().setWhite(true); - filterWhite.setUseColor(true); - filterBlue.getColor().setBlue(true); - filterBlue.setUseColor(true); + filterWhite.add(new ColorPredicate(ObjectColor.WHITE)); + filterBlue.add(new ColorPredicate(ObjectColor.BLUE)); } public ThistledownLiege(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/shardsofalara/AngelsHerald.java b/Mage.Sets/src/mage/sets/shardsofalara/AngelsHerald.java index 53e867660e..457d3d9dbb 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/AngelsHerald.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/AngelsHerald.java @@ -33,6 +33,7 @@ import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeTargetCost; @@ -42,6 +43,7 @@ import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.cards.CardImpl; import mage.filter.FilterCard; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.filter.predicate.mageobject.NamePredicate; import mage.target.common.TargetCardInLibrary; import mage.target.common.TargetControlledCreaturePermanent; @@ -58,12 +60,9 @@ public class AngelsHerald extends CardImpl { private static final FilterControlledCreaturePermanent filterBlue = new FilterControlledCreaturePermanent("a blue creature"); static { - filterGreen.getColor().setGreen(true); - filterGreen.setUseColor(true); - filterWhite.getColor().setWhite(true); - filterWhite.setUseColor(true); - filterBlue.getColor().setBlue(true); - filterBlue.setUseColor(true); + filterGreen.add(new ColorPredicate(ObjectColor.GREEN)); + filterWhite.add(new ColorPredicate(ObjectColor.WHITE)); + filterBlue.add(new ColorPredicate(ObjectColor.BLUE)); filter.add(new NamePredicate("Empyrial Archangel")); } diff --git a/Mage.Sets/src/mage/sets/shardsofalara/ExecutionersCapsule.java b/Mage.Sets/src/mage/sets/shardsofalara/ExecutionersCapsule.java index 30ffd5be53..92e8d6eb91 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/ExecutionersCapsule.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/ExecutionersCapsule.java @@ -31,6 +31,7 @@ import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.Constants.Zone; +import mage.ObjectColor; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.common.TapSourceCost; @@ -38,6 +39,8 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -49,9 +52,7 @@ public class ExecutionersCapsule extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature"); static { - filter.getColor().setBlack(true); - filter.setUseColor(true); - filter.setNotColor(true); + filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); } public ExecutionersCapsule(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tempest/DarkBanishing.java b/Mage.Sets/src/mage/sets/tempest/DarkBanishing.java index 884080f646..5e2f2a052b 100644 --- a/Mage.Sets/src/mage/sets/tempest/DarkBanishing.java +++ b/Mage.Sets/src/mage/sets/tempest/DarkBanishing.java @@ -30,9 +30,12 @@ package mage.sets.tempest; import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.ObjectColor; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -44,9 +47,7 @@ public class DarkBanishing extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature"); static { - filter.setUseColor(true); - filter.getColor().setBlack(true); - filter.setNotColor(true); + filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); } public DarkBanishing(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tempest/DreadOfNight.java b/Mage.Sets/src/mage/sets/tempest/DreadOfNight.java index d62fbc0b28..de9b7e6f5e 100644 --- a/Mage.Sets/src/mage/sets/tempest/DreadOfNight.java +++ b/Mage.Sets/src/mage/sets/tempest/DreadOfNight.java @@ -32,10 +32,12 @@ import java.util.UUID; import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.ObjectColor; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.continious.BoostAllEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -46,8 +48,7 @@ public class DreadOfNight extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("White creatures"); static { - filter.setUseColor(true); - filter.getColor().setWhite(true); + filter.add(new ColorPredicate(ObjectColor.WHITE)); } public DreadOfNight(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tempest/Perish.java b/Mage.Sets/src/mage/sets/tempest/Perish.java index faa6298768..0430a4dd02 100644 --- a/Mage.Sets/src/mage/sets/tempest/Perish.java +++ b/Mage.Sets/src/mage/sets/tempest/Perish.java @@ -30,10 +30,12 @@ package mage.sets.tempest; import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.ObjectColor; import mage.abilities.effects.common.DestroyAllEffect; import mage.cards.CardImpl; import mage.filter.FilterPermanent; import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -44,8 +46,7 @@ public class Perish extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("green creatures"); static { - filter.getColor().setGreen(true); - filter.setUseColor(true); + filter.add(new ColorPredicate(ObjectColor.GREEN)); filter.add(new CardTypePredicate(CardType.CREATURE)); } diff --git a/Mage.Sets/src/mage/sets/tempest/RecklessSpite.java b/Mage.Sets/src/mage/sets/tempest/RecklessSpite.java index 65e84789c5..7a85fae81d 100644 --- a/Mage.Sets/src/mage/sets/tempest/RecklessSpite.java +++ b/Mage.Sets/src/mage/sets/tempest/RecklessSpite.java @@ -30,10 +30,13 @@ package mage.sets.tempest; import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.ObjectColor; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.effects.common.LoseLifeSourceEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -45,9 +48,7 @@ public class RecklessSpite extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature"); static { - filter.setUseColor(true); - filter.getColor().setBlack(true); - filter.setNotColor(true); + filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); } public RecklessSpite(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tenth/Deathmark.java b/Mage.Sets/src/mage/sets/tenth/Deathmark.java index e842f51a38..15618d7248 100644 --- a/Mage.Sets/src/mage/sets/tenth/Deathmark.java +++ b/Mage.Sets/src/mage/sets/tenth/Deathmark.java @@ -31,10 +31,12 @@ package mage.sets.tenth; import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.ObjectColor; 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.ColorPredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -46,10 +48,9 @@ public class Deathmark extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("green or white creature"); static { - filter.getColor().setGreen(true); - filter.getColor().setWhite(true); - filter.setUseColor(true); - filter.setScopeColor(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new ColorPredicate(ObjectColor.GREEN), + new ColorPredicate(ObjectColor.WHITE))); } public Deathmark(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tenth/Flashfreeze.java b/Mage.Sets/src/mage/sets/tenth/Flashfreeze.java index 3fcd36beba..01d10f9c21 100644 --- a/Mage.Sets/src/mage/sets/tenth/Flashfreeze.java +++ b/Mage.Sets/src/mage/sets/tenth/Flashfreeze.java @@ -31,10 +31,12 @@ package mage.sets.tenth; import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.ObjectColor; import mage.abilities.effects.common.CounterTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterSpell; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.TargetSpell; /** @@ -46,10 +48,9 @@ public class Flashfreeze extends CardImpl { private static final FilterSpell filter = new FilterSpell("red or green spell"); static { - filter.getColor().setRed(true); - filter.getColor().setGreen(true); - filter.setScopeColor(ComparisonScope.Any); - filter.setUseColor(true); + filter.add(Predicates.or( + new ColorPredicate(ObjectColor.RED), + new ColorPredicate(ObjectColor.GREEN))); } public Flashfreeze(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tenth/HateWeaver.java b/Mage.Sets/src/mage/sets/tenth/HateWeaver.java index 61cc24d9c8..c771b75bda 100644 --- a/Mage.Sets/src/mage/sets/tenth/HateWeaver.java +++ b/Mage.Sets/src/mage/sets/tenth/HateWeaver.java @@ -33,13 +33,15 @@ import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.continious.BoostTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -51,10 +53,9 @@ public class HateWeaver extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("blue or red creature"); static { - filter.setUseColor(true); - filter.getColor().setBlue(true); - filter.getColor().setRed(true); - filter.setScopeColor(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new ColorPredicate(ObjectColor.BLUE), + new ColorPredicate(ObjectColor.RED))); } public HateWeaver(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tenth/MightWeaver.java b/Mage.Sets/src/mage/sets/tenth/MightWeaver.java index 46233d7d53..2a642d48c8 100644 --- a/Mage.Sets/src/mage/sets/tenth/MightWeaver.java +++ b/Mage.Sets/src/mage/sets/tenth/MightWeaver.java @@ -33,14 +33,16 @@ import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.continious.GainAbilityTargetEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -52,10 +54,9 @@ public class MightWeaver extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("red or white creature"); static { - filter.setUseColor(true); - filter.getColor().setRed(true); - filter.getColor().setWhite(true); - filter.setScopeColor(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new ColorPredicate(ObjectColor.RED), + new ColorPredicate(ObjectColor.WHITE))); } public MightWeaver(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tenth/QuirionDryad.java b/Mage.Sets/src/mage/sets/tenth/QuirionDryad.java index 793c80bb74..54088aff6c 100644 --- a/Mage.Sets/src/mage/sets/tenth/QuirionDryad.java +++ b/Mage.Sets/src/mage/sets/tenth/QuirionDryad.java @@ -31,12 +31,14 @@ import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.common.SpellCastTriggeredAbility; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.counters.CounterType; -import mage.filter.Filter; import mage.filter.FilterSpell; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -47,12 +49,11 @@ public class QuirionDryad extends CardImpl { private final static FilterSpell filter = new FilterSpell("white, blue, black, or red spell"); static { - filter.setUseColor(true); - filter.getColor().setWhite(true); - filter.getColor().setBlue(true); - filter.getColor().setBlack(true); - filter.getColor().setRed(true); - filter.setScopeColor(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new ColorPredicate(ObjectColor.WHITE), + new ColorPredicate(ObjectColor.BLUE), + new ColorPredicate(ObjectColor.BLACK), + new ColorPredicate(ObjectColor.RED))); } public QuirionDryad(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tenth/RageWeaver.java b/Mage.Sets/src/mage/sets/tenth/RageWeaver.java index 822c9076e0..b8e768dff4 100644 --- a/Mage.Sets/src/mage/sets/tenth/RageWeaver.java +++ b/Mage.Sets/src/mage/sets/tenth/RageWeaver.java @@ -33,14 +33,16 @@ import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.continious.GainAbilityTargetEffect; import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -52,10 +54,9 @@ public class RageWeaver extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("black or green creature"); static { - filter.setUseColor(true); - filter.getColor().setBlack(true); - filter.getColor().setGreen(true); - filter.setScopeColor(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new ColorPredicate(ObjectColor.BLACK), + new ColorPredicate(ObjectColor.GREEN))); } public RageWeaver(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tenth/SkyWeaver.java b/Mage.Sets/src/mage/sets/tenth/SkyWeaver.java index 73911b706b..70dfe3549f 100644 --- a/Mage.Sets/src/mage/sets/tenth/SkyWeaver.java +++ b/Mage.Sets/src/mage/sets/tenth/SkyWeaver.java @@ -33,14 +33,16 @@ import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.continious.GainAbilityTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -52,10 +54,9 @@ public class SkyWeaver extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("white or black creature"); static { - filter.setUseColor(true); - filter.getColor().setWhite(true); - filter.getColor().setBlack(true); - filter.setScopeColor(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new ColorPredicate(ObjectColor.WHITE), + new ColorPredicate(ObjectColor.BLACK))); } public SkyWeaver(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tenth/SpiritWeaver.java b/Mage.Sets/src/mage/sets/tenth/SpiritWeaver.java index 0e63131cc3..1f63e8ed34 100644 --- a/Mage.Sets/src/mage/sets/tenth/SpiritWeaver.java +++ b/Mage.Sets/src/mage/sets/tenth/SpiritWeaver.java @@ -33,13 +33,15 @@ import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.continious.BoostTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -51,10 +53,9 @@ public class SpiritWeaver extends CardImpl { private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("green or blue creature"); static { - filter.setUseColor(true); - filter.getColor().setGreen(true); - filter.getColor().setBlue(true); - filter.setScopeColor(Filter.ComparisonScope.Any); + filter.add(Predicates.or( + new ColorPredicate(ObjectColor.GREEN), + new ColorPredicate(ObjectColor.BLUE))); } public SpiritWeaver(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tenth/Terror.java b/Mage.Sets/src/mage/sets/tenth/Terror.java index 2eb8a95582..09cc9fae49 100644 --- a/Mage.Sets/src/mage/sets/tenth/Terror.java +++ b/Mage.Sets/src/mage/sets/tenth/Terror.java @@ -30,11 +30,13 @@ package mage.sets.tenth; import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.ObjectColor; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -47,9 +49,7 @@ public class Terror extends CardImpl { static { filter.add(Predicates.not(new CardTypePredicate(CardType.ARTIFACT))); - filter.getColor().setBlack(true); - filter.setNotColor(true); - filter.setUseColor(true); + filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); } public Terror(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/timeshifted/AkromaAngelOfWrath.java b/Mage.Sets/src/mage/sets/timeshifted/AkromaAngelOfWrath.java index 911583ac93..3dd6a72cfd 100644 --- a/Mage.Sets/src/mage/sets/timeshifted/AkromaAngelOfWrath.java +++ b/Mage.Sets/src/mage/sets/timeshifted/AkromaAngelOfWrath.java @@ -31,27 +31,24 @@ import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.keyword.*; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; /** * * @author Loki */ public class AkromaAngelOfWrath extends CardImpl { - private static FilterCard filter = new FilterCard("Black"); - private static FilterCard filter2 = new FilterCard("Red"); + private static final FilterCard filter = new FilterCard("Black"); + private static final FilterCard filter2 = new FilterCard("Red"); static { - filter.setUseColor(true); - filter.getColor().setBlack(true); - filter.setScopeColor(Filter.ComparisonScope.Any); + filter.add(new ColorPredicate(ObjectColor.BLACK)); - filter2.setUseColor(true); - filter2.getColor().setRed(true); - filter2.setScopeColor(Filter.ComparisonScope.Any); + filter2.add(new ColorPredicate(ObjectColor.RED)); } public AkromaAngelOfWrath(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/timeshifted/WhirlingDervish.java b/Mage.Sets/src/mage/sets/timeshifted/WhirlingDervish.java index 385b0cd64c..cceaa6664b 100644 --- a/Mage.Sets/src/mage/sets/timeshifted/WhirlingDervish.java +++ b/Mage.Sets/src/mage/sets/timeshifted/WhirlingDervish.java @@ -41,6 +41,7 @@ import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; import mage.counters.CounterType; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.events.GameEvent; /** @@ -53,8 +54,7 @@ public class WhirlingDervish extends CardImpl { private static final FilterCard filter = new FilterCard("black"); static { - filter.setColor(ObjectColor.BLACK); - filter.setUseColor(true); + filter.add(new ColorPredicate(ObjectColor.BLACK)); } public WhirlingDervish(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/urzaslegacy/BloatedToad.java b/Mage.Sets/src/mage/sets/urzaslegacy/BloatedToad.java index 4887b43041..a9d5478214 100644 --- a/Mage.Sets/src/mage/sets/urzaslegacy/BloatedToad.java +++ b/Mage.Sets/src/mage/sets/urzaslegacy/BloatedToad.java @@ -31,12 +31,13 @@ import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.keyword.CyclingAbility; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -47,9 +48,7 @@ public class BloatedToad extends CardImpl { private static final FilterCard filter = new FilterCard("Blue"); static { - filter.setUseColor(true); - filter.getColor().setBlue(true); - filter.setScopeColor(ComparisonScope.Any); + filter.add(new ColorPredicate(ObjectColor.BLUE)); } public BloatedToad(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/urzaslegacy/BoneShredder.java b/Mage.Sets/src/mage/sets/urzaslegacy/BoneShredder.java index 997b5cdcf2..556fb9f0f5 100644 --- a/Mage.Sets/src/mage/sets/urzaslegacy/BoneShredder.java +++ b/Mage.Sets/src/mage/sets/urzaslegacy/BoneShredder.java @@ -31,6 +31,7 @@ import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.DestroyTargetEffect; @@ -40,6 +41,7 @@ import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.Target; import mage.target.common.TargetCreaturePermanent; @@ -53,9 +55,7 @@ public class BoneShredder extends CardImpl { static { filter.add(Predicates.not(new CardTypePredicate(CardType.ARTIFACT))); - filter.getColor().setBlack(true); - filter.setNotColor(true); - filter.setUseColor(true); + filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); } public BoneShredder(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/urzaslegacy/DarkwatchElves.java b/Mage.Sets/src/mage/sets/urzaslegacy/DarkwatchElves.java index 8ad79538c7..8f8057c0b1 100644 --- a/Mage.Sets/src/mage/sets/urzaslegacy/DarkwatchElves.java +++ b/Mage.Sets/src/mage/sets/urzaslegacy/DarkwatchElves.java @@ -30,12 +30,13 @@ package mage.sets.urzaslegacy; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.keyword.CyclingAbility; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; import java.util.UUID; @@ -47,9 +48,7 @@ public class DarkwatchElves extends CardImpl { private static final FilterCard filter = new FilterCard("Black"); static { - filter.setUseColor(true); - filter.getColor().setBlack(true); - filter.setScopeColor(ComparisonScope.Any); + filter.add(new ColorPredicate(ObjectColor.BLACK)); } public DarkwatchElves(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/urzaslegacy/DefenderOfChaos.java b/Mage.Sets/src/mage/sets/urzaslegacy/DefenderOfChaos.java index 7a2b420946..549c37c2f3 100644 --- a/Mage.Sets/src/mage/sets/urzaslegacy/DefenderOfChaos.java +++ b/Mage.Sets/src/mage/sets/urzaslegacy/DefenderOfChaos.java @@ -30,11 +30,12 @@ package mage.sets.urzaslegacy; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.keyword.FlashAbility; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; import java.util.UUID; @@ -46,9 +47,7 @@ public class DefenderOfChaos extends CardImpl { private static final FilterCard filter = new FilterCard("White"); static { - filter.setUseColor(true); - filter.getColor().setWhite(true); - filter.setScopeColor(ComparisonScope.Any); + filter.add(new ColorPredicate(ObjectColor.WHITE)); } public DefenderOfChaos(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/urzaslegacy/DefenderOfLaw.java b/Mage.Sets/src/mage/sets/urzaslegacy/DefenderOfLaw.java index 28024b9633..381f19bbb0 100644 --- a/Mage.Sets/src/mage/sets/urzaslegacy/DefenderOfLaw.java +++ b/Mage.Sets/src/mage/sets/urzaslegacy/DefenderOfLaw.java @@ -30,11 +30,12 @@ package mage.sets.urzaslegacy; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.keyword.FlashAbility; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; import java.util.UUID; @@ -46,9 +47,7 @@ public class DefenderOfLaw extends CardImpl { private static final FilterCard filter = new FilterCard("Red"); static { - filter.setUseColor(true); - filter.getColor().setRed(true); - filter.setScopeColor(ComparisonScope.Any); + filter.add(new ColorPredicate(ObjectColor.RED)); } public DefenderOfLaw(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/urzassaga/AbsoluteGrace.java b/Mage.Sets/src/mage/sets/urzassaga/AbsoluteGrace.java index ba79655ea6..e31dd87d1a 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/AbsoluteGrace.java +++ b/Mage.Sets/src/mage/sets/urzassaga/AbsoluteGrace.java @@ -33,14 +33,15 @@ import mage.Constants.CardType; import mage.Constants.Duration; import mage.Constants.Rarity; import mage.Constants.Zone; +import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.continious.GainAbilityAllEffect; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -51,9 +52,7 @@ public class AbsoluteGrace extends CardImpl { private static final FilterCard filter = new FilterCard("Black"); static { - filter.setUseColor(true); - filter.getColor().setBlack(true); - filter.setScopeColor(ComparisonScope.Any); + filter.add(new ColorPredicate(ObjectColor.BLACK)); } public AbsoluteGrace(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/urzassaga/AbsoluteLaw.java b/Mage.Sets/src/mage/sets/urzassaga/AbsoluteLaw.java index b687584cd7..a3b7d717c4 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/AbsoluteLaw.java +++ b/Mage.Sets/src/mage/sets/urzassaga/AbsoluteLaw.java @@ -33,14 +33,15 @@ import mage.Constants.CardType; import mage.Constants.Duration; import mage.Constants.Rarity; import mage.Constants.Zone; +import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.continious.GainAbilityAllEffect; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -51,9 +52,7 @@ public class AbsoluteLaw extends CardImpl { private static final FilterCard filter = new FilterCard("Red"); static { - filter.setUseColor(true); - filter.getColor().setRed(true); - filter.setScopeColor(ComparisonScope.Any); + filter.add(new ColorPredicate(ObjectColor.RED)); } public AbsoluteLaw(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/urzassaga/DiscipleOfGrace.java b/Mage.Sets/src/mage/sets/urzassaga/DiscipleOfGrace.java index 22ebda45fb..725fe05729 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/DiscipleOfGrace.java +++ b/Mage.Sets/src/mage/sets/urzassaga/DiscipleOfGrace.java @@ -31,12 +31,13 @@ package mage.sets.urzassaga; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.keyword.CyclingAbility; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; import java.util.UUID; @@ -48,9 +49,7 @@ public class DiscipleOfGrace extends CardImpl { private static final FilterCard filter = new FilterCard("Black"); static { - filter.setUseColor(true); - filter.getColor().setBlack(true); - filter.setScopeColor(ComparisonScope.Any); + filter.add(new ColorPredicate(ObjectColor.BLACK)); } public DiscipleOfGrace(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/urzassaga/DiscipleOfLaw.java b/Mage.Sets/src/mage/sets/urzassaga/DiscipleOfLaw.java index 3ec29f316c..b5253f72fd 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/DiscipleOfLaw.java +++ b/Mage.Sets/src/mage/sets/urzassaga/DiscipleOfLaw.java @@ -32,12 +32,13 @@ import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.keyword.CyclingAbility; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -48,9 +49,7 @@ public class DiscipleOfLaw extends CardImpl { private static final FilterCard filter = new FilterCard("Red"); static { - filter.setUseColor(true); - filter.getColor().setRed(true); - filter.setScopeColor(ComparisonScope.Any); + filter.add(new ColorPredicate(ObjectColor.RED)); } public DiscipleOfLaw(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/urzassaga/EasternPaladin.java b/Mage.Sets/src/mage/sets/urzassaga/EasternPaladin.java index dcb4d06153..2fb1bbddd1 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/EasternPaladin.java +++ b/Mage.Sets/src/mage/sets/urzassaga/EasternPaladin.java @@ -34,14 +34,15 @@ import mage.Constants.CardType; import mage.Constants.Rarity; import mage.Constants.Zone; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -53,9 +54,7 @@ public class EasternPaladin extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("green creature"); static { - filter.getColor().setGreen(true); - filter.setUseColor(true); - filter.setScopeColor(Filter.ComparisonScope.Any); + filter.add(new ColorPredicate(ObjectColor.GREEN)); } public EasternPaladin(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/urzassaga/Guma.java b/Mage.Sets/src/mage/sets/urzassaga/Guma.java index 3db35ad581..4732e88144 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/Guma.java +++ b/Mage.Sets/src/mage/sets/urzassaga/Guma.java @@ -32,10 +32,11 @@ import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -46,9 +47,7 @@ public class Guma extends CardImpl { private static final FilterCard filter = new FilterCard("Blue"); static { - filter.setUseColor(true); - filter.getColor().setBlue(true); - filter.setScopeColor(ComparisonScope.Any); + filter.add(new ColorPredicate(ObjectColor.BLUE)); } public Guma(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/urzassaga/VoiceOfGrace.java b/Mage.Sets/src/mage/sets/urzassaga/VoiceOfGrace.java index 7185e2f38f..fa0277e380 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/VoiceOfGrace.java +++ b/Mage.Sets/src/mage/sets/urzassaga/VoiceOfGrace.java @@ -33,11 +33,12 @@ import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -48,9 +49,7 @@ public class VoiceOfGrace extends CardImpl { private static final FilterCard filter = new FilterCard("Black"); static { - filter.setUseColor(true); - filter.getColor().setBlack(true); - filter.setScopeColor(ComparisonScope.Any); + filter.add(new ColorPredicate(ObjectColor.BLACK)); } public VoiceOfGrace(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/urzassaga/VoiceOfLaw.java b/Mage.Sets/src/mage/sets/urzassaga/VoiceOfLaw.java index c130bfce44..fec915a297 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/VoiceOfLaw.java +++ b/Mage.Sets/src/mage/sets/urzassaga/VoiceOfLaw.java @@ -32,11 +32,12 @@ import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -47,9 +48,7 @@ public class VoiceOfLaw extends CardImpl { private static final FilterCard filter = new FilterCard("Red"); static { - filter.setUseColor(true); - filter.getColor().setRed(true); - filter.setScopeColor(ComparisonScope.Any); + filter.add(new ColorPredicate(ObjectColor.RED)); } public VoiceOfLaw(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/urzassaga/WesternPaladin.java b/Mage.Sets/src/mage/sets/urzassaga/WesternPaladin.java index 25071a2ec3..7523525986 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/WesternPaladin.java +++ b/Mage.Sets/src/mage/sets/urzassaga/WesternPaladin.java @@ -34,14 +34,15 @@ import mage.Constants.CardType; import mage.Constants.Rarity; import mage.Constants.Zone; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -53,9 +54,7 @@ public class WesternPaladin extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("white creature"); static { - filter.getColor().setWhite(true); - filter.setUseColor(true); - filter.setScopeColor(Filter.ComparisonScope.Any); + filter.add(new ColorPredicate(ObjectColor.WHITE)); } public WesternPaladin(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/worldwake/EyeOfUgin.java b/Mage.Sets/src/mage/sets/worldwake/EyeOfUgin.java index 42f8b76586..78fecd8d52 100644 --- a/Mage.Sets/src/mage/sets/worldwake/EyeOfUgin.java +++ b/Mage.Sets/src/mage/sets/worldwake/EyeOfUgin.java @@ -45,6 +45,7 @@ import mage.abilities.effects.common.search.SearchLibraryRevealPutInHandEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.filter.common.FilterCreatureCard; +import mage.filter.predicate.mageobject.ColorlessPredicate; import mage.game.Game; import mage.target.common.TargetCardInLibrary; @@ -59,8 +60,7 @@ public class EyeOfUgin extends CardImpl { static { filter = new FilterCreatureCard(); - filter.setColorless(true); - filter.setUseColorless(true); + filter.add(new ColorlessPredicate()); } public EyeOfUgin (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/worldwake/KorFirewalker.java b/Mage.Sets/src/mage/sets/worldwake/KorFirewalker.java index 73d9aeb462..252f324ba0 100644 --- a/Mage.Sets/src/mage/sets/worldwake/KorFirewalker.java +++ b/Mage.Sets/src/mage/sets/worldwake/KorFirewalker.java @@ -33,12 +33,13 @@ import mage.Constants.CardType; import mage.Constants.Rarity; import mage.Constants.Zone; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.stack.Spell; @@ -48,12 +49,10 @@ import mage.game.stack.Spell; * @author Loki */ public class KorFirewalker extends CardImpl { - private static FilterCard filter = new FilterCard("Red"); + private static final FilterCard filter = new FilterCard("Red"); static { - filter.setUseColor(true); - filter.getColor().setRed(true); - filter.setScopeColor(ComparisonScope.Any); + filter.add(new ColorPredicate(ObjectColor.RED)); } public KorFirewalker (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/zendikar/BraveTheElements.java b/Mage.Sets/src/mage/sets/zendikar/BraveTheElements.java index 53671f7c96..18d6598ff9 100644 --- a/Mage.Sets/src/mage/sets/zendikar/BraveTheElements.java +++ b/Mage.Sets/src/mage/sets/zendikar/BraveTheElements.java @@ -31,14 +31,15 @@ package mage.sets.zendikar; import mage.Constants.CardType; import mage.Constants.Duration; import mage.Constants.Rarity; +import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.effects.common.continious.GainAbilityControlledEffect; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; import mage.choices.ChoiceColor; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; import java.util.UUID; @@ -73,9 +74,7 @@ class BraveTheElementsEffect extends GainAbilityControlledEffect { private static final FilterCreaturePermanent filter1 = new FilterCreaturePermanent(); static { - filter1.setUseColor(true); - filter1.getColor().setWhite(true); - filter1.setScopeColor(ComparisonScope.Any); + filter1.add(new ColorPredicate(ObjectColor.WHITE)); } FilterCard filter2; @@ -83,8 +82,6 @@ class BraveTheElementsEffect extends GainAbilityControlledEffect { public BraveTheElementsEffect() { super(new ProtectionAbility(new FilterCard()), Duration.EndOfTurn, filter1); filter2 = (FilterCard)((ProtectionAbility)getFirstAbility()).getFilter(); - filter2.setUseColor(true); - filter2.setScopeColor(ComparisonScope.Any); staticText = "Choose a color. White creatures you control gain protection from the chosen color until end of turn"; } @@ -101,7 +98,7 @@ class BraveTheElementsEffect extends GainAbilityControlledEffect { @Override public boolean apply(Game game, Ability source) { ChoiceColor choice = (ChoiceColor) source.getChoices().get(0); - filter2.setColor(choice.getColor()); + filter2.add(new ColorPredicate(choice.getColor())); filter2.setMessage(choice.getChoice()); setAbility(new ProtectionAbility(new FilterCard(filter2))); return super.apply(game, source); diff --git a/Mage.Sets/src/mage/sets/zendikar/ChandraAblaze.java b/Mage.Sets/src/mage/sets/zendikar/ChandraAblaze.java index 4bc419d1ca..bfc02ff991 100644 --- a/Mage.Sets/src/mage/sets/zendikar/ChandraAblaze.java +++ b/Mage.Sets/src/mage/sets/zendikar/ChandraAblaze.java @@ -32,6 +32,7 @@ import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Outcome; import mage.Constants.Rarity; +import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; import mage.abilities.common.EntersBattlefieldAbility; @@ -44,6 +45,7 @@ import mage.counters.CounterType; import mage.filter.FilterCard; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -230,7 +232,7 @@ class ChandraAblazeEffect5 extends OneShotEffect { Player player = game.getPlayer(source.getControllerId()); if (player != null) { FilterCard filter = new FilterCard("red instant or sorcery card from your graveyard to play"); - filter.getColor().setRed(true); + filter.add(new ColorPredicate(ObjectColor.RED)); filter.add(Predicates.or( new CardTypePredicate(CardType.INSTANT), new CardTypePredicate(CardType.SORCERY))); diff --git a/Mage.Sets/src/mage/sets/zendikar/CryptOfAgadeem.java b/Mage.Sets/src/mage/sets/zendikar/CryptOfAgadeem.java index 439f063fb7..4d49630d10 100644 --- a/Mage.Sets/src/mage/sets/zendikar/CryptOfAgadeem.java +++ b/Mage.Sets/src/mage/sets/zendikar/CryptOfAgadeem.java @@ -40,6 +40,7 @@ import mage.abilities.mana.BlackManaAbility; import mage.abilities.mana.DynamicManaAbility; import mage.cards.CardImpl; import mage.filter.common.FilterCreatureCard; +import mage.filter.predicate.mageobject.ColorPredicate; /** * @@ -50,8 +51,7 @@ public class CryptOfAgadeem extends CardImpl { private static final FilterCreatureCard filter = new FilterCreatureCard("black creature card"); static { - filter.setColor(ObjectColor.BLACK); - filter.setUseColor(true); + filter.add(new ColorPredicate(ObjectColor.BLACK)); } public CryptOfAgadeem(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/zendikar/DevoutLightcaster.java b/Mage.Sets/src/mage/sets/zendikar/DevoutLightcaster.java index 963e7dc3ea..6fa3e5b590 100644 --- a/Mage.Sets/src/mage/sets/zendikar/DevoutLightcaster.java +++ b/Mage.Sets/src/mage/sets/zendikar/DevoutLightcaster.java @@ -31,13 +31,14 @@ import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.ExileTargetEffect; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.TargetPermanent; /** @@ -50,11 +51,8 @@ public class DevoutLightcaster extends CardImpl { private static final FilterPermanent filterTarget = new FilterPermanent("Black"); static { - filterProtection.setUseColor(true); - filterProtection.getColor().setBlack(true); - filterProtection.setScopeColor(ComparisonScope.Any); - filterTarget.setUseColor(true); - filterTarget.getColor().setBlack(true); + filterProtection.add(new ColorPredicate(ObjectColor.BLACK)); + filterTarget.add(new ColorPredicate(ObjectColor.BLACK)); } public DevoutLightcaster(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/zendikar/HideousEnd.java b/Mage.Sets/src/mage/sets/zendikar/HideousEnd.java index 0d245ca189..f09560b8a0 100644 --- a/Mage.Sets/src/mage/sets/zendikar/HideousEnd.java +++ b/Mage.Sets/src/mage/sets/zendikar/HideousEnd.java @@ -30,10 +30,13 @@ package mage.sets.zendikar; import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.ObjectColor; import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.effects.common.LoseLifeControllerEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -45,9 +48,7 @@ public class HideousEnd extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature"); static { - filter.getColor().setBlack(true); - filter.setUseColor(true); - filter.setNotColor(true); + filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); } public HideousEnd(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/zendikar/MalakirBloodwitch.java b/Mage.Sets/src/mage/sets/zendikar/MalakirBloodwitch.java index e3543da6db..a56bd811f4 100644 --- a/Mage.Sets/src/mage/sets/zendikar/MalakirBloodwitch.java +++ b/Mage.Sets/src/mage/sets/zendikar/MalakirBloodwitch.java @@ -33,6 +33,7 @@ import mage.Constants.CardType; import mage.Constants.Outcome; import mage.Constants.Rarity; import mage.MageInt; +import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.OneShotEffect; @@ -41,6 +42,7 @@ import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; import mage.filter.FilterCard; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.players.Player; @@ -54,8 +56,7 @@ public class MalakirBloodwitch extends CardImpl { private static final FilterCard filter = new FilterCard("white"); static { - filter.setUseColor(true); - filter.getColor().setWhite(true); + filter.add(new ColorPredicate(ObjectColor.WHITE)); } public MalakirBloodwitch(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/zendikar/OranRiefTheVastwood.java b/Mage.Sets/src/mage/sets/zendikar/OranRiefTheVastwood.java index 0d405cc5b3..b3587ea8a4 100644 --- a/Mage.Sets/src/mage/sets/zendikar/OranRiefTheVastwood.java +++ b/Mage.Sets/src/mage/sets/zendikar/OranRiefTheVastwood.java @@ -33,6 +33,7 @@ import mage.Constants.CardType; import mage.Constants.Outcome; import mage.Constants.Rarity; import mage.Constants.Zone; +import mage.ObjectColor; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTappedAbility; import mage.abilities.common.SimpleActivatedAbility; @@ -41,9 +42,9 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.mana.GreenManaAbility; import mage.cards.CardImpl; import mage.counters.CounterType; -import mage.filter.Filter; import mage.filter.FilterPermanent; import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; import mage.game.permanent.Permanent; @@ -92,9 +93,7 @@ class OranRiefTheVastwoodEffect extends OneShotEffect public boolean apply(Game game, Ability source) { FilterPermanent filter = new FilterPermanent(); filter.add(new CardTypePredicate(CardType.CREATURE)); - filter.getColor().setGreen(true); - filter.setScopeColor(Filter.ComparisonScope.Any); - filter.setUseColor(true); + filter.add(new ColorPredicate(ObjectColor.GREEN)); for (Permanent permanent: game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) { if (permanent.getTurnsOnBattlefield() == 0) { permanent.addCounters(CounterType.P1P1.createInstance(), game); diff --git a/Mage/src/mage/abilities/effects/common/continious/GainProtectionFromColorTargetEffect.java b/Mage/src/mage/abilities/effects/common/continious/GainProtectionFromColorTargetEffect.java index 4ef00e3473..7fb11d0268 100644 --- a/Mage/src/mage/abilities/effects/common/continious/GainProtectionFromColorTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/GainProtectionFromColorTargetEffect.java @@ -32,8 +32,8 @@ import mage.Constants.Duration; import mage.abilities.Ability; import mage.abilities.keyword.ProtectionAbility; import mage.choices.ChoiceColor; -import mage.filter.Filter.ComparisonScope; import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.ColorPredicate; import mage.game.Game; import mage.game.permanent.Permanent; @@ -48,8 +48,6 @@ public class GainProtectionFromColorTargetEffect extends GainAbilityTargetEffect public GainProtectionFromColorTargetEffect(Duration duration) { super(new ProtectionAbility(new FilterCard()), duration); protectionFilter = (FilterCard)((ProtectionAbility)ability).getFilter(); - protectionFilter.setUseColor(true); - protectionFilter.setScopeColor(ComparisonScope.Any); staticText = "target creature you control gains protection from the color of your choice " + duration.toString(); } @@ -68,7 +66,7 @@ public class GainProtectionFromColorTargetEffect extends GainAbilityTargetEffect Permanent creature = game.getPermanent(source.getFirstTarget()); if (creature != null) { ChoiceColor choice = (ChoiceColor) source.getChoices().get(0); - protectionFilter.setColor(choice.getColor()); + protectionFilter.add(new ColorPredicate(choice.getColor())); protectionFilter.setMessage(choice.getChoice()); ((ProtectionAbility)ability).setFilter(protectionFilter); creature.addAbility(ability, game); diff --git a/Mage/src/mage/filter/FilterObject.java b/Mage/src/mage/filter/FilterObject.java index ce1f0e0544..01eb2e04d2 100644 --- a/Mage/src/mage/filter/FilterObject.java +++ b/Mage/src/mage/filter/FilterObject.java @@ -29,21 +29,13 @@ package mage.filter; import mage.MageObject; -import mage.ObjectColor; -import mage.game.Game; /** * * @author BetaSteward_at_googlemail.com * @author North */ -public class FilterObject> extends FilterImpl implements Filter { - protected boolean colorless; - protected boolean useColorless; - protected boolean useColor; - protected ObjectColor color; - protected ComparisonScope scopeColor = ComparisonScope.Any; - protected boolean notColor; +public class FilterObject> extends FilterImpl { /** * Indicates that filter shouldn't match the source. @@ -57,78 +49,13 @@ public class FilterObject> ex public FilterObject(String name) { super(name); - color = new ObjectColor(); } public FilterObject(FilterObject filter) { super(filter); - this.colorless = filter.colorless; - this.useColorless = filter.useColorless; - this.useColor = filter.useColor; - this.color = filter.color.copy(); - this.scopeColor = filter.scopeColor; - this.notColor = filter.notColor; this.another = filter.another; } - @Override - public boolean match(E object, Game game) { - if (!super.match(object, game)) { - return notFilter; - } - - if (useColor) { - if (scopeColor == ComparisonScope.All) { - if (object.getColor().equals(color) == notColor) { - return notFilter; - } - } - else if (object.getColor().contains(color) == notColor) { - if (useColorless && colorless) { //need to treat colorless like a color in this case - if (object.getColor().isColorless() != colorless) { - return notFilter; - } - } - else { - return notFilter; - } - } - } - else if (useColorless && object.getColor().isColorless() != colorless) { - return notFilter; - } - - return !notFilter; - } - - public void setColor(ObjectColor color) { - this.color = color; - } - - public ObjectColor getColor() { - return this.color; - } - - public void setScopeColor(ComparisonScope scopeColor) { - this.scopeColor = scopeColor; - } - - public void setNotColor(boolean notColor) { - this.notColor = notColor; - } - - public void setUseColor(boolean useColor) { - this.useColor = useColor; - } - - public void setColorless(boolean colorless) { - this.colorless = colorless; - } - - public void setUseColorless(boolean useColorless) { - this.useColorless = useColorless; - } - public boolean isAnother() { return another; }