added a new static filter

This commit is contained in:
Evan Kranzler 2020-05-01 18:28:43 -04:00
parent 43c9bec7be
commit 4ceaeeebad
71 changed files with 389 additions and 894 deletions

View file

@ -1,31 +1,23 @@
package mage.cards.a;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.common.FightTargetSourceEffect;
import mage.constants.SubType;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.constants.SubType;
import mage.filter.StaticFilters;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author TheElk801
*/
public final class AffectionateIndrik extends CardImpl {
private static final FilterCreaturePermanent filter
= new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public AffectionateIndrik(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{G}");
@ -40,11 +32,11 @@ public final class AffectionateIndrik extends CardImpl {
+ "target creature you don't control"),
true
);
ability.addTarget(new TargetCreaturePermanent(filter));
ability.addTarget(new TargetCreaturePermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
this.addAbility(ability);
}
public AffectionateIndrik(final AffectionateIndrik card) {
private AffectionateIndrik(final AffectionateIndrik card) {
super(card);
}

View file

@ -4,8 +4,7 @@ import mage.abilities.effects.common.DamageWithPowerFromOneToAnotherTargetEffect
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
@ -16,22 +15,16 @@ import java.util.UUID;
*/
public final class AggressiveInstinct extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public AggressiveInstinct(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{G}");
// Target creature you control deals damage equal to its power to target creature you don't control.
this.getSpellAbility().addEffect(new DamageWithPowerFromOneToAnotherTargetEffect());
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
this.getSpellAbility().addTarget(new TargetCreaturePermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
}
public AggressiveInstinct(final AggressiveInstinct card) {
private AggressiveInstinct(final AggressiveInstinct card) {
super(card);
}

View file

@ -7,8 +7,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
@ -19,12 +18,6 @@ import java.util.UUID;
*/
public final class Ambuscade extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public Ambuscade(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{G}");
@ -35,10 +28,10 @@ public final class Ambuscade extends CardImpl {
// It deals damage equal to its power to target creature you don't control.
this.getSpellAbility().addEffect(new DamageWithPowerFromOneToAnotherTargetEffect("It"));
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); // second target for effect
this.getSpellAbility().addTarget(new TargetCreaturePermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL)); // second target for effect
}
public Ambuscade(final Ambuscade card) {
private Ambuscade(final Ambuscade card) {
super(card);
}

View file

@ -10,9 +10,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.TargetController;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import mage.target.TargetPermanent;
import java.util.UUID;
@ -22,12 +20,6 @@ import java.util.UUID;
*/
public final class ApexAltisaur extends CardImpl {
private static final FilterPermanent filter = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public ApexAltisaur(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{7}{G}{G}");
@ -40,12 +32,12 @@ public final class ApexAltisaur extends CardImpl {
// When Apex Altisaur enters the battlefield, it fights up to one target creature you don't control.
Ability ability = new EntersBattlefieldTriggeredAbility(effect);
ability.addTarget(new TargetPermanent(0, 1, filter, false));
ability.addTarget(new TargetPermanent(0, 1, StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL, false));
this.addAbility(ability);
// Enrage Whenever Apex Altisaur is dealt damage, it fights up to one target creature you don't control.
ability = new DealtDamageToSourceTriggeredAbility(effect, false, true);
ability.addTarget(new TargetPermanent(0, 1, filter, false));
ability.addTarget(new TargetPermanent(0, 1, StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL, false));
this.addAbility(ability);
}

View file

@ -11,11 +11,10 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.constants.TargetController;
import mage.counters.CounterType;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.target.TargetPermanent;
import mage.target.common.TargetControlledPermanent;
@ -30,12 +29,10 @@ public final class AyulaQueenAmongBears extends CardImpl {
private static final FilterPermanent filter = new FilterPermanent(SubType.BEAR, "another Bear");
private static final FilterPermanent filter2 = new FilterPermanent(SubType.BEAR, "Bear");
private static final FilterControlledPermanent filter3 = new FilterControlledPermanent("Bear you controls");
private static final FilterPermanent filter4 = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(AnotherPredicate.instance);
filter3.add(SubType.BEAR.getPredicate());
filter4.add(TargetController.NOT_YOU.getControllerPredicate());
}
public AyulaQueenAmongBears(UUID ownerId, CardSetInfo setInfo) {
@ -56,7 +53,7 @@ public final class AyulaQueenAmongBears extends CardImpl {
// Target Bear you control fights target creature you don't control.
Mode mode = new Mode(new FightTargetsEffect());
mode.addTarget(new TargetControlledPermanent(filter3));
mode.addTarget(new TargetPermanent(filter4));
mode.addTarget(new TargetPermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
ability.addMode(mode);
this.addAbility(ability);
}

View file

@ -11,8 +11,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import java.util.UUID;
@ -23,17 +22,11 @@ import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES;
*/
public final class BarrageOfBoulders extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public BarrageOfBoulders(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{R}");
// Barrage of Boulders deals 1 damage to each creature you don't control.
this.getSpellAbility().addEffect(new DamageAllEffect(1, filter));
this.getSpellAbility().addEffect(new DamageAllEffect(1, StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
// Ferocious - If you control a creature with power 4 or greater, creatures can't block this turn
Effect effect = new ConditionalRestrictionEffect(
Duration.EndOfTurn,
@ -44,7 +37,7 @@ public final class BarrageOfBoulders extends CardImpl {
this.getSpellAbility().addHint(FerociousHint.instance);
}
public BarrageOfBoulders(final BarrageOfBoulders card) {
private BarrageOfBoulders(final BarrageOfBoulders card) {
super(card);
}

View file

@ -1,7 +1,5 @@
package mage.cards.b;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
@ -11,35 +9,28 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class Blustersquall extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public Blustersquall(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{U}");
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{U}");
// Tap target creature you don't control.
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
this.getSpellAbility().addTarget(new TargetCreaturePermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
this.getSpellAbility().addEffect(new TapTargetEffect());
// Overload {3}{U} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.")
this.addAbility(new OverloadAbility(this, new BlustersqallTapAllEffect(filter), new ManaCostsImpl("{3}{U}")));
this.addAbility(new OverloadAbility(this, new BlustersqallTapAllEffect(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL), new ManaCostsImpl("{3}{U}")));
}
@ -57,13 +48,13 @@ class BlustersqallTapAllEffect extends OneShotEffect {
protected FilterCreaturePermanent filter;
public BlustersqallTapAllEffect(FilterCreaturePermanent filter) {
BlustersqallTapAllEffect(FilterCreaturePermanent filter) {
super(Outcome.Tap);
this.filter = filter;
staticText = "Tap each creature you don't control";
}
public BlustersqallTapAllEffect(final BlustersqallTapAllEffect effect) {
private BlustersqallTapAllEffect(final BlustersqallTapAllEffect effect) {
super(effect);
this.filter = effect.filter;
}

View file

@ -1,7 +1,5 @@
package mage.cards.c;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.TriggeredAbilityImpl;
@ -14,7 +12,7 @@ import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
@ -26,24 +24,19 @@ import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
import mage.target.targetpointer.FixedTarget;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class CapturedByTheConsulate extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent();
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public CapturedByTheConsulate(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{W}");
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}");
this.subtype.add(SubType.AURA);
// Enchant creature you don't control
TargetPermanent auraTarget = new TargetCreaturePermanent(filter);
TargetPermanent auraTarget = new TargetCreaturePermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL);
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.UnboostCreature));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
@ -54,10 +47,9 @@ public final class CapturedByTheConsulate extends CardImpl {
// Whenever an opponent casts a spell, if it has a single target, change the target to enchanted creature if able.
this.addAbility(new CapturedByTheConsulateTriggeredAbility(Zone.BATTLEFIELD, new CapturedByTheConsulateEffect()));
}
public CapturedByTheConsulate(final CapturedByTheConsulate card) {
private CapturedByTheConsulate(final CapturedByTheConsulate card) {
super(card);
}
@ -70,15 +62,14 @@ public final class CapturedByTheConsulate extends CardImpl {
class CapturedByTheConsulateTriggeredAbility extends TriggeredAbilityImpl {
/**
*
* @param zone
* @param effect
*/
public CapturedByTheConsulateTriggeredAbility(Zone zone, Effect effect) {
CapturedByTheConsulateTriggeredAbility(Zone zone, Effect effect) {
super(zone, effect, false);
}
public CapturedByTheConsulateTriggeredAbility(final CapturedByTheConsulateTriggeredAbility ability) {
private CapturedByTheConsulateTriggeredAbility(final CapturedByTheConsulateTriggeredAbility ability) {
super(ability);
}
@ -133,12 +124,12 @@ class CapturedByTheConsulateTriggeredAbility extends TriggeredAbilityImpl {
class CapturedByTheConsulateEffect extends OneShotEffect {
public CapturedByTheConsulateEffect() {
CapturedByTheConsulateEffect() {
super(Outcome.Benefit);
this.staticText = "change the target to enchanted creature if able";
}
public CapturedByTheConsulateEffect(final CapturedByTheConsulateEffect effect) {
private CapturedByTheConsulateEffect(final CapturedByTheConsulateEffect effect) {
super(effect);
}

View file

@ -1,7 +1,5 @@
package mage.cards.c;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
@ -14,42 +12,35 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCreaturePermanent;
import mage.target.targetpointer.FixedTarget;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class ChemistersTrick extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public ChemistersTrick(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{U}{R}");
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{U}{R}");
// Target creature you don't control gets -2/-0 until end of turn and attacks this turn if able.
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
this.getSpellAbility().addEffect(new BoostTargetEffect(-2,0, Duration.EndOfTurn));
this.getSpellAbility().addTarget(new TargetCreaturePermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
this.getSpellAbility().addEffect(new BoostTargetEffect(-2, 0, Duration.EndOfTurn));
this.getSpellAbility().addEffect(new AttacksIfAbleTargetEffect(Duration.EndOfTurn));
// Overload {3}{U}{R} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.")
OverloadAbility ability = new OverloadAbility(this, new BoostAllEffect(-2,0, Duration.EndOfTurn,filter,false), new ManaCostsImpl("{3}{U}{R}"));
ability.addEffect(new ChemistersTrickEffect(filter));
OverloadAbility ability = new OverloadAbility(this, new BoostAllEffect(-2, 0, Duration.EndOfTurn, StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL, false), new ManaCostsImpl("{3}{U}{R}"));
ability.addEffect(new ChemistersTrickEffect());
this.addAbility(ability);
}
public ChemistersTrick(final ChemistersTrick card) {
private ChemistersTrick(final ChemistersTrick card) {
super(card);
}
@ -61,22 +52,19 @@ public final class ChemistersTrick extends CardImpl {
class ChemistersTrickEffect extends OneShotEffect {
private FilterCreaturePermanent filter;
public ChemistersTrickEffect(FilterCreaturePermanent filter) {
ChemistersTrickEffect() {
super(Outcome.ReturnToHand);
staticText = "each creature you don't control attacks this turn if able";
this.filter = filter;
}
public ChemistersTrickEffect(final ChemistersTrickEffect effect) {
private ChemistersTrickEffect(final ChemistersTrickEffect effect) {
super(effect);
this.filter = effect.filter;
}
@Override
public boolean apply(Game game, Ability source) {
for (Permanent creature : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
for (Permanent creature : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL, source.getControllerId(), source.getSourceId(), game)) {
AttacksIfAbleTargetEffect effect = new AttacksIfAbleTargetEffect(Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(creature.getId()));
game.addEffect(effect, source);
@ -88,5 +76,4 @@ class ChemistersTrickEffect extends OneShotEffect {
public ChemistersTrickEffect copy() {
return new ChemistersTrickEffect(this);
}
}

View file

@ -7,8 +7,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
@ -19,12 +18,6 @@ import java.util.UUID;
*/
public final class ClearShot extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public ClearShot(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{G}");
@ -35,11 +28,11 @@ public final class ClearShot extends CardImpl {
// It deals damage equal to its power to target creature you don't control.
this.getSpellAbility().addEffect(new DamageWithPowerFromOneToAnotherTargetEffect("It"));
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); // second target
this.getSpellAbility().addTarget(new TargetCreaturePermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL)); // second target
}
public ClearShot(final ClearShot card) {
private ClearShot(final ClearShot card) {
super(card);
}

View file

@ -1,6 +1,5 @@
package mage.cards.d;
import java.util.UUID;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.cards.Card;
@ -8,36 +7,31 @@ import mage.cards.CardSetInfo;
import mage.cards.SplitCard;
import mage.constants.CardType;
import mage.constants.SpellAbilityType;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
* @author dustinconrad
*/
public final class DeadGone extends SplitCard {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public DeadGone(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{R}", "{2}{R}", SpellAbilityType.SPLIT);
// Dead
// Dead deals 2 damage to target creature.
getLeftHalfCard().getSpellAbility().addEffect(new DeadDamageEffect());
getLeftHalfCard().getSpellAbility().addEffect(new DamageTargetEffect(2, "Dead"));
getLeftHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent());
// Gone
// Return target creature you don't control to its owner's hand.
getRightHalfCard().getSpellAbility().addEffect(new ReturnToHandTargetEffect());
getRightHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
getRightHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
}
public DeadGone(final DeadGone card) {
private DeadGone(final DeadGone card) {
super(card);
}
@ -46,12 +40,3 @@ public final class DeadGone extends SplitCard {
return new DeadGone(this);
}
}
class DeadDamageEffect extends DamageTargetEffect {
public DeadDamageEffect() {
super(2);
// Full name of split card was displaying using DamageTargetEffect
staticText = "Dead deals 2 damage to target creature.";
}
}

View file

@ -12,9 +12,7 @@ import mage.abilities.effects.common.continuous.BoostControlledEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.players.Player;
import mage.target.TargetPermanent;
@ -27,13 +25,6 @@ import java.util.UUID;
*/
public final class DomriAnarchOfBolas extends CardImpl {
private static final FilterPermanent filter
= new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public DomriAnarchOfBolas(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{1}{R}{G}");
@ -52,7 +43,7 @@ public final class DomriAnarchOfBolas extends CardImpl {
// -2: Target creature you control fights target creature you don't control.
Ability ability = new LoyaltyAbility(new FightTargetsEffect(), -2);
ability.addTarget(new TargetControlledCreaturePermanent());
ability.addTarget(new TargetPermanent(filter));
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
this.addAbility(ability);
}

View file

@ -1,7 +1,5 @@
package mage.cards.d;
import java.util.UUID;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.continuous.BoostAllEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
@ -10,36 +8,29 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class Downsize extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public Downsize(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{U}");
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{U}");
// Target creature you don't control gets -4/-0 until end of turn.
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
this.getSpellAbility().addEffect(new BoostTargetEffect(-4,0, Duration.EndOfTurn));
this.getSpellAbility().addTarget(new TargetCreaturePermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
this.getSpellAbility().addEffect(new BoostTargetEffect(-4, 0, Duration.EndOfTurn));
// Overload {2}{U} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.")
this.addAbility(new OverloadAbility(this, new BoostAllEffect(-4,0, Duration.EndOfTurn,filter,false), new ManaCostsImpl("{2}{U}")));
this.addAbility(new OverloadAbility(this, new BoostAllEffect(-4, 0, Duration.EndOfTurn, StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL, false), new ManaCostsImpl("{2}{U}")));
}
public Downsize(final Downsize card) {
private Downsize(final Downsize card) {
super(card);
}

View file

@ -1,7 +1,5 @@
package mage.cards.d;
import java.util.UUID;
import mage.abilities.Mode;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.FightTargetsEffect;
@ -12,8 +10,8 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.TargetController;
import mage.counters.CounterType;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.common.FilterEnchantmentPermanent;
import mage.filter.common.FilterInstantOrSorcerySpell;
@ -22,19 +20,15 @@ import mage.target.TargetSpell;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author jeffwadsworth
*/
public final class DromokasCommand extends CardImpl {
private static final FilterEnchantmentPermanent filterEnchantment = new FilterEnchantmentPermanent("an enchantment");
private static final FilterCreaturePermanent filterCreature = new FilterCreaturePermanent("creature to put a +1/+1 counter on it");
private static final FilterCreaturePermanent filterUncontrolledCreature = new FilterCreaturePermanent("creature you don't control");
static {
filterUncontrolledCreature.add(TargetController.NOT_YOU.getControllerPredicate());
}
public DromokasCommand(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{G}{W}");
@ -69,12 +63,12 @@ public final class DromokasCommand extends CardImpl {
effect.setText("Target creature you control fights target creature you don't control");
mode.addEffect(effect);
mode.addTarget(new TargetControlledCreaturePermanent());
mode.addTarget(new TargetCreaturePermanent(filterUncontrolledCreature));
mode.addTarget(new TargetCreaturePermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
this.getSpellAbility().getModes().addMode(mode);
}
public DromokasCommand(final DromokasCommand card) {
private DromokasCommand(final DromokasCommand card) {
super(card);
}

View file

@ -1,7 +1,5 @@
package mage.cards.e;
import java.util.UUID;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.DamageAllEffect;
import mage.abilities.effects.common.DamageTargetEffect;
@ -9,32 +7,25 @@ import mage.abilities.keyword.OverloadAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class Electrickery extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public Electrickery(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{R}");
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{R}");
// Electrickery deals 1 damage to target creature you don't control.
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
this.getSpellAbility().addTarget(new TargetCreaturePermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
this.getSpellAbility().addEffect(new DamageTargetEffect(1));
// Overload {1}{R} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.")
this.addAbility(new OverloadAbility(this, new DamageAllEffect(1, filter), new ManaCostsImpl("{1}{R}")));
this.addAbility(new OverloadAbility(this, new DamageAllEffect(1, StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL), new ManaCostsImpl("{1}{R}")));
}
public Electrickery(final Electrickery card) {

View file

@ -1,7 +1,5 @@
package mage.cards.e;
import java.util.UUID;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.FightTargetsEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
@ -9,24 +7,18 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import mage.target.Target;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author fireshoes
*/
public final class EpicConfrontation extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public EpicConfrontation(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{G}");
@ -37,11 +29,11 @@ public final class EpicConfrontation extends CardImpl {
effect.setText("It fights target creature you don't control");
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
Target target = new TargetCreaturePermanent(filter);
Target target = new TargetCreaturePermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL);
this.getSpellAbility().addTarget(target);
}
public EpicConfrontation(final EpicConfrontation card) {
private EpicConfrontation(final EpicConfrontation card) {
super(card);
}

View file

@ -1,7 +1,5 @@
package mage.cards.f;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
@ -16,10 +14,9 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
@ -27,18 +24,13 @@ import mage.game.permanent.Permanent;
import mage.target.common.TargetCreaturePermanent;
import mage.target.targetpointer.FixedTarget;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class FoeRazerRegent extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public FoeRazerRegent(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{G}{G}");
this.subtype.add(SubType.DRAGON);
@ -50,14 +42,14 @@ public final class FoeRazerRegent extends CardImpl {
// When Foe-Razer Regent enters the battlefield, you may have it fight target creature you don't control.
Ability ability = new EntersBattlefieldTriggeredAbility(new FightTargetSourceEffect(), true);
ability.addTarget(new TargetCreaturePermanent(filter));
ability.addTarget(new TargetCreaturePermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
this.addAbility(ability);
// Whenever a creature you control fights, put two +1/+1 counters on it at the beginning of the next end step.
this.addAbility(new FoeRazerRegentTriggeredAbility());
}
public FoeRazerRegent(final FoeRazerRegent card) {
private FoeRazerRegent(final FoeRazerRegent card) {
super(card);
}
@ -69,11 +61,11 @@ public final class FoeRazerRegent extends CardImpl {
class FoeRazerRegentTriggeredAbility extends TriggeredAbilityImpl {
public FoeRazerRegentTriggeredAbility() {
FoeRazerRegentTriggeredAbility() {
super(Zone.BATTLEFIELD, new CreateDelayedTriggeredAbilityEffect(new FoeRazerRegentDelayedTriggeredAbility(), true), false);
}
public FoeRazerRegentTriggeredAbility(final FoeRazerRegentTriggeredAbility ability) {
private FoeRazerRegentTriggeredAbility(final FoeRazerRegentTriggeredAbility ability) {
super(ability);
}
@ -107,11 +99,11 @@ class FoeRazerRegentTriggeredAbility extends TriggeredAbilityImpl {
class FoeRazerRegentDelayedTriggeredAbility extends DelayedTriggeredAbility {
public FoeRazerRegentDelayedTriggeredAbility() {
FoeRazerRegentDelayedTriggeredAbility() {
super(new AddCountersTargetEffect(CounterType.P1P1.createInstance(2)));
}
public FoeRazerRegentDelayedTriggeredAbility(final FoeRazerRegentDelayedTriggeredAbility ability) {
private FoeRazerRegentDelayedTriggeredAbility(final FoeRazerRegentDelayedTriggeredAbility ability) {
super(ability);
}

View file

@ -1,4 +1,3 @@
package mage.cards.f;
import mage.Mana;
@ -15,6 +14,7 @@ import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.AbilityPredicate;
import mage.game.Game;
@ -25,24 +25,22 @@ import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class FrontierSiege extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("a creature with flying");
private static final FilterCreaturePermanent filter2 = new FilterCreaturePermanent("a creature you don't control");
static {
filter.add(TargetController.YOU.getControllerPredicate());
filter.add(new AbilityPredicate(FlyingAbility.class));
filter2.add(TargetController.NOT_YOU.getControllerPredicate());
}
private static final String ruleTrigger1 = "&bull Khans — At the beginning of each of your main phases, add {G}{G}.";
private static final String ruleTrigger2 = "&bull Dragons — Whenever a creature with flying enters the battlefield under your control, you may have it fight target creature you don't control.";
public FrontierSiege(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{G}");
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{G}");
// As Frontier Siege enters the battlefield, choose Khans or Dragons.
this.addAbility(new EntersBattlefieldAbility(new ChooseModeEffect("Khans or Dragons?", "Khans", "Dragons"), null,
@ -59,12 +57,12 @@ public final class FrontierSiege extends CardImpl {
new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, new FrontierSiegeFightEffect(), filter, true, SetTargetPointer.PERMANENT, ""),
new ModeChoiceSourceCondition("Dragons"),
ruleTrigger2);
ability2.addTarget(new TargetCreaturePermanent(filter2));
ability2.addTarget(new TargetCreaturePermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
this.addAbility(ability2);
}
public FrontierSiege(final FrontierSiege card) {
private FrontierSiege(final FrontierSiege card) {
super(card);
}
@ -76,12 +74,12 @@ public final class FrontierSiege extends CardImpl {
class FrontierSiegeKhansTriggeredAbility extends TriggeredAbilityImpl {
public FrontierSiegeKhansTriggeredAbility() {
FrontierSiegeKhansTriggeredAbility() {
super(Zone.BATTLEFIELD, new AddManaToManaPoolSourceControllerEffect(Mana.GreenMana(2)), false);
}
public FrontierSiegeKhansTriggeredAbility(final FrontierSiegeKhansTriggeredAbility ability) {
private FrontierSiegeKhansTriggeredAbility(final FrontierSiegeKhansTriggeredAbility ability) {
super(ability);
}
@ -114,7 +112,7 @@ class FrontierSiegeFightEffect extends OneShotEffect {
super(Outcome.Damage);
}
FrontierSiegeFightEffect(final FrontierSiegeFightEffect effect) {
private FrontierSiegeFightEffect(final FrontierSiegeFightEffect effect) {
super(effect);
}

View file

@ -9,15 +9,17 @@ import mage.abilities.effects.common.cost.SpellsCostReductionControllerEffect;
import mage.abilities.keyword.VigilanceAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.game.stack.Spell;
import mage.target.TargetPermanent;
import java.util.UUID;
@ -63,15 +65,9 @@ public final class GargosViciousWatcher extends CardImpl {
class GargosViciousWatcherTriggeredAbility extends TriggeredAbilityImpl {
private static final FilterPermanent filter = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
GargosViciousWatcherTriggeredAbility() {
super(Zone.BATTLEFIELD, new FightTargetSourceEffect());
this.addTarget(new TargetPermanent(0, 1, filter, false));
this.addTarget(new TargetPermanent(0, 1, StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL, false));
}
private GargosViciousWatcherTriggeredAbility(final GargosViciousWatcherTriggeredAbility ability) {
@ -99,7 +95,6 @@ class GargosViciousWatcherTriggeredAbility extends TriggeredAbilityImpl {
return false;
}
return object instanceof Spell; // must be a type of spell (instant, sorcery, or aura)
}
@Override

View file

@ -6,8 +6,7 @@ import mage.abilities.keyword.CyclingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
@ -18,20 +17,13 @@ import java.util.UUID;
*/
public final class GoForBlood extends CardImpl {
private static final FilterCreaturePermanent filter
= new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public GoForBlood(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{R}");
// Target creature you control fights target creature you don't control.
this.getSpellAbility().addEffect(new FightTargetsEffect());
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
this.getSpellAbility().addTarget(new TargetCreaturePermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
// Cycling {1}
this.addAbility(new CyclingAbility(new ManaCostsImpl("{1}")));

View file

@ -12,7 +12,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.counters.CounterType;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
@ -25,12 +25,6 @@ import java.util.UUID;
*/
public final class GwafaHazidProfiteer extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public GwafaHazidProfiteer(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}{U}");
addSuperType(SuperType.LEGENDARY);
@ -41,17 +35,16 @@ public final class GwafaHazidProfiteer extends CardImpl {
this.toughness = new MageInt(2);
// {W}{U}, {tap}: Put a bribery counter on target creature you don't control. Its controller draws a card.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GwafaHazidProfiteerEffect1(), new ManaCostsImpl("{W}{U}"));
Ability ability = new SimpleActivatedAbility(new GwafaHazidProfiteerEffect1(), new ManaCostsImpl("{W}{U}"));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetCreaturePermanent(filter));
ability.addTarget(new TargetCreaturePermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
this.addAbility(ability);
// Creatures with bribery counters on them can't attack or block.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GwafaHazidProfiteerEffect2()));
this.addAbility(new SimpleStaticAbility(new GwafaHazidProfiteerEffect2()));
}
public GwafaHazidProfiteer(final GwafaHazidProfiteer card) {
private GwafaHazidProfiteer(final GwafaHazidProfiteer card) {
super(card);
}
@ -68,7 +61,7 @@ class GwafaHazidProfiteerEffect1 extends OneShotEffect {
staticText = "Put a bribery counter on target creature you don't control. Its controller draws a card";
}
public GwafaHazidProfiteerEffect1(final GwafaHazidProfiteerEffect1 effect) {
private GwafaHazidProfiteerEffect1(final GwafaHazidProfiteerEffect1 effect) {
super(effect);
}
@ -96,12 +89,12 @@ class GwafaHazidProfiteerEffect1 extends OneShotEffect {
class GwafaHazidProfiteerEffect2 extends RestrictionEffect {
public GwafaHazidProfiteerEffect2() {
GwafaHazidProfiteerEffect2() {
super(Duration.WhileOnBattlefield);
staticText = "Creatures with bribery counters on them can't attack or block";
}
public GwafaHazidProfiteerEffect2(final GwafaHazidProfiteerEffect2 effect) {
private GwafaHazidProfiteerEffect2(final GwafaHazidProfiteerEffect2 effect) {
super(effect);
}

View file

@ -7,9 +7,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.target.Target;
import mage.target.TargetPermanent;
@ -23,18 +21,12 @@ import java.util.UUID;
*/
public final class HateMirage extends CardImpl {
private static final FilterPermanent filter = new FilterCreaturePermanent("creatures you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public HateMirage(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{R}");
// Choose up to two target creatures you don't control. For each of those creatures, create a token that's a copy of that creature. Those tokens gain haste. Exile them at the beginning of the next end step.
this.getSpellAbility().addEffect(new HateMirageEffect());
this.getSpellAbility().addTarget(new TargetPermanent(0, 2, filter, false));
this.getSpellAbility().addTarget(new TargetPermanent(0, 2, StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL, false));
}
private HateMirage(final HateMirage card) {

View file

@ -10,9 +10,8 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SuperType;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
@ -23,12 +22,6 @@ import java.util.UUID;
*/
public final class Helvault extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public Helvault(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
addSuperType(SuperType.LEGENDARY);
@ -42,14 +35,14 @@ public final class Helvault extends CardImpl {
// {7}, {T}: Exile target creature you don't control.
ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetForSourceEffect(), new GenericManaCost(7));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetCreaturePermanent(filter));
ability.addTarget(new TargetCreaturePermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
this.addAbility(ability);
// When Helvault is put into a graveyard from the battlefield, return all cards exiled with it to the battlefield under their owners' control.
this.addAbility(new DiesTriggeredAbility(new ReturnFromExileForSourceEffect(Zone.BATTLEFIELD)));
}
public Helvault(final Helvault card) {
private Helvault(final Helvault card) {
super(card);
}

View file

@ -10,6 +10,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.counters.CounterType;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
@ -21,14 +22,12 @@ import java.util.UUID;
public final class HuatliDinosaurKnight extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Dinosaur you control");
private static final FilterCreaturePermanent filter2 = new FilterCreaturePermanent("creature you don't control");
private static final FilterCreaturePermanent filter3 = new FilterCreaturePermanent("Dinosaurs");
private static final FilterCreaturePermanent filter2 = new FilterCreaturePermanent("Dinosaurs");
static {
filter.add(SubType.DINOSAUR.getPredicate());
filter.add(TargetController.YOU.getControllerPredicate());
filter2.add(TargetController.NOT_YOU.getControllerPredicate());
filter3.add(SubType.DINOSAUR.getPredicate());
filter2.add(SubType.DINOSAUR.getPredicate());
}
public HuatliDinosaurKnight(UUID ownerId, CardSetInfo setInfo) {
@ -49,14 +48,14 @@ public final class HuatliDinosaurKnight extends CardImpl {
// -3: Target Dinosaur you control deals damage equal to its power to target creature you don't control.
ability = new LoyaltyAbility(new DamageWithPowerFromOneToAnotherTargetEffect(), -3);
ability.addTarget(new TargetCreaturePermanent(filter));
ability.addTarget(new TargetCreaturePermanent(filter2));
ability.addTarget(new TargetCreaturePermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
this.addAbility(ability);
// -7: Dinosaurs you control get +4/+4 until end of turn.
this.addAbility(new LoyaltyAbility(new BoostControlledEffect(4, 4, Duration.EndOfTurn, filter3), -7));
this.addAbility(new LoyaltyAbility(new BoostControlledEffect(4, 4, Duration.EndOfTurn, filter2), -7));
}
public HuatliDinosaurKnight(final HuatliDinosaurKnight card) {
private HuatliDinosaurKnight(final HuatliDinosaurKnight card) {
super(card);
}

View file

@ -1,32 +1,24 @@
package mage.cards.h;
import java.util.UUID;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.FightTargetsEffect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TargetController;
import mage.counters.CounterType;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import mage.target.Target;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class HuntTheWeak extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public HuntTheWeak(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{G}");
@ -37,12 +29,11 @@ public final class HuntTheWeak extends CardImpl {
effect.setText("Then that creature fights target creature you don't control");
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
Target target = new TargetCreaturePermanent(filter);
Target target = new TargetCreaturePermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL);
this.getSpellAbility().addTarget(target);
}
public HuntTheWeak(final HuntTheWeak card) {
private HuntTheWeak(final HuntTheWeak card) {
super(card);
}
@ -50,5 +41,4 @@ public final class HuntTheWeak extends CardImpl {
public HuntTheWeak copy() {
return new HuntTheWeak(this);
}
}

View file

@ -1,7 +1,5 @@
package mage.cards.h;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
@ -14,30 +12,27 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.CounterAnyPredicate;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author Styxo
*/
public final class HunterOfEyeblights extends CardImpl {
private static final FilterCreaturePermanent filter1 = new FilterCreaturePermanent("creature you don't control");
private static final FilterCreaturePermanent filter2 = new FilterCreaturePermanent("creature with a counter on it");
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with a counter on it");
static {
filter1.add(TargetController.NOT_YOU.getControllerPredicate());
filter2.add(CounterAnyPredicate.instance);
filter.add(CounterAnyPredicate.instance);
}
public HunterOfEyeblights(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}{B}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}");
this.subtype.add(SubType.ELF);
this.subtype.add(SubType.ASSASSIN);
this.power = new MageInt(3);
@ -45,17 +40,17 @@ public final class HunterOfEyeblights extends CardImpl {
// When Hunter of Eyeblights enters the battlefield, put a +1/+1 counter on target creature you don't control
Ability ability = new EntersBattlefieldTriggeredAbility(new AddCountersTargetEffect(CounterType.P1P1.createInstance()));
ability.addTarget(new TargetCreaturePermanent(filter1));
ability.addTarget(new TargetCreaturePermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
this.addAbility(ability);
//{B}{2},{T}: Destroy target creature with a counter on it.
Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{2}{B}"));
Ability ability2 = new SimpleActivatedAbility(new DestroyTargetEffect(), new ManaCostsImpl("{2}{B}"));
ability2.addCost(new TapSourceCost());
ability2.addTarget(new TargetCreaturePermanent(filter2));
ability2.addTarget(new TargetCreaturePermanent(filter));
this.addAbility(ability2);
}
public HunterOfEyeblights(final HunterOfEyeblights card) {
private HunterOfEyeblights(final HunterOfEyeblights card) {
super(card);
}

View file

@ -1,7 +1,5 @@
package mage.cards.j;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
@ -12,25 +10,23 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.TargetController;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author Styxo
*/
public final class JediSentinel extends CardImpl {
private static final FilterControlledCreaturePermanent filter1 = new FilterControlledCreaturePermanent("another target creature you control");
private static final FilterCreaturePermanent filter2 = new FilterCreaturePermanent("creature you don't control");
static {
filter1.add(AnotherPredicate.instance);
filter2.add(TargetController.NOT_YOU.getControllerPredicate());
}
public JediSentinel(UUID ownerId, CardSetInfo setInfo) {
@ -48,12 +44,11 @@ public final class JediSentinel extends CardImpl {
effect.setText("return another target creature you control and target creature you don't control to their owners' hands");
Ability ability = new EntersBattlefieldTriggeredAbility(effect);
ability.addTarget(new TargetControlledCreaturePermanent(filter1));
ability.addTarget(new TargetCreaturePermanent(filter2));
ability.addTarget(new TargetCreaturePermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
this.addAbility(ability);
}
public JediSentinel(final JediSentinel card) {
private JediSentinel(final JediSentinel card) {
super(card);
}

View file

@ -6,9 +6,11 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
@ -22,20 +24,13 @@ import java.util.UUID;
*/
public final class Joust extends CardImpl {
private static final FilterPermanent filter
= new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public Joust(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{R}");
// Choose target creature you control and target creature you don't control. The creature you control gets +2/+1 until end of turn if it's a Knight. Then those creatures fight each other.
this.getSpellAbility().addEffect(new JoustEffect());
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
this.getSpellAbility().addTarget(new TargetPermanent(filter));
this.getSpellAbility().addTarget(new TargetPermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
}
private Joust(final Joust card) {

View file

@ -17,7 +17,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.counters.CounterType;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.ZoneChangeEvent;
@ -32,13 +32,6 @@ import java.util.UUID;
*/
public final class KelsienThePlague extends CardImpl {
private static final FilterCreaturePermanent filter
= new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public KelsienThePlague(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{R}{W}{B}");
@ -62,7 +55,7 @@ public final class KelsienThePlague extends CardImpl {
// {T}: Kelsien deals 1 damage to target creature you don't control. When that creature dies this turn, you get an experience counter.
Ability ability = new SimpleActivatedAbility(new KelsienThePlagueEffect(), new TapSourceCost());
ability.addTarget(new TargetPermanent(filter));
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
this.addAbility(ability);
}

View file

@ -13,11 +13,14 @@ import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
import mage.abilities.keyword.IndestructibleAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterArtifactOrEnchantmentPermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.DefendingPlayerControlsPredicate;
import mage.target.TargetPermanent;
@ -29,15 +32,12 @@ import java.util.UUID;
public final class KoglaTheTitanApe extends CardImpl {
private static final FilterPermanent filter
= new FilterCreaturePermanent("creature you don't control");
private static final FilterPermanent filter2
= new FilterArtifactOrEnchantmentPermanent("artifact or enchantment defending player controls");
private static final FilterPermanent filter3
private static final FilterPermanent filter2
= new FilterControlledPermanent(SubType.HUMAN);
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
filter2.add(DefendingPlayerControlsPredicate.instance);
filter.add(DefendingPlayerControlsPredicate.instance);
}
public KoglaTheTitanApe(UUID ownerId, CardSetInfo setInfo) {
@ -51,18 +51,18 @@ public final class KoglaTheTitanApe extends CardImpl {
// When Kogla, the Titan Ape enters the battlefield, it fights up to one target creature you don't control.
Ability ability = new EntersBattlefieldTriggeredAbility(new FightTargetSourceEffect()
.setText("it fights up to one target creature you don't control"));
ability.addTarget(new TargetPermanent(filter));
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
this.addAbility(ability);
// Whenever Kogla attacks, destroy target artifact or enchantment defending player controls.
ability = new AttacksTriggeredAbility(new DestroyTargetEffect(), false);
ability.addTarget(new TargetPermanent(filter2));
ability.addTarget(new TargetPermanent(filter));
this.addAbility(ability);
// {1}{G}: Return target Human you control to its owner's hand. Kogla gains indestructible until end of turn.
ability = new SimpleActivatedAbility(new ReturnToHandTargetEffect(), new ManaCostsImpl("{1}{G}"));
ability.addEffect(new GainAbilitySourceEffect(IndestructibleAbility.getInstance(), Duration.EndOfTurn));
ability.addTarget(new TargetPermanent(filter3));
ability.addTarget(new TargetPermanent(filter2));
this.addAbility(ability);
}

View file

@ -1,30 +1,26 @@
package mage.cards.l;
import java.util.UUID;
import mage.abilities.effects.common.counter.AddCountersAllEffect;
import mage.abilities.effects.common.search.SearchLibraryGraveyardPutInHandEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TargetController;
import mage.counters.CounterType;
import mage.filter.FilterCard;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import mage.filter.predicate.mageobject.NamePredicate;
import java.util.UUID;
/**
*
* @author fireshoes
*/
public final class LilianasInfluence extends CardImpl {
private static final FilterCard filter = new FilterCard("Liliana, Death Wielder");
private static final FilterCreaturePermanent filterCreatures = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(new NamePredicate("Liliana, Death Wielder"));
filterCreatures.add(TargetController.NOT_YOU.getControllerPredicate());
}
public LilianasInfluence(UUID ownerId, CardSetInfo setInfo) {
@ -32,11 +28,11 @@ public final class LilianasInfluence extends CardImpl {
// Put a -1/-1 counter on each creature you don't control. You may search your library and/or graveyard for a card named Liliana, Death Wielder,
// reveal it, and put it into your hand. If you search your library this way, shuffle it.
getSpellAbility().addEffect(new AddCountersAllEffect(CounterType.M1M1.createInstance(1), filterCreatures));
getSpellAbility().addEffect(new AddCountersAllEffect(CounterType.M1M1.createInstance(1), StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
getSpellAbility().addEffect(new SearchLibraryGraveyardPutInHandEffect(filter));
}
public LilianasInfluence(final LilianasInfluence card) {
private LilianasInfluence(final LilianasInfluence card) {
super(card);
}

View file

@ -7,8 +7,7 @@ import mage.abilities.keyword.OverloadAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
@ -18,25 +17,18 @@ import java.util.UUID;
*/
public final class MizziumMortars extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public MizziumMortars(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{R}");
// MizziumMortars deals 4 damage to target creature you don't control.
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
this.getSpellAbility().addTarget(new TargetCreaturePermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
this.getSpellAbility().addEffect(new DamageTargetEffect(4));
// Overload {3}{R}{R}{R} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.")
this.addAbility(new OverloadAbility(this, new DamageAllEffect(4, filter), new ManaCostsImpl("{3}{R}{R}{R}")));
this.addAbility(new OverloadAbility(this, new DamageAllEffect(4, StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL), new ManaCostsImpl("{3}{R}{R}{R}")));
}
public MizziumMortars(final MizziumMortars card) {
private MizziumMortars(final MizziumMortars card) {
super(card);
}

View file

@ -1,7 +1,5 @@
package mage.cards.m;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
@ -9,7 +7,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.TargetController;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.game.Game;
@ -17,27 +15,22 @@ import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class MoonlightHunt extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public MoonlightHunt(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{G}");
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{G}");
// Choose target creature you don't control. Each creature you control that's a Wolf or Werewolf deals damage equal to its power to that creature.
this.getSpellAbility().addEffect(new MoonlightHuntEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
this.getSpellAbility().addTarget(new TargetCreaturePermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
}
public MoonlightHunt(final MoonlightHunt card) {
private MoonlightHunt(final MoonlightHunt card) {
super(card);
}
@ -55,12 +48,12 @@ class MoonlightHuntEffect extends OneShotEffect {
filter.add(Predicates.or(SubType.WOLF.getPredicate(), SubType.WEREWOLF.getPredicate()));
}
public MoonlightHuntEffect() {
MoonlightHuntEffect() {
super(Outcome.Damage);
this.staticText = "Choose target creature you don't control. Each creature you control that's a Wolf or Werewolf deals damage equal to its power to that creature";
}
public MoonlightHuntEffect(final MoonlightHuntEffect effect) {
private MoonlightHuntEffect(final MoonlightHuntEffect effect) {
super(effect);
}

View file

@ -14,8 +14,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.ColoredManaSymbol;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
@ -53,12 +52,6 @@ class MythosOfIllunaEffect extends OneShotEffect {
new ManaWasSpentCondition(ColoredManaSymbol.R),
new ManaWasSpentCondition(ColoredManaSymbol.G)
);
private static final FilterCreaturePermanent filter
= new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
MythosOfIllunaEffect() {
super(Outcome.Benefit);
@ -90,7 +83,7 @@ class MythosOfIllunaEffect extends OneShotEffect {
MythosOfIllunaCondition.instance, "When this permanent enters the battlefield, " +
"if it's a creature, it fights up to one target creature you don't control."
);
ability.addTarget(new TargetPermanent(0, 1, filter, false));
ability.addTarget(new TargetPermanent(0, 1, StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL, false));
effect.addAdditionalAbilities(ability);
}
return effect.apply(game, source);

View file

@ -8,8 +8,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
@ -20,12 +19,6 @@ import java.util.UUID;
*/
public final class NaturesWay extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public NaturesWay(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{G}");
@ -38,10 +31,10 @@ public final class NaturesWay extends CardImpl {
// It deals damage equal to its power to target creature you don't control.
this.getSpellAbility().addEffect(new DamageWithPowerFromOneToAnotherTargetEffect("It"));
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); // second target
this.getSpellAbility().addTarget(new TargetCreaturePermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL)); // second target
}
public NaturesWay(final NaturesWay card) {
private NaturesWay(final NaturesWay card) {
super(card);
}

View file

@ -1,38 +1,29 @@
package mage.cards.o;
import java.util.UUID;
import mage.abilities.effects.common.DestroyAllEffect;
import mage.abilities.effects.common.counter.AddCountersAllEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TargetController;
import mage.counters.CounterType;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import java.util.UUID;
/**
*
* @author Styxo
*/
public final class Order66 extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public Order66(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{7}{B}{B}");
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{7}{B}{B}");
// Put a bounty counter on each creature you don't control, then destroy all creatures you don't control.
this.getSpellAbility().addEffect(new AddCountersAllEffect(CounterType.BOUNTY.createInstance(), filter));
this.getSpellAbility().addEffect(new DestroyAllEffect(filter));
this.getSpellAbility().addEffect(new AddCountersAllEffect(CounterType.BOUNTY.createInstance(), StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
this.getSpellAbility().addEffect(new DestroyAllEffect(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
}
public Order66(final Order66 card) {
private Order66(final Order66 card) {
super(card);
}

View file

@ -11,9 +11,8 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.counters.CounterType;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
@ -28,13 +27,6 @@ import java.util.UUID;
*/
public final class Outmuscle extends CardImpl {
private static final FilterCreaturePermanent filter
= new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public Outmuscle(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{G}");
@ -42,7 +34,7 @@ public final class Outmuscle extends CardImpl {
// Adamant If at least three green mana was spent to cast this spell, the creature you control gains indestructible until end of turn.
this.getSpellAbility().addEffect(new OutmuscleEffect());
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
this.getSpellAbility().addTarget(new TargetPermanent(filter));
this.getSpellAbility().addTarget(new TargetPermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
this.getSpellAbility().addWatcher(new ManaSpentToCastWatcher());
}

View file

@ -1,44 +1,35 @@
package mage.cards.p;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author North
*/
public final class PeelFromReality extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public PeelFromReality(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{U}");
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}");
// Return target creature you control and target creature you don't control to their owners' hands.
this.getSpellAbility().addEffect(new PeelFromRealityEffect());
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
this.getSpellAbility().addTarget(new TargetCreaturePermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
}
public PeelFromReality(final PeelFromReality card) {
private PeelFromReality(final PeelFromReality card) {
super(card);
}
@ -50,12 +41,12 @@ public final class PeelFromReality extends CardImpl {
class PeelFromRealityEffect extends OneShotEffect {
public PeelFromRealityEffect() {
PeelFromRealityEffect() {
super(Outcome.ReturnToHand);
this.staticText = "Return target creature you control and target creature you don't control to their owners' hands";
}
public PeelFromRealityEffect(final PeelFromRealityEffect effect) {
private PeelFromRealityEffect(final PeelFromRealityEffect effect) {
super(effect);
}

View file

@ -8,9 +8,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.TargetController;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import mage.target.TargetPermanent;
import java.util.UUID;
@ -20,13 +18,6 @@ import java.util.UUID;
*/
public final class PheresBandBrawler extends CardImpl {
private static final FilterPermanent filter
= new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public PheresBandBrawler(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{G}{G}");
@ -38,7 +29,7 @@ public final class PheresBandBrawler extends CardImpl {
// When Pheres-Band Brawler enters the battlefield, it fights up to one target creature you don't control.
Ability ability = new EntersBattlefieldTriggeredAbility(new FightTargetSourceEffect()
.setText("it fights up to one target creature you don't control"));
ability.addTarget(new TargetPermanent(0, 1, filter, false));
ability.addTarget(new TargetPermanent(0, 1, StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL, false));
this.addAbility(ability);
}

View file

@ -1,37 +1,27 @@
package mage.cards.p;
import java.util.UUID;
import mage.abilities.effects.common.FightTargetsEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.target.Target;
import mage.filter.StaticFilters;
import mage.target.TargetPermanent;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class Pounce extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public Pounce(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{G}");
// Target creature you control fights target creature you don't control.
this.getSpellAbility().addEffect(new FightTargetsEffect());
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
Target target = new TargetCreaturePermanent(filter);
this.getSpellAbility().addTarget(target);
this.getSpellAbility().addTarget(new TargetPermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
}
public Pounce(final Pounce card) {

View file

@ -1,33 +1,28 @@
package mage.cards.p;
import java.util.UUID;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.*;
import mage.abilities.effects.common.FightTargetsEffect;
import mage.abilities.effects.common.UntapTargetEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.keyword.AftermathAbility;
import mage.abilities.keyword.LifelinkAbility;
import mage.cards.CardSetInfo;
import mage.cards.SplitCard;
import mage.constants.*;
import mage.filter.common.FilterCreaturePermanent;
import mage.target.Target;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SpellAbilityType;
import mage.filter.StaticFilters;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author stravant
*/
public final class PrepareFight extends SplitCard {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public PrepareFight(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, new CardType[]{CardType.SORCERY}, "{1}{W}", "{3}{G}", SpellAbilityType.SPLIT_AFTERMATH);
@ -50,11 +45,10 @@ public final class PrepareFight extends SplitCard {
getRightHalfCard().addAbility(new AftermathAbility().setRuleAtTheTop(true));
getRightHalfCard().getSpellAbility().addEffect(new FightTargetsEffect());
getRightHalfCard().getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
Target target = new TargetCreaturePermanent(filter);
getRightHalfCard().getSpellAbility().addTarget(target);
getRightHalfCard().getSpellAbility().addTarget(new TargetCreaturePermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
}
public PrepareFight(final PrepareFight card) {
private PrepareFight(final PrepareFight card) {
super(card);
}

View file

@ -1,41 +1,30 @@
package mage.cards.p;
import java.util.UUID;
import mage.abilities.effects.common.FightTargetsEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.target.Target;
import mage.filter.StaticFilters;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author BetaSteward
*/
public final class PreyUpon extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public PreyUpon(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{G}");
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{G}");
// Target creature you control fights target creature you don't control.
this.getSpellAbility().addEffect(new FightTargetsEffect());
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
Target target = new TargetCreaturePermanent(filter);
this.getSpellAbility().addTarget(target);
this.getSpellAbility().addTarget(new TargetCreaturePermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
}
public PreyUpon(final PreyUpon card) {
private PreyUpon(final PreyUpon card) {
super(card);
}

View file

@ -1,7 +1,5 @@
package mage.cards.p;
import java.util.UUID;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.UntapTargetEffect;
@ -10,37 +8,31 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class Provoke extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public Provoke(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{G}");
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{G}");
// Untap target creature you don't control. That creature blocks this turn if able.
this.getSpellAbility().addEffect(new UntapTargetEffect());
Effect effect = new BlocksIfAbleTargetEffect(Duration.EndOfTurn);
effect.setText("That creature blocks this turn if able");
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
this.getSpellAbility().addTarget(new TargetCreaturePermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
// Draw a card.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1));
}
public Provoke(final Provoke card) {
private Provoke(final Provoke card) {
super(card);
}

View file

@ -4,8 +4,7 @@ import mage.abilities.effects.common.DamageWithPowerFromOneToAnotherTargetEffect
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
@ -16,22 +15,16 @@ import java.util.UUID;
*/
public final class RabidBite extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public RabidBite(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{G}");
// Target creature you control deals damage equal to its power to target creature you don't control.
this.getSpellAbility().addEffect(new DamageWithPowerFromOneToAnotherTargetEffect());
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
this.getSpellAbility().addTarget(new TargetCreaturePermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
}
public RabidBite(final RabidBite card) {
private RabidBite(final RabidBite card) {
super(card);
}

View file

@ -8,8 +8,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
@ -25,20 +24,13 @@ import static mage.game.combat.CombatGroup.getLethalDamage;
*/
public final class RamThrough extends CardImpl {
private static final FilterCreaturePermanent filter
= new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public RamThrough(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{G}");
// Target creature you control deals damage equal to its power to target creature you don't control. If the creature you control has trample, excess damage is dealt to that creature's controller instead.
this.getSpellAbility().addEffect(new RamThroughEffect());
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
this.getSpellAbility().addTarget(new TargetCreaturePermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
}
private RamThrough(final RamThrough card) {

View file

@ -12,9 +12,8 @@ import mage.cards.CardSetInfo;
import mage.constants.AbilityType;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.TargetController;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import mage.filter.predicate.Predicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
@ -28,13 +27,10 @@ import java.util.UUID;
public final class RavagerWurm extends CardImpl {
private static final FilterPermanent filter
= new FilterCreaturePermanent("creature you don't control");
private static final FilterPermanent filter2
= new FilterPermanent("land with an activated ability that isn't a mana ability");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
filter2.add(RavagerWurmPredicate.instance);
filter.add(RavagerWurmPredicate.instance);
}
public RavagerWurm(UUID ownerId, CardSetInfo setInfo) {
@ -52,13 +48,13 @@ public final class RavagerWurm extends CardImpl {
Ability ability = new EntersBattlefieldTriggeredAbility(
new FightTargetSourceEffect().setText("{this} fights target creature you don't control"), false
);
ability.addTarget(new TargetPermanent(filter));
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
ability.getModes().setMinModes(0);
ability.getModes().setMaxModes(1);
// Destroy target land with an activated ability that isn't a mana ability.
Mode mode = new Mode(new DestroyTargetEffect());
mode.addTarget(new TargetPermanent(filter2));
mode.addTarget(new TargetPermanent(filter));
ability.addMode(mode);
this.addAbility(ability);
}
@ -78,14 +74,11 @@ enum RavagerWurmPredicate implements Predicate<Permanent> {
@Override
public boolean apply(Permanent input, Game game) {
if (input == null || !input.isLand()) {
return false;
}
for (Ability ability : input.getAbilities()) {
if (ability.getAbilityType() == AbilityType.ACTIVATED) {
return true;
}
}
return false;
return input != null && input.isLand()
&& input
.getAbilities(game)
.stream()
.map(Ability::getAbilityType)
.anyMatch(AbilityType.ACTIVATED::equals);
}
}

View file

@ -1,16 +1,16 @@
package mage.cards.r;
import java.util.UUID;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.common.FilterCreaturePermanent;
import mage.constants.CardType;
import mage.filter.StaticFilters;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
import mage.target.targetpointer.SecondTargetPointer;
import java.util.UUID;
/**
* @author JayDi85
*/
@ -20,9 +20,7 @@ public final class RecklessRage extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{R}");
// Reckless Rage deals 4 damage to target creature you don't control and 2 damage to target creature you control.
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control");
filter.add(TargetController.NOT_YOU.getControllerPredicate());
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
this.getSpellAbility().addTarget(new TargetCreaturePermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
this.getSpellAbility().addEffect(new DamageTargetEffect(4).setUseOnlyTargetPointer(true));
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
this.getSpellAbility().addEffect(new DamageTargetEffect(2).setUseOnlyTargetPointer(true)
@ -30,7 +28,7 @@ public final class RecklessRage extends CardImpl {
.setTargetPointer(new SecondTargetPointer()));
}
public RecklessRage(final RecklessRage card) {
private RecklessRage(final RecklessRage card) {
super(card);
}

View file

@ -11,8 +11,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import mage.target.Target;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
@ -24,12 +23,6 @@ import java.util.UUID;
*/
public final class SavagePunch extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public SavagePunch(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{G}");
@ -46,11 +39,11 @@ public final class SavagePunch extends CardImpl {
effect.setText("<br/>Target creature you control fights target creature you don't control");
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
Target target = new TargetCreaturePermanent(filter);
Target target = new TargetCreaturePermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL);
this.getSpellAbility().addTarget(target);
}
public SavagePunch(final SavagePunch card) {
private SavagePunch(final SavagePunch card) {
super(card);
}

View file

@ -6,8 +6,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
@ -18,13 +17,6 @@ import java.util.UUID;
*/
public final class SavageSmash extends CardImpl {
private static final FilterCreaturePermanent filter
= new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public SavageSmash(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{R}{G}");
@ -34,7 +26,7 @@ public final class SavageSmash extends CardImpl {
new FightTargetsEffect().setText("It fights target creature you don't control")
);
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
this.getSpellAbility().addTarget(new TargetCreaturePermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
}
private SavageSmash(final SavageSmash card) {

View file

@ -1,4 +1,3 @@
package mage.cards.s;
import mage.abilities.common.SimpleStaticAbility;
@ -12,13 +11,11 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.target.Target;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
@ -29,16 +26,10 @@ import java.util.UUID;
*/
public final class SavageStomp extends CardImpl {
private static final FilterCreaturePermanent filter
= new FilterCreaturePermanent("creature you don't control");
private static final FilterPermanent filter2
private static final FilterPermanent filter
= new FilterControlledCreaturePermanent(SubType.DINOSAUR, "a Dinosaur you control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
private static final Condition condition = new SourceTargetsPermanentCondition(filter2);
private static final Condition condition = new SourceTargetsPermanentCondition(filter);
public SavageStomp(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{G}");
@ -55,11 +46,10 @@ public final class SavageStomp extends CardImpl {
effect.setText("Then that creature fights target creature you don't control");
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
Target target = new TargetCreaturePermanent(filter);
this.getSpellAbility().addTarget(target);
this.getSpellAbility().addTarget(new TargetCreaturePermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
}
public SavageStomp(final SavageStomp card) {
private SavageStomp(final SavageStomp card) {
super(card);
}

View file

@ -10,9 +10,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
@ -26,19 +24,13 @@ import java.util.UUID;
*/
public final class SavageSwipe extends CardImpl {
private static final FilterPermanent filter = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public SavageSwipe(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{G}");
// Target creature you control gets +2/+2 until end of turn if its power is 2. Then it fights target creature you don't control.
this.getSpellAbility().addEffect(new SavageSwipeEffect());
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
this.getSpellAbility().addTarget(new TargetPermanent(filter));
this.getSpellAbility().addTarget(new TargetPermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
}
private SavageSwipe(final SavageSwipe card) {

View file

@ -7,9 +7,7 @@ import mage.abilities.effects.common.ReturnToBattlefieldUnderOwnerControlTargetE
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TargetController;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import mage.target.TargetPermanent;
import mage.target.common.TargetControlledCreaturePermanent;
@ -20,12 +18,6 @@ import java.util.UUID;
*/
public final class SettleBeyondReality extends CardImpl {
private static final FilterPermanent filter = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public SettleBeyondReality(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{W}");
@ -35,7 +27,7 @@ public final class SettleBeyondReality extends CardImpl {
// Exile target creature you don't control.
this.getSpellAbility().addEffect(new ExileTargetEffect());
this.getSpellAbility().addTarget(new TargetPermanent(filter));
this.getSpellAbility().addTarget(new TargetPermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
// Exile target creature you control, then return it to the battlefield under its owner's control.
Mode mode = new Mode(new ExileTargetForSourceEffect());

View file

@ -1,7 +1,5 @@
package mage.cards.s;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
@ -11,37 +9,31 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class SomberwaldStag extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public SomberwaldStag(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{G}{G}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{G}{G}");
this.subtype.add(SubType.ELK);
this.power = new MageInt(4);
this.toughness = new MageInt(3);
// When Somberwald Stag enters the battlefield, you may have it fight target creature you don't control.
Effect effect = new FightTargetSourceEffect();
effect.setText("you may have it fight target creature you don't control");
effect.setText("have it fight target creature you don't control");
Ability ability = new EntersBattlefieldTriggeredAbility(effect, true);
ability.addTarget(new TargetCreaturePermanent(filter));
ability.addTarget(new TargetCreaturePermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
this.addAbility(ability);
}
public SomberwaldStag(final SomberwaldStag card) {
private SomberwaldStag(final SomberwaldStag card) {
super(card);
}

View file

@ -1,7 +1,5 @@
package mage.cards.s;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.common.CastOnlyDuringPhaseStepSourceAbility;
@ -17,27 +15,21 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.constants.TurnPhase;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetPermanent;
import mage.target.targetpointer.FixedTarget;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class SpinalEmbrace extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public SpinalEmbrace(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{U}{U}{B}");
@ -45,7 +37,7 @@ public final class SpinalEmbrace extends CardImpl {
this.addAbility(new CastOnlyDuringPhaseStepSourceAbility(TurnPhase.COMBAT));
// Untap target creature you don't control and gain control of it. It gains haste until end of turn. At the beginning of the next end step, sacrifice it. If you do, you gain life equal to its toughness.
this.getSpellAbility().addTarget(new TargetPermanent(filter));
this.getSpellAbility().addTarget(new TargetPermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
this.getSpellAbility().addEffect(new UntapTargetEffect());
Effect effect = new GainControlTargetEffect(Duration.EndOfTurn);
effect.setText("and gain control of it");
@ -54,7 +46,7 @@ public final class SpinalEmbrace extends CardImpl {
this.getSpellAbility().addEffect(new SpinalEmbraceAddDelayedEffect());
}
public SpinalEmbrace(final SpinalEmbrace card) {
private SpinalEmbrace(final SpinalEmbrace card) {
super(card);
}
@ -66,12 +58,12 @@ public final class SpinalEmbrace extends CardImpl {
class SpinalEmbraceAddDelayedEffect extends OneShotEffect {
public SpinalEmbraceAddDelayedEffect() {
SpinalEmbraceAddDelayedEffect() {
super(Outcome.Sacrifice);
staticText = "At the beginning of the next end step, sacrifice it. If you do, you gain life equal to its toughness";
}
public SpinalEmbraceAddDelayedEffect(final SpinalEmbraceAddDelayedEffect effect) {
private SpinalEmbraceAddDelayedEffect(final SpinalEmbraceAddDelayedEffect effect) {
super(effect);
}
@ -92,12 +84,12 @@ class SpinalEmbraceAddDelayedEffect extends OneShotEffect {
class SpinalEmbraceSacrificeEffect extends OneShotEffect {
public SpinalEmbraceSacrificeEffect() {
SpinalEmbraceSacrificeEffect() {
super(Outcome.Benefit);
this.staticText = "sacrifice it. If you do, you gain life equal to its toughness";
}
public SpinalEmbraceSacrificeEffect(final SpinalEmbraceSacrificeEffect effect) {
private SpinalEmbraceSacrificeEffect(final SpinalEmbraceSacrificeEffect effect) {
super(effect);
}

View file

@ -10,12 +10,9 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.TargetController;
import mage.counters.CounterType;
import mage.filter.FilterCard;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.common.FilterNonlandCard;
import mage.filter.predicate.Predicates;
import mage.game.permanent.token.TreasureToken;
@ -29,11 +26,9 @@ import java.util.UUID;
public final class SurlyBadgersaur extends CardImpl {
private static final FilterCard filter = new FilterNonlandCard("a noncreature, nonland card");
private static final FilterPermanent filter2 = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(Predicates.not(CardType.CREATURE.getPredicate()));
filter2.add(TargetController.NOT_YOU.getControllerPredicate());
}
public SurlyBadgersaur(UUID ownerId, CardSetInfo setInfo) {
@ -62,7 +57,7 @@ public final class SurlyBadgersaur extends CardImpl {
"{this} fights up to one target creature you don't control"
), false, filter
);
ability.addTarget(new TargetPermanent(0, 1, filter2, false));
ability.addTarget(new TargetPermanent(0, 1, StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL, false));
this.addAbility(ability);
}

View file

@ -1,7 +1,5 @@
package mage.cards.s;
import java.util.UUID;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.FightTargetsEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
@ -9,24 +7,17 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.target.Target;
import mage.filter.StaticFilters;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class SwiftKick extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public SwiftKick(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{R}");
@ -38,12 +29,10 @@ public final class SwiftKick extends CardImpl {
effect = new FightTargetsEffect();
effect.setText("It fights target creature you don't control");
this.getSpellAbility().addEffect(effect);
Target target = new TargetCreaturePermanent(filter);
this.getSpellAbility().addTarget(target);
this.getSpellAbility().addTarget(new TargetCreaturePermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
}
public SwiftKick(final SwiftKick card) {
private SwiftKick(final SwiftKick card) {
super(card);
}

View file

@ -4,8 +4,7 @@ import mage.abilities.effects.common.DamageWithPowerFromOneToAnotherTargetEffect
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
@ -16,22 +15,16 @@ import java.util.UUID;
*/
public final class TailSlash extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public TailSlash(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{R}");
// Target creature you control deals damage equal to its power to target creature you don't control.
this.getSpellAbility().addEffect(new DamageWithPowerFromOneToAnotherTargetEffect());
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
this.getSpellAbility().addTarget(new TargetCreaturePermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
}
public TailSlash(final TailSlash card) {
private TailSlash(final TailSlash card) {
super(card);
}

View file

@ -1,7 +1,5 @@
package mage.cards.t;
import java.util.UUID;
import mage.abilities.Mode;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.Effect;
@ -14,7 +12,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.ComparisonType;
import mage.constants.Duration;
import mage.constants.TargetController;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.PowerPredicate;
import mage.target.Target;
@ -22,17 +20,16 @@ import mage.target.TargetSpell;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class TemurCharm extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control");
private static final FilterCreaturePermanent filterCantBlock = new FilterCreaturePermanent("Creatures with power 3 or less");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
filterCantBlock.add(new PowerPredicate(ComparisonType.FEWER_THAN, 4));
}
@ -47,7 +44,7 @@ public final class TemurCharm extends CardImpl {
effect.setText("It fights target creature you don't control");
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
Target target = new TargetCreaturePermanent(filter);
Target target = new TargetCreaturePermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL);
this.getSpellAbility().addTarget(target);
// Counter target spell unless its controller pays {3}.
@ -60,7 +57,6 @@ public final class TemurCharm extends CardImpl {
mode = new Mode();
mode.addEffect(new CantBlockAllEffect(filterCantBlock, Duration.EndOfTurn));
this.getSpellAbility().addMode(mode);
}
private TemurCharm(final TemurCharm card) {

View file

@ -1,7 +1,5 @@
package mage.cards.t;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
@ -11,30 +9,24 @@ import mage.abilities.effects.keyword.ManifestEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class TemurWarShaman extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public TemurWarShaman(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{G}{G}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{G}{G}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.SHAMAN);
this.power = new MageInt(4);
@ -45,11 +37,11 @@ public final class TemurWarShaman extends CardImpl {
// Whenever a permanent you control is turned face up, if it is a creature, you may have it fight target creature you don't control.
Ability ability = new TemurWarShamanTriggeredAbility();
ability.addTarget(new TargetCreaturePermanent(filter));
ability.addTarget(new TargetCreaturePermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
this.addAbility(ability);
}
public TemurWarShaman(final TemurWarShaman card) {
private TemurWarShaman(final TemurWarShaman card) {
super(card);
}
@ -61,11 +53,11 @@ public final class TemurWarShaman extends CardImpl {
class TemurWarShamanTriggeredAbility extends TurnedFaceUpAllTriggeredAbility {
public TemurWarShamanTriggeredAbility() {
TemurWarShamanTriggeredAbility() {
super(Zone.BATTLEFIELD, new TemurWarShamanFightEffect(), new FilterControlledCreaturePermanent(), true, true);
}
public TemurWarShamanTriggeredAbility(final TemurWarShamanTriggeredAbility ability) {
private TemurWarShamanTriggeredAbility(final TemurWarShamanTriggeredAbility ability) {
super(ability);
}
@ -86,7 +78,7 @@ class TemurWarShamanFightEffect extends OneShotEffect {
super(Outcome.Damage);
}
TemurWarShamanFightEffect(final TemurWarShamanFightEffect effect) {
private TemurWarShamanFightEffect(final TemurWarShamanFightEffect effect) {
super(effect);
}

View file

@ -11,10 +11,12 @@ import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SagaChapter;
import mage.constants.SubType;
import mage.counters.CounterType;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import mage.target.TargetPermanent;
import mage.target.Targets;
import mage.target.common.TargetControlledCreaturePermanent;
@ -28,11 +30,6 @@ import java.util.UUID;
public final class TheTriumphOfAnax extends CardImpl {
private static final DynamicValue xValue = new CountersSourceCount(CounterType.LORE);
private static final FilterPermanent filter = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public TheTriumphOfAnax(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}");
@ -61,7 +58,7 @@ public final class TheTriumphOfAnax extends CardImpl {
"Target creature you control fights up to one target creature you don't control"
)), new Targets(
new TargetControlledCreaturePermanent(),
new TargetPermanent(0, 1, filter, false)
new TargetPermanent(0, 1, StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL, false)
)
);
this.addAbility(sagaAbility);

View file

@ -9,10 +9,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.TargetController;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.target.TargetPermanent;
import java.util.UUID;
@ -22,12 +19,6 @@ import java.util.UUID;
*/
public final class ThornMammoth extends CardImpl {
private static final FilterPermanent filter = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public ThornMammoth(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{G}{G}");
@ -44,7 +35,7 @@ public final class ThornMammoth extends CardImpl {
"Whenever {this} or another creature enters the battlefield under your control, " +
"{this} fights up to one target creature you don't control."
);
ability.addTarget(new TargetPermanent(0, 1, filter, false));
ability.addTarget(new TargetPermanent(0, 1, StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL, false));
this.addAbility(ability);
}

View file

@ -8,12 +8,11 @@ import mage.abilities.effects.common.cost.SpellCostReductionSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.CounterPredicate;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
@ -25,17 +24,14 @@ import java.util.UUID;
*/
public final class TitanicBrawl extends CardImpl {
private static final FilterCreaturePermanent filter
= new FilterCreaturePermanent("creature you don't control");
private static final FilterPermanent filter2
private static final FilterPermanent filter
= new FilterControlledCreaturePermanent("a creature you control with a +1/+1 counter on it");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
filter2.add(new CounterPredicate(CounterType.P1P1));
filter.add(new CounterPredicate(CounterType.P1P1));
}
private static final Condition condition = new SourceTargetsPermanentCondition(filter2);
private static final Condition condition = new SourceTargetsPermanentCondition(filter);
public TitanicBrawl(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{G}");
@ -48,7 +44,7 @@ public final class TitanicBrawl extends CardImpl {
// Target creature you control fights target creature you don't control.
this.getSpellAbility().addEffect(new FightTargetsEffect());
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
this.getSpellAbility().addTarget(new TargetCreaturePermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
}
private TitanicBrawl(final TitanicBrawl card) {

View file

@ -1,6 +1,5 @@
package mage.cards.u;
import java.util.UUID;
import mage.abilities.effects.common.FightTargetsEffect;
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
import mage.abilities.keyword.DeathtouchAbility;
@ -8,25 +7,17 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.TargetController;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author TheElk801
*/
public final class UndercityUprising extends CardImpl {
private static final FilterCreaturePermanent filter
= new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public UndercityUprising(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{B}{G}");
@ -38,10 +29,10 @@ public final class UndercityUprising extends CardImpl {
this.getSpellAbility().addEffect(new FightTargetsEffect()
.setText("Then target creature you control fights target creature you don't control"));
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
this.getSpellAbility().addTarget(new TargetCreaturePermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
}
public UndercityUprising(final UndercityUprising card) {
private UndercityUprising(final UndercityUprising card) {
super(card);
}

View file

@ -1,34 +1,27 @@
package mage.cards.v;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.InvertCondition;
import mage.abilities.condition.Condition;
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
import mage.abilities.decorator.ConditionalContinuousEffect;
import mage.abilities.effects.common.CantBeCounteredSourceEffect;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.constants.SubType;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.constants.*;
import mage.filter.StaticFilters;
import java.util.UUID;
/**
*
* @author TheElk801
*/
public final class VexingBeetle extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.OPPONENT.getControllerPredicate());
}
private static final Condition condition = new PermanentsOnTheBattlefieldCondition(
StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURE, ComparisonType.EQUAL_TO, 0, false
);
public VexingBeetle(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{G}");
@ -41,14 +34,13 @@ public final class VexingBeetle extends CardImpl {
this.addAbility(new SimpleStaticAbility(Zone.STACK, new CantBeCounteredSourceEffect()));
// Vexing Beetle gets +3/+3 as long as no opponent controls a creature.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(
this.addAbility(new SimpleStaticAbility(new ConditionalContinuousEffect(
new BoostSourceEffect(3, 3, Duration.WhileOnBattlefield),
new InvertCondition(new PermanentsOnTheBattlefieldCondition(filter)),
"{this} gets +3/+3 as long as no opponent controls a creature")
));
condition, "{this} gets +3/+3 as long as no opponent controls a creature"
)));
}
public VexingBeetle(final VexingBeetle card) {
private VexingBeetle(final VexingBeetle card) {
super(card);
}

View file

@ -10,10 +10,12 @@ import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.counters.CounterType;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
@ -24,12 +26,6 @@ import java.util.UUID;
*/
public final class VivienOfTheArkbow extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public VivienOfTheArkbow(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{4}{G}{G}");
@ -45,7 +41,7 @@ public final class VivienOfTheArkbow extends CardImpl {
// 3: Target creature you control deals damage equal to its power to target creature you don't control.
ability = new LoyaltyAbility(new DamageWithPowerFromOneToAnotherTargetEffect(), -3);
ability.addTarget(new TargetControlledCreaturePermanent());
ability.addTarget(new TargetCreaturePermanent(filter));
ability.addTarget(new TargetCreaturePermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
this.addAbility(ability);
// 9: Creatures you control get +4/+4 and gain trample until end of turn.
@ -61,7 +57,7 @@ public final class VivienOfTheArkbow extends CardImpl {
this.addAbility(ability);
}
public VivienOfTheArkbow(final VivienOfTheArkbow card) {
private VivienOfTheArkbow(final VivienOfTheArkbow card) {
super(card);
}

View file

@ -8,6 +8,7 @@ import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SuperType;
import mage.constants.TargetController;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.Predicates;
@ -35,7 +36,7 @@ public final class VolcanicOffering extends CardImpl {
this.getSpellAbility().setTargetAdjuster(VolcanicOfferingAdjuster.instance);
}
public VolcanicOffering(final VolcanicOffering card) {
private VolcanicOffering(final VolcanicOffering card) {
super(card);
}
@ -48,12 +49,10 @@ public final class VolcanicOffering extends CardImpl {
enum VolcanicOfferingAdjuster implements TargetAdjuster {
instance;
private static final FilterLandPermanent filterLand = new FilterLandPermanent("nonbasic land you don't control");
private static final FilterCreaturePermanent filterCreature = new FilterCreaturePermanent("creature you don't control");
static {
filterLand.add(TargetController.NOT_YOU.getControllerPredicate());
filterLand.add(Predicates.not(SuperType.BASIC.getPredicate()));
filterCreature.add(TargetController.NOT_YOU.getControllerPredicate());
}
@Override
@ -69,7 +68,7 @@ enum VolcanicOfferingAdjuster implements TargetAdjuster {
filterLandForOpponent.add(Predicates.not(new ControllerIdPredicate(controller.getId())));
ability.addTarget(new TargetOpponentsChoicePermanent(1, 1, filterLandForOpponent, false));
ability.addTarget(new TargetPermanent(filterCreature));
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
FilterCreaturePermanent filterCreatureForOpponent = new FilterCreaturePermanent("creature not controlled by " + controller.getLogName());
filterCreatureForOpponent.add(Predicates.not(new ControllerIdPredicate(controller.getId())));
ability.addTarget(new TargetOpponentsChoicePermanent(1, 1, filterCreatureForOpponent, false));
@ -78,13 +77,13 @@ enum VolcanicOfferingAdjuster implements TargetAdjuster {
class VolcanicOfferingEffect extends OneShotEffect {
public VolcanicOfferingEffect() {
VolcanicOfferingEffect() {
super(Outcome.Benefit);
this.staticText = "Destroy target nonbasic land you don't control and target nonbasic land of an opponent's choice you don't control.<br>" +
"{this} deals 7 damage to target creature you don't control and 7 damage to target creature of an opponent's choice you don't control";
}
public VolcanicOfferingEffect(final VolcanicOfferingEffect effect) {
private VolcanicOfferingEffect(final VolcanicOfferingEffect effect) {
super(effect);
}
@ -95,26 +94,22 @@ class VolcanicOfferingEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent != null) {
permanent.destroy(source.getSourceId(), game, false);
}
permanent = game.getPermanent(source.getTargets().get(1).getFirstTarget());
if (permanent != null) {
permanent.destroy(source.getSourceId(), game, false);
}
permanent = game.getPermanent(source.getTargets().get(2).getFirstTarget());
if (permanent != null) {
permanent.damage(7, source.getSourceId(), game, false, true);
}
permanent = game.getPermanent(source.getTargets().get(3).getFirstTarget());
if (permanent != null) {
permanent.damage(7, source.getSourceId(), game, false, true);
}
return true;
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent != null) {
permanent.destroy(source.getSourceId(), game, false);
}
return false;
permanent = game.getPermanent(source.getTargets().get(1).getFirstTarget());
if (permanent != null) {
permanent.destroy(source.getSourceId(), game, false);
}
permanent = game.getPermanent(source.getTargets().get(2).getFirstTarget());
if (permanent != null) {
permanent.damage(7, source.getSourceId(), game, false, true);
}
permanent = game.getPermanent(source.getTargets().get(3).getFirstTarget());
if (permanent != null) {
permanent.damage(7, source.getSourceId(), game, false, true);
}
return true;
}
}

View file

@ -14,10 +14,8 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.TargetController;
import mage.counters.CounterType;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
@ -29,12 +27,6 @@ import java.util.UUID;
*/
public final class VoraciousHydra extends CardImpl {
private static final FilterPermanent filter = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public VoraciousHydra(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{X}{G}{G}");
@ -59,7 +51,7 @@ public final class VoraciousHydra extends CardImpl {
new FightTargetSourceEffect()
.setText("{this} fights target creature you don't control")
);
mode.addTarget(new TargetPermanent(filter));
mode.addTarget(new TargetPermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
ability.addMode(mode);
this.addAbility(ability);
}

View file

@ -12,10 +12,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.TargetController;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
@ -27,12 +24,6 @@ import java.util.UUID;
*/
public final class WarbriarBlessing extends CardImpl {
private static final FilterPermanent filter = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public WarbriarBlessing(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}");
@ -47,7 +38,7 @@ public final class WarbriarBlessing extends CardImpl {
// When Warbriar Blessing enters the battlefield, enchanted creature fights up to one target creature you don't control.
ability = new EntersBattlefieldTriggeredAbility(new WarbriarBlessingEffect());
ability.addTarget(new TargetPermanent(0, 1, filter, false));
ability.addTarget(new TargetPermanent(0, 1, StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL, false));
this.addAbility(ability);
// Enchanted creature gets +0/+2.

View file

@ -15,11 +15,9 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.TargetController;
import mage.counters.CounterType;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetControlledPermanent;
@ -30,15 +28,9 @@ import java.util.UUID;
*/
public final class WickedWolf extends CardImpl {
private static final FilterPermanent filter
= new FilterCreaturePermanent("creature you don't control");
private static final FilterControlledPermanent filter2
private static final FilterControlledPermanent filter
= new FilterControlledPermanent(SubType.FOOD, "a Food");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
public WickedWolf(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}{G}");
@ -50,13 +42,13 @@ public final class WickedWolf extends CardImpl {
Ability ability = new EntersBattlefieldTriggeredAbility(
new FightTargetSourceEffect().setText("it fights up to one target creature you don't control")
);
ability.addTarget(new TargetPermanent(0, 1, filter, false));
ability.addTarget(new TargetPermanent(0, 1, StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL, false));
this.addAbility(ability);
// Sacrifice a Food: Put a +1/+1 counter on Wicked Wolf. It gains indestructible until end of turn. Tap it.
ability = new SimpleActivatedAbility(
new AddCountersSourceEffect(CounterType.P1P1.createInstance()),
new SacrificeTargetCost(new TargetControlledPermanent(filter2))
new SacrificeTargetCost(new TargetControlledPermanent(filter))
);
ability.addEffect(new GainAbilitySourceEffect(
IndestructibleAbility.getInstance(), Duration.EndOfTurn

View file

@ -10,11 +10,8 @@ import mage.cards.CardSetInfo;
import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
@ -36,7 +33,7 @@ public final class WindsOfAbandon extends CardImpl {
// Exile target creature you don't control. For each creature exiled this way, its controller searches their library for a basic land card. Those players put those cards onto the battlefield tapped, then shuffle their libraries.
this.getSpellAbility().addEffect(new WindsOfAbandonEffect());
this.getSpellAbility().addTarget(new TargetPermanent(WindsOfAbandonOverloadEffect.filter));
this.getSpellAbility().addTarget(new TargetPermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL));
// Overload {4}{W}{W}
this.addAbility(new OverloadAbility(
@ -102,12 +99,6 @@ class WindsOfAbandonEffect extends OneShotEffect {
class WindsOfAbandonOverloadEffect extends OneShotEffect {
static final FilterPermanent filter = new FilterCreaturePermanent("creature you don't control");
static {
filter.add(TargetController.NOT_YOU.getControllerPredicate());
}
WindsOfAbandonOverloadEffect() {
super(Outcome.Exile);
staticText = "Exile each creature you don't control. For each creature exiled this way, " +
@ -132,7 +123,7 @@ class WindsOfAbandonOverloadEffect extends OneShotEffect {
}
Map<UUID, Integer> playerMap = new HashMap<>();
CardsImpl cards = new CardsImpl();
for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL, source.getControllerId(), source.getSourceId(), game)) {
int count = playerMap.getOrDefault(permanent.getControllerId(), 0);
playerMap.put(permanent.getControllerId(), count + 1);
cards.add(permanent);

View file

@ -1,8 +1,3 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package mage.filter;
import mage.constants.CardType;
@ -339,6 +334,13 @@ public final class StaticFilters {
FILTER_OPPONENTS_PERMANENT_ARTIFACT_OR_CREATURE.setLockedFilter(true);
}
public static final FilterCreaturePermanent FILTER_CREATURE_YOU_DONT_CONTROL = new FilterCreaturePermanent("creature you don't control");
static {
FILTER_CREATURE_YOU_DONT_CONTROL.add(TargetController.NOT_YOU.getControllerPredicate());
FILTER_CREATURE_YOU_DONT_CONTROL.setLockedFilter(true);
}
public static final FilterControlledCreaturePermanent FILTER_CONTROLLED_CREATURE = new FilterControlledCreaturePermanent();
static {