From fba4e662d0c014694992be8619582b2e3a89c237 Mon Sep 17 00:00:00 2001 From: North Date: Sat, 14 Jul 2012 15:26:00 +0300 Subject: [PATCH] [filters] Replaced tapped condition with Predicate --- .../sets/alarareborn/KnotvinePaladin.java | 7 +-- .../sets/apocalypse/DiversionaryTactics.java | 5 +- .../sets/avacynrestored/BurnAtTheStake.java | 5 +- .../sets/avacynrestored/DevoutChaplain.java | 4 +- .../avacynrestored/GallowsAtWillowHill.java | 5 +- .../avacynrestored/TamiyoTheMoonSage.java | 4 +- .../championsofkamigawa/AuraOfDominion.java | 5 +- .../AzamiLadyOfScrolls.java | 5 +- .../championsofkamigawa/BenBenAkkiHermit.java | 5 +- .../championsofkamigawa/HairStrungKoto.java | 5 +- .../championsofkamigawa/HonorWornShaku.java | 5 +- .../sets/darkascension/ChosenOfMarkov.java | 5 +- .../src/mage/sets/lorwyn/Benthicore.java | 7 +-- .../src/mage/sets/lorwyn/CloudgoatRanger.java | 7 +-- .../src/mage/sets/lorwyn/GlimmerdustNap.java | 3 +- .../src/mage/sets/lorwyn/SpringleafDrum.java | 5 +- .../src/mage/sets/lorwyn/SummonTheSchool.java | 5 +- .../mage/sets/magic2010/EntanglingVines.java | 3 +- .../sets/magic2010/MasterOfTheWildHunt.java | 5 +- .../sets/magic2011/CaptivatingVampire.java | 5 +- .../mage/sets/magic2012/ArachnusSpinner.java | 5 +- .../mage/sets/morningtide/HeritageDruid.java | 5 +- .../sets/morningtide/MothdustChangeling.java | 5 +- .../mage/sets/morningtide/SigilTracer.java | 4 +- .../mage/sets/planechase/LodestoneMyr.java | 5 +- .../src/mage/sets/ravnika/GlareOfSubdual.java | 4 +- .../mage/sets/ravnika/NullmageShepherd.java | 4 +- .../src/mage/sets/ravnika/Sandsower.java | 5 +- .../mage/sets/ravnika/SelesnyaEvangel.java | 5 +- .../sets/riseoftheeldrazi/GideonJura.java | 4 +- .../riseoftheeldrazi/SharedDiscovery.java | 5 +- .../sets/scarsofmirrodin/GrandArchitect.java | 5 +- .../sets/scarsofmirrodin/MyrBattlesphere.java | 5 +- .../sets/scarsofmirrodin/SunblastAngel.java | 4 +- .../mage/sets/shadowmoor/ToilToRenown.java | 3 +- .../src/mage/sets/tempest/Earthcraft.java | 5 +- .../src/mage/sets/tempest/Telethopter.java | 5 +- .../src/mage/sets/tempest/TradewindRider.java | 5 +- .../src/mage/sets/tenth/Assassinate.java | 4 +- .../src/mage/sets/tenth/RoyalAssassin.java | 4 +- .../mage/sets/weatherlight/MaraxusOfKeld.java | 11 ++--- .../mage/sets/worldwake/SurrakarBanisher.java | 3 +- .../src/mage/sets/zendikar/BloodTribute.java | 5 +- Mage/src/mage/filter/FilterPermanent.java | 15 ------ .../common/FilterArtifactPermanent.java | 5 -- .../common/FilterCreatureForAttack.java | 4 +- .../common/FilterCreatureForCombat.java | 5 +- .../common/FilterCreaturePermanent.java | 2 - .../filter/common/FilterUntappedCreature.java | 6 ++- .../predicate/permanent/TappedPredicate.java | 49 +++++++++++++++++++ 50 files changed, 179 insertions(+), 117 deletions(-) create mode 100644 Mage/src/mage/filter/predicate/permanent/TappedPredicate.java diff --git a/Mage.Sets/src/mage/sets/alarareborn/KnotvinePaladin.java b/Mage.Sets/src/mage/sets/alarareborn/KnotvinePaladin.java index 3101f70548a..61d0cc8cec2 100644 --- a/Mage.Sets/src/mage/sets/alarareborn/KnotvinePaladin.java +++ b/Mage.Sets/src/mage/sets/alarareborn/KnotvinePaladin.java @@ -38,17 +38,18 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.permanent.TappedPredicate; /** * * @author Loki */ public class KnotvinePaladin extends CardImpl { - private static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped creature you control"); + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped creature you control"); static { - filter.setUseTapped(true); - filter.setTapped(false); + filter.add(Predicates.not(new TappedPredicate())); } diff --git a/Mage.Sets/src/mage/sets/apocalypse/DiversionaryTactics.java b/Mage.Sets/src/mage/sets/apocalypse/DiversionaryTactics.java index 56cecb45855..fe7c43ee138 100644 --- a/Mage.Sets/src/mage/sets/apocalypse/DiversionaryTactics.java +++ b/Mage.Sets/src/mage/sets/apocalypse/DiversionaryTactics.java @@ -38,6 +38,8 @@ import mage.abilities.costs.common.TapTargetCost; import mage.abilities.effects.common.TapTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.permanent.TappedPredicate; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreaturePermanent; @@ -49,8 +51,7 @@ public class DiversionaryTactics extends CardImpl { private final static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped creatures you control"); static { - filter.setTapped(false); - filter.setUseTapped(true); + filter.add(Predicates.not(new TappedPredicate())); } public DiversionaryTactics(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/avacynrestored/BurnAtTheStake.java b/Mage.Sets/src/mage/sets/avacynrestored/BurnAtTheStake.java index 016e1a2e0b7..2a41b8c5591 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/BurnAtTheStake.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/BurnAtTheStake.java @@ -39,6 +39,8 @@ import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; import mage.filter.FilterMana; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.permanent.TappedPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -80,8 +82,7 @@ class BurnAtTheStakeCost extends CostImpl implements Variabl private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped creature you control"); static { - filter.setTapped(false); - filter.setUseTapped(true); + filter.add(Predicates.not(new TappedPredicate())); } private int amountPaid = 0; diff --git a/Mage.Sets/src/mage/sets/avacynrestored/DevoutChaplain.java b/Mage.Sets/src/mage/sets/avacynrestored/DevoutChaplain.java index 560c3afb9d1..8e3a1fb3284 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/DevoutChaplain.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/DevoutChaplain.java @@ -42,6 +42,7 @@ import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.permanent.TappedPredicate; import mage.target.TargetPermanent; import mage.target.common.TargetControlledPermanent; @@ -63,8 +64,7 @@ public class DevoutChaplain extends CardImpl { private final static FilterControlledPermanent humanFilter = new FilterControlledPermanent("untapped Human you control"); static { - humanFilter.setTapped(false); - humanFilter.setUseTapped(true); + humanFilter.add(Predicates.not(new TappedPredicate())); humanFilter.add(new SubtypePredicate("Human")); } diff --git a/Mage.Sets/src/mage/sets/avacynrestored/GallowsAtWillowHill.java b/Mage.Sets/src/mage/sets/avacynrestored/GallowsAtWillowHill.java index b185d77d378..d283ed0f44d 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/GallowsAtWillowHill.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/GallowsAtWillowHill.java @@ -38,7 +38,9 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.TappedPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.permanent.token.SpiritWhiteToken; @@ -57,8 +59,7 @@ public class GallowsAtWillowHill extends CardImpl { private final static FilterControlledPermanent humanFilter = new FilterControlledPermanent("untapped Human you control"); static { - humanFilter.setTapped(false); - humanFilter.setUseTapped(true); + humanFilter.add(Predicates.not(new TappedPredicate())); humanFilter.add(new SubtypePredicate("Human")); } diff --git a/Mage.Sets/src/mage/sets/avacynrestored/TamiyoTheMoonSage.java b/Mage.Sets/src/mage/sets/avacynrestored/TamiyoTheMoonSage.java index 5caac4468eb..7f2924d1b0c 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/TamiyoTheMoonSage.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/TamiyoTheMoonSage.java @@ -45,6 +45,7 @@ import mage.cards.Card; import mage.cards.CardImpl; import mage.counters.CounterType; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.TappedPredicate; import mage.game.Game; import mage.game.command.Emblem; import mage.game.events.GameEvent; @@ -100,8 +101,7 @@ class TappedCreaturesControlledByTargetCount implements DynamicValue { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); static { - filter.setTapped(true); - filter.setUseTapped(true); + filter.add(new TappedPredicate()); } @Override diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/AuraOfDominion.java b/Mage.Sets/src/mage/sets/championsofkamigawa/AuraOfDominion.java index cc093f6f8dc..99e5444a52d 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/AuraOfDominion.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/AuraOfDominion.java @@ -42,6 +42,8 @@ import mage.abilities.effects.common.UntapEnchantedEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.permanent.TappedPredicate; import mage.target.TargetPermanent; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreaturePermanent; @@ -54,8 +56,7 @@ public class AuraOfDominion extends CardImpl { private final static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped creature you control"); static { - filter.setTapped(false); - filter.setUseTapped(true); + filter.add(Predicates.not(new TappedPredicate())); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/AzamiLadyOfScrolls.java b/Mage.Sets/src/mage/sets/championsofkamigawa/AzamiLadyOfScrolls.java index 8c8840fc12d..060d4f554dd 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/AzamiLadyOfScrolls.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/AzamiLadyOfScrolls.java @@ -39,7 +39,9 @@ import mage.abilities.costs.common.TapTargetCost; import mage.abilities.effects.common.DrawCardControllerEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.TappedPredicate; import mage.target.common.TargetControlledPermanent; /** @@ -50,8 +52,7 @@ public class AzamiLadyOfScrolls extends CardImpl { private final static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped Wizard you control"); static { - filter.setTapped(false); - filter.setUseTapped(true); + filter.add(Predicates.not(new TappedPredicate())); filter.add(new SubtypePredicate("Wizard")); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/BenBenAkkiHermit.java b/Mage.Sets/src/mage/sets/championsofkamigawa/BenBenAkkiHermit.java index 9bb1f03c70e..4adcd7dd0f6 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/BenBenAkkiHermit.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/BenBenAkkiHermit.java @@ -41,7 +41,9 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.TappedPredicate; import mage.target.common.TargetAttackingCreature; /** @@ -53,8 +55,7 @@ public class BenBenAkkiHermit extends CardImpl { private final static FilterLandPermanent filter = new FilterLandPermanent("untapped Mountain you control"); static { - filter.setTapped(false); - filter.setUseTapped(true); + filter.add(Predicates.not(new TappedPredicate())); filter.add(new SubtypePredicate("Mountain")); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/HairStrungKoto.java b/Mage.Sets/src/mage/sets/championsofkamigawa/HairStrungKoto.java index 06300fcc8e2..73a2bf008c9 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/HairStrungKoto.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/HairStrungKoto.java @@ -39,6 +39,8 @@ import mage.abilities.costs.common.TapTargetCost; import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.permanent.TappedPredicate; import mage.target.TargetPlayer; import mage.target.common.TargetControlledCreaturePermanent; @@ -51,8 +53,7 @@ public class HairStrungKoto extends CardImpl { private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped creature you control"); static { - filter.setTapped(false); - filter.setUseTapped(true); + filter.add(Predicates.not(new TappedPredicate())); } public HairStrungKoto (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/HonorWornShaku.java b/Mage.Sets/src/mage/sets/championsofkamigawa/HonorWornShaku.java index 69331e6c29e..cb63daefbe3 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/HonorWornShaku.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/HonorWornShaku.java @@ -40,7 +40,9 @@ import mage.abilities.effects.common.UntapSourceEffect; import mage.abilities.mana.ColorlessManaAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.SupertypePredicate; +import mage.filter.predicate.permanent.TappedPredicate; import mage.target.common.TargetControlledPermanent; /** @@ -51,8 +53,7 @@ public class HonorWornShaku extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("untapped legendary permanent"); static { - filter.setTapped(false); - filter.setUseTapped(true); + filter.add(Predicates.not(new TappedPredicate())); filter.add(new SupertypePredicate("Legendary")); } diff --git a/Mage.Sets/src/mage/sets/darkascension/ChosenOfMarkov.java b/Mage.Sets/src/mage/sets/darkascension/ChosenOfMarkov.java index 89d676b6dee..48af8a9e313 100644 --- a/Mage.Sets/src/mage/sets/darkascension/ChosenOfMarkov.java +++ b/Mage.Sets/src/mage/sets/darkascension/ChosenOfMarkov.java @@ -41,7 +41,9 @@ import mage.abilities.effects.common.TransformSourceEffect; import mage.abilities.keyword.TransformAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.TappedPredicate; import mage.target.common.TargetControlledPermanent; /** @@ -52,8 +54,7 @@ public class ChosenOfMarkov extends CardImpl { private static final FilterControlledPermanent filter = new FilterControlledPermanent("untapped Vampire you control"); static { - filter.setUseTapped(true); - filter.setTapped(false); + filter.add(Predicates.not(new TappedPredicate())); filter.add(new SubtypePredicate("Vampire")); } diff --git a/Mage.Sets/src/mage/sets/lorwyn/Benthicore.java b/Mage.Sets/src/mage/sets/lorwyn/Benthicore.java index 47eb0b69325..f060a141110 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/Benthicore.java +++ b/Mage.Sets/src/mage/sets/lorwyn/Benthicore.java @@ -41,9 +41,11 @@ import mage.abilities.effects.common.continious.GainAbilitySourceEffect; import mage.abilities.keyword.ShroudAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.TappedPredicate; import mage.game.permanent.token.MerfolkToken; import mage.target.common.TargetControlledPermanent; -import mage.filter.predicate.mageobject.SubtypePredicate; import java.util.UUID; @@ -56,8 +58,7 @@ public class Benthicore extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("untapped Merfolk you control"); static { - filter.setTapped(false); - filter.setUseTapped(true); + filter.add(Predicates.not(new TappedPredicate())); filter.add(new SubtypePredicate("Merfolk")); } diff --git a/Mage.Sets/src/mage/sets/lorwyn/CloudgoatRanger.java b/Mage.Sets/src/mage/sets/lorwyn/CloudgoatRanger.java index dcec8faa4da..aadcad7362e 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/CloudgoatRanger.java +++ b/Mage.Sets/src/mage/sets/lorwyn/CloudgoatRanger.java @@ -41,9 +41,11 @@ import mage.abilities.effects.common.continious.GainAbilitySourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.TappedPredicate; import mage.game.permanent.token.KithkinToken; import mage.target.common.TargetControlledPermanent; -import mage.filter.predicate.mageobject.SubtypePredicate; import java.util.UUID; @@ -56,8 +58,7 @@ public class CloudgoatRanger extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("untapped Kithkin you control"); static { - filter.setTapped(false); - filter.setUseTapped(true); + filter.add(Predicates.not(new TappedPredicate())); filter.add(new SubtypePredicate("Kithkin")); } diff --git a/Mage.Sets/src/mage/sets/lorwyn/GlimmerdustNap.java b/Mage.Sets/src/mage/sets/lorwyn/GlimmerdustNap.java index 8e231239b79..9fc37eaace7 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/GlimmerdustNap.java +++ b/Mage.Sets/src/mage/sets/lorwyn/GlimmerdustNap.java @@ -38,6 +38,7 @@ import mage.abilities.effects.common.SkipEnchantedUntapEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.TappedPredicate; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -50,7 +51,7 @@ public class GlimmerdustNap extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("tapped creature"); static { - filter.setTapped(true); + filter.add(new TappedPredicate()); } public GlimmerdustNap(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/lorwyn/SpringleafDrum.java b/Mage.Sets/src/mage/sets/lorwyn/SpringleafDrum.java index e82778a8940..ba872610878 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/SpringleafDrum.java +++ b/Mage.Sets/src/mage/sets/lorwyn/SpringleafDrum.java @@ -34,6 +34,8 @@ import mage.abilities.costs.common.TapTargetCost; import mage.abilities.mana.AnyColorManaAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.permanent.TappedPredicate; import mage.target.common.TargetControlledCreaturePermanent; import java.util.UUID; @@ -46,8 +48,7 @@ public class SpringleafDrum extends CardImpl { private final static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped creature"); static { - filter.setUseTapped(true); - filter.setTapped(false); + filter.add(Predicates.not(new TappedPredicate())); } public SpringleafDrum(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/lorwyn/SummonTheSchool.java b/Mage.Sets/src/mage/sets/lorwyn/SummonTheSchool.java index 9126ff904e7..2ba69cc5664 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/SummonTheSchool.java +++ b/Mage.Sets/src/mage/sets/lorwyn/SummonTheSchool.java @@ -36,7 +36,9 @@ import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.ReturnToHandSourceEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.TappedPredicate; import mage.game.permanent.token.MerfolkToken; import mage.target.common.TargetControlledPermanent; @@ -51,8 +53,7 @@ public class SummonTheSchool extends CardImpl { private final static FilterControlledPermanent filter = new FilterControlledPermanent("untapped Merfolk you control"); static { - filter.setUseTapped(true); - filter.setTapped(false); + filter.add(Predicates.not(new TappedPredicate())); filter.add(new SubtypePredicate("Merfolk")); } diff --git a/Mage.Sets/src/mage/sets/magic2010/EntanglingVines.java b/Mage.Sets/src/mage/sets/magic2010/EntanglingVines.java index 39d494bcfc9..b193f26be9e 100644 --- a/Mage.Sets/src/mage/sets/magic2010/EntanglingVines.java +++ b/Mage.Sets/src/mage/sets/magic2010/EntanglingVines.java @@ -38,6 +38,7 @@ import mage.abilities.effects.common.SkipEnchantedUntapEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.TappedPredicate; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -50,7 +51,7 @@ public class EntanglingVines extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("tapped creature"); static { - filter.setTapped(true); + filter.add(new TappedPredicate()); } public EntanglingVines(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2010/MasterOfTheWildHunt.java b/Mage.Sets/src/mage/sets/magic2010/MasterOfTheWildHunt.java index 7cfe4dc5b4f..878f010a1c2 100644 --- a/Mage.Sets/src/mage/sets/magic2010/MasterOfTheWildHunt.java +++ b/Mage.Sets/src/mage/sets/magic2010/MasterOfTheWildHunt.java @@ -41,7 +41,9 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.TappedPredicate; import mage.game.Game; import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; @@ -92,8 +94,7 @@ class MasterOfTheWildHuntEffect extends OneShotEffect static { filter.add(new SubtypePredicate("Wolf")); - filter.setTapped(false); - filter.setUseTapped(true); + filter.add(Predicates.not(new TappedPredicate())); } public MasterOfTheWildHuntEffect() { diff --git a/Mage.Sets/src/mage/sets/magic2011/CaptivatingVampire.java b/Mage.Sets/src/mage/sets/magic2011/CaptivatingVampire.java index 2a0b642b0dc..879e2438cf2 100644 --- a/Mage.Sets/src/mage/sets/magic2011/CaptivatingVampire.java +++ b/Mage.Sets/src/mage/sets/magic2011/CaptivatingVampire.java @@ -46,7 +46,9 @@ import mage.abilities.effects.common.continious.BoostControlledEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.TappedPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.common.TargetControlledCreaturePermanent; @@ -64,8 +66,7 @@ public class CaptivatingVampire extends CardImpl { static { filter1.add(new SubtypePredicate("Vampire")); filter2.add(new SubtypePredicate("Vampire")); - filter2.setTapped(false); - filter2.setUseTapped(true); + filter2.add(Predicates.not(new TappedPredicate())); } public CaptivatingVampire(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2012/ArachnusSpinner.java b/Mage.Sets/src/mage/sets/magic2012/ArachnusSpinner.java index 6b17b3d4bce..5cedfb214eb 100644 --- a/Mage.Sets/src/mage/sets/magic2012/ArachnusSpinner.java +++ b/Mage.Sets/src/mage/sets/magic2012/ArachnusSpinner.java @@ -42,8 +42,10 @@ import mage.cards.Card; import mage.cards.CardImpl; import mage.filter.FilterCard; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.NamePredicate; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.TappedPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -62,8 +64,7 @@ public class ArachnusSpinner extends CardImpl { static { filter.add(new SubtypePredicate("Spider")); - filter.setTapped(false); - filter.setUseTapped(true); + filter.add(Predicates.not(new TappedPredicate())); } public ArachnusSpinner(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/morningtide/HeritageDruid.java b/Mage.Sets/src/mage/sets/morningtide/HeritageDruid.java index fd51ab7dff0..9dcab1774e4 100644 --- a/Mage.Sets/src/mage/sets/morningtide/HeritageDruid.java +++ b/Mage.Sets/src/mage/sets/morningtide/HeritageDruid.java @@ -39,7 +39,9 @@ import mage.abilities.effects.common.BasicManaEffect; import mage.abilities.mana.SimpleManaAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.TappedPredicate; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -51,8 +53,7 @@ public class HeritageDruid extends CardImpl { private final static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped Elves you control"); static { - filter.setTapped(false); - filter.setUseTapped(true); + filter.add(Predicates.not(new TappedPredicate())); filter.add(new SubtypePredicate("Elf")); } diff --git a/Mage.Sets/src/mage/sets/morningtide/MothdustChangeling.java b/Mage.Sets/src/mage/sets/morningtide/MothdustChangeling.java index 42502a44b9e..4f66fd9f6d4 100644 --- a/Mage.Sets/src/mage/sets/morningtide/MothdustChangeling.java +++ b/Mage.Sets/src/mage/sets/morningtide/MothdustChangeling.java @@ -40,6 +40,8 @@ import mage.abilities.keyword.ChangelingAbility; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.permanent.TappedPredicate; import mage.target.common.TargetControlledPermanent; /** @@ -50,8 +52,7 @@ public class MothdustChangeling extends CardImpl { private final static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped creature you control"); static { - filter.setTapped(false); - filter.setUseTapped(true); + filter.add(Predicates.not(new TappedPredicate())); } public MothdustChangeling(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/morningtide/SigilTracer.java b/Mage.Sets/src/mage/sets/morningtide/SigilTracer.java index 40c2796a00e..81a0289a85d 100644 --- a/Mage.Sets/src/mage/sets/morningtide/SigilTracer.java +++ b/Mage.Sets/src/mage/sets/morningtide/SigilTracer.java @@ -44,6 +44,7 @@ import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.TappedPredicate; import mage.target.TargetSpell; import mage.target.common.TargetControlledCreaturePermanent; @@ -56,8 +57,7 @@ public class SigilTracer extends CardImpl { private static final FilterSpell filterInstorSorc = new FilterSpell("instant or sorcery spell"); static { - filter.setTapped(false); - filter.setUseTapped(true); + filter.add(Predicates.not(new TappedPredicate())); filter.add(new SubtypePredicate("Wizard")); filterInstorSorc.add(Predicates.or( new CardTypePredicate(CardType.INSTANT), diff --git a/Mage.Sets/src/mage/sets/planechase/LodestoneMyr.java b/Mage.Sets/src/mage/sets/planechase/LodestoneMyr.java index 20b0eda03f4..c262889f4e8 100644 --- a/Mage.Sets/src/mage/sets/planechase/LodestoneMyr.java +++ b/Mage.Sets/src/mage/sets/planechase/LodestoneMyr.java @@ -39,7 +39,9 @@ import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.permanent.TappedPredicate; import mage.target.common.TargetControlledPermanent; /** @@ -50,8 +52,7 @@ public class LodestoneMyr extends CardImpl { private final static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped artifact you control"); static { - filter.setTapped(false); - filter.setUseTapped(true); + filter.add(Predicates.not(new TappedPredicate())); filter.add(new CardTypePredicate(CardType.ARTIFACT)); } diff --git a/Mage.Sets/src/mage/sets/ravnika/GlareOfSubdual.java b/Mage.Sets/src/mage/sets/ravnika/GlareOfSubdual.java index 6eb1d3b8b7e..6c3b83f4591 100644 --- a/Mage.Sets/src/mage/sets/ravnika/GlareOfSubdual.java +++ b/Mage.Sets/src/mage/sets/ravnika/GlareOfSubdual.java @@ -41,6 +41,7 @@ import mage.filter.FilterPermanent; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.permanent.TappedPredicate; import mage.target.TargetPermanent; import mage.target.common.TargetControlledCreaturePermanent; @@ -54,8 +55,7 @@ public class GlareOfSubdual extends CardImpl { private final static FilterPermanent filterTarget = new FilterPermanent("artifact or creature"); static { - filterCost.setTapped(false); - filterCost.setUseTapped(true); + filterCost.add(Predicates.not(new TappedPredicate())); filterTarget.add(Predicates.or( new CardTypePredicate(CardType.ARTIFACT), new CardTypePredicate(CardType.CREATURE))); diff --git a/Mage.Sets/src/mage/sets/ravnika/NullmageShepherd.java b/Mage.Sets/src/mage/sets/ravnika/NullmageShepherd.java index 0d5739aab98..f74fa8d9603 100644 --- a/Mage.Sets/src/mage/sets/ravnika/NullmageShepherd.java +++ b/Mage.Sets/src/mage/sets/ravnika/NullmageShepherd.java @@ -42,6 +42,7 @@ import mage.filter.FilterPermanent; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.permanent.TappedPredicate; import mage.target.TargetPermanent; import mage.target.common.TargetControlledCreaturePermanent; @@ -55,8 +56,7 @@ public class NullmageShepherd extends CardImpl { private final static FilterPermanent filterTarget = new FilterPermanent("artifact or enchantment"); static { - filterCost.setTapped(false); - filterCost.setUseTapped(true); + filterCost.add(Predicates.not(new TappedPredicate())); filterTarget.add(Predicates.or( new CardTypePredicate(CardType.ARTIFACT), new CardTypePredicate(CardType.ENCHANTMENT))); diff --git a/Mage.Sets/src/mage/sets/ravnika/Sandsower.java b/Mage.Sets/src/mage/sets/ravnika/Sandsower.java index 358c3608808..afc90e06b21 100644 --- a/Mage.Sets/src/mage/sets/ravnika/Sandsower.java +++ b/Mage.Sets/src/mage/sets/ravnika/Sandsower.java @@ -39,6 +39,8 @@ import mage.abilities.costs.common.TapTargetCost; import mage.abilities.effects.common.TapTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.permanent.TappedPredicate; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreaturePermanent; @@ -51,8 +53,7 @@ public class Sandsower extends CardImpl { private final static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped creatures you control"); static { - filter.setTapped(false); - filter.setUseTapped(true); + filter.add(Predicates.not(new TappedPredicate())); } public Sandsower(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/ravnika/SelesnyaEvangel.java b/Mage.Sets/src/mage/sets/ravnika/SelesnyaEvangel.java index 59d79751931..4e7c0d5b04a 100644 --- a/Mage.Sets/src/mage/sets/ravnika/SelesnyaEvangel.java +++ b/Mage.Sets/src/mage/sets/ravnika/SelesnyaEvangel.java @@ -41,6 +41,8 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.permanent.TappedPredicate; import mage.game.permanent.token.SaprolingToken; import mage.target.common.TargetControlledCreaturePermanent; @@ -53,8 +55,7 @@ public class SelesnyaEvangel extends CardImpl { private final static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped creature you control"); static { - filter.setTapped(false); - filter.setUseTapped(true); + filter.add(Predicates.not(new TappedPredicate())); } public SelesnyaEvangel(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/GideonJura.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/GideonJura.java index 778fc1ca4fc..cc9f3b0a4ff 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/GideonJura.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/GideonJura.java @@ -45,6 +45,7 @@ import mage.abilities.effects.common.PreventAllDamageSourceEffect; import mage.cards.CardImpl; import mage.counters.CounterType; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.TappedPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.permanent.token.Token; @@ -60,8 +61,7 @@ public class GideonJura extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("tapped creature"); static { - filter.setUseTapped(true); - filter.setTapped(true); + filter.add(new TappedPredicate()); } public GideonJura(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/SharedDiscovery.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/SharedDiscovery.java index f6c4d28d25e..3abb0288d23 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/SharedDiscovery.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/SharedDiscovery.java @@ -34,6 +34,8 @@ import mage.abilities.costs.common.TapTargetCost; import mage.abilities.effects.common.DrawCardControllerEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.permanent.TappedPredicate; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -45,8 +47,7 @@ public class SharedDiscovery extends CardImpl { private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped creatures you control"); static { - filter.setTapped(false); - filter.setUseTapped(true); + filter.add(Predicates.not(new TappedPredicate())); } public SharedDiscovery(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/GrandArchitect.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/GrandArchitect.java index 07353e3ed0e..eac89869778 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/GrandArchitect.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/GrandArchitect.java @@ -55,8 +55,10 @@ import mage.abilities.mana.ManaAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.ColorPredicate; +import mage.filter.predicate.permanent.TappedPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.TargetPermanent; @@ -141,8 +143,7 @@ class GrandArchitectManaAbility extends ManaAbility { static { filter.add(new ColorPredicate(ObjectColor.BLUE)); - filter.setTapped(false); - filter.setUseTapped(true); + filter.add(Predicates.not(new TappedPredicate())); } GrandArchitectManaAbility ( ) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/MyrBattlesphere.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/MyrBattlesphere.java index eb5161d6ecd..1d405d10a99 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/MyrBattlesphere.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/MyrBattlesphere.java @@ -46,7 +46,9 @@ import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.TappedPredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -89,8 +91,7 @@ class MyrBattlesphereAbility extends TriggeredAbilityImpl { private static final FilterPermanent tappedFilter = new FilterCreaturePermanent("tapped creatures"); static { - tappedFilter.setUseTapped(true); - tappedFilter.setTapped(true); + tappedFilter.add(new TappedPredicate()); } public SunblastAngel (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/shadowmoor/ToilToRenown.java b/Mage.Sets/src/mage/sets/shadowmoor/ToilToRenown.java index b11340fb3b9..c484e10b683 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/ToilToRenown.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/ToilToRenown.java @@ -37,6 +37,7 @@ import mage.cards.CardImpl; import mage.filter.FilterPermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.permanent.TappedPredicate; /** * @@ -47,7 +48,7 @@ public class ToilToRenown extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("tapped artifact, creature, and land you control"); static { - filter.setTapped(true); + filter.add(new TappedPredicate()); filter.add(Predicates.or( new CardTypePredicate(CardType.ARTIFACT), new CardTypePredicate(CardType.CREATURE), diff --git a/Mage.Sets/src/mage/sets/tempest/Earthcraft.java b/Mage.Sets/src/mage/sets/tempest/Earthcraft.java index 32bf3bee8b3..fe46f15e2b1 100644 --- a/Mage.Sets/src/mage/sets/tempest/Earthcraft.java +++ b/Mage.Sets/src/mage/sets/tempest/Earthcraft.java @@ -39,8 +39,10 @@ import mage.abilities.effects.common.UntapTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SupertypePredicate; +import mage.filter.predicate.permanent.TappedPredicate; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetControlledPermanent; @@ -53,8 +55,7 @@ public class Earthcraft extends CardImpl { private final static FilterControlledPermanent filterLand = new FilterControlledPermanent("basic land"); static { - filterCreature.setUseTapped(true); - filterCreature.setTapped(false); + filterCreature.add(Predicates.not(new TappedPredicate())); filterLand.add(new CardTypePredicate(CardType.LAND)); filterLand.add(new SupertypePredicate("Basic")); } diff --git a/Mage.Sets/src/mage/sets/tempest/Telethopter.java b/Mage.Sets/src/mage/sets/tempest/Telethopter.java index 38bc8d1b4e7..38d0737aeae 100644 --- a/Mage.Sets/src/mage/sets/tempest/Telethopter.java +++ b/Mage.Sets/src/mage/sets/tempest/Telethopter.java @@ -39,6 +39,8 @@ import mage.abilities.effects.common.continious.GainAbilitySourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.permanent.TappedPredicate; import mage.target.common.TargetControlledCreaturePermanent; /** @@ -49,8 +51,7 @@ public class Telethopter extends CardImpl { private final static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped creature you control"); static { - filter.setTapped(false); - filter.setUseTapped(true); + filter.add(Predicates.not(new TappedPredicate())); } public Telethopter(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tempest/TradewindRider.java b/Mage.Sets/src/mage/sets/tempest/TradewindRider.java index 1b7e4e9521e..f288cdd648c 100644 --- a/Mage.Sets/src/mage/sets/tempest/TradewindRider.java +++ b/Mage.Sets/src/mage/sets/tempest/TradewindRider.java @@ -41,6 +41,8 @@ import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.permanent.TappedPredicate; import mage.target.TargetPermanent; import mage.target.common.TargetControlledCreaturePermanent; @@ -52,8 +54,7 @@ public class TradewindRider extends CardImpl { private final static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped creatures you control"); static { - filter.setTapped(false); - filter.setUseTapped(true); + filter.add(Predicates.not(new TappedPredicate())); } public TradewindRider(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tenth/Assassinate.java b/Mage.Sets/src/mage/sets/tenth/Assassinate.java index 06332c98ba1..1e8020c7183 100644 --- a/Mage.Sets/src/mage/sets/tenth/Assassinate.java +++ b/Mage.Sets/src/mage/sets/tenth/Assassinate.java @@ -34,6 +34,7 @@ import mage.Constants.Rarity; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.TappedPredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -45,8 +46,7 @@ public class Assassinate extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("tapped creature"); static { - filter.setTapped(true); - filter.setUseTapped(true); + filter.add(new TappedPredicate()); } public Assassinate(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/tenth/RoyalAssassin.java b/Mage.Sets/src/mage/sets/tenth/RoyalAssassin.java index 7d3caf89d27..4cd40197cbe 100644 --- a/Mage.Sets/src/mage/sets/tenth/RoyalAssassin.java +++ b/Mage.Sets/src/mage/sets/tenth/RoyalAssassin.java @@ -39,6 +39,7 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.TappedPredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -50,8 +51,7 @@ public class RoyalAssassin extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("tapped creature"); static { - filter.setUseTapped(true); - filter.setTapped(true); + filter.add(new TappedPredicate()); } public RoyalAssassin(UUID ownerId){ diff --git a/Mage.Sets/src/mage/sets/weatherlight/MaraxusOfKeld.java b/Mage.Sets/src/mage/sets/weatherlight/MaraxusOfKeld.java index 75e082cf37d..75e935e08e9 100644 --- a/Mage.Sets/src/mage/sets/weatherlight/MaraxusOfKeld.java +++ b/Mage.Sets/src/mage/sets/weatherlight/MaraxusOfKeld.java @@ -38,6 +38,7 @@ import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.permanent.TappedPredicate; import java.util.UUID; @@ -47,13 +48,11 @@ import java.util.UUID; */ public class MaraxusOfKeld extends CardImpl { - private static final FilterControlledPermanent filterUntapped = new FilterControlledPermanent("untapped artifacts, creatures, and lands you control"); + private static final FilterControlledPermanent filter = new FilterControlledPermanent("untapped artifacts, creatures, and lands you control"); static { - filterUntapped.setUseTapped(true); - filterUntapped.setTapped(false); - - filterUntapped.add(Predicates.or( + filter.add(Predicates.not(new TappedPredicate())); + filter.add(Predicates.or( new CardTypePredicate(CardType.ARTIFACT), new CardTypePredicate(CardType.CREATURE), new CardTypePredicate(CardType.LAND))); @@ -71,7 +70,7 @@ public class MaraxusOfKeld extends CardImpl { this.toughness = new MageInt(0); // Maraxus of Keld's power and toughness are each equal to the number of untapped artifacts, creatures, and lands you control. - this.addAbility(new SimpleStaticAbility(Constants.Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filterUntapped), Constants.Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Constants.Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filter), Constants.Duration.EndOfGame))); } public MaraxusOfKeld(final MaraxusOfKeld card) { diff --git a/Mage.Sets/src/mage/sets/worldwake/SurrakarBanisher.java b/Mage.Sets/src/mage/sets/worldwake/SurrakarBanisher.java index 0b0e961a906..d014cf2874a 100644 --- a/Mage.Sets/src/mage/sets/worldwake/SurrakarBanisher.java +++ b/Mage.Sets/src/mage/sets/worldwake/SurrakarBanisher.java @@ -36,6 +36,7 @@ import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.TappedPredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -47,7 +48,7 @@ public class SurrakarBanisher extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("tapped creature"); static { - filter.setTapped(true); + filter.add(new TappedPredicate()); } public SurrakarBanisher(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/zendikar/BloodTribute.java b/Mage.Sets/src/mage/sets/zendikar/BloodTribute.java index 72ea521d825..b5d4ad5aa69 100644 --- a/Mage.Sets/src/mage/sets/zendikar/BloodTribute.java +++ b/Mage.Sets/src/mage/sets/zendikar/BloodTribute.java @@ -37,7 +37,9 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.KickerAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.TappedPredicate; import mage.game.Game; import mage.players.Player; import mage.target.common.TargetControlledCreaturePermanent; @@ -52,8 +54,7 @@ public class BloodTribute extends CardImpl { private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped Vampire you control"); static { - filter.setTapped(false); - filter.setUseTapped(true); + filter.add(Predicates.not(new TappedPredicate())); filter.add(new SubtypePredicate("Vampire")); } diff --git a/Mage/src/mage/filter/FilterPermanent.java b/Mage/src/mage/filter/FilterPermanent.java index 7056862ce38..6defbe5fec8 100644 --- a/Mage/src/mage/filter/FilterPermanent.java +++ b/Mage/src/mage/filter/FilterPermanent.java @@ -45,8 +45,6 @@ public class FilterPermanent extends FilterObject { protected boolean notOwner; protected List controllerId = new ArrayList(); protected boolean notController; - protected boolean useTapped; - protected boolean tapped; protected boolean useFlipped; protected boolean flipped; protected boolean useFaceup; @@ -67,8 +65,6 @@ public class FilterPermanent extends FilterObject { this.notOwner = filter.notOwner; this.controllerId = new ArrayList(filter.controllerId); this.notController = filter.notController; - this.useTapped = filter.useTapped; - this.tapped = filter.tapped; this.useFlipped = filter.useFlipped; this.flipped = filter.flipped; this.useFaceup = filter.useFaceup; @@ -95,9 +91,6 @@ public class FilterPermanent extends FilterObject { if (controllerId.size() > 0 && controllerId.contains(permanent.getControllerId()) == notController) return notFilter; - if (useTapped && permanent.isTapped() != tapped) - return notFilter; - if (useFlipped && permanent.isFlipped() != flipped) return notFilter; @@ -174,14 +167,6 @@ public class FilterPermanent extends FilterObject { this.notController = notController; } - public void setUseTapped(boolean useTapped) { - this.useTapped = useTapped; - } - - public void setTapped(boolean tapped) { - this.tapped = tapped; - } - public void setUseFlipped(boolean useFlipped) { this.useFlipped = useFlipped; } diff --git a/Mage/src/mage/filter/common/FilterArtifactPermanent.java b/Mage/src/mage/filter/common/FilterArtifactPermanent.java index 696c2aff9ba..83f35ebf57c 100644 --- a/Mage/src/mage/filter/common/FilterArtifactPermanent.java +++ b/Mage/src/mage/filter/common/FilterArtifactPermanent.java @@ -60,8 +60,6 @@ public class FilterArtifactPermanent extends FilterPermanent { this.attacking = filter.attacking; this.useBlocking = filter.useBlocking; this.blocking = filter.blocking; - this.useTapped = filter.useTapped; - this.tapped = filter.tapped; } @Override @@ -75,9 +73,6 @@ public class FilterArtifactPermanent extends FilterPermanent { if (useBlocking && (permanent.getBlocking() > 0) != blocking) return notFilter; - if (useTapped && permanent.isTapped() != tapped) - return notFilter; - return !notFilter; } diff --git a/Mage/src/mage/filter/common/FilterCreatureForAttack.java b/Mage/src/mage/filter/common/FilterCreatureForAttack.java index 83c7aa04163..592759a365d 100644 --- a/Mage/src/mage/filter/common/FilterCreatureForAttack.java +++ b/Mage/src/mage/filter/common/FilterCreatureForAttack.java @@ -31,6 +31,7 @@ package mage.filter.common; import mage.abilities.keyword.DefenderAbility; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.filter.predicate.permanent.TappedPredicate; import mage.game.Game; import mage.game.permanent.Permanent; @@ -50,8 +51,7 @@ public class FilterCreatureForAttack extends FilterCreaturePermanent { this.useAttacking = true; this.blocking = false; this.useBlocking = true; - this.tapped = false; - this.useTapped = true; + this.add(Predicates.not(new TappedPredicate())); this.add(Predicates.not(new AbilityPredicate(DefenderAbility.class))); } diff --git a/Mage/src/mage/filter/common/FilterCreatureForCombat.java b/Mage/src/mage/filter/common/FilterCreatureForCombat.java index 33c5f13e50f..d141bdf61c1 100644 --- a/Mage/src/mage/filter/common/FilterCreatureForCombat.java +++ b/Mage/src/mage/filter/common/FilterCreatureForCombat.java @@ -28,6 +28,8 @@ package mage.filter.common; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.permanent.TappedPredicate; import mage.game.Game; import mage.game.permanent.Permanent; @@ -45,10 +47,9 @@ public class FilterCreatureForCombat extends FilterCreaturePermanent { super(name); this.attacking = false; this.useAttacking = true; - this.tapped = false; - this.useTapped = true; this.phasedIn = true; this.usePhased = true; + this.add(Predicates.not(new TappedPredicate())); } public FilterCreatureForCombat(final FilterCreatureForCombat filter) { diff --git a/Mage/src/mage/filter/common/FilterCreaturePermanent.java b/Mage/src/mage/filter/common/FilterCreaturePermanent.java index cc55cbfd898..0e16863d039 100644 --- a/Mage/src/mage/filter/common/FilterCreaturePermanent.java +++ b/Mage/src/mage/filter/common/FilterCreaturePermanent.java @@ -64,8 +64,6 @@ public class FilterCreaturePermanent extends FilterPermanent { this.blocking = filter.blocking; this.useDamageDealt = filter.useDamageDealt; this.damageDealt = filter.damageDealt; - this.useTapped = filter.useTapped; - this.tapped = filter.tapped; } @Override diff --git a/Mage/src/mage/filter/common/FilterUntappedCreature.java b/Mage/src/mage/filter/common/FilterUntappedCreature.java index 4485d77c87e..1bc77b37c0d 100644 --- a/Mage/src/mage/filter/common/FilterUntappedCreature.java +++ b/Mage/src/mage/filter/common/FilterUntappedCreature.java @@ -28,6 +28,9 @@ package mage.filter.common; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.permanent.TappedPredicate; + /** * * @author noxx @@ -40,8 +43,7 @@ public class FilterUntappedCreature extends FilterCreaturePermanent { public FilterUntappedCreature(String name) { super(name); - this.tapped = false; - this.useTapped = true; + this.add(Predicates.not(new TappedPredicate())); } public FilterUntappedCreature(final FilterUntappedCreature filter) { diff --git a/Mage/src/mage/filter/predicate/permanent/TappedPredicate.java b/Mage/src/mage/filter/predicate/permanent/TappedPredicate.java new file mode 100644 index 00000000000..95d7e37f694 --- /dev/null +++ b/Mage/src/mage/filter/predicate/permanent/TappedPredicate.java @@ -0,0 +1,49 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.filter.predicate.permanent; + +import mage.filter.predicate.Predicate; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author North + */ +public class TappedPredicate implements Predicate { + + @Override + public boolean apply(Permanent input, Game game) { + return input.isTapped(); + } + + @Override + public String toString() { + return "Tapped"; + } +}