Removed info option from ReturnFromGraveyardToHand, info is always written to log.

This commit is contained in:
LevelX2 2014-04-16 17:38:00 +02:00
parent fb145b2811
commit fc56b8bc88
7 changed files with 20 additions and 51 deletions

View file

@ -68,7 +68,7 @@ public class DawnToDusk extends CardImpl<DawnToDusk> {
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();

View file

@ -65,11 +65,11 @@ public class OdunosRiverTrawler extends CardImpl<OdunosRiverTrawler> {
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);
}

View file

@ -56,7 +56,7 @@ public class TillingTreefolk extends CardImpl<TillingTreefolk> {
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()));

View file

@ -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<MorbidPlunder> {
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<MorbidPlunder> {
return new MorbidPlunder(this);
}
}
class MorbidPlunderEffect extends OneShotEffect<MorbidPlunderEffect> {
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;
}
}

View file

@ -61,7 +61,7 @@ public class Anarchist extends CardImpl<Anarchist> {
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);
}

View file

@ -65,7 +65,7 @@ public class PharikasMender extends CardImpl<PharikasMender> {
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);

View file

@ -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<ReturnFromGraveyardToHandTargetEffect> {
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<ReturnF
Card card = game.getCard(cardId);
if (card != null && game.getState().getZone(cardId).equals(Zone.GRAVEYARD)) {
Player player = game.getPlayer(card.getOwnerId());
if (player != null) {
if (informPlayers) {
player.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.GRAVEYARD);
} else {
card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
}
if (player != null) {
player.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.GRAVEYARD);
}
}
}
@ -90,7 +79,14 @@ public class ReturnFromGraveyardToHandTargetEffect extends OneShotEffect<ReturnF
return staticText;
}
StringBuilder sb = new StringBuilder();
Target target = mode.getTargets().get(0);
sb.append("Return ");
if (target.getMaxNumberOfTargets() > 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 ");
}