diff --git a/Mage.Sets/src/mage/sets/bornofthegods/DawnToDusk.java b/Mage.Sets/src/mage/sets/bornofthegods/DawnToDusk.java index 024a655e49..e2ed471a1e 100644 --- a/Mage.Sets/src/mage/sets/bornofthegods/DawnToDusk.java +++ b/Mage.Sets/src/mage/sets/bornofthegods/DawnToDusk.java @@ -68,7 +68,7 @@ public class DawnToDusk extends CardImpl { this.getSpellAbility().getModes().setMinModes(1); this.getSpellAbility().getModes().setMaxModes(2); // Return target enchantment card from your graveyard to your hand; - this.getSpellAbility().addEffect(new ReturnFromGraveyardToHandTargetEffect(true)); + this.getSpellAbility().addEffect(new ReturnFromGraveyardToHandTargetEffect()); this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(filterCard)); // and/or destroy target enchantment. Mode mode = new Mode(); diff --git a/Mage.Sets/src/mage/sets/bornofthegods/OdunosRiverTrawler.java b/Mage.Sets/src/mage/sets/bornofthegods/OdunosRiverTrawler.java index fa1cd0ef47..b6808bf6ba 100644 --- a/Mage.Sets/src/mage/sets/bornofthegods/OdunosRiverTrawler.java +++ b/Mage.Sets/src/mage/sets/bornofthegods/OdunosRiverTrawler.java @@ -65,11 +65,11 @@ public class OdunosRiverTrawler extends CardImpl { this.toughness = new MageInt(2); // When Odunos River Trawler enters the battlefield, return target enchantment creature card from your graveyard to your hand. - Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnFromGraveyardToHandTargetEffect(true)); + Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnFromGraveyardToHandTargetEffect()); ability.addTarget(new TargetCardInYourGraveyard(filter, true)); this.addAbility(ability); // {W}, Sacrifice Odunos River Trawler: Return target enchantment creature card from your graveyard to your hand. - ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnFromGraveyardToHandTargetEffect(true), new ManaCostsImpl("{W}")); + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnFromGraveyardToHandTargetEffect(), new ManaCostsImpl("{W}")); ability.addTarget(new TargetCardInYourGraveyard(filter, true)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/eventide/TillingTreefolk.java b/Mage.Sets/src/mage/sets/eventide/TillingTreefolk.java index fd8fc1de56..4e979b93b3 100644 --- a/Mage.Sets/src/mage/sets/eventide/TillingTreefolk.java +++ b/Mage.Sets/src/mage/sets/eventide/TillingTreefolk.java @@ -56,7 +56,7 @@ public class TillingTreefolk extends CardImpl { this.toughness = new MageInt(3); // When Tilling Treefolk enters the battlefield, you may return up to two target land cards from your graveyard to your hand. - Effect effect = new ReturnFromGraveyardToHandTargetEffect(true); + Effect effect = new ReturnFromGraveyardToHandTargetEffect(); effect.setText("you may return up to two target land cards from your graveyard to your hand"); Ability ability = new EntersBattlefieldTriggeredAbility(effect, true); ability.addTarget(new TargetCardInYourGraveyard(0, 2, new FilterLandCard())); diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/MorbidPlunder.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/MorbidPlunder.java index 3cc6526662..955dc96ace 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/MorbidPlunder.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/MorbidPlunder.java @@ -34,6 +34,7 @@ import mage.constants.Rarity; import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.filter.common.FilterCreatureCard; @@ -52,7 +53,8 @@ public class MorbidPlunder extends CardImpl { this.color.setBlack(true); - this.getSpellAbility().addEffect(new MorbidPlunderEffect()); + // Return up to two target creature cards from your graveyard to your hand. + this.getSpellAbility().addEffect(new ReturnFromGraveyardToHandTargetEffect()); this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(0, 2, new FilterCreatureCard("creature cards from your graveyard"))); } @@ -65,32 +67,3 @@ public class MorbidPlunder extends CardImpl { return new MorbidPlunder(this); } } - -class MorbidPlunderEffect extends OneShotEffect { - - public MorbidPlunderEffect() { - super(Outcome.ReturnToHand); - staticText = "Return up to two target creature cards from your graveyard to your hand"; - } - - public MorbidPlunderEffect(final MorbidPlunderEffect effect) { - super(effect); - } - - @Override - public MorbidPlunderEffect copy() { - return new MorbidPlunderEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - boolean result = false; - for (UUID target : targetPointer.getTargets(game, source)) { - Card card = game.getCard(target); - if (card != null) { - result |= card.moveToZone(Zone.HAND, source.getId(), game, true); - } - } - return result; - } -} diff --git a/Mage.Sets/src/mage/sets/ninthedition/Anarchist.java b/Mage.Sets/src/mage/sets/ninthedition/Anarchist.java index 9180a427a2..b8db8eb5f7 100644 --- a/Mage.Sets/src/mage/sets/ninthedition/Anarchist.java +++ b/Mage.Sets/src/mage/sets/ninthedition/Anarchist.java @@ -61,7 +61,7 @@ public class Anarchist extends CardImpl { this.toughness = new MageInt(2); // When Anarchist enters the battlefield, you may return target sorcery card from your graveyard to your hand. - Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnFromGraveyardToHandTargetEffect(true), true); + Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnFromGraveyardToHandTargetEffect(), true); ability.addTarget(new TargetCardInYourGraveyard(filter)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/theros/PharikasMender.java b/Mage.Sets/src/mage/sets/theros/PharikasMender.java index 3deec938e2..7331466714 100644 --- a/Mage.Sets/src/mage/sets/theros/PharikasMender.java +++ b/Mage.Sets/src/mage/sets/theros/PharikasMender.java @@ -65,7 +65,7 @@ public class PharikasMender extends CardImpl { this.toughness = new MageInt(3); // When Pharika's Mender enters the battlefield, you may return target creature or enchantment card from your graveyard to your hand. - Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnFromGraveyardToHandTargetEffect(true)); + Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnFromGraveyardToHandTargetEffect()); Target target = new TargetCardInYourGraveyard(filter); target.setRequired(true); ability.addTarget(target); diff --git a/Mage/src/mage/abilities/effects/common/ReturnFromGraveyardToHandTargetEffect.java b/Mage/src/mage/abilities/effects/common/ReturnFromGraveyardToHandTargetEffect.java index 08047b0086..90a21d68f8 100644 --- a/Mage/src/mage/abilities/effects/common/ReturnFromGraveyardToHandTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/ReturnFromGraveyardToHandTargetEffect.java @@ -37,6 +37,8 @@ import mage.constants.Outcome; import mage.constants.Zone; import mage.game.Game; import mage.players.Player; +import mage.target.Target; +import mage.util.CardUtil; /** * @@ -44,20 +46,12 @@ import mage.players.Player; */ public class ReturnFromGraveyardToHandTargetEffect extends OneShotEffect { - boolean informPlayers; - public ReturnFromGraveyardToHandTargetEffect() { - this(true); - } - - public ReturnFromGraveyardToHandTargetEffect(boolean informPlayers) { super(Outcome.ReturnToHand); - this.informPlayers = informPlayers; } public ReturnFromGraveyardToHandTargetEffect(final ReturnFromGraveyardToHandTargetEffect effect) { super(effect); - this.informPlayers = effect.informPlayers; } @Override @@ -71,13 +65,8 @@ public class ReturnFromGraveyardToHandTargetEffect extends OneShotEffect 1) { + if (target.getMaxNumberOfTargets() != target.getNumberOfTargets()) { + sb.append("up to "); + } + sb.append(CardUtil.numberToText(target.getMaxNumberOfTargets())).append(" "); + } if (!mode.getTargets().get(0).getTargetName().startsWith("another")) { sb.append("target "); }