1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-12 01:01:04 -09:00

Merge pull request from magefree/master

Merge https://github.com/magefree/mage
This commit is contained in:
L_J 2018-03-27 23:23:02 +02:00 committed by GitHub
commit b6162cb642
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 74 additions and 65 deletions

View file

@ -40,6 +40,8 @@ import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SetTargetPointer;
import mage.filter.StaticFilters;
import mage.target.TargetPlayer;
/**
@ -60,11 +62,12 @@ public class AxelrodGunnarson extends CardImpl {
this.addAbility(TrampleAbility.getInstance());
// Whenever a creature dealt damage by Axelrod Gunnarson this turn dies, you gain 1 life and Axelrod deals 1 damage to target player.
Ability ability = new DealtDamageAndDiedTriggeredAbility(new GainLifeEffect(1), false);
Ability ability = new DealtDamageAndDiedTriggeredAbility(new GainLifeEffect(1), false, StaticFilters.FILTER_PERMANENT_CREATURE, SetTargetPointer.NONE);
Effect effect = new DamageTargetEffect(1);
effect.setText("and {this} deals 1 damage to target player");
ability.addEffect(effect);
ability.addTarget(new TargetPlayer());
this.addAbility(ability);
}
public AxelrodGunnarson(final AxelrodGunnarson card) {

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

@ -141,7 +141,7 @@ public class CityInABottle extends CardImpl {
namePredicatesArabianNights.add(new NamePredicate("Piety"));
namePredicatesArabianNights.add(new NamePredicate("Pyramids"));
namePredicatesArabianNights.add(new NamePredicate("Repentant Blacksmith"));
namePredicatesArabianNights.add(new NamePredicate("Ring of Ma'rûf"));
namePredicatesArabianNights.add(new NamePredicate("Ring of Ma'ruf"));
namePredicatesArabianNights.add(new NamePredicate("Rukh Egg"));
namePredicatesArabianNights.add(new NamePredicate("Sandals of Abdallah"));
namePredicatesArabianNights.add(new NamePredicate("Sandstorm"));

View file

@ -54,6 +54,7 @@ public class Corrupt extends CardImpl {
public Corrupt(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{5}{B}");
// Corrupt deals damage to target creature or player equal to the number of Swamps you control. You gain life equal to the damage dealt this way.
this.getSpellAbility().addTarget(new TargetCreatureOrPlayer());
this.getSpellAbility().addEffect(new CorruptEffect());
}
@ -80,7 +81,7 @@ class CorruptEffect extends OneShotEffect {
public CorruptEffect() {
super(Outcome.Damage);
staticText = "{this} deals damage equal to the number of Swamps you control to target creature or player. You gain life equal to the damage dealt this way";
staticText = "{this} deals damage to target creature or player equal to the number of Swamps you control. You gain life equal to the damage dealt this way";
}
public CorruptEffect(final CorruptEffect effect) {

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

@ -101,7 +101,9 @@ class DroughtAdditionalCostEffect extends CostModificationEffectImpl {
@Override
public boolean apply(Game game, Ability source, Ability abilityToModify) {
int blackSymbols = abilityToModify.getManaCosts().getMana().getBlack();
abilityToModify.addCost(new SacrificeTargetCost(new TargetControlledPermanent(blackSymbols, blackSymbols, filter, true)));
TargetControlledPermanent target = new TargetControlledPermanent(blackSymbols, blackSymbols, filter, true);
target.setRequired(false);
abilityToModify.addCost(new SacrificeTargetCost(target));
return true;
}

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

@ -62,7 +62,7 @@ public class GlyphKeeper extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
// Whenever Glyph Keeper becomes the target of a spell or ability for the first time in a turn, counter that spell or ability.
// Whenever Glyph Keeper becomes the target of a spell or ability for the first time each turn, counter that spell or ability.
this.addAbility(new GlyphKeeperAbility(), new NumberOfTimesPermanentTargetedATurnWatcher());
// Embalm {5}{U}{U}
@ -120,7 +120,7 @@ class GlyphKeeperAbility extends TriggeredAbilityImpl {
@Override
public String getRule() {
return "Whenever {this} becomes the target of a spell or ability for the first time in a turn, counter that spell or ability.";
return "Whenever {this} becomes the target of a spell or ability for the first time each turn, counter that spell or ability.";
}
}

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

@ -63,7 +63,7 @@ public class KiraGreatGlassSpinner extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
// Creatures you control have "Whenever this creature becomes the target of a spell or ability for the first time in a turn, counter that spell or ability."
// Creatures you control have "Whenever this creature becomes the target of a spell or ability for the first time each turn, counter that spell or ability."
Effect effect = new CounterTargetEffect();
effect.setText("counter that spell or ability");
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
@ -122,7 +122,7 @@ class KiraGreatGlassSpinnerAbility extends TriggeredAbilityImpl {
@Override
public String getRule() {
return "Whenever this creature becomes the target of a spell or ability for the first time in a turn, counter that spell or ability.";
return "Whenever this creature becomes the target of a spell or ability for the first time each turn, counter that spell or ability.";
}
}

View file

@ -54,7 +54,7 @@ public class LastStand extends CardImpl {
public LastStand(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{W}{U}{B}{R}{G}");
// Target opponent loses 2 life for each Swamp you control. Last Stand deals damage equal to the number of Mountains you control to target creature. Create a 1/1 green Saproling creature token for each Forest you control. You gain 2 life for each Plains you control. Draw a card for each Island you control, then discard that many cards.
// Target opponent loses 2 life for each Swamp you control. Last Stand deals damage to target creature equal to the number of Mountains you control. Create a 1/1 green Saproling creature token for each Forest you control. You gain 2 life for each Plains you control. Draw a card for each Island you control, then discard that many cards.
this.getSpellAbility().addEffect(new LastStandEffect());
this.getSpellAbility().addTarget(new TargetOpponent());
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
@ -87,7 +87,7 @@ class LastStandEffect extends OneShotEffect {
public LastStandEffect() {
super(Outcome.Benefit);
this.staticText = "Target opponent loses 2 life for each Swamp you control. Last Stand deals damage equal to the number of Mountains you control to target creature. Create a 1/1 green Saproling creature token for each Forest you control. You gain 2 life for each Plains you control. Draw a card for each Island you control, then discard that many cards";
this.staticText = "Target opponent loses 2 life for each Swamp you control. Last Stand deals damage to target creature equal to the number of Mountains you control. Create a 1/1 green Saproling creature token for each Forest you control. You gain 2 life for each Plains you control. Draw a card for each Island you control, then discard that many cards";
}
public LastStandEffect(final LastStandEffect effect) {

View file

@ -51,7 +51,7 @@ public class LimDulsHex extends CardImpl {
public LimDulsHex(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}");
// At the beginning of your upkeep, for each player, Lim-Dûl's Hex deals 1 damage to that player unless he or she pays {B} or {3}.
// At the beginning of your upkeep, for each player, Lim-Dul's Hex deals 1 damage to that player unless he or she pays {B} or {3}.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new LimDulsHexEffect(), TargetController.YOU, false));
}

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

@ -59,7 +59,7 @@ public class ShimmeringGlasskite extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
// Whenever Shimmering Glasskite becomes the target of a spell or ability for the first time in a turn, counter that spell or ability.
// Whenever Shimmering Glasskite becomes the target of a spell or ability for the first time each turn, counter that spell or ability.
this.addAbility(new ShimmeringGlasskiteAbility());
}
@ -112,7 +112,7 @@ class ShimmeringGlasskiteAbility extends TriggeredAbilityImpl {
@Override
public String getRule() {
return "Whenever {this} becomes the target of a spell or ability for the first time in a turn, counter that spell or ability.";
return "Whenever {this} becomes the target of a spell or ability for the first time each turn, counter that spell or ability.";
}
}

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

@ -131,7 +131,7 @@ public class ArabianNights extends ExpansionSet {
cards.add(new SetCardInfo("Piety", 65, Rarity.COMMON, Piety.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Pyramids", 81, Rarity.RARE, mage.cards.p.Pyramids.class));
cards.add(new SetCardInfo("Repentant Blacksmith", 66, Rarity.RARE, mage.cards.r.RepentantBlacksmith.class));
cards.add(new SetCardInfo("Ring of Ma'rûf", 82, Rarity.RARE, mage.cards.r.RingOfMaruf.class));
cards.add(new SetCardInfo("Ring of Ma'ruf", 82, Rarity.RARE, mage.cards.r.RingOfMaruf.class));
cards.add(new SetCardInfo("Rukh Egg", 52, Rarity.COMMON, RukhEgg.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Rukh Egg", 53, Rarity.COMMON, RukhEgg.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Sandals of Abdallah", 83, Rarity.UNCOMMON, mage.cards.s.SandalsOfAbdallah.class));

View file

@ -221,7 +221,7 @@ public class IceAge extends ExpansionSet {
cards.add(new SetCardInfo("Legions of Lim-Dul", 30, Rarity.COMMON, mage.cards.l.LegionsOfLimDul.class));
cards.add(new SetCardInfo("Leshrac's Rite", 31, Rarity.UNCOMMON, mage.cards.l.LeshracsRite.class));
cards.add(new SetCardInfo("Leshrac's Sigil", 32, Rarity.UNCOMMON, mage.cards.l.LeshracsSigil.class));
cards.add(new SetCardInfo("Lim-Dûl's Hex", 34, Rarity.UNCOMMON, mage.cards.l.LimDulsHex.class));
cards.add(new SetCardInfo("Lim-Dul's Hex", 34, Rarity.UNCOMMON, mage.cards.l.LimDulsHex.class));
cards.add(new SetCardInfo("Lhurgoyf", 140, Rarity.RARE, mage.cards.l.Lhurgoyf.class));
cards.add(new SetCardInfo("Lightning Blow", 266, Rarity.RARE, mage.cards.l.LightningBlow.class));
cards.add(new SetCardInfo("Lure", 141, Rarity.UNCOMMON, mage.cards.l.Lure.class));

View file

@ -3,7 +3,9 @@ package mage.abilities.common;
import mage.MageObjectReference;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.constants.SetTargetPointer;
import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.events.GameEvent;
@ -13,23 +15,30 @@ import mage.target.targetpointer.FixedTarget;
public class DealtDamageAndDiedTriggeredAbility extends TriggeredAbilityImpl {
private final FilterCreaturePermanent filter;
protected SetTargetPointer setTargetPointer;
public DealtDamageAndDiedTriggeredAbility(Effect effect) {
this(effect, false);
}
public DealtDamageAndDiedTriggeredAbility(Effect effect, boolean optional) {
this(effect, optional, new FilterCreaturePermanent());
this(effect, optional, StaticFilters.FILTER_PERMANENT_CREATURE);
}
public DealtDamageAndDiedTriggeredAbility(Effect effect, boolean optional, FilterCreaturePermanent filter) {
this(effect, optional, filter, SetTargetPointer.PERMANENT);
}
public DealtDamageAndDiedTriggeredAbility(Effect effect, boolean optional, FilterCreaturePermanent filter, SetTargetPointer setTargetPointer) {
super(Zone.ALL, effect, optional);
this.filter = filter;
this.setTargetPointer = setTargetPointer;
}
public DealtDamageAndDiedTriggeredAbility(final DealtDamageAndDiedTriggeredAbility ability) {
super(ability);
this.filter = ability.filter;
this.setTargetPointer = ability.setTargetPointer;
}
@Override
@ -55,8 +64,10 @@ public class DealtDamageAndDiedTriggeredAbility extends TriggeredAbilityImpl {
}
}
if (damageDealt) {
for (Effect effect : getEffects()) {
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
if(this.setTargetPointer == SetTargetPointer.PERMANENT) {
for (Effect effect : getEffects()) {
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
}
}
return true;
}

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();