* Death Denied - Fixed the bug that only the first targeted card was returned to hand.

This commit is contained in:
LevelX2 2013-08-01 09:57:49 +02:00
parent 2e8c856617
commit bd83ca37d1

View file

@ -28,12 +28,13 @@
package mage.abilities.effects.common; package mage.abilities.effects.common;
import mage.constants.Outcome; import java.util.UUID;
import mage.constants.Zone;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.Mode; import mage.abilities.Mode;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.cards.Card; import mage.cards.Card;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.players.Player; import mage.players.Player;
@ -58,16 +59,17 @@ public class ReturnFromGraveyardToHandTargetEffect extends OneShotEffect<ReturnF
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Card card = game.getCard(source.getFirstTarget()); for (UUID cardId: getTargetPointer().getTargets(game, source)) {
if (card != null) { Card card = game.getCard(cardId);
if (card != null && game.getState().getZone(cardId).equals(Zone.GRAVEYARD)) {
Player player = game.getPlayer(card.getOwnerId()); Player player = game.getPlayer(card.getOwnerId());
if (player != null) { if (player != null) {
card.moveToZone(Zone.HAND, source.getSourceId(), game, false); card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
}
}
}
return true; return true;
} }
}
return false;
}
@Override @Override
public String getText(Mode mode) { public String getText(Mode mode) {