mirror of
https://github.com/magefree/mage.git
synced 2025-12-26 05:22:02 -08:00
replaced various instances of ReturnToHandTargetEffect with ReturnFromGraveyardToHandTargetEffect
This commit is contained in:
parent
daea494f41
commit
ccecda52fd
82 changed files with 471 additions and 625 deletions
|
|
@ -3,7 +3,6 @@ package mage.abilities.effects.common;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.constants.Outcome;
|
||||
|
|
@ -14,7 +13,6 @@ import mage.target.Target;
|
|||
import mage.util.CardUtil;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeff
|
||||
*/
|
||||
public class ReturnFromGraveyardToHandTargetEffect extends OneShotEffect {
|
||||
|
|
@ -38,14 +36,9 @@ public class ReturnFromGraveyardToHandTargetEffect extends OneShotEffect {
|
|||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
Cards cardsInGraveyard = new CardsImpl(getTargetPointer().getTargets(game, source));
|
||||
for (Card card : cardsInGraveyard.getCards(game)) {
|
||||
if (card != null
|
||||
&& game.getState().getZone(card.getId()) == Zone.GRAVEYARD) {
|
||||
controller.moveCards(card, Zone.HAND, source, game); //verify the target card is still in the graveyard
|
||||
}
|
||||
}
|
||||
return false;
|
||||
Cards cards = new CardsImpl(getTargetPointer().getTargets(game, source));
|
||||
cards.retainZone(Zone.GRAVEYARD, game); //verify the target card is still in the graveyard
|
||||
return !cards.isEmpty() && controller.moveCards(cards, Zone.HAND, source, game);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -62,10 +55,14 @@ public class ReturnFromGraveyardToHandTargetEffect extends OneShotEffect {
|
|||
} else if (target.getMaxNumberOfTargets() > 1) {
|
||||
sb.append(CardUtil.numberToText(target.getMaxNumberOfTargets())).append(' ');
|
||||
}
|
||||
if (!mode.getTargets().get(0).getTargetName().startsWith("another")) {
|
||||
if (!target.getTargetName().startsWith("another")) {
|
||||
sb.append("target ");
|
||||
}
|
||||
sb.append(mode.getTargets().get(0).getTargetName()).append(" to your hand");
|
||||
sb.append(target.getTargetName());
|
||||
if (!target.getTargetName().endsWith("graveyard")) {
|
||||
sb.append(" from your graveyard");
|
||||
}
|
||||
sb.append(" to your hand");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -124,6 +124,12 @@ public final class StaticFilters {
|
|||
FILTER_CARD_INSTANT_OR_SORCERY_FROM_YOUR_GRAVEYARD.setLockedFilter(true);
|
||||
}
|
||||
|
||||
public static final FilterCard FILTER_CARD_ARTIFACT_FROM_YOUR_GRAVEYARD = new FilterInstantOrSorceryCard("artifact card from your graveyard");
|
||||
|
||||
static {
|
||||
FILTER_CARD_ARTIFACT_FROM_YOUR_GRAVEYARD.setLockedFilter(true);
|
||||
}
|
||||
|
||||
public static final FilterNoncreatureCard FILTER_CARD_NON_CREATURE = new FilterNoncreatureCard();
|
||||
|
||||
static {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue