Add StaticFilters.FILTER_CONTROLLED_LAND_SHORT_TEXT

This commit is contained in:
Plopman 2018-03-27 00:04:13 +02:00
parent 95b07bdb1f
commit a33916f3f4
17 changed files with 39 additions and 47 deletions

View file

@ -40,7 +40,7 @@ import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.common.FilterControlledLandPermanent;
import mage.filter.StaticFilters;
import mage.target.common.TargetControlledPermanent;
/**
@ -60,7 +60,7 @@ public class BogElemental extends CardImpl {
// At the beginning of your upkeep, sacrifice Bog Elemental unless you sacrifice a land.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD,
new SacrificeSourceUnlessPaysEffect(new SacrificeTargetCost(new TargetControlledPermanent(new FilterControlledLandPermanent()))),
new SacrificeSourceUnlessPaysEffect(new SacrificeTargetCost(new TargetControlledPermanent(StaticFilters.FILTER_CONTROLLED_LAND_SHORT_TEXT))),
TargetController.YOU,
false));
}

View file

@ -40,7 +40,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.filter.common.FilterControlledLandPermanent;
import mage.filter.StaticFilters;
import mage.target.common.TargetControlledPermanent;
/**
@ -62,7 +62,7 @@ public class CephalidScout extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// {2}{U}, Sacrifice a land: Draw a card.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new ManaCostsImpl("{2}{U}"));
ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(new FilterControlledLandPermanent())));
ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(StaticFilters.FILTER_CONTROLLED_LAND_SHORT_TEXT)));
this.addAbility(ability);
}

View file

@ -34,8 +34,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.filter.common.FilterControlledLandPermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterLandCard;
import mage.target.common.TargetCardInLibrary;
import mage.target.common.TargetControlledPermanent;
@ -46,14 +45,12 @@ import mage.target.common.TargetControlledPermanent;
*/
public class CropRotation extends CardImpl {
private static final FilterControlledPermanent filter = new FilterControlledLandPermanent();
public CropRotation(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{G}");
// As an additional cost to cast Crop Rotation, sacrifice a land.
this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter)));
this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledPermanent(StaticFilters.FILTER_CONTROLLED_LAND_SHORT_TEXT)));
// Search your library for a land card and put that card onto the battlefield. Then shuffle your library.
this.getSpellAbility().addEffect(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(new FilterLandCard()), false, Outcome.PutLandInPlay));

View file

@ -40,7 +40,7 @@ import mage.constants.CardType;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.common.FilterControlledLandPermanent;
import mage.filter.StaticFilters;
import mage.target.common.TargetControlledPermanent;
import mage.target.common.TargetCreaturePermanent;
@ -59,7 +59,7 @@ public class DwarvenArmory extends CardImpl {
new ManaCostsImpl("{2}"),
new IsStepCondition(PhaseStep.UPKEEP, false),
null);
ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(new FilterControlledLandPermanent())));
ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(StaticFilters.FILTER_CONTROLLED_LAND_SHORT_TEXT)));
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);
}

View file

@ -41,7 +41,7 @@ import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.common.FilterControlledLandPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
@ -57,7 +57,7 @@ public class GlacialChasm extends CardImpl {
// Cumulative upkeep-Pay 2 life.
this.addAbility(new CumulativeUpkeepAbility(new PayLifeCost(2)));
// When Glacial Chasm enters the battlefield, sacrifice a land.
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeControllerEffect(new FilterControlledLandPermanent(), 1, "")));
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeControllerEffect(StaticFilters.FILTER_LAND, 1, "")));
// Creatures you control can't attack.
FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures you control");
filter.add(new ControllerPredicate(TargetController.YOU));

View file

@ -36,6 +36,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreatureOrPlayer;
@ -48,7 +49,7 @@ public class GoblinBombardment extends CardImpl {
public GoblinBombardment(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{R}");
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new SacrificeTargetCost(new TargetControlledCreaturePermanent(1)));
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new SacrificeTargetCost(new TargetControlledCreaturePermanent(StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT)));
ability.addTarget(new TargetCreatureOrPlayer());
this.addAbility(ability);
}

View file

