diff --git a/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java b/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java index 29cd9d2b242..9787e20d492 100644 --- a/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java +++ b/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java @@ -46,6 +46,7 @@ import mage.choices.ChoiceImpl; import mage.filter.common.FilterAttackingCreature; import mage.filter.common.FilterBlockingCreature; import mage.filter.common.FilterCreatureForCombat; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.draft.Draft; import mage.game.match.Match; @@ -80,7 +81,7 @@ public class HumanPlayer extends PlayerImpl { private static Map staticOptions = new HashMap(); static { - filter.setTargetController(TargetController.YOU); + filter.add(new ControllerPredicate(TargetController.YOU)); replacementEffectChoice.setMessage("Choose replacement effect"); staticOptions.put("UI.right.btn.text", "Done"); } diff --git a/Mage.Sets/src/mage/sets/avacynrestored/Dreadwaters.java b/Mage.Sets/src/mage/sets/avacynrestored/Dreadwaters.java index 5aa2b5b8495..14b617fda9f 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/Dreadwaters.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/Dreadwaters.java @@ -34,6 +34,7 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.target.TargetPlayer; import java.util.UUID; @@ -48,7 +49,7 @@ public class Dreadwaters extends CardImpl { private static final FilterLandPermanent filter = new FilterLandPermanent("lands you control"); static { - filter.setTargetController(Constants.TargetController.YOU); + filter.add(new ControllerPredicate(Constants.TargetController.YOU)); } public Dreadwaters(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/avacynrestored/PeelFromReality.java b/Mage.Sets/src/mage/sets/avacynrestored/PeelFromReality.java index 7f7fc15e5f7..24ae4c1fb04 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/PeelFromReality.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/PeelFromReality.java @@ -37,6 +37,7 @@ import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.common.TargetControlledCreaturePermanent; @@ -51,7 +52,7 @@ public class PeelFromReality extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control"); static { - filter.setTargetController(TargetController.NOT_YOU); + filter.add(new ControllerPredicate(TargetController.NOT_YOU)); } public PeelFromReality(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/MyojinOfSeeingWinds.java b/Mage.Sets/src/mage/sets/championsofkamigawa/MyojinOfSeeingWinds.java index 823ced55d55..806d0d4a1ed 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/MyojinOfSeeingWinds.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/MyojinOfSeeingWinds.java @@ -51,6 +51,7 @@ import mage.abilities.keyword.IndestructibleAbility; import mage.cards.CardImpl; import mage.counters.CounterType; import mage.filter.FilterPermanent; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.watchers.common.CastFromHandWatcher; /** @@ -60,7 +61,7 @@ public class MyojinOfSeeingWinds extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("permanent you control"); static { - filter.setTargetOwner(TargetController.YOU); + filter.add(new ControllerPredicate(TargetController.YOU)); } public MyojinOfSeeingWinds(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/darkascension/AlphaBrawl.java b/Mage.Sets/src/mage/sets/darkascension/AlphaBrawl.java index f94a357be22..086c3f5e013 100644 --- a/Mage.Sets/src/mage/sets/darkascension/AlphaBrawl.java +++ b/Mage.Sets/src/mage/sets/darkascension/AlphaBrawl.java @@ -34,6 +34,7 @@ import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -50,7 +51,7 @@ public class AlphaBrawl extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls"); static { - filter.setTargetController(Constants.TargetController.OPPONENT); + filter.add(new ControllerPredicate(Constants.TargetController.OPPONENT)); } public AlphaBrawl(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/darkascension/ArchdemonOfGreed.java b/Mage.Sets/src/mage/sets/darkascension/ArchdemonOfGreed.java index 14ee45f8a97..bb1e873618d 100644 --- a/Mage.Sets/src/mage/sets/darkascension/ArchdemonOfGreed.java +++ b/Mage.Sets/src/mage/sets/darkascension/ArchdemonOfGreed.java @@ -40,6 +40,7 @@ import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; @@ -56,7 +57,7 @@ public class ArchdemonOfGreed extends CardImpl { static { filter.add(new SubtypePredicate("Human")); - filter.setTargetController(Constants.TargetController.YOU); + filter.add(new ControllerPredicate(Constants.TargetController.YOU)); } public ArchdemonOfGreed(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/darkascension/DungeonGeists.java b/Mage.Sets/src/mage/sets/darkascension/DungeonGeists.java index 42036e1a805..5709d62fa57 100644 --- a/Mage.Sets/src/mage/sets/darkascension/DungeonGeists.java +++ b/Mage.Sets/src/mage/sets/darkascension/DungeonGeists.java @@ -40,6 +40,7 @@ import mage.abilities.effects.common.TapTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.ZoneChangeEvent; @@ -58,7 +59,7 @@ public class DungeonGeists extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls"); static { - filter.setTargetController(Constants.TargetController.OPPONENT); + filter.add(new ControllerPredicate(Constants.TargetController.OPPONENT)); } public DungeonGeists(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/darkascension/FeedThePack.java b/Mage.Sets/src/mage/sets/darkascension/FeedThePack.java index e30427bb46d..96a0935ebee 100644 --- a/Mage.Sets/src/mage/sets/darkascension/FeedThePack.java +++ b/Mage.Sets/src/mage/sets/darkascension/FeedThePack.java @@ -38,6 +38,7 @@ import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; import mage.filter.common.FilterNonTokenPermanent; import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.permanent.token.WolfToken; @@ -77,7 +78,7 @@ class FeedThePackEffect extends OneShotEffect { static { filter.add(new CardTypePredicate(CardType.CREATURE)); - filter.setTargetController(Constants.TargetController.YOU); + filter.add(new ControllerPredicate(Constants.TargetController.YOU)); } public FeedThePackEffect() { diff --git a/Mage.Sets/src/mage/sets/darkascension/Helvault.java b/Mage.Sets/src/mage/sets/darkascension/Helvault.java index 62768cf5c89..cab0aeb1b18 100644 --- a/Mage.Sets/src/mage/sets/darkascension/Helvault.java +++ b/Mage.Sets/src/mage/sets/darkascension/Helvault.java @@ -40,6 +40,7 @@ import mage.abilities.effects.common.ExileTargetForSourceEffect; import mage.abilities.effects.common.ReturnFromExileForSourceEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreaturePermanent; @@ -52,7 +53,7 @@ public class Helvault extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control"); static { - filter.setTargetController(TargetController.NOT_YOU); + filter.add(new ControllerPredicate(TargetController.NOT_YOU)); } public Helvault(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/darksteel/EmissaryOfHope.java b/Mage.Sets/src/mage/sets/darksteel/EmissaryOfHope.java index 80a88adb325..f3ca21d6a40 100644 --- a/Mage.Sets/src/mage/sets/darksteel/EmissaryOfHope.java +++ b/Mage.Sets/src/mage/sets/darksteel/EmissaryOfHope.java @@ -38,9 +38,9 @@ import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.filter.Filter; import mage.filter.FilterPermanent; import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.players.Player; @@ -79,7 +79,7 @@ class EmissaryOfHopeEffect extends OneShotEffect { static { filter.add(new CardTypePredicate(CardType.ARTIFACT)); - filter.setTargetController(Constants.TargetController.YOU); + filter.add(new ControllerPredicate(Constants.TargetController.YOU)); } EmissaryOfHopeEffect() { diff --git a/Mage.Sets/src/mage/sets/innistrad/DivineReckoning.java b/Mage.Sets/src/mage/sets/innistrad/DivineReckoning.java index f396ac3d951..7932fe0e423 100644 --- a/Mage.Sets/src/mage/sets/innistrad/DivineReckoning.java +++ b/Mage.Sets/src/mage/sets/innistrad/DivineReckoning.java @@ -37,6 +37,7 @@ import mage.abilities.keyword.FlashbackAbility; import mage.cards.Card; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -80,7 +81,7 @@ class DivineReckoningEffect extends OneShotEffect { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you control"); static { - filter.setTargetController(Constants.TargetController.YOU); + filter.add(new ControllerPredicate(Constants.TargetController.YOU)); } public DivineReckoningEffect() { diff --git a/Mage.Sets/src/mage/sets/innistrad/GarrukTheVeilCursed.java b/Mage.Sets/src/mage/sets/innistrad/GarrukTheVeilCursed.java index 979f2b11e99..8ba6114b4a4 100644 --- a/Mage.Sets/src/mage/sets/innistrad/GarrukTheVeilCursed.java +++ b/Mage.Sets/src/mage/sets/innistrad/GarrukTheVeilCursed.java @@ -47,6 +47,7 @@ import mage.filter.FilterPermanent; import mage.filter.common.FilterCreatureCard; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.permanent.token.WolfTokenWithDeathtouch; @@ -136,7 +137,7 @@ class GarrukTheVeilCursedEffect extends OneShotEffect static { filterCreature.add(new CardTypePredicate(CardType.CREATURE)); - filterCreature.setTargetController(Constants.TargetController.YOU); + filterCreature.add(new ControllerPredicate(Constants.TargetController.YOU)); } public GarrukTheVeilCursedEffect() { diff --git a/Mage.Sets/src/mage/sets/innistrad/HystericalBlindness.java b/Mage.Sets/src/mage/sets/innistrad/HystericalBlindness.java index 57409bc2ab4..6bb27629af9 100644 --- a/Mage.Sets/src/mage/sets/innistrad/HystericalBlindness.java +++ b/Mage.Sets/src/mage/sets/innistrad/HystericalBlindness.java @@ -35,6 +35,7 @@ import mage.Constants.TargetController; import mage.abilities.effects.common.continious.BoostAllEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerPredicate; /** * @@ -45,7 +46,7 @@ public class HystericalBlindness extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures your opponents control"); static { - filter.setTargetController(TargetController.OPPONENT); + filter.add(new ControllerPredicate(TargetController.OPPONENT)); } public HystericalBlindness(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/innistrad/OneEyedScarecrow.java b/Mage.Sets/src/mage/sets/innistrad/OneEyedScarecrow.java index 463118414d7..c6a7fcc4d7e 100644 --- a/Mage.Sets/src/mage/sets/innistrad/OneEyedScarecrow.java +++ b/Mage.Sets/src/mage/sets/innistrad/OneEyedScarecrow.java @@ -41,6 +41,7 @@ import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.filter.predicate.permanent.ControllerPredicate; /** * @@ -52,7 +53,7 @@ public class OneEyedScarecrow extends CardImpl { static { filter.add(new AbilityPredicate(FlyingAbility.class)); - filter.setTargetController(TargetController.OPPONENT); + filter.add(new ControllerPredicate(TargetController.OPPONENT)); } public OneEyedScarecrow(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/innistrad/PreyUpon.java b/Mage.Sets/src/mage/sets/innistrad/PreyUpon.java index 0b1a5b42c3b..77efa2d733d 100644 --- a/Mage.Sets/src/mage/sets/innistrad/PreyUpon.java +++ b/Mage.Sets/src/mage/sets/innistrad/PreyUpon.java @@ -34,6 +34,7 @@ import mage.Constants.TargetController; import mage.abilities.effects.common.FightTargetsEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetCreaturePermanent; @@ -46,7 +47,7 @@ public class PreyUpon extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control"); static { - filter.setTargetController(TargetController.NOT_YOU); + filter.add(new ControllerPredicate(TargetController.NOT_YOU)); } public PreyUpon(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/innistrad/ScourgeOfGeierReach.java b/Mage.Sets/src/mage/sets/innistrad/ScourgeOfGeierReach.java index d6fcc4446e8..b20f326be2d 100644 --- a/Mage.Sets/src/mage/sets/innistrad/ScourgeOfGeierReach.java +++ b/Mage.Sets/src/mage/sets/innistrad/ScourgeOfGeierReach.java @@ -39,6 +39,7 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerPredicate; /** * @@ -49,7 +50,7 @@ public class ScourgeOfGeierReach extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(""); static { - filter.setTargetController(TargetController.OPPONENT); + filter.add(new ControllerPredicate(TargetController.OPPONENT)); } public ScourgeOfGeierReach(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/innistrad/TributeToHunger.java b/Mage.Sets/src/mage/sets/innistrad/TributeToHunger.java index b1f23dff2a4..cabb1e46a50 100644 --- a/Mage.Sets/src/mage/sets/innistrad/TributeToHunger.java +++ b/Mage.Sets/src/mage/sets/innistrad/TributeToHunger.java @@ -37,6 +37,7 @@ import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -93,7 +94,7 @@ class TributeToHungerEffect extends OneShotEffect { FilterControlledPermanent filter = new FilterControlledPermanent("creature"); filter.add(new CardTypePredicate(CardType.CREATURE)); - filter.setTargetController(TargetController.YOU); + filter.add(new ControllerPredicate(TargetController.YOU)); TargetControlledPermanent target = new TargetControlledPermanent(1, 1, filter, false); if (target.canChoose(player.getId(), game)) { diff --git a/Mage.Sets/src/mage/sets/innistrad/VampiricFury.java b/Mage.Sets/src/mage/sets/innistrad/VampiricFury.java index 8017b76bb53..aca4be3a979 100644 --- a/Mage.Sets/src/mage/sets/innistrad/VampiricFury.java +++ b/Mage.Sets/src/mage/sets/innistrad/VampiricFury.java @@ -37,6 +37,7 @@ import mage.abilities.keyword.FirstStrikeAbility; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; import java.util.UUID; @@ -49,7 +50,7 @@ public class VampiricFury extends CardImpl { static { vampires.add(new SubtypePredicate("Vampire")); - vampires.setTargetController(Constants.TargetController.YOU); + vampires.add(new ControllerPredicate(Constants.TargetController.YOU)); } public VampiricFury(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/lorwyn/ScionOfOona.java b/Mage.Sets/src/mage/sets/lorwyn/ScionOfOona.java index 2cb23a4672d..5874880f9de 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/ScionOfOona.java +++ b/Mage.Sets/src/mage/sets/lorwyn/ScionOfOona.java @@ -43,6 +43,7 @@ import mage.abilities.keyword.ShroudAbility; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; /** * @@ -54,7 +55,7 @@ public class ScionOfOona extends CardImpl { static { filter.add(new SubtypePredicate("Faerie")); - filter.setTargetController(TargetController.YOU); + filter.add(new ControllerPredicate(TargetController.YOU)); } public ScionOfOona(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2010/AlluringSiren.java b/Mage.Sets/src/mage/sets/magic2010/AlluringSiren.java index 9a521959c93..6cb24cdbb8d 100644 --- a/Mage.Sets/src/mage/sets/magic2010/AlluringSiren.java +++ b/Mage.Sets/src/mage/sets/magic2010/AlluringSiren.java @@ -41,6 +41,7 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.AttacksIfAbleTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -52,7 +53,7 @@ public class AlluringSiren extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls"); static { - filter.setTargetController(TargetController.OPPONENT); + filter.add(new ControllerPredicate(TargetController.OPPONENT)); } public AlluringSiren(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2010/ArmoredAscension.java b/Mage.Sets/src/mage/sets/magic2010/ArmoredAscension.java index e3e21882d73..7bf6c08f037 100644 --- a/Mage.Sets/src/mage/sets/magic2010/ArmoredAscension.java +++ b/Mage.Sets/src/mage/sets/magic2010/ArmoredAscension.java @@ -45,6 +45,7 @@ import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -58,7 +59,7 @@ public class ArmoredAscension extends CardImpl { static { filter.add(new SubtypePredicate("Plains")); - filter.setTargetController(TargetController.YOU); + filter.add(new ControllerPredicate(TargetController.YOU)); } public ArmoredAscension(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2010/CapriciousEfreet.java b/Mage.Sets/src/mage/sets/magic2010/CapriciousEfreet.java index 7b5489a7b66..24e4214d2e7 100644 --- a/Mage.Sets/src/mage/sets/magic2010/CapriciousEfreet.java +++ b/Mage.Sets/src/mage/sets/magic2010/CapriciousEfreet.java @@ -40,6 +40,7 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; import mage.filter.common.FilterNonlandPermanent; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.TargetPermanent; @@ -54,8 +55,8 @@ public class CapriciousEfreet extends CardImpl { private static final FilterNonlandPermanent filterNotControlled = new FilterNonlandPermanent("nonland permanent you don't control"); static { - filterControlled.setTargetController(TargetController.YOU); - filterNotControlled.setTargetController(TargetController.NOT_YOU); + filterControlled.add(new ControllerPredicate(TargetController.YOU)); + filterNotControlled.add(new ControllerPredicate(TargetController.NOT_YOU)); } public CapriciousEfreet(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2010/SafePassage.java b/Mage.Sets/src/mage/sets/magic2010/SafePassage.java index 100dec4d413..cd792dccc9b 100644 --- a/Mage.Sets/src/mage/sets/magic2010/SafePassage.java +++ b/Mage.Sets/src/mage/sets/magic2010/SafePassage.java @@ -36,6 +36,7 @@ import mage.Constants.TargetController; import mage.abilities.effects.common.PreventAllDamageToEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreatureOrPlayer; +import mage.filter.predicate.permanent.ControllerPredicate; /** * @@ -46,7 +47,7 @@ public class SafePassage extends CardImpl { private static final FilterCreatureOrPlayer filter = new FilterCreatureOrPlayer("you and creatures you control"); static { - filter.getCreatureFilter().setTargetController(TargetController.YOU); + filter.getCreatureFilter().add(new ControllerPredicate(TargetController.YOU)); filter.getPlayerFilter().setPlayerTarget(TargetController.YOU); } diff --git a/Mage.Sets/src/mage/sets/magic2010/YawningFissure.java b/Mage.Sets/src/mage/sets/magic2010/YawningFissure.java index f0cbdbd3410..56178dd2e31 100644 --- a/Mage.Sets/src/mage/sets/magic2010/YawningFissure.java +++ b/Mage.Sets/src/mage/sets/magic2010/YawningFissure.java @@ -38,6 +38,7 @@ import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -90,7 +91,7 @@ class YawningFissureEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { FilterControlledPermanent filter = new FilterControlledPermanent("land you control"); filter.add(new CardTypePredicate(CardType.LAND)); - filter.setTargetController(TargetController.YOU); + filter.add(new ControllerPredicate(TargetController.YOU)); Set opponents = game.getOpponents(source.getControllerId()); for (UUID opponentId : opponents) { diff --git a/Mage.Sets/src/mage/sets/magic2011/Corrupt.java b/Mage.Sets/src/mage/sets/magic2011/Corrupt.java index 1595d2fd7f0..ff953fd1039 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Corrupt.java +++ b/Mage.Sets/src/mage/sets/magic2011/Corrupt.java @@ -38,6 +38,7 @@ import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -74,7 +75,7 @@ class CorruptEffect extends OneShotEffect { static { filter.add(new SubtypePredicate("Swamp")); - filter.setTargetController(TargetController.YOU); + filter.add(new ControllerPredicate(TargetController.YOU)); } public CorruptEffect() { diff --git a/Mage.Sets/src/mage/sets/magic2011/EarthServant.java b/Mage.Sets/src/mage/sets/magic2011/EarthServant.java index 1870c478657..7693b422ddd 100644 --- a/Mage.Sets/src/mage/sets/magic2011/EarthServant.java +++ b/Mage.Sets/src/mage/sets/magic2011/EarthServant.java @@ -41,6 +41,7 @@ import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.cards.CardImpl; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; /** * @@ -52,7 +53,7 @@ public class EarthServant extends CardImpl { static { filter.add(new SubtypePredicate("Mountain")); - filter.setTargetController(TargetController.YOU); + filter.add(new ControllerPredicate(TargetController.YOU)); } public EarthServant(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2011/MystifyingMaze.java b/Mage.Sets/src/mage/sets/magic2011/MystifyingMaze.java index cc97b4de361..f9706646c78 100644 --- a/Mage.Sets/src/mage/sets/magic2011/MystifyingMaze.java +++ b/Mage.Sets/src/mage/sets/magic2011/MystifyingMaze.java @@ -44,6 +44,7 @@ import mage.abilities.effects.common.ReturnFromExileEffect; import mage.abilities.mana.ColorlessManaAbility; import mage.cards.CardImpl; import mage.filter.common.FilterAttackingCreature; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.common.TargetCreaturePermanent; @@ -57,7 +58,7 @@ public class MystifyingMaze extends CardImpl { private static final FilterAttackingCreature filter = new FilterAttackingCreature("attacking creature an opponent controls"); static { - filter.setTargetController(TargetController.OPPONENT); + filter.add(new ControllerPredicate(TargetController.OPPONENT)); } public MystifyingMaze(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2011/NecroticPlague.java b/Mage.Sets/src/mage/sets/magic2011/NecroticPlague.java index a7503222292..df68fb38ea2 100644 --- a/Mage.Sets/src/mage/sets/magic2011/NecroticPlague.java +++ b/Mage.Sets/src/mage/sets/magic2011/NecroticPlague.java @@ -50,6 +50,7 @@ import mage.abilities.keyword.EnchantAbility; import mage.cards.Card; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.events.GameEvent.EventType; import mage.game.permanent.Permanent; @@ -175,7 +176,7 @@ class NecroticPlagueEffect2 extends OneShotEffect { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls"); static { - filter.setTargetController(TargetController.OPPONENT); + filter.add(new ControllerPredicate(TargetController.OPPONENT)); } public NecroticPlagueEffect2(UUID cardId) { diff --git a/Mage.Sets/src/mage/sets/magic2011/QuagSickness.java b/Mage.Sets/src/mage/sets/magic2011/QuagSickness.java index f5bbfd10d87..cf9bf7cfecd 100644 --- a/Mage.Sets/src/mage/sets/magic2011/QuagSickness.java +++ b/Mage.Sets/src/mage/sets/magic2011/QuagSickness.java @@ -43,6 +43,7 @@ import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -56,7 +57,7 @@ public class QuagSickness extends CardImpl { static { filter.add(new SubtypePredicate("Swamp")); - filter.setTargetController(TargetController.YOU); + filter.add(new ControllerPredicate(TargetController.YOU)); } public QuagSickness(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2011/SteelOverseer.java b/Mage.Sets/src/mage/sets/magic2011/SteelOverseer.java index e26fe71df79..3adbb432c98 100644 --- a/Mage.Sets/src/mage/sets/magic2011/SteelOverseer.java +++ b/Mage.Sets/src/mage/sets/magic2011/SteelOverseer.java @@ -41,6 +41,7 @@ import mage.cards.CardImpl; import mage.counters.CounterType; import mage.filter.FilterPermanent; import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; /** * @@ -53,7 +54,7 @@ public class SteelOverseer extends CardImpl { static { filter.add(new CardTypePredicate(CardType.ARTIFACT)); filter.add(new CardTypePredicate(CardType.CREATURE)); - filter.setTargetController(TargetController.YOU); + filter.add(new ControllerPredicate(TargetController.YOU)); } public SteelOverseer(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2012/Smallpox.java b/Mage.Sets/src/mage/sets/magic2012/Smallpox.java index 686c8a0f4e7..731039ed39a 100644 --- a/Mage.Sets/src/mage/sets/magic2012/Smallpox.java +++ b/Mage.Sets/src/mage/sets/magic2012/Smallpox.java @@ -37,6 +37,7 @@ import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; import mage.filter.FilterPermanent; import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -76,9 +77,9 @@ class SmallpoxEffect extends OneShotEffect { static { filterCreature.add(new CardTypePredicate(CardType.CREATURE)); - filterCreature.setTargetController(Constants.TargetController.YOU); + filterCreature.add(new ControllerPredicate(Constants.TargetController.YOU)); filterLand.add(new CardTypePredicate(CardType.LAND)); - filterLand.setTargetController(Constants.TargetController.YOU); + filterLand.add(new ControllerPredicate(Constants.TargetController.YOU)); } SmallpoxEffect() { diff --git a/Mage.Sets/src/mage/sets/magic2013/CowerInFear.java b/Mage.Sets/src/mage/sets/magic2013/CowerInFear.java index 8b731a8e6cc..906e9115eab 100644 --- a/Mage.Sets/src/mage/sets/magic2013/CowerInFear.java +++ b/Mage.Sets/src/mage/sets/magic2013/CowerInFear.java @@ -35,6 +35,7 @@ import mage.Constants.Rarity; import mage.abilities.effects.common.continious.BoostAllEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerPredicate; /** * @@ -45,7 +46,7 @@ public class CowerInFear extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures your opponents control"); static { - filter.setTargetController(Constants.TargetController.OPPONENT); + filter.add(new ControllerPredicate(Constants.TargetController.OPPONENT)); } public CowerInFear(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2013/FungalSprouting.java b/Mage.Sets/src/mage/sets/magic2013/FungalSprouting.java index 4e274610432..58f3a4428b7 100644 --- a/Mage.Sets/src/mage/sets/magic2013/FungalSprouting.java +++ b/Mage.Sets/src/mage/sets/magic2013/FungalSprouting.java @@ -37,6 +37,7 @@ import mage.cards.CardImpl; import mage.filter.FilterPermanent; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.permanent.token.SaprolingToken; @@ -74,7 +75,7 @@ class FungalSproutingEffect extends OneShotEffect { static { filter.add(new CardTypePredicate(CardType.CREATURE)); - filter.setTargetController(Constants.TargetController.YOU); + filter.add(new ControllerPredicate(Constants.TargetController.YOU)); } public FungalSproutingEffect() { diff --git a/Mage.Sets/src/mage/sets/magic2013/LilianaOfTheDarkRealms.java b/Mage.Sets/src/mage/sets/magic2013/LilianaOfTheDarkRealms.java index ef0cc399759..2c79fffddaa 100644 --- a/Mage.Sets/src/mage/sets/magic2013/LilianaOfTheDarkRealms.java +++ b/Mage.Sets/src/mage/sets/magic2013/LilianaOfTheDarkRealms.java @@ -53,6 +53,7 @@ import mage.counters.CounterType; import mage.filter.common.FilterLandCard; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.command.Emblem; import mage.game.permanent.Permanent; @@ -127,7 +128,7 @@ class LilianaOfTheDarkRealmsEffect extends ContinuousEffectImpl { static { filter.add(new SubtypePredicate("Swamp")); - filter.setTargetController(Constants.TargetController.YOU); + filter.add(new ControllerPredicate(Constants.TargetController.YOU)); } public Mutilate(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2013/ThundermawHellkite.java b/Mage.Sets/src/mage/sets/magic2013/ThundermawHellkite.java index 0077b9be78a..7e3f02236df 100644 --- a/Mage.Sets/src/mage/sets/magic2013/ThundermawHellkite.java +++ b/Mage.Sets/src/mage/sets/magic2013/ThundermawHellkite.java @@ -41,6 +41,7 @@ import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.permanent.Permanent; @@ -54,7 +55,7 @@ public class ThundermawHellkite extends CardImpl { static { filter.add(new AbilityPredicate(FlyingAbility.class)); - filter.setTargetController(Constants.TargetController.OPPONENT); + filter.add(new ControllerPredicate(Constants.TargetController.OPPONENT)); } public ThundermawHellkite(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2013/TimberpackWolf.java b/Mage.Sets/src/mage/sets/magic2013/TimberpackWolf.java index c73ec1f9f40..9c806fd0db9 100644 --- a/Mage.Sets/src/mage/sets/magic2013/TimberpackWolf.java +++ b/Mage.Sets/src/mage/sets/magic2013/TimberpackWolf.java @@ -38,6 +38,7 @@ import mage.abilities.effects.ContinuousEffectImpl; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.NamePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.permanent.Permanent; @@ -51,7 +52,7 @@ public class TimberpackWolf extends CardImpl { static { filter.add(new NamePredicate("Timberpack Wolf")); - filter.setTargetController(Constants.TargetController.YOU); + filter.add(new ControllerPredicate(Constants.TargetController.YOU)); } public TimberpackWolf(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/mirrodin/NightmareLash.java b/Mage.Sets/src/mage/sets/mirrodin/NightmareLash.java index 40071ecac85..a950019ce17 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/NightmareLash.java +++ b/Mage.Sets/src/mage/sets/mirrodin/NightmareLash.java @@ -40,6 +40,7 @@ import mage.abilities.keyword.EquipAbility; import mage.cards.CardImpl; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; /** * @@ -50,7 +51,7 @@ public class NightmareLash extends CardImpl { static { filter.add(new SubtypePredicate("Swamp")); - filter.setTargetController(Constants.TargetController.YOU); + filter.add(new ControllerPredicate(Constants.TargetController.YOU)); } public NightmareLash(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheForge.java b/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheForge.java index 0d721ef7010..48150f78b0f 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheForge.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheForge.java @@ -41,6 +41,7 @@ import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.permanent.token.Token; @@ -55,7 +56,7 @@ public class ChancellorOfTheForge extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures you control"); static { - filter.setTargetController(TargetController.YOU); + filter.add(new ControllerPredicate(TargetController.YOU)); } public ChancellorOfTheForge(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/DeceiverExarch.java b/Mage.Sets/src/mage/sets/newphyrexia/DeceiverExarch.java index a69792897f1..d4d7eaa8760 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/DeceiverExarch.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/DeceiverExarch.java @@ -40,6 +40,7 @@ import mage.abilities.effects.common.UntapTargetEffect; import mage.abilities.keyword.FlashAbility; import mage.cards.CardImpl; import mage.filter.FilterPermanent; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.target.TargetPermanent; import mage.target.common.TargetControlledPermanent; @@ -52,7 +53,7 @@ public class DeceiverExarch extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("permanent an opponent controls"); static { - filter.setTargetController(TargetController.OPPONENT); + filter.add(new ControllerPredicate(TargetController.OPPONENT)); } public DeceiverExarch(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/Lashwrithe.java b/Mage.Sets/src/mage/sets/newphyrexia/Lashwrithe.java index 1349b224a2e..69d00942ad1 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/Lashwrithe.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/Lashwrithe.java @@ -42,6 +42,7 @@ import mage.abilities.keyword.LivingWeaponAbility; import mage.cards.CardImpl; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; /** * @@ -53,7 +54,7 @@ public class Lashwrithe extends CardImpl { static { filter.add(new SubtypePredicate("Swamp")); - filter.setTargetController(TargetController.YOU); + filter.add(new ControllerPredicate(TargetController.YOU)); } public Lashwrithe(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/VitalSplicer.java b/Mage.Sets/src/mage/sets/newphyrexia/VitalSplicer.java index 81eeb94c797..fc9f98c0cc7 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/VitalSplicer.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/VitalSplicer.java @@ -43,6 +43,7 @@ import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.permanent.token.GolemToken; import mage.target.common.TargetCreaturePermanent; @@ -57,7 +58,7 @@ public class VitalSplicer extends CardImpl { static { filter.add(new CardTypePredicate(CardType.CREATURE)); filter.add(new SubtypePredicate("Golem")); - filter.setTargetController(TargetController.YOU); + filter.add(new ControllerPredicate(TargetController.YOU)); } public VitalSplicer(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/planechase/FiresOfYavimaya.java b/Mage.Sets/src/mage/sets/planechase/FiresOfYavimaya.java index a87da3cce7c..eb78859c560 100644 --- a/Mage.Sets/src/mage/sets/planechase/FiresOfYavimaya.java +++ b/Mage.Sets/src/mage/sets/planechase/FiresOfYavimaya.java @@ -41,6 +41,7 @@ import mage.abilities.effects.common.continious.GainAbilityAllEffect; import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -52,7 +53,7 @@ public class FiresOfYavimaya extends CardImpl { private final static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Creatures you control"); static { - filter.setTargetController(Constants.TargetController.YOU); + filter.add(new ControllerPredicate(Constants.TargetController.YOU)); } public FiresOfYavimaya(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/ConsumingVapors.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/ConsumingVapors.java index b55fb49e5fa..e1562aad80b 100644 --- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/ConsumingVapors.java +++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/ConsumingVapors.java @@ -38,6 +38,7 @@ import mage.abilities.keyword.ReboundAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -90,7 +91,7 @@ class ConsumingVaporsEffect extends OneShotEffect { FilterControlledPermanent filter = new FilterControlledPermanent("creature"); filter.add(new CardTypePredicate(CardType.CREATURE)); - filter.setTargetController(TargetController.YOU); + filter.add(new ControllerPredicate(TargetController.YOU)); TargetControlledPermanent target = new TargetControlledPermanent(1, 1, filter, false); //A spell or ability could have removed the only legal target this player diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/DarksteelJuggernaut.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/DarksteelJuggernaut.java index 6ea29579612..c7b36d91762 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/DarksteelJuggernaut.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/DarksteelJuggernaut.java @@ -41,6 +41,7 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.keyword.IndestructibleAbility; import mage.cards.CardImpl; import mage.filter.common.FilterArtifactPermanent; +import mage.filter.predicate.permanent.ControllerPredicate; /** * @@ -50,7 +51,7 @@ public class DarksteelJuggernaut extends CardImpl { private static final FilterArtifactPermanent filter = new FilterArtifactPermanent("artifacts you control"); static { - filter.setTargetController(Constants.TargetController.YOU); + filter.add(new ControllerPredicate(Constants.TargetController.YOU)); } public DarksteelJuggernaut (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/KothOfTheHammer.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/KothOfTheHammer.java index 7481e0364f0..6054efdde41 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/KothOfTheHammer.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/KothOfTheHammer.java @@ -53,6 +53,7 @@ import mage.cards.CardImpl; import mage.counters.CounterType; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.permanent.token.Token; @@ -69,9 +70,9 @@ public class KothOfTheHammer extends CardImpl { static { filter.add(new SubtypePredicate("Mountain")); - filter.setTargetController(Constants.TargetController.YOU); + filter.add(new ControllerPredicate(Constants.TargetController.YOU)); filterCount.add(new SubtypePredicate("Mountain")); - filterCount.setTargetController(Constants.TargetController.YOU); + filterCount.add(new ControllerPredicate(Constants.TargetController.YOU)); } public KothOfTheHammer (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/OgreGeargrabber.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/OgreGeargrabber.java index 9b6dda95387..88b3e8b5110 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/OgreGeargrabber.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/OgreGeargrabber.java @@ -41,6 +41,7 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.continious.GainControlTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterEquipment; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; @@ -52,10 +53,10 @@ import mage.target.TargetPermanent; */ public class OgreGeargrabber extends CardImpl { - private static FilterEquipment filter = new FilterEquipment("Equipment an opponent controls"); + private static final FilterEquipment filter = new FilterEquipment("Equipment an opponent controls"); static { - filter.setTargetController(TargetController.OPPONENT); + filter.add(new ControllerPredicate(TargetController.OPPONENT)); } public OgreGeargrabber(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/shadowmoor/ToilToRenown.java b/Mage.Sets/src/mage/sets/shadowmoor/ToilToRenown.java index c484e10b683..bbb58db0605 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.ControllerPredicate; import mage.filter.predicate.permanent.TappedPredicate; /** @@ -53,7 +54,7 @@ public class ToilToRenown extends CardImpl { new CardTypePredicate(CardType.ARTIFACT), new CardTypePredicate(CardType.CREATURE), new CardTypePredicate(CardType.LAND))); - filter.setTargetController(TargetController.YOU); + filter.add(new ControllerPredicate(TargetController.YOU)); } public ToilToRenown(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/shardsofalara/MasterOfEtherium.java b/Mage.Sets/src/mage/sets/shardsofalara/MasterOfEtherium.java index 10995dfa634..ef0a8503f3c 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/MasterOfEtherium.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/MasterOfEtherium.java @@ -41,6 +41,7 @@ import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; /** * @@ -54,7 +55,7 @@ public class MasterOfEtherium extends CardImpl { static { filterCounted.add(new CardTypePredicate(CardType.ARTIFACT)); filterBoosted.add(new CardTypePredicate(CardType.ARTIFACT)); - filterBoosted.setTargetController(Constants.TargetController.YOU); + filterBoosted.add(new ControllerPredicate(Constants.TargetController.YOU)); } public MasterOfEtherium(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/worldwake/AkoumBattlesinger.java b/Mage.Sets/src/mage/sets/worldwake/AkoumBattlesinger.java index 6d0003eb74a..d17ddba7007 100644 --- a/Mage.Sets/src/mage/sets/worldwake/AkoumBattlesinger.java +++ b/Mage.Sets/src/mage/sets/worldwake/AkoumBattlesinger.java @@ -38,6 +38,7 @@ import mage.abilities.effects.common.continious.BoostControlledEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; /** * @@ -49,7 +50,7 @@ public class AkoumBattlesinger extends CardImpl { static { filter.add(new SubtypePredicate("Ally")); - filter.setTargetController(TargetController.YOU); + filter.add(new ControllerPredicate(TargetController.YOU)); } public AkoumBattlesinger(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/worldwake/ButcherOfMalakir.java b/Mage.Sets/src/mage/sets/worldwake/ButcherOfMalakir.java index 815b4a34bb4..20b117ae210 100644 --- a/Mage.Sets/src/mage/sets/worldwake/ButcherOfMalakir.java +++ b/Mage.Sets/src/mage/sets/worldwake/ButcherOfMalakir.java @@ -40,6 +40,7 @@ import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -99,7 +100,7 @@ class ButcherOfMalakirEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { FilterControlledPermanent filter = new FilterControlledPermanent("creature you control"); filter.add(new CardTypePredicate(CardType.CREATURE)); - filter.setTargetController(Constants.TargetController.YOU); + filter.add(new ControllerPredicate(Constants.TargetController.YOU)); Set opponents = game.getOpponents(source.getControllerId()); for (UUID opponentId : opponents) { diff --git a/Mage.Sets/src/mage/sets/worldwake/ClawsOfValakut.java b/Mage.Sets/src/mage/sets/worldwake/ClawsOfValakut.java index b22a223fc0b..862fa8b13d6 100644 --- a/Mage.Sets/src/mage/sets/worldwake/ClawsOfValakut.java +++ b/Mage.Sets/src/mage/sets/worldwake/ClawsOfValakut.java @@ -45,6 +45,7 @@ import mage.abilities.keyword.FirstStrikeAbility; import mage.cards.CardImpl; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -58,7 +59,7 @@ public class ClawsOfValakut extends CardImpl { static { filter.add(new SubtypePredicate("Mountain")); - filter.setTargetController(Constants.TargetController.YOU); + filter.add(new ControllerPredicate(Constants.TargetController.YOU)); } public ClawsOfValakut (UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/worldwake/HalimarExcavator.java b/Mage.Sets/src/mage/sets/worldwake/HalimarExcavator.java index 54e486e8304..f9f694c0d1f 100644 --- a/Mage.Sets/src/mage/sets/worldwake/HalimarExcavator.java +++ b/Mage.Sets/src/mage/sets/worldwake/HalimarExcavator.java @@ -40,6 +40,7 @@ import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.target.TargetPlayer; /** @@ -52,7 +53,7 @@ public class HalimarExcavator extends CardImpl { static { filter.add(new SubtypePredicate("Ally")); - filter.setTargetController(TargetController.YOU); + filter.add(new ControllerPredicate(TargetController.YOU)); } public HalimarExcavator(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/zendikar/HagraDiabolist.java b/Mage.Sets/src/mage/sets/zendikar/HagraDiabolist.java index 9834cb3c34d..ad400996fa2 100644 --- a/Mage.Sets/src/mage/sets/zendikar/HagraDiabolist.java +++ b/Mage.Sets/src/mage/sets/zendikar/HagraDiabolist.java @@ -40,6 +40,7 @@ import mage.abilities.effects.common.LoseLifeTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.target.TargetPlayer; /** @@ -52,7 +53,7 @@ public class HagraDiabolist extends CardImpl { static { filter.add(new SubtypePredicate("Ally")); - filter.setTargetController(Constants.TargetController.YOU); + filter.add(new ControllerPredicate(Constants.TargetController.YOU)); } public HagraDiabolist(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/zendikar/HighlandBerserker.java b/Mage.Sets/src/mage/sets/zendikar/HighlandBerserker.java index 7e7032695e1..4faed11438c 100644 --- a/Mage.Sets/src/mage/sets/zendikar/HighlandBerserker.java +++ b/Mage.Sets/src/mage/sets/zendikar/HighlandBerserker.java @@ -40,6 +40,7 @@ import mage.abilities.keyword.FirstStrikeAbility; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; /** * @@ -51,7 +52,7 @@ public class HighlandBerserker extends CardImpl { static { filter.add(new SubtypePredicate("Ally")); - filter.setTargetController(Constants.TargetController.YOU); + filter.add(new ControllerPredicate(Constants.TargetController.YOU)); } public HighlandBerserker(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/zendikar/JoragaBard.java b/Mage.Sets/src/mage/sets/zendikar/JoragaBard.java index b6618ef7fb0..8227a1fc184 100644 --- a/Mage.Sets/src/mage/sets/zendikar/JoragaBard.java +++ b/Mage.Sets/src/mage/sets/zendikar/JoragaBard.java @@ -40,6 +40,7 @@ import mage.abilities.keyword.VigilanceAbility; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; /** * @@ -51,7 +52,7 @@ public class JoragaBard extends CardImpl { static { filter.add(new SubtypePredicate("Ally")); - filter.setTargetController(Constants.TargetController.YOU); + filter.add(new ControllerPredicate(Constants.TargetController.YOU)); } public JoragaBard(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/zendikar/KazuulWarlord.java b/Mage.Sets/src/mage/sets/zendikar/KazuulWarlord.java index 8a1f897f84a..d11fc5f65d0 100644 --- a/Mage.Sets/src/mage/sets/zendikar/KazuulWarlord.java +++ b/Mage.Sets/src/mage/sets/zendikar/KazuulWarlord.java @@ -39,6 +39,7 @@ import mage.cards.CardImpl; import mage.counters.CounterType; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; /** * @@ -50,7 +51,7 @@ public class KazuulWarlord extends CardImpl { static { filter.add(new SubtypePredicate("Ally")); - filter.setTargetController(TargetController.YOU); + filter.add(new ControllerPredicate(TargetController.YOU)); } public KazuulWarlord(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/zendikar/KorHookmaster.java b/Mage.Sets/src/mage/sets/zendikar/KorHookmaster.java index 879c306d829..c7af0967b22 100644 --- a/Mage.Sets/src/mage/sets/zendikar/KorHookmaster.java +++ b/Mage.Sets/src/mage/sets/zendikar/KorHookmaster.java @@ -37,6 +37,7 @@ import mage.abilities.effects.common.SkipNextUntapTargetEffect; import mage.abilities.effects.common.TapTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -48,7 +49,7 @@ public class KorHookmaster extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls"); static { - filter.setTargetController(TargetController.OPPONENT); + filter.add(new ControllerPredicate(TargetController.OPPONENT)); } public KorHookmaster(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/zendikar/LandbindRitual.java b/Mage.Sets/src/mage/sets/zendikar/LandbindRitual.java index 849b7650ed4..970e54c7147 100644 --- a/Mage.Sets/src/mage/sets/zendikar/LandbindRitual.java +++ b/Mage.Sets/src/mage/sets/zendikar/LandbindRitual.java @@ -36,6 +36,7 @@ import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; /** * @@ -47,7 +48,7 @@ public class LandbindRitual extends CardImpl { static { filter.add(new SubtypePredicate("Plains")); - filter.setTargetController(TargetController.YOU); + filter.add(new ControllerPredicate(TargetController.YOU)); } public LandbindRitual(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/zendikar/MindSludge.java b/Mage.Sets/src/mage/sets/zendikar/MindSludge.java index 3d4ecdab114..c9937a0f937 100644 --- a/Mage.Sets/src/mage/sets/zendikar/MindSludge.java +++ b/Mage.Sets/src/mage/sets/zendikar/MindSludge.java @@ -36,6 +36,7 @@ import mage.abilities.effects.common.DiscardTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.target.TargetPlayer; /** @@ -48,7 +49,7 @@ public class MindSludge extends CardImpl { static { filter.add(new SubtypePredicate("Swamp")); - filter.setTargetController(TargetController.YOU); + filter.add(new ControllerPredicate(TargetController.YOU)); } public MindSludge(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/zendikar/MurasaPyromancer.java b/Mage.Sets/src/mage/sets/zendikar/MurasaPyromancer.java index 10fd44006c9..a6b10842ab3 100644 --- a/Mage.Sets/src/mage/sets/zendikar/MurasaPyromancer.java +++ b/Mage.Sets/src/mage/sets/zendikar/MurasaPyromancer.java @@ -40,6 +40,7 @@ import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -52,7 +53,7 @@ public class MurasaPyromancer extends CardImpl { static { filter.add(new SubtypePredicate("Ally")); - filter.setTargetController(Constants.TargetController.YOU); + filter.add(new ControllerPredicate(Constants.TargetController.YOU)); } public MurasaPyromancer(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/zendikar/OnduCleric.java b/Mage.Sets/src/mage/sets/zendikar/OnduCleric.java index 74c1400d40b..c3e68895d02 100644 --- a/Mage.Sets/src/mage/sets/zendikar/OnduCleric.java +++ b/Mage.Sets/src/mage/sets/zendikar/OnduCleric.java @@ -39,6 +39,7 @@ import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; /** * @@ -50,7 +51,7 @@ public class OnduCleric extends CardImpl { static { filter.add(new SubtypePredicate("Ally")); - filter.setTargetController(Constants.TargetController.YOU); + filter.add(new ControllerPredicate(Constants.TargetController.YOU)); } public OnduCleric(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/zendikar/PrimalBellow.java b/Mage.Sets/src/mage/sets/zendikar/PrimalBellow.java index 60682f8d85d..62065dc65f7 100644 --- a/Mage.Sets/src/mage/sets/zendikar/PrimalBellow.java +++ b/Mage.Sets/src/mage/sets/zendikar/PrimalBellow.java @@ -37,6 +37,7 @@ import mage.abilities.effects.common.continious.BoostTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -49,7 +50,7 @@ public class PrimalBellow extends CardImpl { static { filter.add(new SubtypePredicate("Forest")); - filter.setTargetController(TargetController.YOU); + filter.add(new ControllerPredicate(TargetController.YOU)); } diff --git a/Mage.Sets/src/mage/sets/zendikar/SeascapeAerialist.java b/Mage.Sets/src/mage/sets/zendikar/SeascapeAerialist.java index 2a665e439a0..0b85d6125a6 100644 --- a/Mage.Sets/src/mage/sets/zendikar/SeascapeAerialist.java +++ b/Mage.Sets/src/mage/sets/zendikar/SeascapeAerialist.java @@ -40,6 +40,7 @@ import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; /** * @@ -51,7 +52,7 @@ public class SeascapeAerialist extends CardImpl { static { filter.add(new SubtypePredicate("Ally")); - filter.setTargetController(Constants.TargetController.YOU); + filter.add(new ControllerPredicate(Constants.TargetController.YOU)); } public SeascapeAerialist(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/zendikar/SpireBarrage.java b/Mage.Sets/src/mage/sets/zendikar/SpireBarrage.java index df2a5b9047d..122060143fb 100644 --- a/Mage.Sets/src/mage/sets/zendikar/SpireBarrage.java +++ b/Mage.Sets/src/mage/sets/zendikar/SpireBarrage.java @@ -35,6 +35,7 @@ import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.target.common.TargetCreatureOrPlayer; import java.util.UUID; @@ -49,7 +50,7 @@ public class SpireBarrage extends CardImpl { static { filter.add(new SubtypePredicate("Mountain")); - filter.setTargetController(TargetController.YOU); + filter.add(new ControllerPredicate(TargetController.YOU)); } public SpireBarrage(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/zendikar/TajuruArcher.java b/Mage.Sets/src/mage/sets/zendikar/TajuruArcher.java index c49b55379fc..4ac94e8ffd3 100644 --- a/Mage.Sets/src/mage/sets/zendikar/TajuruArcher.java +++ b/Mage.Sets/src/mage/sets/zendikar/TajuruArcher.java @@ -42,6 +42,7 @@ import mage.cards.CardImpl; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.AbilityPredicate; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.target.common.TargetCreaturePermanent; /** @@ -55,7 +56,7 @@ public class TajuruArcher extends CardImpl { static { filter.add(new SubtypePredicate("Ally")); - filter.setTargetController(Constants.TargetController.YOU); + filter.add(new ControllerPredicate(Constants.TargetController.YOU)); filterTarget.add(new AbilityPredicate(FlyingAbility.class)); } diff --git a/Mage.Sets/src/mage/sets/zendikar/TimbermawLarva.java b/Mage.Sets/src/mage/sets/zendikar/TimbermawLarva.java index 6d06aa061b6..d23138b6d40 100644 --- a/Mage.Sets/src/mage/sets/zendikar/TimbermawLarva.java +++ b/Mage.Sets/src/mage/sets/zendikar/TimbermawLarva.java @@ -39,6 +39,7 @@ import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.cards.CardImpl; import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.ControllerPredicate; /** * @@ -50,7 +51,7 @@ public class TimbermawLarva extends CardImpl { static { filter.add(new SubtypePredicate("Forest")); - filter.setTargetController(TargetController.YOU); + filter.add(new ControllerPredicate(TargetController.YOU)); } diff --git a/Mage/src/mage/abilities/effects/common/CantTargetControlledEffect.java b/Mage/src/mage/abilities/effects/common/CantTargetControlledEffect.java index a1bd610b84a..9a4c2151241 100644 --- a/Mage/src/mage/abilities/effects/common/CantTargetControlledEffect.java +++ b/Mage/src/mage/abilities/effects/common/CantTargetControlledEffect.java @@ -35,6 +35,7 @@ import mage.abilities.Ability; import mage.abilities.effects.ReplacementEffectImpl; import mage.filter.FilterPermanent; import mage.filter.FilterStackObject; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -87,7 +88,7 @@ public class CantTargetControlledEffect extends ReplacementEffectImpl{ return false; } - filter.setTargetController(Constants.TargetController.YOU); + filter.add(new ControllerPredicate(Constants.TargetController.YOU)); int amount = count.calculate(game, source); int realCount = game.getBattlefield().countAll(filter, player.getId(), game); diff --git a/Mage/src/mage/abilities/keyword/AnnihilatorAbility.java b/Mage/src/mage/abilities/keyword/AnnihilatorAbility.java index 0fab1ccbebc..7cfb26a9e9a 100644 --- a/Mage/src/mage/abilities/keyword/AnnihilatorAbility.java +++ b/Mage/src/mage/abilities/keyword/AnnihilatorAbility.java @@ -35,6 +35,7 @@ import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.OneShotEffect; import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.GameEvent.EventType; @@ -114,7 +115,7 @@ class AnnihilatorEffect extends OneShotEffect { player = game.getPlayer(permanent.getControllerId()); } - filter.setTargetController(TargetController.YOU); + filter.add(new ControllerPredicate(TargetController.YOU)); int amount = Math.min(count, game.getBattlefield().countAll(filter, player.getId(), game)); Target target = new TargetControlledPermanent(amount, amount, filter, false); diff --git a/Mage/src/mage/abilities/keyword/FortifyAbility.java b/Mage/src/mage/abilities/keyword/FortifyAbility.java index c7b5cbc03cd..56108ba1802 100644 --- a/Mage/src/mage/abilities/keyword/FortifyAbility.java +++ b/Mage/src/mage/abilities/keyword/FortifyAbility.java @@ -35,6 +35,7 @@ import mage.abilities.ActivatedAbilityImpl; import mage.abilities.costs.Cost; import mage.abilities.effects.common.AttachEffect; import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.permanent.ControllerPredicate; import mage.target.common.TargetLandPermanent; /** @@ -48,7 +49,7 @@ public class FortifyAbility extends ActivatedAbilityImpl { private static final FilterLandPermanent filter = new FilterLandPermanent("land you control"); static { - filter.setTargetController(TargetController.YOU); + filter.add(new ControllerPredicate(TargetController.YOU)); } public FortifyAbility(Zone zone, AttachEffect effect, Cost cost) { diff --git a/Mage/src/mage/filter/FilterPermanent.java b/Mage/src/mage/filter/FilterPermanent.java index f2db3f8fc30..5e20eb3a5f8 100644 --- a/Mage/src/mage/filter/FilterPermanent.java +++ b/Mage/src/mage/filter/FilterPermanent.java @@ -31,9 +31,9 @@ package mage.filter; import java.util.ArrayList; import java.util.List; import java.util.UUID; -import mage.Constants.TargetController; +import mage.filter.predicate.ObjectPlayer; +import mage.filter.predicate.ObjectPlayerPredicate; import mage.filter.predicate.ObjectSourcePlayer; -import mage.filter.predicate.ObjectSourcePlayerPredicate; import mage.filter.predicate.Predicates; import mage.game.Game; import mage.game.permanent.Permanent; @@ -43,11 +43,9 @@ import mage.game.permanent.Permanent; * @author BetaSteward_at_googlemail.com */ public class FilterPermanent extends FilterObject { - protected List>> extraPredicates = new ArrayList>>(); + protected List>> extraPredicates = new ArrayList>>(); protected List controllerId = new ArrayList(); protected boolean notController; - protected TargetController controller = TargetController.ANY; - protected TargetController owner = TargetController.ANY; public FilterPermanent() { super("permanent"); @@ -57,9 +55,7 @@ public class FilterPermanent extends FilterObject { super(filter); this.controllerId = new ArrayList(filter.controllerId); this.notController = filter.notController; - this.controller = filter.controller; - this.owner = filter.owner; - this.extraPredicates = new ArrayList>>(extraPredicates); + this.extraPredicates = new ArrayList>>(extraPredicates); } public FilterPermanent(String name) { @@ -79,46 +75,12 @@ public class FilterPermanent extends FilterObject { public boolean match(Permanent permanent, UUID sourceId, UUID playerId, Game game) { if (!this.match(permanent, game)) - return notFilter; - - if (controller != TargetController.ANY && playerId != null) { - switch(controller) { - case YOU: - if (!permanent.getControllerId().equals(playerId)) - return notFilter; - break; - case OPPONENT: - if (!game.getOpponents(playerId).contains(permanent.getControllerId())) - return notFilter; - break; - case NOT_YOU: - if (permanent.getControllerId().equals(playerId)) - return notFilter; - break; - } - } - - if (owner != TargetController.ANY && playerId != null) { - switch(owner) { - case YOU: - if (!permanent.getOwnerId().equals(playerId)) - return notFilter; - break; - case OPPONENT: - if (!game.getOpponents(playerId).contains(permanent.getOwnerId())) - return notFilter; - break; - case NOT_YOU: - if (permanent.getOwnerId().equals(playerId)) - return notFilter; - break; - } - } + return false; return Predicates.and(extraPredicates).apply(new ObjectSourcePlayer(permanent, sourceId, playerId), game); } - public void add(ObjectSourcePlayerPredicate predicate) { + public void add(ObjectPlayerPredicate predicate) { extraPredicates.add(predicate); } @@ -130,20 +92,6 @@ public class FilterPermanent extends FilterObject { this.notController = notController; } - public void setTargetController(TargetController controller) { - this.controller = controller; - } - - public void setTargetOwner(TargetController owner) { - this.owner = owner; - } - - public boolean matchController(UUID testControllerId) { - if (controllerId.size() > 0 && controllerId.contains(testControllerId) == notController) - return false; - return true; - } - @Override public FilterPermanent copy() { return new FilterPermanent(this); diff --git a/Mage/src/mage/filter/ListComparer.java b/Mage/src/mage/filter/ListComparer.java deleted file mode 100644 index 75f870d49a3..00000000000 --- a/Mage/src/mage/filter/ListComparer.java +++ /dev/null @@ -1,55 +0,0 @@ -/* -* 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; - -import java.util.ArrayList; -import java.util.List; -import mage.filter.Filter.ComparisonScope; - -/** - * - * @author BetaSteward_at_googlemail.com - */ -public class ListComparer { - - public boolean compare(List list1, List list2, ComparisonScope scope, boolean negate) { - if (scope == ComparisonScope.All) { - if (list2.containsAll(list1) == negate) { - return false; - } - } - else { - List check = new ArrayList(list1); - if (check.removeAll(list2) == negate) { - return false; - } - } - return true; - } -} diff --git a/Mage/src/mage/filter/common/FilterControlledPermanent.java b/Mage/src/mage/filter/common/FilterControlledPermanent.java index 8ffaae4fcab..05c4ef6eb35 100644 --- a/Mage/src/mage/filter/common/FilterControlledPermanent.java +++ b/Mage/src/mage/filter/common/FilterControlledPermanent.java @@ -30,6 +30,7 @@ package mage.filter.common; import mage.Constants.TargetController; import mage.filter.FilterPermanent; +import mage.filter.predicate.permanent.ControllerPredicate; /** * @@ -43,7 +44,7 @@ public class FilterControlledPermanent extends FilterPermanent { public FilterControlledPermanent(String name) { super(name); - this.controller = TargetController.YOU; + this.add(new ControllerPredicate(TargetController.YOU)); } public FilterControlledPermanent(final FilterControlledPermanent filter) { diff --git a/Mage/src/mage/filter/predicate/ObjectSourcePlayerPredicate.java b/Mage/src/mage/filter/predicate/ObjectSourcePlayerPredicate.java index 32e7a771547..6099abc8322 100644 --- a/Mage/src/mage/filter/predicate/ObjectSourcePlayerPredicate.java +++ b/Mage/src/mage/filter/predicate/ObjectSourcePlayerPredicate.java @@ -31,5 +31,5 @@ package mage.filter.predicate; * * @author North */ -public interface ObjectSourcePlayerPredicate extends Predicate { +public interface ObjectSourcePlayerPredicate extends ObjectPlayerPredicate { } diff --git a/Mage/src/mage/filter/predicate/permanent/ControllerPredicate.java b/Mage/src/mage/filter/predicate/permanent/ControllerPredicate.java new file mode 100644 index 00000000000..78e06142283 --- /dev/null +++ b/Mage/src/mage/filter/predicate/permanent/ControllerPredicate.java @@ -0,0 +1,80 @@ +/* + * 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 java.util.UUID; +import mage.Constants; +import mage.Constants.TargetController; +import mage.filter.predicate.ObjectPlayer; +import mage.filter.predicate.ObjectPlayerPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author North + */ +public class ControllerPredicate implements ObjectPlayerPredicate> { + + private Constants.TargetController controller; + + public ControllerPredicate(TargetController controller) { + this.controller = controller; + } + + @Override + public boolean apply(ObjectPlayer input, Game game) { + Permanent permanent = input.getObject(); + UUID playerId = input.getPlayerId(); + + switch (controller) { + case YOU: + if (permanent.getControllerId().equals(playerId)) { + return true; + } + break; + case OPPONENT: + if (game.getOpponents(playerId).contains(permanent.getControllerId())) { + return true; + } + break; + case NOT_YOU: + if (!permanent.getControllerId().equals(playerId)) { + return true; + } + break; + } + + return true; + } + + @Override + public String toString() { + return "TargetController(" + controller.toString() + ')'; + } +}