* 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,15 +59,16 @@ 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);
Player player = game.getPlayer(card.getOwnerId()); if (card != null && game.getState().getZone(cardId).equals(Zone.GRAVEYARD)) {
if (player != null) { Player player = game.getPlayer(card.getOwnerId());
card.moveToZone(Zone.HAND, source.getSourceId(), game, false); if (player != null) {
return true; card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
}
} }
} }
return false; return true;
} }
@Override @Override