@ -33,8 +33,7 @@ import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.common.FilterControlledLandPermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.StaticFilters;
import mage.target.common.TargetControlledPermanent;
import mage.target.common.TargetCreaturePermanent;
@ -44,14 +43,11 @@ import mage.target.common.TargetCreaturePermanent;
*/
public class MagmaRift extends CardImpl {
private static final FilterControlledPermanent filter = new FilterControlledLandPermanent();
public MagmaRift(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{R}");
// As an additional cost to cast Magma Rift, sacrifice a land.
this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter)));
this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledPermanent(StaticFilters.FILTER_CONTROLLED_LAND_SHORT_TEXT)));
// Magma Rift deals 5 damage to target creature.
this.getSpellAbility().addEffect(new DamageTargetEffect(5));

View file

@ -34,7 +34,7 @@ import mage.abilities.keyword.BuybackAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.common.FilterControlledLandPermanent;
import mage.filter.StaticFilters;
import mage.game.permanent.token.PegasusToken;
import mage.target.common.TargetControlledPermanent;
@ -48,7 +48,7 @@ public class PegasusStampede extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{W}");
// Buyback-Sacrifice a land.
this.addAbility(new BuybackAbility(new SacrificeTargetCost(new TargetControlledPermanent(1,1, new FilterControlledLandPermanent(), true))));
this.addAbility(new BuybackAbility(new SacrificeTargetCost(new TargetControlledPermanent(1, 1, StaticFilters.FILTER_CONTROLLED_LAND_SHORT_TEXT, true))));
// Create a 1/1 white Pegasus creature token with flying.
this.getSpellAbility().addEffect(new CreateTokenEffect(new PegasusToken()));

View file

@ -38,9 +38,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.filter.common.FilterControlledLandPermanent;
import mage.target.common.TargetControlledPermanent;
import mage.filter.StaticFilters;
/**
*
* @author fireshoes
@ -54,11 +52,10 @@ public class PhyrexianWarBeast extends CardImpl {
this.toughness = new MageInt(4);
// When Phyrexian War Beast leaves the battlefield, sacrifice a land and Phyrexian War Beast deals 1 damage to you.
Ability ability = new LeavesBattlefieldTriggeredAbility(new SacrificeControllerEffect(new FilterControlledLandPermanent(), 1, ""), false);
Ability ability = new LeavesBattlefieldTriggeredAbility(new SacrificeControllerEffect(StaticFilters.FILTER_LAND, 1, ""), false);
Effect effect = new DamageControllerEffect(1);
effect.setText("and {this} deals 1 damage to you");
ability.addEffect(effect);
ability.addTarget(new TargetControlledPermanent(new FilterControlledLandPermanent()));
this.addAbility(ability);
}

View file

@ -37,7 +37,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.filter.common.FilterControlledLandPermanent;
import mage.filter.StaticFilters;
import mage.target.common.TargetControlledPermanent;
/**
@ -58,7 +58,7 @@ public class PolarKraken extends CardImpl {
// Polar Kraken enters the battlefield tapped.
this.addAbility(new EntersBattlefieldTappedAbility());
// Cumulative upkeep-Sacrifice a land.
this.addAbility(new CumulativeUpkeepAbility(new SacrificeTargetCost(new TargetControlledPermanent(new FilterControlledLandPermanent()))));
this.addAbility(new CumulativeUpkeepAbility(new SacrificeTargetCost(new TargetControlledPermanent(StaticFilters.FILTER_CONTROLLED_LAND_SHORT_TEXT))));
}
public PolarKraken(final PolarKraken card) {

View file

@ -33,7 +33,7 @@ import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.common.FilterControlledLandPermanent;
import mage.filter.StaticFilters;
import mage.target.common.TargetControlledPermanent;
import mage.target.common.TargetLandPermanent;
@ -48,7 +48,7 @@ public class Raze extends CardImpl {
// As an additional cost to cast Raze, sacrifice a land.
this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledPermanent(1,1, new FilterControlledLandPermanent(), true)));
this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledPermanent(1, 1, StaticFilters.FILTER_CONTROLLED_LAND_SHORT_TEXT, true)));
// Destroy target land.
this.getSpellAbility().addEffect(new DestroyTargetEffect());
this.getSpellAbility().addTarget(new TargetLandPermanent());

View file

@ -37,8 +37,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.filter.common.FilterControlledLandPermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.StaticFilters;
import mage.target.common.TargetControlledPermanent;
/**
@ -47,8 +46,6 @@ import mage.target.common.TargetControlledPermanent;
*/
public class ScytheTiger extends CardImpl {
private static final FilterControlledPermanent filter = new FilterControlledLandPermanent();
public ScytheTiger(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{G}");
this.subtype.add(SubType.CAT);
@ -60,7 +57,7 @@ public class ScytheTiger extends CardImpl {
this.addAbility(ShroudAbility.getInstance());
// When Scythe Tiger enters the battlefield, sacrifice it unless you sacrifice a land.
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new SacrificeTargetCost(new TargetControlledPermanent(filter)))));
this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new SacrificeTargetCost(new TargetControlledPermanent(StaticFilters.FILTER_CONTROLLED_LAND_SHORT_TEXT)))));
}
public ScytheTiger(final ScytheTiger card) {

View file

@ -33,8 +33,7 @@ import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.common.FilterControlledLandPermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.StaticFilters;
import mage.target.common.TargetControlledPermanent;
import mage.target.common.TargetCreatureOrPlayer;
@ -44,14 +43,12 @@ import mage.target.common.TargetCreatureOrPlayer;
*/
public class ShardVolley extends CardImpl {
private static final FilterControlledPermanent filter = new FilterControlledLandPermanent();
public ShardVolley(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{R}");
// As an additional cost to cast Shard Volley, sacrifice a land.
this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter)));
this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledPermanent(StaticFilters.FILTER_CONTROLLED_LAND_SHORT_TEXT)));
// Shard Volley deals 3 damage to target creature or player.
this.getSpellAbility().addEffect(new DamageTargetEffect(3));

