diff --git a/Mage.Sets/src/mage/cards/b/BontuTheGlorified.java b/Mage.Sets/src/mage/cards/b/BontuTheGlorified.java index 49836fc48d..a0748bad7d 100644 --- a/Mage.Sets/src/mage/cards/b/BontuTheGlorified.java +++ b/Mage.Sets/src/mage/cards/b/BontuTheGlorified.java @@ -61,7 +61,7 @@ import mage.watchers.common.CreaturesDiedWatcher; */ public class BontuTheGlorified extends CardImpl { - private static final FilterControlledPermanent filter = new FilterControlledPermanent(); + private static final FilterControlledPermanent filter = new FilterControlledPermanent("another creature"); static { filter.add(new AnotherPredicate()); diff --git a/Mage.Sets/src/mage/cards/d/Decompose.java b/Mage.Sets/src/mage/cards/d/Decompose.java index 4dceecffe6..d27d07b588 100644 --- a/Mage.Sets/src/mage/cards/d/Decompose.java +++ b/Mage.Sets/src/mage/cards/d/Decompose.java @@ -47,7 +47,7 @@ public class Decompose extends CardImpl { // Exile up to three target cards from a single graveyard. this.getSpellAbility().addEffect(new ExileTargetEffect()); - this.getSpellAbility().addTarget(new TargetCardInASingleGraveyard(0, 3, new FilterCard("cards"))); + this.getSpellAbility().addTarget(new TargetCardInASingleGraveyard(0, 3, new FilterCard("cards from a single graveyard"))); } public Decompose(final Decompose card) { diff --git a/Mage.Sets/src/mage/cards/f/FaerieMacabre.java b/Mage.Sets/src/mage/cards/f/FaerieMacabre.java index 51909bad25..340d5e5e73 100644 --- a/Mage.Sets/src/mage/cards/f/FaerieMacabre.java +++ b/Mage.Sets/src/mage/cards/f/FaerieMacabre.java @@ -29,22 +29,18 @@ package mage.cards.f; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.Mode; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.DiscardSourceCost; -import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.FlyingAbility; -import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Zone; import mage.filter.FilterCard; -import mage.game.Game; import mage.target.common.TargetCardInGraveyard; import java.util.UUID; +import mage.abilities.effects.common.ExileTargetEffect; /** * @@ -53,7 +49,7 @@ import java.util.UUID; public class FaerieMacabre extends CardImpl { public FaerieMacabre(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{B}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}{B}"); this.subtype.add("Faerie"); this.subtype.add("Rogue"); @@ -63,7 +59,7 @@ public class FaerieMacabre extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); // Discard Faerie Macabre: Exile up to two target cards from graveyards. - Ability ability = new SimpleActivatedAbility(Zone.HAND, new FaerieMacabreExileTargetEffect(), new DiscardSourceCost()); + Ability ability = new SimpleActivatedAbility(Zone.HAND, new ExileTargetEffect(), new DiscardSourceCost()); ability.addTarget(new TargetCardInGraveyard(0, 2, new FilterCard("cards from graveyards"))); this.addAbility(ability); } @@ -77,35 +73,3 @@ public class FaerieMacabre extends CardImpl { return new FaerieMacabre(this); } } - -class FaerieMacabreExileTargetEffect extends OneShotEffect { - - public FaerieMacabreExileTargetEffect() { - super(Outcome.Exile); - } - - public FaerieMacabreExileTargetEffect(final FaerieMacabreExileTargetEffect effect) { - super(effect); - } - - @Override - public FaerieMacabreExileTargetEffect copy() { - return new FaerieMacabreExileTargetEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - for(UUID uuid : source.getTargets().get(0).getTargets()){ - Card card = game.getCard(uuid); - if (card != null) { - card.moveToExile(null, "Faerie Macabre", source.getSourceId(), game); - } - } - return true; - } - - @Override - public String getText(Mode mode) { - return "Exile up to two target cards from graveyards"; - } -} diff --git a/Mage.Sets/src/mage/cards/f/FamishedGhoul.java b/Mage.Sets/src/mage/cards/f/FamishedGhoul.java index e50230d238..193aaeb313 100644 --- a/Mage.Sets/src/mage/cards/f/FamishedGhoul.java +++ b/Mage.Sets/src/mage/cards/f/FamishedGhoul.java @@ -56,9 +56,9 @@ public class FamishedGhoul extends CardImpl { this.toughness = new MageInt(2); // {1}{B}, Sacrifice Famished Ghoul: Exile up to two target cards from a single graveyard. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetEffect("Exile up to two target cards from a single graveyard"), new ManaCostsImpl("{1}{B}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetEffect(), new ManaCostsImpl("{1}{B}")); ability.addCost(new SacrificeSourceCost()); - ability.addTarget(new TargetCardInASingleGraveyard(0, 2, new FilterCard())); + ability.addTarget(new TargetCardInASingleGraveyard(0, 2, new FilterCard("cards from a single graveyard"))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/r/RagDealer.java b/Mage.Sets/src/mage/cards/r/RagDealer.java index 7cdfc77343..ec087aefd6 100644 --- a/Mage.Sets/src/mage/cards/r/RagDealer.java +++ b/Mage.Sets/src/mage/cards/r/RagDealer.java @@ -25,25 +25,21 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.cards.r; import java.util.UUID; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; +import mage.abilities.effects.common.ExileTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.filter.FilterCard; -import mage.game.Game; import mage.target.common.TargetCardInASingleGraveyard; /** @@ -52,23 +48,22 @@ import mage.target.common.TargetCardInASingleGraveyard; */ public class RagDealer extends CardImpl { - public RagDealer (UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{B}"); + public RagDealer(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{B}"); this.subtype.add("Human"); this.subtype.add("Rogue"); - this.power = new MageInt(1); this.toughness = new MageInt(1); // {2}{B}, {T}: Exile up to three target cards from a single graveyard. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RagDealerExileEffect(), new ManaCostsImpl("{2}{B}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetEffect(), new ManaCostsImpl("{2}{B}")); ability.addCost(new TapSourceCost()); - ability.addTarget(new TargetCardInASingleGraveyard(0, 3, new FilterCard("up to three target cards from a single graveyard"))); + ability.addTarget(new TargetCardInASingleGraveyard(0, 3, new FilterCard("cards from a single graveyard"))); this.addAbility(ability); } - public RagDealer (final RagDealer card) { + public RagDealer(final RagDealer card) { super(card); } @@ -78,31 +73,3 @@ public class RagDealer extends CardImpl { } } - -class RagDealerExileEffect extends OneShotEffect { - - public RagDealerExileEffect() { - super(Outcome.Exile); - this.staticText = "Exile up to three target cards from a single graveyard"; - } - - public RagDealerExileEffect(final RagDealerExileEffect effect) { - super(effect); - } - - @Override - public RagDealerExileEffect copy() { - return new RagDealerExileEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - for (UUID targetID : source.getTargets().get(0).getTargets()) { - Card card = game.getCard(targetID); - if (card != null) { - card.moveToExile(null, "", source.getSourceId(), game); - } - } - return true; - } -} diff --git a/Mage.Sets/src/mage/cards/r/RapidDecay.java b/Mage.Sets/src/mage/cards/r/RapidDecay.java index 6d21381291..e5700cbda6 100644 --- a/Mage.Sets/src/mage/cards/r/RapidDecay.java +++ b/Mage.Sets/src/mage/cards/r/RapidDecay.java @@ -28,17 +28,13 @@ package mage.cards.r; import java.util.UUID; -import mage.abilities.Ability; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ExileTargetEffect; import mage.abilities.keyword.CyclingAbility; -import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.Outcome; import mage.filter.FilterCard; -import mage.game.Game; import mage.target.common.TargetCardInASingleGraveyard; /** @@ -48,12 +44,12 @@ import mage.target.common.TargetCardInASingleGraveyard; public class RapidDecay extends CardImpl { public RapidDecay(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{B}"); // Exile up to three target cards from a single graveyard. - this.getSpellAbility().addEffect(new RapidDecayExileEffect()); - this.getSpellAbility().addTarget(new TargetCardInASingleGraveyard(0, 3, new FilterCard("up to three target cards from a single graveyard"))); - + this.getSpellAbility().addEffect(new ExileTargetEffect()); + this.getSpellAbility().addTarget(new TargetCardInASingleGraveyard(0, 3, new FilterCard("cards from a single graveyard"))); + // Cycling {2} this.addAbility(new CyclingAbility(new ManaCostsImpl("{2}"))); } @@ -67,31 +63,3 @@ public class RapidDecay extends CardImpl { return new RapidDecay(this); } } - -class RapidDecayExileEffect extends OneShotEffect { - - public RapidDecayExileEffect() { - super(Outcome.Exile); - this.staticText = "Exile up to three target cards from a single graveyard"; - } - - public RapidDecayExileEffect(final RapidDecayExileEffect effect) { - super(effect); - } - - @Override - public RapidDecayExileEffect copy() { - return new RapidDecayExileEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - for (UUID targetID : source.getTargets().get(0).getTargets()) { - Card card = game.getCard(targetID); - if (card != null) { - card.moveToExile(null, "", source.getSourceId(), game); - } - } - return true; - } -} diff --git a/Mage.Sets/src/mage/cards/s/ScarabFeast.java b/Mage.Sets/src/mage/cards/s/ScarabFeast.java index 7cb2c8b46a..13862295de 100644 --- a/Mage.Sets/src/mage/cards/s/ScarabFeast.java +++ b/Mage.Sets/src/mage/cards/s/ScarabFeast.java @@ -20,7 +20,7 @@ public class ScarabFeast extends CardImpl { // Exile up to three target cards from a single graveyard. getSpellAbility().addEffect(new ExileTargetEffect()); - getSpellAbility().addTarget(new TargetCardInASingleGraveyard(0, 3, new FilterCard("cards"))); + getSpellAbility().addTarget(new TargetCardInASingleGraveyard(0, 3, new FilterCard("cards from a single graveyard"))); // Cycling {B} addAbility(new CyclingAbility(new ManaCostsImpl("{B}"))); diff --git a/Mage/src/main/java/mage/abilities/effects/common/ExileTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/ExileTargetEffect.java index 88b3307d25..669b572451 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/ExileTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/ExileTargetEffect.java @@ -172,6 +172,8 @@ public class ExileTargetEffect extends OneShotEffect { sb.append("target "); } sb.append(targetName); + } else if (target.getNumberOfTargets() == 0 && target.getMaxNumberOfTargets() > 0) { + sb.append("exile up to ").append(CardUtil.numberToText(target.getMaxNumberOfTargets())).append(" target ").append(target.getTargetName()); } else { sb.append("exile ").append(CardUtil.numberToText(target.getNumberOfTargets())).append(" target ").append(target.getTargetName()); }