Merge branch 'filters'

This commit is contained in:
North 2012-07-16 21:41:36 +03:00
commit b478287a99
118 changed files with 705 additions and 422 deletions

View file

@ -29,11 +29,8 @@
package mage.player.ai; package mage.player.ai;
import mage.Constants; import mage.Constants;
import mage.Constants.AbilityType;
import mage.Constants.RangeOfInfluence; import mage.Constants.RangeOfInfluence;
import mage.Constants.Zone;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.filter.FilterAbility;
import mage.game.Game; import mage.game.Game;
import mage.game.combat.Combat; import mage.game.combat.Combat;
import mage.game.combat.CombatGroup; import mage.game.combat.CombatGroup;
@ -54,21 +51,8 @@ public class ComputerPlayer7 extends ComputerPlayer6 implements Player {
private static final transient Logger logger = Logger.getLogger(ComputerPlayer7.class); private static final transient Logger logger = Logger.getLogger(ComputerPlayer7.class);
private static FilterAbility filterLand = new FilterAbility();
private static FilterAbility filterNotLand = new FilterAbility();
private boolean allowBadMoves; private boolean allowBadMoves;
static {
filterLand.getTypes().add(AbilityType.PLAY_LAND);
filterLand.setZone(Zone.HAND);
filterNotLand.getTypes().add(AbilityType.PLAY_LAND);
filterNotLand.setZone(Zone.HAND);
filterNotLand.setNotFilter(true);
}
public ComputerPlayer7(String name, RangeOfInfluence range, int skill) { public ComputerPlayer7(String name, RangeOfInfluence range, int skill) {
super(name, range, skill); super(name, range, skill);
} }

View file

@ -28,12 +28,9 @@
package mage.player.ai; package mage.player.ai;
import mage.Constants.AbilityType;
import mage.Constants.PhaseStep; import mage.Constants.PhaseStep;
import mage.Constants.RangeOfInfluence; import mage.Constants.RangeOfInfluence;
import mage.Constants.Zone;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.filter.FilterAbility;
import mage.game.Game; import mage.game.Game;
import mage.game.combat.Combat; import mage.game.combat.Combat;
import mage.game.combat.CombatGroup; import mage.game.combat.CombatGroup;
@ -54,19 +51,6 @@ public class ComputerPlayer3 extends ComputerPlayer2 implements Player {
private static final transient Logger logger = Logger.getLogger(ComputerPlayer3.class); private static final transient Logger logger = Logger.getLogger(ComputerPlayer3.class);
private static FilterAbility filterLand = new FilterAbility();
private static FilterAbility filterNotLand = new FilterAbility();
static {
filterLand.getTypes().add(AbilityType.PLAY_LAND);
filterLand.setZone(Zone.HAND);
filterNotLand.getTypes().add(AbilityType.PLAY_LAND);
filterNotLand.setZone(Zone.HAND);
filterNotLand.setNotFilter(true);
}
public ComputerPlayer3(String name, RangeOfInfluence range, int skill) { public ComputerPlayer3(String name, RangeOfInfluence range, int skill) {
super(name, range, skill); super(name, range, skill);
} }

View file

@ -46,6 +46,7 @@ import mage.choices.ChoiceImpl;
import mage.filter.common.FilterAttackingCreature; import mage.filter.common.FilterAttackingCreature;
import mage.filter.common.FilterBlockingCreature; import mage.filter.common.FilterBlockingCreature;
import mage.filter.common.FilterCreatureForCombat; import mage.filter.common.FilterCreatureForCombat;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.draft.Draft; import mage.game.draft.Draft;
import mage.game.match.Match; import mage.game.match.Match;
@ -80,7 +81,7 @@ public class HumanPlayer extends PlayerImpl<HumanPlayer> {
private static Map<String, Serializable> staticOptions = new HashMap<String, Serializable>(); private static Map<String, Serializable> staticOptions = new HashMap<String, Serializable>();
static { static {
filter.setTargetController(TargetController.YOU); filter.add(new ControllerPredicate(TargetController.YOU));
replacementEffectChoice.setMessage("Choose replacement effect"); replacementEffectChoice.setMessage("Choose replacement effect");
staticOptions.put("UI.right.btn.text", "Done"); staticOptions.put("UI.right.btn.text", "Done");
} }

View file

@ -38,6 +38,7 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.RequirementEffect; import mage.abilities.effects.RequirementEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
@ -95,7 +96,7 @@ class AggraveteEffect extends OneShotEffect<AggraveteEffect> {
Player player = game.getPlayer(source.getFirstTarget()); Player player = game.getPlayer(source.getFirstTarget());
if (player != null) { if (player != null) {
FilterCreaturePermanent filter = new FilterCreaturePermanent(); FilterCreaturePermanent filter = new FilterCreaturePermanent();
filter.getControllerId().add(player.getId()); filter.add(new ControllerIdPredicate(player.getId()));
List<Permanent> creatures = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getId(), game); List<Permanent> creatures = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getId(), game);
for (Permanent creature : creatures) { for (Permanent creature : creatures) {
creature.damage(1, source.getSourceId(), game, true, false); creature.damage(1, source.getSourceId(), game, true, false);

View file

@ -37,6 +37,7 @@ import mage.abilities.effects.common.SacrificeEffect;
import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.permanent.AnotherPredicate;
import java.util.UUID; import java.util.UUID;
@ -49,7 +50,7 @@ public class DemonicTaskmaster extends CardImpl<DemonicTaskmaster> {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("a creature other than Demonic Taskmaster"); private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("a creature other than Demonic Taskmaster");
static { static {
filter.setAnother(true); filter.add(new AnotherPredicate());
} }
public DemonicTaskmaster(UUID ownerId) { public DemonicTaskmaster(UUID ownerId) {

View file

@ -37,6 +37,7 @@ import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.UndyingAbility; import mage.abilities.keyword.UndyingAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetControlledPermanent;
import java.util.UUID; import java.util.UUID;
@ -46,10 +47,10 @@ import java.util.UUID;
*/ */
public class DemonlordOfAshmouth extends CardImpl<DemonlordOfAshmouth> { public class DemonlordOfAshmouth extends CardImpl<DemonlordOfAshmouth> {
private static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(" another creature"); private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(" another creature");
static { static {
filter.setAnother(true); filter.add(new AnotherPredicate());
} }
public DemonlordOfAshmouth(UUID ownerId) { public DemonlordOfAshmouth(UUID ownerId) {

View file

@ -34,6 +34,7 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect; import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterLandPermanent; import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.target.TargetPlayer; import mage.target.TargetPlayer;
import java.util.UUID; import java.util.UUID;
@ -48,7 +49,7 @@ public class Dreadwaters extends CardImpl<Dreadwaters> {
private static final FilterLandPermanent filter = new FilterLandPermanent("lands you control"); private static final FilterLandPermanent filter = new FilterLandPermanent("lands you control");
static { static {
filter.setTargetController(Constants.TargetController.YOU); filter.add(new ControllerPredicate(Constants.TargetController.YOU));
} }
public Dreadwaters(UUID ownerId) { public Dreadwaters(UUID ownerId) {

View file

@ -39,6 +39,7 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
@ -79,10 +80,10 @@ public class Fettergeist extends CardImpl<Fettergeist> {
class FettergeistUnlessPaysEffect extends OneShotEffect<FettergeistUnlessPaysEffect> { class FettergeistUnlessPaysEffect extends OneShotEffect<FettergeistUnlessPaysEffect> {
private static FilterCreaturePermanent filter = new FilterCreaturePermanent(); private static final FilterCreaturePermanent filter = new FilterCreaturePermanent();
static { static {
filter.setAnother(true); filter.add(new AnotherPredicate());
} }
public FettergeistUnlessPaysEffect() { public FettergeistUnlessPaysEffect() {

View file

@ -36,6 +36,7 @@ import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.permanent.AnotherPredicate;
import java.util.UUID; import java.util.UUID;
@ -46,10 +47,10 @@ import java.util.UUID;
*/ */
public class GoldnightRedeemer extends CardImpl<GoldnightRedeemer> { public class GoldnightRedeemer extends CardImpl<GoldnightRedeemer> {
private static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("other creature you control"); private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("other creature you control");
static { static {
filter.setAnother(true); filter.add(new AnotherPredicate());
} }
public GoldnightRedeemer(UUID ownerId) { public GoldnightRedeemer(UUID ownerId) {

View file

@ -36,6 +36,7 @@ import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetControlledCreaturePermanent;
@ -77,7 +78,7 @@ class HavengulSkaabAbility extends TriggeredAbilityImpl<HavengulSkaabAbility> {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("another creature you control"); private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("another creature you control");
static { static {
filter.setAnother(true); filter.add(new AnotherPredicate());
} }
public HavengulSkaabAbility() { public HavengulSkaabAbility() {

View file

@ -37,6 +37,7 @@ import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetControlledCreaturePermanent;
@ -51,7 +52,7 @@ public class PeelFromReality extends CardImpl<PeelFromReality> {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control"); private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control");
static { static {
filter.setTargetController(TargetController.NOT_YOU); filter.add(new ControllerPredicate(TargetController.NOT_YOU));
} }
public PeelFromReality(UUID ownerId) { public PeelFromReality(UUID ownerId) {

View file

@ -39,6 +39,7 @@ import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterControlledPermanent; import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
@ -98,15 +99,13 @@ class FeastOfWormsEffect extends OneShotEffect<FeastOfWormsEffect> {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
//Player player = game.getPlayer(source.getControllerId());
Permanent permanent = (Permanent) game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD); Permanent permanent = (Permanent) game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD);
Player targetPlayer = game.getPlayer(permanent.getControllerId()); Player targetPlayer = game.getPlayer(permanent.getControllerId());
if (targetPlayer != null && permanent != null if (targetPlayer != null && permanent != null
&& (permanent.getSupertype().get(0).toString().equals("Legendary"))) { && (permanent.getSupertype().get(0).toString().equals("Legendary"))) {
FilterControlledPermanent filter = new FilterControlledPermanent("land to sacrifice"); FilterControlledPermanent filter = new FilterControlledPermanent("land to sacrifice");
filter.add(new CardTypePredicate(CardType.LAND)); filter.add(new CardTypePredicate(CardType.LAND));
filter.getControllerId().add(targetPlayer.getId()); filter.add(new ControllerIdPredicate(targetPlayer.getId()));
filter.setNotController(false);
TargetControlledPermanent target = new TargetControlledPermanent(1, 1, filter, false); TargetControlledPermanent target = new TargetControlledPermanent(1, 1, filter, false);
if (target.canChoose(targetPlayer.getId(), game)) { if (target.canChoose(targetPlayer.getId(), game)) {

View file

@ -40,6 +40,7 @@ import mage.abilities.effects.RestrictionEffect;
import mage.abilities.keyword.ShroudAbility; import mage.abilities.keyword.ShroudAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
@ -68,7 +69,7 @@ public class HisokasGuard extends CardImpl<HisokasGuard> {
// {1}{U}, {T}: Target creature you control other than Hisoka's Guard has shroud for as long as Hisoka's Guard remains tapped. (It can't be the target of spells or abilities.) // {1}{U}, {T}: Target creature you control other than Hisoka's Guard has shroud for as long as Hisoka's Guard remains tapped. (It can't be the target of spells or abilities.)
FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(); FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent();
filter.setAnother(true); filter.add(new AnotherPredicate());
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new HisokasGuardGainAbilityTargetEffect(), new ManaCostsImpl("{1}{U}")); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new HisokasGuardGainAbilityTargetEffect(), new ManaCostsImpl("{1}{U}"));
ability.addCost(new TapSourceCost()); ability.addCost(new TapSourceCost());
Target target = new TargetControlledCreaturePermanent(1, 1, filter, true, true); Target target = new TargetControlledCreaturePermanent(1, 1, filter, true, true);

View file

@ -48,6 +48,7 @@ import mage.abilities.keyword.IndestructibleAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.watchers.common.CastFromHandWatcher; import mage.watchers.common.CastFromHandWatcher;
/** /**
@ -57,7 +58,7 @@ public class MyojinOfCleansingFire extends CardImpl<MyojinOfCleansingFire> {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("other creatures"); private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("other creatures");
static { static {
filter.setAnother(true); filter.add(new AnotherPredicate());
} }
public MyojinOfCleansingFire(UUID ownerId) { public MyojinOfCleansingFire(UUID ownerId) {

View file

@ -51,6 +51,7 @@ import mage.abilities.keyword.IndestructibleAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.FilterPermanent; import mage.filter.FilterPermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.watchers.common.CastFromHandWatcher; import mage.watchers.common.CastFromHandWatcher;
/** /**
@ -60,7 +61,7 @@ public class MyojinOfSeeingWinds extends CardImpl<MyojinOfSeeingWinds> {
private static final FilterPermanent filter = new FilterPermanent("permanent you control"); private static final FilterPermanent filter = new FilterPermanent("permanent you control");
static { static {
filter.setTargetOwner(TargetController.YOU); filter.add(new ControllerPredicate(TargetController.YOU));
} }
public MyojinOfSeeingWinds(UUID ownerId) { public MyojinOfSeeingWinds(UUID ownerId) {

View file

@ -40,6 +40,7 @@ import mage.abilities.effects.common.SkipNextPlayerUntapStepEffect;
import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.FilterPermanent; import mage.filter.FilterPermanent;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
@ -85,8 +86,10 @@ public class YoseiTheMorningStar extends CardImpl<YoseiTheMorningStar> {
class YoseiTheMorningStarTarget extends TargetPermanent { class YoseiTheMorningStarTarget extends TargetPermanent {
private static final FilterPermanent filterTemplate = new FilterPermanent("up to five target permanents that player controls that will be tapped");
public YoseiTheMorningStarTarget() { public YoseiTheMorningStarTarget() {
super(0, 5, new FilterPermanent("up to five target permanents that player controls that will be tapped"), false); super(0, 5, filterTemplate, false);
} }
public YoseiTheMorningStarTarget(final YoseiTheMorningStarTarget target) { public YoseiTheMorningStarTarget(final YoseiTheMorningStarTarget target) {
@ -97,8 +100,8 @@ public class YoseiTheMorningStar extends CardImpl<YoseiTheMorningStar> {
public boolean canTarget(UUID controllerId, UUID id, Ability source, Game game) { public boolean canTarget(UUID controllerId, UUID id, Ability source, Game game) {
Player player = game.getPlayer(source.getFirstTarget()); Player player = game.getPlayer(source.getFirstTarget());
if (player != null) { if (player != null) {
filter.getControllerId().clear(); this.filter = filterTemplate.copy();
filter.getControllerId().add(player.getId()); this.filter.add(new ControllerIdPredicate(player.getId()));
return super.canTarget(controllerId, id, source, game); return super.canTarget(controllerId, id, source, game);
} }
return false; return false;

View file

@ -34,6 +34,7 @@ import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
@ -50,7 +51,7 @@ public class AlphaBrawl extends CardImpl<AlphaBrawl> {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls"); private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls");
static { static {
filter.setTargetController(Constants.TargetController.OPPONENT); filter.add(new ControllerPredicate(Constants.TargetController.OPPONENT));
} }
public AlphaBrawl(UUID ownerId) { public AlphaBrawl(UUID ownerId) {

View file

@ -40,6 +40,7 @@ import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
@ -56,7 +57,7 @@ public class ArchdemonOfGreed extends CardImpl<ArchdemonOfGreed> {
static { static {
filter.add(new SubtypePredicate("Human")); filter.add(new SubtypePredicate("Human"));
filter.setTargetController(Constants.TargetController.YOU); filter.add(new ControllerPredicate(Constants.TargetController.YOU));
} }
public ArchdemonOfGreed(UUID ownerId) { public ArchdemonOfGreed(UUID ownerId) {

View file

@ -40,6 +40,7 @@ import mage.abilities.effects.common.TapTargetEffect;
import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.game.events.ZoneChangeEvent; import mage.game.events.ZoneChangeEvent;
@ -58,7 +59,7 @@ public class DungeonGeists extends CardImpl<DungeonGeists> {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls"); private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls");
static { static {
filter.setTargetController(Constants.TargetController.OPPONENT); filter.add(new ControllerPredicate(Constants.TargetController.OPPONENT));
} }
public DungeonGeists(UUID ownerId) { public DungeonGeists(UUID ownerId) {

View file

@ -38,6 +38,7 @@ import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterNonTokenPermanent; import mage.filter.common.FilterNonTokenPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.game.permanent.token.WolfToken; import mage.game.permanent.token.WolfToken;
@ -77,7 +78,7 @@ class FeedThePackEffect extends OneShotEffect<FeedThePackEffect> {
static { static {
filter.add(new CardTypePredicate(CardType.CREATURE)); filter.add(new CardTypePredicate(CardType.CREATURE));
filter.setTargetController(Constants.TargetController.YOU); filter.add(new ControllerPredicate(Constants.TargetController.YOU));
} }
public FeedThePackEffect() { public FeedThePackEffect() {

View file

@ -40,6 +40,7 @@ import mage.abilities.effects.common.ExileTargetForSourceEffect;
import mage.abilities.effects.common.ReturnFromExileForSourceEffect; import mage.abilities.effects.common.ReturnFromExileForSourceEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
@ -52,7 +53,7 @@ public class Helvault extends CardImpl<Helvault> {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control"); private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control");
static { static {
filter.setTargetController(TargetController.NOT_YOU); filter.add(new ControllerPredicate(TargetController.NOT_YOU));
} }
public Helvault(UUID ownerId) { public Helvault(UUID ownerId) {

View file

@ -40,6 +40,7 @@ import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.TransformAbility; import mage.abilities.keyword.TransformAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.events.DamagedPlayerEvent; import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
@ -105,7 +106,8 @@ class SoulSeizerTriggeredAbility extends TriggeredAbilityImpl<SoulSeizerTriggere
Player opponent = game.getPlayer(event.getPlayerId()); Player opponent = game.getPlayer(event.getPlayerId());
if (opponent != null) { if (opponent != null) {
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature " + opponent.getName() + " controls"); FilterCreaturePermanent filter = new FilterCreaturePermanent("creature " + opponent.getName() + " controls");
filter.getControllerId().add(opponent.getId()); filter.add(new ControllerIdPredicate(opponent.getId()));
this.getTargets().clear(); this.getTargets().clear();
this.addTarget(new TargetCreaturePermanent(filter)); this.addTarget(new TargetCreaturePermanent(filter));
return true; return true;

View file

@ -38,9 +38,9 @@ import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.FilterPermanent; import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game; import mage.game.Game;
import mage.players.Player; import mage.players.Player;
@ -79,7 +79,7 @@ class EmissaryOfHopeEffect extends OneShotEffect<EmissaryOfHopeEffect> {
static { static {
filter.add(new CardTypePredicate(CardType.ARTIFACT)); filter.add(new CardTypePredicate(CardType.ARTIFACT));
filter.setTargetController(Constants.TargetController.YOU); filter.add(new ControllerPredicate(Constants.TargetController.YOU));
} }
EmissaryOfHopeEffect() { EmissaryOfHopeEffect() {

View file

@ -38,6 +38,7 @@ import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.SacrificeTargetEffect; import mage.abilities.effects.common.SacrificeTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.events.DamagedPlayerEvent; import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
@ -95,9 +96,10 @@ class AshlingTheExtinguisherTriggeredAbility extends TriggeredAbilityImpl<Ashlin
if (damageEvent.isCombatDamage() && event.getSourceId().equals(this.getSourceId())) { if (damageEvent.isCombatDamage() && event.getSourceId().equals(this.getSourceId())) {
Player opponent = game.getPlayer(event.getPlayerId()); Player opponent = game.getPlayer(event.getPlayerId());
if (opponent != null) { if (opponent != null) {
this.getTargets().clear();
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature " + opponent.getName() + " controls"); FilterCreaturePermanent filter = new FilterCreaturePermanent("creature " + opponent.getName() + " controls");
filter.getControllerId().add(opponent.getId()); filter.add(new ControllerIdPredicate(opponent.getId()));
this.getTargets().clear();
this.addTarget(new TargetCreaturePermanent(filter)); this.addTarget(new TargetCreaturePermanent(filter));
return true; return true;
} }

View file

@ -37,6 +37,7 @@ import mage.abilities.keyword.FlashbackAbility;
import mage.cards.Card; import mage.cards.Card;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
@ -80,7 +81,7 @@ class DivineReckoningEffect extends OneShotEffect<DivineReckoningEffect> {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you control"); private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you control");
static { static {
filter.setTargetController(Constants.TargetController.YOU); filter.add(new ControllerPredicate(Constants.TargetController.YOU));
} }
public DivineReckoningEffect() { public DivineReckoningEffect() {

View file

@ -27,6 +27,7 @@
*/ */
package mage.sets.innistrad; package mage.sets.innistrad;
import java.util.UUID;
import mage.Constants; import mage.Constants;
import mage.Constants.CardType; import mage.Constants.CardType;
import mage.Constants.Rarity; import mage.Constants.Rarity;
@ -34,14 +35,13 @@ import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.LeavesBattlefieldTriggeredAbility; import mage.abilities.common.LeavesBattlefieldTriggeredAbility;
import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent;
import mage.target.Target;
import mage.target.TargetPermanent;
import java.util.UUID;
import mage.abilities.effects.common.ExileTargetForSourceEffect; import mage.abilities.effects.common.ExileTargetForSourceEffect;
import mage.abilities.effects.common.ReturnFromExileForSourceEffect; import mage.abilities.effects.common.ReturnFromExileForSourceEffect;
import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.target.Target;
import mage.target.TargetPermanent;
/** /**
* @author nantuko * @author nantuko
@ -50,7 +50,7 @@ public class FiendHunter extends CardImpl<FiendHunter> {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); private static final FilterCreaturePermanent filter = new FilterCreaturePermanent();
static { static {
filter.setAnother(true); filter.add(new AnotherPredicate());
} }
public FiendHunter(UUID ownerId) { public FiendHunter(UUID ownerId) {

View file

@ -47,6 +47,7 @@ import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreatureCard; import mage.filter.common.FilterCreatureCard;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.game.permanent.token.WolfTokenWithDeathtouch; import mage.game.permanent.token.WolfTokenWithDeathtouch;
@ -136,7 +137,7 @@ class GarrukTheVeilCursedEffect extends OneShotEffect<GarrukTheVeilCursedEffect>
static { static {
filterCreature.add(new CardTypePredicate(CardType.CREATURE)); filterCreature.add(new CardTypePredicate(CardType.CREATURE));
filterCreature.setTargetController(Constants.TargetController.YOU); filterCreature.add(new ControllerPredicate(Constants.TargetController.YOU));
} }
public GarrukTheVeilCursedEffect() { public GarrukTheVeilCursedEffect() {

View file

@ -45,6 +45,8 @@ import mage.cards.CardImpl;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetControlledCreaturePermanent;
@ -59,7 +61,7 @@ public class GrimgrinCorpseBorn extends CardImpl<GrimgrinCorpseBorn> {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("another creature"); private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("another creature");
static { static {
filter.setAnother(true); filter.add(new AnotherPredicate());
} }
public GrimgrinCorpseBorn(UUID ownerId) { public GrimgrinCorpseBorn(UUID ownerId) {
@ -112,7 +114,9 @@ class GrimgrinCorpseBornAbility extends TriggeredAbilityImpl<GrimgrinCorpseBornA
if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) { if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) {
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls"); FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls");
UUID defenderId = game.getCombat().getDefendingPlayer(sourceId); UUID defenderId = game.getCombat().getDefendingPlayer(sourceId);
filter.getControllerId().add(defenderId); filter.add(new ControllerIdPredicate(defenderId));
this.getTargets().clear();
TargetCreaturePermanent target = new TargetCreaturePermanent(filter); TargetCreaturePermanent target = new TargetCreaturePermanent(filter);
target.setRequired(true); target.setRequired(true);
this.addTarget(target); this.addTarget(target);

View file

@ -35,6 +35,7 @@ import mage.Constants.TargetController;
import mage.abilities.effects.common.continious.BoostAllEffect; import mage.abilities.effects.common.continious.BoostAllEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
/** /**
* *
@ -45,7 +46,7 @@ public class HystericalBlindness extends CardImpl<HystericalBlindness> {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures your opponents control"); private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures your opponents control");
static { static {
filter.setTargetController(TargetController.OPPONENT); filter.add(new ControllerPredicate(TargetController.OPPONENT));
} }
public HystericalBlindness(UUID ownerId) { public HystericalBlindness(UUID ownerId) {

View file

@ -45,6 +45,7 @@ import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
@ -58,7 +59,7 @@ public class MikaeusTheLunarch extends CardImpl<MikaeusTheLunarch> {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(); private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent();
static { static {
filter.setAnother(true); filter.add(new AnotherPredicate());
} }
public MikaeusTheLunarch(UUID ownerId) { public MikaeusTheLunarch(UUID ownerId) {

View file

@ -45,6 +45,7 @@ import mage.cards.CardImpl;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
/** /**
@ -57,7 +58,7 @@ public class OliviaVoldaren extends CardImpl<OliviaVoldaren> {
private static final FilterCreaturePermanent vampireFilter = new FilterCreaturePermanent("Vampire"); private static final FilterCreaturePermanent vampireFilter = new FilterCreaturePermanent("Vampire");
static { static {
filter.setAnother(true); filter.add(new AnotherPredicate());
vampireFilter.add(new SubtypePredicate("Vampire")); vampireFilter.add(new SubtypePredicate("Vampire"));
} }

View file

@ -41,6 +41,7 @@ import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.AbilityPredicate; import mage.filter.predicate.mageobject.AbilityPredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
/** /**
* *
@ -52,7 +53,7 @@ public class OneEyedScarecrow extends CardImpl<OneEyedScarecrow> {
static { static {
filter.add(new AbilityPredicate(FlyingAbility.class)); filter.add(new AbilityPredicate(FlyingAbility.class));
filter.setTargetController(TargetController.OPPONENT); filter.add(new ControllerPredicate(TargetController.OPPONENT));
} }
public OneEyedScarecrow(UUID ownerId) { public OneEyedScarecrow(UUID ownerId) {

View file

@ -34,6 +34,7 @@ import mage.Constants.TargetController;
import mage.abilities.effects.common.FightTargetsEffect; import mage.abilities.effects.common.FightTargetsEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
@ -46,7 +47,7 @@ public class PreyUpon extends CardImpl<PreyUpon> {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control"); private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control");
static { static {
filter.setTargetController(TargetController.NOT_YOU); filter.add(new ControllerPredicate(TargetController.NOT_YOU));
} }
public PreyUpon(UUID ownerId) { public PreyUpon(UUID ownerId) {

View file

@ -39,6 +39,7 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.abilities.effects.common.continious.BoostSourceEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
/** /**
* *
@ -49,7 +50,7 @@ public class ScourgeOfGeierReach extends CardImpl<ScourgeOfGeierReach> {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(""); private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("");
static { static {
filter.setTargetController(TargetController.OPPONENT); filter.add(new ControllerPredicate(TargetController.OPPONENT));
} }
public ScourgeOfGeierReach(UUID ownerId) { public ScourgeOfGeierReach(UUID ownerId) {

View file

@ -37,6 +37,7 @@ import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterControlledPermanent; import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
@ -93,7 +94,7 @@ class TributeToHungerEffect extends OneShotEffect<TributeToHungerEffect> {
FilterControlledPermanent filter = new FilterControlledPermanent("creature"); FilterControlledPermanent filter = new FilterControlledPermanent("creature");
filter.add(new CardTypePredicate(CardType.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); TargetControlledPermanent target = new TargetControlledPermanent(1, 1, filter, false);
if (target.canChoose(player.getId(), game)) { if (target.canChoose(player.getId(), game)) {

View file

@ -37,6 +37,7 @@ import mage.abilities.keyword.FirstStrikeAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import java.util.UUID; import java.util.UUID;
@ -49,7 +50,7 @@ public class VampiricFury extends CardImpl<VampiricFury> {
static { static {
vampires.add(new SubtypePredicate("Vampire")); vampires.add(new SubtypePredicate("Vampire"));
vampires.setTargetController(Constants.TargetController.YOU); vampires.add(new ControllerPredicate(Constants.TargetController.YOU));
} }
public VampiricFury(UUID ownerId) { public VampiricFury(UUID ownerId) {

View file

@ -41,6 +41,7 @@ import mage.cards.CardImpl;
import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetControlledCreaturePermanent;
import java.util.UUID; import java.util.UUID;
@ -56,7 +57,7 @@ public class MadAuntie extends CardImpl<MadAuntie> {
static { static {
filter1.add(new SubtypePredicate("Goblin")); filter1.add(new SubtypePredicate("Goblin"));
filter1.setAnother(true); filter1.add(new AnotherPredicate());
filter2.add(new SubtypePredicate("Goblin")); filter2.add(new SubtypePredicate("Goblin"));
} }

View file

@ -43,6 +43,7 @@ import mage.abilities.keyword.ShroudAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
/** /**
* *
@ -54,7 +55,7 @@ public class ScionOfOona extends CardImpl<ScionOfOona> {
static { static {
filter.add(new SubtypePredicate("Faerie")); filter.add(new SubtypePredicate("Faerie"));
filter.setTargetController(TargetController.YOU); filter.add(new ControllerPredicate(TargetController.YOU));
} }
public ScionOfOona(UUID ownerId) { public ScionOfOona(UUID ownerId) {

View file

@ -41,6 +41,7 @@ import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.AttacksIfAbleTargetEffect; import mage.abilities.effects.common.AttacksIfAbleTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
/** /**
@ -52,7 +53,7 @@ public class AlluringSiren extends CardImpl<AlluringSiren> {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls"); private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls");
static { static {
filter.setTargetController(TargetController.OPPONENT); filter.add(new ControllerPredicate(TargetController.OPPONENT));
} }
public AlluringSiren(UUID ownerId) { public AlluringSiren(UUID ownerId) {

View file

@ -45,6 +45,7 @@ import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterLandPermanent; import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
@ -58,7 +59,7 @@ public class ArmoredAscension extends CardImpl<ArmoredAscension> {
static { static {
filter.add(new SubtypePredicate("Plains")); filter.add(new SubtypePredicate("Plains"));
filter.setTargetController(TargetController.YOU); filter.add(new ControllerPredicate(TargetController.YOU));
} }
public ArmoredAscension(UUID ownerId) { public ArmoredAscension(UUID ownerId) {

View file

@ -40,6 +40,7 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterNonlandPermanent; import mage.filter.common.FilterNonlandPermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
@ -54,8 +55,8 @@ public class CapriciousEfreet extends CardImpl<CapriciousEfreet> {
private static final FilterNonlandPermanent filterNotControlled = new FilterNonlandPermanent("nonland permanent you don't control"); private static final FilterNonlandPermanent filterNotControlled = new FilterNonlandPermanent("nonland permanent you don't control");
static { static {
filterControlled.setTargetController(TargetController.YOU); filterControlled.add(new ControllerPredicate(TargetController.YOU));
filterNotControlled.setTargetController(TargetController.NOT_YOU); filterNotControlled.add(new ControllerPredicate(TargetController.NOT_YOU));
} }
public CapriciousEfreet(UUID ownerId) { public CapriciousEfreet(UUID ownerId) {

View file

@ -40,10 +40,12 @@ import mage.cards.CardImpl;
import mage.filter.FilterPermanent; import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates; import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.ColorPredicate; import mage.filter.predicate.mageobject.ColorPredicate;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.events.DamagedPlayerEvent; import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType; import mage.game.events.GameEvent.EventType;
import mage.players.Player;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
/** /**
@ -95,16 +97,19 @@ class LightwielderPaladinTriggeredAbility extends TriggeredAbilityImpl<Lightwiel
public boolean checkTrigger(GameEvent event, Game game) { public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == EventType.DAMAGED_PLAYER && event.getSourceId().equals(this.sourceId) if (event.getType() == EventType.DAMAGED_PLAYER && event.getSourceId().equals(this.sourceId)
&& ((DamagedPlayerEvent) event).isCombatDamage()) { && ((DamagedPlayerEvent) event).isCombatDamage()) {
FilterPermanent filter = new FilterPermanent("black or red permanent"); Player player = game.getPlayer(event.getTargetId());
if (player != null) {
FilterPermanent filter = new FilterPermanent("black or red permanent controlled by " + player.getName());
filter.add(Predicates.or( filter.add(Predicates.or(
new ColorPredicate(ObjectColor.BLACK), new ColorPredicate(ObjectColor.BLACK),
new ColorPredicate(ObjectColor.RED))); new ColorPredicate(ObjectColor.RED)));
filter.getControllerId().add(event.getTargetId()); filter.add(new ControllerIdPredicate(event.getTargetId()));
filter.setNotController(false);
this.getTargets().clear(); this.getTargets().clear();
this.addTarget(new TargetPermanent(filter)); this.addTarget(new TargetPermanent(filter));
return true; return true;
} }
}
return false; return false;
} }

View file

@ -36,6 +36,7 @@ import mage.Constants.TargetController;
import mage.abilities.effects.common.PreventAllDamageToEffect; import mage.abilities.effects.common.PreventAllDamageToEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterCreatureOrPlayer; import mage.filter.common.FilterCreatureOrPlayer;
import mage.filter.predicate.permanent.ControllerPredicate;
/** /**
* *
@ -46,7 +47,7 @@ public class SafePassage extends CardImpl<SafePassage> {
private static final FilterCreatureOrPlayer filter = new FilterCreatureOrPlayer("you and creatures you control"); private static final FilterCreatureOrPlayer filter = new FilterCreatureOrPlayer("you and creatures you control");
static { static {
filter.getCreatureFilter().setTargetController(TargetController.YOU); filter.getCreatureFilter().add(new ControllerPredicate(TargetController.YOU));
filter.getPlayerFilter().setPlayerTarget(TargetController.YOU); filter.getPlayerFilter().setPlayerTarget(TargetController.YOU);
} }

View file

@ -42,6 +42,7 @@ import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.TrampleAbility; import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
@ -107,7 +108,7 @@ class XathridDemonEffect extends OneShotEffect<XathridDemonEffect> {
} }
FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("creature other than " + sourcePermanent.getName()); FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("creature other than " + sourcePermanent.getName());
filter.setAnother(true); filter.add(new AnotherPredicate());
Target target = new TargetControlledCreaturePermanent(1, 1, filter, true, true); Target target = new TargetControlledCreaturePermanent(1, 1, filter, true, true);
if (target.canChoose(source.getSourceId(), player.getId(), game)) { if (target.canChoose(source.getSourceId(), player.getId(), game)) {

View file

@ -38,6 +38,7 @@ import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterControlledPermanent; import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
@ -90,7 +91,7 @@ class YawningFissureEffect extends OneShotEffect<YawningFissureEffect> {
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
FilterControlledPermanent filter = new FilterControlledPermanent("land you control"); FilterControlledPermanent filter = new FilterControlledPermanent("land you control");
filter.add(new CardTypePredicate(CardType.LAND)); filter.add(new CardTypePredicate(CardType.LAND));
filter.setTargetController(TargetController.YOU); filter.add(new ControllerPredicate(TargetController.YOU));
Set<UUID> opponents = game.getOpponents(source.getControllerId()); Set<UUID> opponents = game.getOpponents(source.getControllerId());
for (UUID opponentId : opponents) { for (UUID opponentId : opponents) {

View file

@ -42,6 +42,7 @@ import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
@ -77,18 +78,14 @@ public class AncientHellkite extends CardImpl<AncientHellkite> {
class AncientHellkiteAbility extends ActivatedAbilityImpl<AncientHellkiteAbility> { class AncientHellkiteAbility extends ActivatedAbilityImpl<AncientHellkiteAbility> {
private FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls");
public AncientHellkiteAbility() { public AncientHellkiteAbility() {
super(Zone.BATTLEFIELD, new DamageTargetEffect(1)); super(Zone.BATTLEFIELD, new DamageTargetEffect(1));
addCost(new AncientHellkiteCost()); addCost(new AncientHellkiteCost());
addTarget(new TargetCreaturePermanent(filter));
addManaCost(new ColoredManaCost(ColoredManaSymbol.R)); addManaCost(new ColoredManaCost(ColoredManaSymbol.R));
} }
public AncientHellkiteAbility(final AncientHellkiteAbility ability) { public AncientHellkiteAbility(final AncientHellkiteAbility ability) {
super(ability); super(ability);
this.filter = ability.filter;
} }
@Override @Override
@ -100,9 +97,10 @@ class AncientHellkiteAbility extends ActivatedAbilityImpl<AncientHellkiteAbility
public boolean activate(Game game, boolean noMana) { public boolean activate(Game game, boolean noMana) {
UUID defenderId = game.getCombat().getDefendingPlayer(sourceId); UUID defenderId = game.getCombat().getDefendingPlayer(sourceId);
if (defenderId != null) { if (defenderId != null) {
getTargets().clear();
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls"); FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls");
filter.getControllerId().add(defenderId); filter.add(new ControllerIdPredicate(defenderId));
this.getTargets().clear();
TargetCreaturePermanent target = new TargetCreaturePermanent(filter); TargetCreaturePermanent target = new TargetCreaturePermanent(filter);
target.setRequired(true); target.setRequired(true);
this.addTarget(target); this.addTarget(target);

View file

@ -38,6 +38,7 @@ import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterLandPermanent; import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
@ -74,7 +75,7 @@ class CorruptEffect extends OneShotEffect<CorruptEffect> {
static { static {
filter.add(new SubtypePredicate("Swamp")); filter.add(new SubtypePredicate("Swamp"));
filter.setTargetController(TargetController.YOU); filter.add(new ControllerPredicate(TargetController.YOU));
} }
public CorruptEffect() { public CorruptEffect() {

View file

@ -38,6 +38,7 @@ import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
@ -89,7 +90,7 @@ class CyclopsGladiatorEffect extends OneShotEffect<CyclopsGladiatorEffect> {
UUID defenderId = game.getCombat().getDefendingPlayer(source.getSourceId()); UUID defenderId = game.getCombat().getDefendingPlayer(source.getSourceId());
if (defenderId != null) { if (defenderId != null) {
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls"); FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls");
filter.getControllerId().add(defenderId); filter.add(new ControllerIdPredicate(defenderId));
TargetCreaturePermanent target = new TargetCreaturePermanent(filter); TargetCreaturePermanent target = new TargetCreaturePermanent(filter);
Player player = game.getPlayer(source.getControllerId()); Player player = game.getPlayer(source.getControllerId());
if (target.canChoose(source.getSourceId(), source.getControllerId(), game)) { if (target.canChoose(source.getSourceId(), source.getControllerId(), game)) {

View file

@ -41,6 +41,7 @@ import mage.abilities.effects.common.continious.BoostSourceEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterLandPermanent; import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
/** /**
* *
@ -52,7 +53,7 @@ public class EarthServant extends CardImpl<EarthServant> {
static { static {
filter.add(new SubtypePredicate("Mountain")); filter.add(new SubtypePredicate("Mountain"));
filter.setTargetController(TargetController.YOU); filter.add(new ControllerPredicate(TargetController.YOU));
} }
public EarthServant(UUID ownerId) { public EarthServant(UUID ownerId) {

View file

@ -44,6 +44,7 @@ import mage.abilities.effects.common.ReturnFromExileEffect;
import mage.abilities.mana.ColorlessManaAbility; import mage.abilities.mana.ColorlessManaAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterAttackingCreature; import mage.filter.common.FilterAttackingCreature;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
@ -57,7 +58,7 @@ public class MystifyingMaze extends CardImpl<MystifyingMaze> {
private static final FilterAttackingCreature filter = new FilterAttackingCreature("attacking creature an opponent controls"); private static final FilterAttackingCreature filter = new FilterAttackingCreature("attacking creature an opponent controls");
static { static {
filter.setTargetController(TargetController.OPPONENT); filter.add(new ControllerPredicate(TargetController.OPPONENT));
} }
public MystifyingMaze(UUID ownerId) { public MystifyingMaze(UUID ownerId) {

View file

@ -50,6 +50,7 @@ import mage.abilities.keyword.EnchantAbility;
import mage.cards.Card; import mage.cards.Card;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.events.GameEvent.EventType; import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
@ -175,7 +176,7 @@ class NecroticPlagueEffect2 extends OneShotEffect<NecroticPlagueEffect2> {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls"); private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls");
static { static {
filter.setTargetController(TargetController.OPPONENT); filter.add(new ControllerPredicate(TargetController.OPPONENT));
} }
public NecroticPlagueEffect2(UUID cardId) { public NecroticPlagueEffect2(UUID cardId) {

View file

@ -43,6 +43,7 @@ import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterLandPermanent; import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
@ -56,7 +57,7 @@ public class QuagSickness extends CardImpl<QuagSickness> {
static { static {
filter.add(new SubtypePredicate("Swamp")); filter.add(new SubtypePredicate("Swamp"));
filter.setTargetController(TargetController.YOU); filter.add(new ControllerPredicate(TargetController.YOU));
} }
public QuagSickness(UUID ownerId) { public QuagSickness(UUID ownerId) {

View file

@ -41,6 +41,7 @@ import mage.cards.CardImpl;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.FilterPermanent; import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
/** /**
* *
@ -53,7 +54,7 @@ public class SteelOverseer extends CardImpl<SteelOverseer> {
static { static {
filter.add(new CardTypePredicate(CardType.ARTIFACT)); filter.add(new CardTypePredicate(CardType.ARTIFACT));
filter.add(new CardTypePredicate(CardType.CREATURE)); filter.add(new CardTypePredicate(CardType.CREATURE));
filter.setTargetController(TargetController.YOU); filter.add(new ControllerPredicate(TargetController.YOU));
} }
public SteelOverseer(UUID ownerId) { public SteelOverseer(UUID ownerId) {

View file

@ -41,6 +41,7 @@ import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.IndestructibleAbility; import mage.abilities.keyword.IndestructibleAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.FilterPermanent; import mage.filter.FilterPermanent;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.target.Target; import mage.target.Target;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
@ -58,7 +59,7 @@ public class AegisAngel extends CardImpl<AegisAngel> {
this.toughness = new MageInt(5); this.toughness = new MageInt(5);
this.addAbility(FlyingAbility.getInstance()); this.addAbility(FlyingAbility.getInstance());
FilterPermanent filter = new FilterPermanent("another target permanent"); FilterPermanent filter = new FilterPermanent("another target permanent");
filter.setAnother(true); filter.add(new AnotherPredicate());
Ability ability = new EntersBattlefieldTriggeredAbility(new GainAbilityTargetEffect(IndestructibleAbility.getInstance(), Constants.Duration.WhileOnBattlefield), false); Ability ability = new EntersBattlefieldTriggeredAbility(new GainAbilityTargetEffect(IndestructibleAbility.getInstance(), Constants.Duration.WhileOnBattlefield), false);
Target target = new TargetPermanent(filter); Target target = new TargetPermanent(filter);
target.setRequired(true); target.setRequired(true);

View file

@ -37,6 +37,7 @@ import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.FilterPermanent; import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
@ -76,9 +77,9 @@ class SmallpoxEffect extends OneShotEffect<SmallpoxEffect> {
static { static {
filterCreature.add(new CardTypePredicate(CardType.CREATURE)); 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.add(new CardTypePredicate(CardType.LAND));
filterLand.setTargetController(Constants.TargetController.YOU); filterLand.add(new ControllerPredicate(Constants.TargetController.YOU));
} }
SmallpoxEffect() { SmallpoxEffect() {

View file

@ -35,6 +35,7 @@ import mage.Constants.Rarity;
import mage.abilities.effects.common.continious.BoostAllEffect; import mage.abilities.effects.common.continious.BoostAllEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
/** /**
* *
@ -45,7 +46,7 @@ public class CowerInFear extends CardImpl<CowerInFear> {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures your opponents control"); private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures your opponents control");
static { static {
filter.setTargetController(Constants.TargetController.OPPONENT); filter.add(new ControllerPredicate(Constants.TargetController.OPPONENT));
} }
public CowerInFear(UUID ownerId) { public CowerInFear(UUID ownerId) {

View file

@ -37,6 +37,7 @@ import mage.cards.CardImpl;
import mage.filter.FilterPermanent; import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.game.permanent.token.SaprolingToken; import mage.game.permanent.token.SaprolingToken;
@ -74,7 +75,7 @@ class FungalSproutingEffect extends OneShotEffect<FungalSproutingEffect> {
static { static {
filter.add(new CardTypePredicate(CardType.CREATURE)); filter.add(new CardTypePredicate(CardType.CREATURE));
filter.setTargetController(Constants.TargetController.YOU); filter.add(new ControllerPredicate(Constants.TargetController.YOU));
} }
public FungalSproutingEffect() { public FungalSproutingEffect() {

View file

@ -53,6 +53,7 @@ import mage.counters.CounterType;
import mage.filter.common.FilterLandCard; import mage.filter.common.FilterLandCard;
import mage.filter.common.FilterLandPermanent; import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.command.Emblem; import mage.game.command.Emblem;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
@ -127,7 +128,7 @@ class LilianaOfTheDarkRealmsEffect extends ContinuousEffectImpl<LilianaOfTheDark
FilterLandPermanent filter = new FilterLandPermanent("Swamps"); FilterLandPermanent filter = new FilterLandPermanent("Swamps");
filter.add(new SubtypePredicate("Swamp")); filter.add(new SubtypePredicate("Swamp"));
filter.setTargetController(TargetController.YOU); filter.add(new ControllerPredicate(TargetController.YOU));
this.amount = game.getBattlefield().count(filter, source.getControllerId(), game); this.amount = game.getBattlefield().count(filter, source.getControllerId(), game);
Player player = game.getPlayer(source.getControllerId()); Player player = game.getPlayer(source.getControllerId());

View file

@ -37,6 +37,7 @@ import mage.abilities.effects.common.continious.BoostAllEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterLandPermanent; import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
/** /**
* *
@ -48,7 +49,7 @@ public class Mutilate extends CardImpl<Mutilate> {
static { static {
filter.add(new SubtypePredicate("Swamp")); filter.add(new SubtypePredicate("Swamp"));
filter.setTargetController(Constants.TargetController.YOU); filter.add(new ControllerPredicate(Constants.TargetController.YOU));
} }
public Mutilate(UUID ownerId) { public Mutilate(UUID ownerId) {

View file

@ -41,6 +41,7 @@ import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.AbilityPredicate; import mage.filter.predicate.mageobject.AbilityPredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
@ -54,7 +55,7 @@ public class ThundermawHellkite extends CardImpl<ThundermawHellkite> {
static { static {
filter.add(new AbilityPredicate(FlyingAbility.class)); filter.add(new AbilityPredicate(FlyingAbility.class));
filter.setTargetController(Constants.TargetController.OPPONENT); filter.add(new ControllerPredicate(Constants.TargetController.OPPONENT));
} }
public ThundermawHellkite(UUID ownerId) { public ThundermawHellkite(UUID ownerId) {

View file

@ -38,6 +38,7 @@ import mage.abilities.effects.ContinuousEffectImpl;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.NamePredicate; import mage.filter.predicate.mageobject.NamePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
@ -51,7 +52,7 @@ public class TimberpackWolf extends CardImpl<TimberpackWolf> {
static { static {
filter.add(new NamePredicate("Timberpack Wolf")); filter.add(new NamePredicate("Timberpack Wolf"));
filter.setTargetController(Constants.TargetController.YOU); filter.add(new ControllerPredicate(Constants.TargetController.YOU));
} }
public TimberpackWolf(UUID ownerId) { public TimberpackWolf(UUID ownerId) {

View file

@ -40,6 +40,7 @@ import mage.abilities.keyword.EquipAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterLandPermanent; import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
/** /**
* *
@ -50,7 +51,7 @@ public class NightmareLash extends CardImpl<NightmareLash> {
static { static {
filter.add(new SubtypePredicate("Swamp")); filter.add(new SubtypePredicate("Swamp"));
filter.setTargetController(Constants.TargetController.YOU); filter.add(new ControllerPredicate(Constants.TargetController.YOU));
} }
public NightmareLash(UUID ownerId) { public NightmareLash(UUID ownerId) {

View file

@ -40,6 +40,7 @@ import mage.abilities.effects.ContinuousEffectImpl;
import mage.cards.Card; import mage.cards.Card;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
@ -52,7 +53,7 @@ public class Cryptoplasm extends CardImpl<Cryptoplasm> {
final static FilterCreaturePermanent filter = new FilterCreaturePermanent(); final static FilterCreaturePermanent filter = new FilterCreaturePermanent();
static { static {
filter.setAnother(true); filter.add(new AnotherPredicate());
} }
public Cryptoplasm(UUID ownerId) { public Cryptoplasm(UUID ownerId) {

View file

@ -43,6 +43,7 @@ import mage.game.events.GameEvent;
import mage.game.permanent.token.Token; import mage.game.permanent.token.Token;
import java.util.UUID; import java.util.UUID;
import mage.filter.predicate.permanent.AnotherPredicate;
/** /**
* *
@ -92,7 +93,7 @@ class ThopterAssemblyTriggeredAbility extends TriggeredAbilityImpl<ThopterAssemb
if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE && event.getPlayerId().equals(this.controllerId)) { if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE && event.getPlayerId().equals(this.controllerId)) {
FilterPermanent filter = new FilterPermanent(); FilterPermanent filter = new FilterPermanent();
filter.add(new SubtypePredicate("Thopter")); filter.add(new SubtypePredicate("Thopter"));
filter.setAnother(true); filter.add(new AnotherPredicate());
if (!game.getBattlefield().contains(filter, controllerId, 1, game)) { if (!game.getBattlefield().contains(filter, controllerId, 1, game)) {
return true; return true;
} }

View file

@ -38,6 +38,7 @@ import mage.abilities.effects.common.continious.GainAbilityControlledEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.players.Player; import mage.players.Player;
@ -57,6 +58,7 @@ public class ArmWithAEther extends CardImpl<ArmWithAEther> {
this.color.setBlue(true); this.color.setBlue(true);
// Until end of turn, creatures you control gain "Whenever this creature deals damage to an opponent, you may return target creature that player controls to its owner's hand."
this.getSpellAbility().addEffect(new GainAbilityControlledEffect(new ArmWithAEtherTriggeredAbility(), Duration.EndOfTurn, filter)); this.getSpellAbility().addEffect(new GainAbilityControlledEffect(new ArmWithAEtherTriggeredAbility(), Duration.EndOfTurn, filter));
} }
@ -89,9 +91,10 @@ class ArmWithAEtherTriggeredAbility extends TriggeredAbilityImpl<ArmWithAEtherTr
public boolean checkTrigger(GameEvent event, Game game) { public boolean checkTrigger(GameEvent event, Game game) {
Player opponent = game.getPlayer(event.getPlayerId()); Player opponent = game.getPlayer(event.getPlayerId());
if (opponent != null && event.getType() == GameEvent.EventType.DAMAGED_PLAYER && event.getSourceId().equals(this.sourceId)) { if (opponent != null && event.getType() == GameEvent.EventType.DAMAGED_PLAYER && event.getSourceId().equals(this.sourceId)) {
this.getTargets().clear();
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature " + opponent.getName() + " controls"); FilterCreaturePermanent filter = new FilterCreaturePermanent("creature " + opponent.getName() + " controls");
filter.getControllerId().add(opponent.getId()); filter.add(new ControllerIdPredicate(opponent.getId()));
this.getTargets().clear();
this.addTarget(new TargetCreaturePermanent(filter)); this.addTarget(new TargetCreaturePermanent(filter));
return true; return true;
} }

View file

@ -39,6 +39,7 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.IntimidateAbility; import mage.abilities.keyword.IntimidateAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.events.DamagedPlayerEvent; import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
@ -64,6 +65,7 @@ public class BlindZealot extends CardImpl<BlindZealot> {
this.toughness = new MageInt(2); this.toughness = new MageInt(2);
this.addAbility(IntimidateAbility.getInstance()); this.addAbility(IntimidateAbility.getInstance());
// Whenever Blind Zealot deals combat damage to a player, you may sacrifice it. If you do, destroy target creature that player controls.
this.addAbility(new BlindZealotTriggeredAbility()); this.addAbility(new BlindZealotTriggeredAbility());
} }
@ -106,11 +108,11 @@ class BlindZealotTriggeredAbility extends TriggeredAbilityImpl<BlindZealotTrigge
sb.append(" to destroy target creature controlled by "); sb.append(" to destroy target creature controlled by ");
sb.append(game.getPlayer(event.getTargetId()).getName()).append("?"); sb.append(game.getPlayer(event.getTargetId()).getName()).append("?");
if (player.chooseUse(Outcome.DestroyPermanent, sb.toString(), game)) { if (player.chooseUse(Outcome.DestroyPermanent, sb.toString(), game)) {
this.getTargets().clear();
FilterCreaturePermanent filter = new FilterCreaturePermanent(); FilterCreaturePermanent filter = new FilterCreaturePermanent();
filter.getControllerId().add(event.getTargetId()); filter.add(new ControllerIdPredicate(event.getTargetId()));
filter.setNotController(false);
filter.setMessage("creature controlled by " + game.getPlayer(event.getTargetId()).getName()); filter.setMessage("creature controlled by " + game.getPlayer(event.getTargetId()).getName());
this.getTargets().clear();
this.addTarget(new TargetCreaturePermanent(filter)); this.addTarget(new TargetCreaturePermanent(filter));
return true; return true;
} }

View file

@ -41,6 +41,7 @@ import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.keyword.HasteAbility; import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.game.permanent.token.Token; import mage.game.permanent.token.Token;
@ -55,7 +56,7 @@ public class ChancellorOfTheForge extends CardImpl<ChancellorOfTheForge> {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures you control"); private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures you control");
static { static {
filter.setTargetController(TargetController.YOU); filter.add(new ControllerPredicate(TargetController.YOU));
} }
public ChancellorOfTheForge(UUID ownerId) { public ChancellorOfTheForge(UUID ownerId) {

View file

@ -40,6 +40,7 @@ import mage.abilities.effects.common.UntapTargetEffect;
import mage.abilities.keyword.FlashAbility; import mage.abilities.keyword.FlashAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.FilterPermanent; import mage.filter.FilterPermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetControlledPermanent;
@ -52,7 +53,7 @@ public class DeceiverExarch extends CardImpl<DeceiverExarch> {
private static final FilterPermanent filter = new FilterPermanent("permanent an opponent controls"); private static final FilterPermanent filter = new FilterPermanent("permanent an opponent controls");
static { static {
filter.setTargetController(TargetController.OPPONENT); filter.add(new ControllerPredicate(TargetController.OPPONENT));
} }
public DeceiverExarch(UUID ownerId) { public DeceiverExarch(UUID ownerId) {

View file

@ -42,6 +42,7 @@ import mage.abilities.keyword.LivingWeaponAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterLandPermanent; import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
/** /**
* *
@ -53,7 +54,7 @@ public class Lashwrithe extends CardImpl<Lashwrithe> {
static { static {
filter.add(new SubtypePredicate("Swamp")); filter.add(new SubtypePredicate("Swamp"));
filter.setTargetController(TargetController.YOU); filter.add(new ControllerPredicate(TargetController.YOU));
} }
public Lashwrithe(UUID ownerId) { public Lashwrithe(UUID ownerId) {

View file

@ -43,6 +43,7 @@ import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.permanent.token.GolemToken; import mage.game.permanent.token.GolemToken;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
@ -57,7 +58,7 @@ public class VitalSplicer extends CardImpl<VitalSplicer> {
static { static {
filter.add(new CardTypePredicate(CardType.CREATURE)); filter.add(new CardTypePredicate(CardType.CREATURE));
filter.add(new SubtypePredicate("Golem")); filter.add(new SubtypePredicate("Golem"));
filter.setTargetController(TargetController.YOU); filter.add(new ControllerPredicate(TargetController.YOU));
} }
public VitalSplicer(UUID ownerId) { public VitalSplicer(UUID ownerId) {

View file

@ -41,6 +41,7 @@ import mage.abilities.effects.common.continious.GainAbilityAllEffect;
import mage.abilities.keyword.HasteAbility; import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
/** /**
@ -52,7 +53,7 @@ public class FiresOfYavimaya extends CardImpl<FiresOfYavimaya> {
private final static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Creatures you control"); private final static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Creatures you control");
static { static {
filter.setTargetController(Constants.TargetController.YOU); filter.add(new ControllerPredicate(Constants.TargetController.YOU));
} }
public FiresOfYavimaya(UUID ownerId) { public FiresOfYavimaya(UUID ownerId) {

View file

@ -38,6 +38,7 @@ import mage.abilities.keyword.ReboundAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterControlledPermanent; import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
@ -90,7 +91,7 @@ class ConsumingVaporsEffect extends OneShotEffect<ConsumingVaporsEffect> {
FilterControlledPermanent filter = new FilterControlledPermanent("creature"); FilterControlledPermanent filter = new FilterControlledPermanent("creature");
filter.add(new CardTypePredicate(CardType.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); TargetControlledPermanent target = new TargetControlledPermanent(1, 1, filter, false);
//A spell or ability could have removed the only legal target this player //A spell or ability could have removed the only legal target this player

View file

@ -41,6 +41,7 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.keyword.IndestructibleAbility; import mage.abilities.keyword.IndestructibleAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterArtifactPermanent; import mage.filter.common.FilterArtifactPermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
/** /**
* *
@ -50,7 +51,7 @@ public class DarksteelJuggernaut extends CardImpl<DarksteelJuggernaut> {
private static final FilterArtifactPermanent filter = new FilterArtifactPermanent("artifacts you control"); private static final FilterArtifactPermanent filter = new FilterArtifactPermanent("artifacts you control");
static { static {
filter.setTargetController(Constants.TargetController.YOU); filter.add(new ControllerPredicate(Constants.TargetController.YOU));
} }
public DarksteelJuggernaut (UUID ownerId) { public DarksteelJuggernaut (UUID ownerId) {

View file

@ -53,6 +53,7 @@ import mage.cards.CardImpl;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.common.FilterLandPermanent; import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.game.permanent.token.Token; import mage.game.permanent.token.Token;
@ -69,9 +70,9 @@ public class KothOfTheHammer extends CardImpl<KothOfTheHammer> {
static { static {
filter.add(new SubtypePredicate("Mountain")); filter.add(new SubtypePredicate("Mountain"));
filter.setTargetController(Constants.TargetController.YOU); filter.add(new ControllerPredicate(Constants.TargetController.YOU));
filterCount.add(new SubtypePredicate("Mountain")); filterCount.add(new SubtypePredicate("Mountain"));
filterCount.setTargetController(Constants.TargetController.YOU); filterCount.add(new ControllerPredicate(Constants.TargetController.YOU));
} }
public KothOfTheHammer (UUID ownerId) { public KothOfTheHammer (UUID ownerId) {

View file

@ -41,6 +41,7 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continious.GainControlTargetEffect; import mage.abilities.effects.common.continious.GainControlTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterEquipment; import mage.filter.common.FilterEquipment;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
@ -52,10 +53,10 @@ import mage.target.TargetPermanent;
*/ */
public class OgreGeargrabber extends CardImpl<OgreGeargrabber> { public class OgreGeargrabber extends CardImpl<OgreGeargrabber> {
private static FilterEquipment filter = new FilterEquipment("Equipment an opponent controls"); private static final FilterEquipment filter = new FilterEquipment("Equipment an opponent controls");
static { static {
filter.setTargetController(TargetController.OPPONENT); filter.add(new ControllerPredicate(TargetController.OPPONENT));
} }
public OgreGeargrabber(UUID ownerId) { public OgreGeargrabber(UUID ownerId) {

View file

@ -37,6 +37,7 @@ import mage.cards.CardImpl;
import mage.filter.FilterPermanent; import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates; import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.filter.predicate.permanent.TappedPredicate; import mage.filter.predicate.permanent.TappedPredicate;
/** /**
@ -53,7 +54,7 @@ public class ToilToRenown extends CardImpl<ToilToRenown> {
new CardTypePredicate(CardType.ARTIFACT), new CardTypePredicate(CardType.ARTIFACT),
new CardTypePredicate(CardType.CREATURE), new CardTypePredicate(CardType.CREATURE),
new CardTypePredicate(CardType.LAND))); new CardTypePredicate(CardType.LAND)));
filter.setTargetController(TargetController.YOU); filter.add(new ControllerPredicate(TargetController.YOU));
} }
public ToilToRenown(UUID ownerId) { public ToilToRenown(UUID ownerId) {

View file

@ -41,6 +41,7 @@ import mage.cards.CardImpl;
import mage.filter.common.FilterControlledPermanent; import mage.filter.common.FilterControlledPermanent;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
/** /**
* *
@ -54,7 +55,7 @@ public class MasterOfEtherium extends CardImpl<MasterOfEtherium> {
static { static {
filterCounted.add(new CardTypePredicate(CardType.ARTIFACT)); filterCounted.add(new CardTypePredicate(CardType.ARTIFACT));
filterBoosted.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) { public MasterOfEtherium(UUID ownerId) {

View file

@ -39,6 +39,7 @@ import mage.abilities.effects.common.ExileTargetForSourceEffect;
import mage.abilities.effects.common.ReturnFromExileForSourceEffect; import mage.abilities.effects.common.ReturnFromExileForSourceEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterNonlandPermanent; import mage.filter.common.FilterNonlandPermanent;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.target.Target; import mage.target.Target;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
@ -48,10 +49,10 @@ import mage.target.TargetPermanent;
*/ */
public class OblivionRing extends CardImpl<OblivionRing> { public class OblivionRing extends CardImpl<OblivionRing> {
private static FilterNonlandPermanent anotherNonlandPermanent = new FilterNonlandPermanent("another nonland permanent"); private static final FilterNonlandPermanent anotherNonlandPermanent = new FilterNonlandPermanent("another nonland permanent");
static { static {
anotherNonlandPermanent.setAnother(true); anotherNonlandPermanent.add(new AnotherPredicate());
} }
public OblivionRing(UUID ownerId) { public OblivionRing(UUID ownerId) {

View file

@ -38,6 +38,7 @@ import mage.abilities.effects.common.continious.BoostControlledEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
/** /**
* *
@ -49,7 +50,7 @@ public class AkoumBattlesinger extends CardImpl<AkoumBattlesinger> {
static { static {
filter.add(new SubtypePredicate("Ally")); filter.add(new SubtypePredicate("Ally"));
filter.setTargetController(TargetController.YOU); filter.add(new ControllerPredicate(TargetController.YOU));
} }
public AkoumBattlesinger(UUID ownerId) { public AkoumBattlesinger(UUID ownerId) {

View file

@ -40,6 +40,7 @@ import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterControlledPermanent; import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
@ -99,7 +100,7 @@ class ButcherOfMalakirEffect extends OneShotEffect<ButcherOfMalakirEffect> {
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
FilterControlledPermanent filter = new FilterControlledPermanent("creature you control"); FilterControlledPermanent filter = new FilterControlledPermanent("creature you control");
filter.add(new CardTypePredicate(CardType.CREATURE)); filter.add(new CardTypePredicate(CardType.CREATURE));
filter.setTargetController(Constants.TargetController.YOU); filter.add(new ControllerPredicate(Constants.TargetController.YOU));
Set<UUID> opponents = game.getOpponents(source.getControllerId()); Set<UUID> opponents = game.getOpponents(source.getControllerId());
for (UUID opponentId : opponents) { for (UUID opponentId : opponents) {

View file

@ -45,6 +45,7 @@ import mage.abilities.keyword.FirstStrikeAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterLandPermanent; import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
@ -58,7 +59,7 @@ public class ClawsOfValakut extends CardImpl<ClawsOfValakut> {
static { static {
filter.add(new SubtypePredicate("Mountain")); filter.add(new SubtypePredicate("Mountain"));
filter.setTargetController(Constants.TargetController.YOU); filter.add(new ControllerPredicate(Constants.TargetController.YOU));
} }
public ClawsOfValakut (UUID ownerId) { public ClawsOfValakut (UUID ownerId) {

View file

@ -40,6 +40,7 @@ import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.target.TargetPlayer; import mage.target.TargetPlayer;
/** /**
@ -52,7 +53,7 @@ public class HalimarExcavator extends CardImpl<HalimarExcavator> {
static { static {
filter.add(new SubtypePredicate("Ally")); filter.add(new SubtypePredicate("Ally"));
filter.setTargetController(TargetController.YOU); filter.add(new ControllerPredicate(TargetController.YOU));
} }
public HalimarExcavator(UUID ownerId) { public HalimarExcavator(UUID ownerId) {

View file

@ -43,6 +43,7 @@ import mage.abilities.keyword.EquipAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.FilterPermanent; import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.events.DamagedPlayerEvent; import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
@ -59,8 +60,12 @@ public class HammerOfRuin extends CardImpl<HammerOfRuin> {
super(ownerId, 124, "Hammer of Ruin", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}"); super(ownerId, 124, "Hammer of Ruin", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}");
this.expansionSetCode = "WWK"; this.expansionSetCode = "WWK";
this.subtype.add("Equipment"); this.subtype.add("Equipment");
// Equipped creature gets +2/+0.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(2, 0))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(2, 0)));
// Whenever equipped creature deals combat damage to a player, you may destroy target Equipment that player controls.
this.addAbility(new HammerOfRuinTriggeredAbility()); this.addAbility(new HammerOfRuinTriggeredAbility());
// Equip {2}
this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(2))); this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(2)));
} }
@ -79,9 +84,6 @@ class HammerOfRuinTriggeredAbility extends TriggeredAbilityImpl<HammerOfRuinTrig
HammerOfRuinTriggeredAbility() { HammerOfRuinTriggeredAbility() {
super(Zone.BATTLEFIELD, new DestroyTargetEffect(), true); super(Zone.BATTLEFIELD, new DestroyTargetEffect(), true);
FilterPermanent filter = new FilterPermanent("Equipment that player controls");
filter.add(new SubtypePredicate("Equipment"));
this.addTarget(new TargetPermanent(filter));
} }
HammerOfRuinTriggeredAbility(final HammerOfRuinTriggeredAbility ability) { HammerOfRuinTriggeredAbility(final HammerOfRuinTriggeredAbility ability) {
@ -99,9 +101,13 @@ class HammerOfRuinTriggeredAbility extends TriggeredAbilityImpl<HammerOfRuinTrig
DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event; DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
Permanent p = game.getPermanent(event.getSourceId()); Permanent p = game.getPermanent(event.getSourceId());
if (damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId())) { if (damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId())) {
FilterPermanent filter = (FilterPermanent)getTargets().get(0).getFilter(); FilterPermanent filter = new FilterPermanent("Equipment that player controls");
filter.getControllerId().clear(); filter.add(new SubtypePredicate("Equipment"));
filter.getControllerId().add(event.getPlayerId()); filter.add(new ControllerIdPredicate(event.getPlayerId()));
filter.setMessage("creature controlled by " + game.getPlayer(event.getTargetId()).getName());
this.getTargets().clear();
this.addTarget(new TargetPermanent(filter));
return true; return true;
} }
} }

View file

@ -42,6 +42,7 @@ import mage.abilities.effects.common.MayTapOrUntapTargetEffect;
import mage.abilities.effects.common.UntapSourceEffect; import mage.abilities.effects.common.UntapSourceEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
/** /**
@ -50,11 +51,10 @@ import mage.target.common.TargetCreaturePermanent;
*/ */
public class TideforceElemental extends CardImpl<TideforceElemental> { public class TideforceElemental extends CardImpl<TideforceElemental> {
// private final static String text = "You may tap or untap another target creature";
private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("another creature"); private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("another creature");
static { static {
filter.setAnother(true); filter.add(new AnotherPredicate());
} }
public TideforceElemental(UUID ownerId) { public TideforceElemental(UUID ownerId) {

View file

@ -40,6 +40,7 @@ import mage.abilities.effects.common.LoseLifeTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.target.TargetPlayer; import mage.target.TargetPlayer;
/** /**
@ -52,7 +53,7 @@ public class HagraDiabolist extends CardImpl<HagraDiabolist> {
static { static {
filter.add(new SubtypePredicate("Ally")); filter.add(new SubtypePredicate("Ally"));
filter.setTargetController(Constants.TargetController.YOU); filter.add(new ControllerPredicate(Constants.TargetController.YOU));
} }
public HagraDiabolist(UUID ownerId) { public HagraDiabolist(UUID ownerId) {

View file

@ -40,6 +40,7 @@ import mage.abilities.keyword.FirstStrikeAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
/** /**
* *
@ -51,7 +52,7 @@ public class HighlandBerserker extends CardImpl<HighlandBerserker> {
static { static {
filter.add(new SubtypePredicate("Ally")); filter.add(new SubtypePredicate("Ally"));
filter.setTargetController(Constants.TargetController.YOU); filter.add(new ControllerPredicate(Constants.TargetController.YOU));
} }
public HighlandBerserker(UUID ownerId) { public HighlandBerserker(UUID ownerId) {

View file

@ -40,6 +40,7 @@ import mage.abilities.keyword.VigilanceAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
/** /**
* *
@ -51,7 +52,7 @@ public class JoragaBard extends CardImpl<JoragaBard> {
static { static {
filter.add(new SubtypePredicate("Ally")); filter.add(new SubtypePredicate("Ally"));
filter.setTargetController(Constants.TargetController.YOU); filter.add(new ControllerPredicate(Constants.TargetController.YOU));
} }
public JoragaBard(UUID ownerId) { public JoragaBard(UUID ownerId) {

View file

@ -39,6 +39,7 @@ import mage.abilities.effects.common.ExileTargetForSourceEffect;
import mage.abilities.effects.common.ReturnFromExileForSourceEffect; import mage.abilities.effects.common.ReturnFromExileForSourceEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.target.Target; import mage.target.Target;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
@ -53,7 +54,7 @@ public class JourneyToNowhere extends CardImpl<JourneyToNowhere> {
this.expansionSetCode = "ZEN"; this.expansionSetCode = "ZEN";
this.color.setWhite(true); this.color.setWhite(true);
FilterCreaturePermanent filter = new FilterCreaturePermanent(); FilterCreaturePermanent filter = new FilterCreaturePermanent();
filter.setAnother(true); filter.add(new AnotherPredicate());
Ability ability1 = new EntersBattlefieldTriggeredAbility(new ExileTargetForSourceEffect("Journey to Nowhere exile"), false); Ability ability1 = new EntersBattlefieldTriggeredAbility(new ExileTargetForSourceEffect("Journey to Nowhere exile"), false);
Target target = new TargetPermanent(filter); Target target = new TargetPermanent(filter);
target.setRequired(true); target.setRequired(true);

View file

@ -39,6 +39,7 @@ import mage.cards.CardImpl;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
/** /**
* *
@ -50,7 +51,7 @@ public class KazuulWarlord extends CardImpl<KazuulWarlord> {
static { static {
filter.add(new SubtypePredicate("Ally")); filter.add(new SubtypePredicate("Ally"));
filter.setTargetController(TargetController.YOU); filter.add(new ControllerPredicate(TargetController.YOU));
} }
public KazuulWarlord(UUID ownerId) { public KazuulWarlord(UUID ownerId) {

View file

@ -37,6 +37,7 @@ import mage.abilities.effects.common.SkipNextUntapTargetEffect;
import mage.abilities.effects.common.TapTargetEffect; import mage.abilities.effects.common.TapTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
/** /**
@ -48,7 +49,7 @@ public class KorHookmaster extends CardImpl<KorHookmaster> {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls"); private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls");
static { static {
filter.setTargetController(TargetController.OPPONENT); filter.add(new ControllerPredicate(TargetController.OPPONENT));
} }
public KorHookmaster(UUID ownerId) { public KorHookmaster(UUID ownerId) {

View file

@ -36,6 +36,7 @@ import mage.abilities.effects.common.GainLifeEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterLandPermanent; import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
/** /**
* *
@ -47,7 +48,7 @@ public class LandbindRitual extends CardImpl<LandbindRitual> {
static { static {
filter.add(new SubtypePredicate("Plains")); filter.add(new SubtypePredicate("Plains"));
filter.setTargetController(TargetController.YOU); filter.add(new ControllerPredicate(TargetController.YOU));
} }
public LandbindRitual(UUID ownerId) { public LandbindRitual(UUID ownerId) {

View file

@ -36,6 +36,7 @@ import mage.abilities.effects.common.DiscardTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterLandPermanent; import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.target.TargetPlayer; import mage.target.TargetPlayer;
/** /**
@ -48,7 +49,7 @@ public class MindSludge extends CardImpl<MindSludge> {
static { static {
filter.add(new SubtypePredicate("Swamp")); filter.add(new SubtypePredicate("Swamp"));
filter.setTargetController(TargetController.YOU); filter.add(new ControllerPredicate(TargetController.YOU));
} }
public MindSludge(UUID ownerId) { public MindSludge(UUID ownerId) {

View file

@ -40,6 +40,7 @@ import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
/** /**
@ -52,7 +53,7 @@ public class MurasaPyromancer extends CardImpl<MurasaPyromancer> {
static { static {
filter.add(new SubtypePredicate("Ally")); filter.add(new SubtypePredicate("Ally"));
filter.setTargetController(Constants.TargetController.YOU); filter.add(new ControllerPredicate(Constants.TargetController.YOU));
} }
public MurasaPyromancer(UUID ownerId) { public MurasaPyromancer(UUID ownerId) {

View file

@ -39,6 +39,7 @@ import mage.abilities.effects.common.GainLifeEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
/** /**
* *
@ -50,7 +51,7 @@ public class OnduCleric extends CardImpl<OnduCleric> {
static { static {
filter.add(new SubtypePredicate("Ally")); filter.add(new SubtypePredicate("Ally"));
filter.setTargetController(Constants.TargetController.YOU); filter.add(new ControllerPredicate(Constants.TargetController.YOU));
} }
public OnduCleric(UUID ownerId) { public OnduCleric(UUID ownerId) {

View file

@ -37,6 +37,7 @@ import mage.abilities.effects.common.continious.BoostTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterLandPermanent; import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
/** /**
@ -49,7 +50,7 @@ public class PrimalBellow extends CardImpl<PrimalBellow> {
static { static {
filter.add(new SubtypePredicate("Forest")); filter.add(new SubtypePredicate("Forest"));
filter.setTargetController(TargetController.YOU); filter.add(new ControllerPredicate(TargetController.YOU));
} }

View file

@ -40,6 +40,7 @@ import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
/** /**
* *
@ -51,7 +52,7 @@ public class SeascapeAerialist extends CardImpl<SeascapeAerialist> {
static { static {
filter.add(new SubtypePredicate("Ally")); filter.add(new SubtypePredicate("Ally"));
filter.setTargetController(Constants.TargetController.YOU); filter.add(new ControllerPredicate(Constants.TargetController.YOU));
} }
public SeascapeAerialist(UUID ownerId) { public SeascapeAerialist(UUID ownerId) {

View file

@ -35,6 +35,7 @@ import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterLandPermanent; import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.target.common.TargetCreatureOrPlayer; import mage.target.common.TargetCreatureOrPlayer;
import java.util.UUID; import java.util.UUID;
@ -49,7 +50,7 @@ public class SpireBarrage extends CardImpl<SpireBarrage> {
static { static {
filter.add(new SubtypePredicate("Mountain")); filter.add(new SubtypePredicate("Mountain"));
filter.setTargetController(TargetController.YOU); filter.add(new ControllerPredicate(TargetController.YOU));
} }
public SpireBarrage(UUID ownerId) { public SpireBarrage(UUID ownerId) {

View file

@ -42,6 +42,7 @@ import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.AbilityPredicate; import mage.filter.predicate.mageobject.AbilityPredicate;
import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
/** /**
@ -55,7 +56,7 @@ public class TajuruArcher extends CardImpl<TajuruArcher> {
static { static {
filter.add(new SubtypePredicate("Ally")); filter.add(new SubtypePredicate("Ally"));
filter.setTargetController(Constants.TargetController.YOU); filter.add(new ControllerPredicate(Constants.TargetController.YOU));
filterTarget.add(new AbilityPredicate(FlyingAbility.class)); filterTarget.add(new AbilityPredicate(FlyingAbility.class));
} }

View file

@ -39,6 +39,7 @@ import mage.abilities.effects.common.continious.BoostSourceEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.common.FilterLandPermanent; import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
/** /**
* *
@ -50,7 +51,7 @@ public class TimbermawLarva extends CardImpl<TimbermawLarva> {
static { static {
filter.add(new SubtypePredicate("Forest")); filter.add(new SubtypePredicate("Forest"));
filter.setTargetController(TargetController.YOU); filter.add(new ControllerPredicate(TargetController.YOU));
} }

View file

@ -35,6 +35,7 @@ import mage.abilities.Ability;
import mage.abilities.effects.ReplacementEffectImpl; import mage.abilities.effects.ReplacementEffectImpl;
import mage.filter.FilterPermanent; import mage.filter.FilterPermanent;
import mage.filter.FilterStackObject; import mage.filter.FilterStackObject;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType; import mage.game.events.GameEvent.EventType;
@ -87,7 +88,7 @@ public class CantTargetControlledEffect extends ReplacementEffectImpl<CantTarget
@Override @Override
public boolean applies(GameEvent event, Ability source, Game game) { public boolean applies(GameEvent event, Ability source, Game game) {
if (event.getType() == EventType.TARGET) { if (event.getType() == EventType.TARGET) {
filterTarget.setTargetController(TargetController.YOU); filterTarget.add(new ControllerPredicate(TargetController.YOU));
Permanent permanent = game.getPermanent(event.getTargetId()); Permanent permanent = game.getPermanent(event.getTargetId());
if (permanent != null && filterTarget.match(permanent, source.getSourceId(), source.getControllerId(), game)) { if (permanent != null && filterTarget.match(permanent, source.getSourceId(), source.getControllerId(), game)) {
if (filterSource == null) if (filterSource == null)

Some files were not shown because too many files have changed in this diff Show more