View file

@ -39,7 +39,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.filter.common.FilterControlledLandPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.AbilityPredicate;
import mage.target.common.TargetControlledPermanent;
@ -64,7 +64,7 @@ public class SpittingSpider extends CardImpl {
// Reach
this.addAbility(ReachAbility.getInstance());
// Sacrifice a land: Spitting Spider deals 1 damage to each creature with flying.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageAllEffect(1, filter), new SacrificeTargetCost(new TargetControlledPermanent(new FilterControlledLandPermanent()))));
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageAllEffect(1, filter), new SacrificeTargetCost(new TargetControlledPermanent(StaticFilters.FILTER_CONTROLLED_LAND_SHORT_TEXT))));
}
public SpittingSpider(final SpittingSpider card) {

View file

@ -44,7 +44,7 @@ import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledLandPermanent;
import mage.filter.StaticFilters;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.TargetPermanent;
@ -84,7 +84,7 @@ public class WorldBreaker extends CardImpl {
// {2}{C}, Sacrifice a land: Return World Breaker from your graveyard to your hand.
ability = new SimpleActivatedAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(), new ManaCostsImpl("{2}{C}"));
ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(new FilterControlledLandPermanent())));
ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(StaticFilters.FILTER_CONTROLLED_LAND_SHORT_TEXT)));
this.addAbility(ability);
}

View file

@ -35,7 +35,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.filter.common.FilterControlledLandPermanent;
import mage.filter.StaticFilters;
import mage.target.common.TargetControlledPermanent;
/**
@ -48,7 +48,7 @@ public class ZuranOrb extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{0}");
// Sacrifice a land: You gain 2 life.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(2), new SacrificeTargetCost(new TargetControlledPermanent(new FilterControlledLandPermanent()))));
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(2), new SacrificeTargetCost(new TargetControlledPermanent(StaticFilters.FILTER_CONTROLLED_LAND_SHORT_TEXT))));
}
public ZuranOrb(final ZuranOrb card) {

View file

@ -236,6 +236,13 @@ public final class StaticFilters {
static {
FILTER_BASIC_LAND_CARD.setLockedFilter(true);
}
// Used for sacrifice targets that don't need the "you control" text
public static final FilterControlledLandPermanent FILTER_CONTROLLED_LAND_SHORT_TEXT = new FilterControlledLandPermanent("a land");
static {
FILTER_CONTROLLED_LAND_SHORT_TEXT.setLockedFilter(true);
}
public static final FilterCreaturePermanent FILTER_PERMANENT_CREATURE = new FilterCreaturePermanent();