Fixed ReturnFromExileEffect, some formatting.

This commit is contained in:
LevelX2 2014-04-25 19:27:08 +02:00
parent 3842aeba7d
commit 61add5ab5b
4 changed files with 27 additions and 24 deletions

View file

@ -28,16 +28,16 @@
package mage.sets.innistrad;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;

View file

@ -151,7 +151,7 @@ class PropheticFlamespeakerCastFromExileEffect extends AsThoughEffectImpl<Prophe
Player player = game.getPlayer(source.getControllerId());
if (player != null ) {
if (card.getCardType().contains(CardType.LAND)) {
// If the revealed card is a land, you can play it only if it's your turn and you haven't yet played a land this turn.
// If the revealed card is a land, you can play it only if it's your turn and you can play still a land this turn.
if (player.canPlayLand()
&& game.getActivePlayerId().equals(player.getId())
&& game.getStack().isEmpty()

View file

@ -88,24 +88,27 @@ public class ReturnFromExileEffect extends OneShotEffect<ReturnFromExileEffect>
exile = exile.copy();
for (UUID cardId: exile) {
Card card = game.getCard(cardId);
switch (zone) {
case BATTLEFIELD:
controller.putOntoBattlefieldWithInfo(card, game, Zone.EXILED, source.getSourceId(), tapped);
break;
case HAND:
controller.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.EXILED);
break;
case GRAVEYARD:
controller.moveCardToGraveyardWithInfo(card, source.getSourceId(), game, Zone.EXILED);
break;
case LIBRARY:
controller.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.EXILED, true);
break;
default:
card.moveToZone(zone, source.getSourceId(), game, tapped);
game.informPlayers(new StringBuilder(controller.getName()).append(" moves ").append(card.getName()).append(" to ").append(zone.toString()).toString());
Player owner = game.getPlayer(card.getOwnerId());
if (owner != null) {
switch (zone) {
case BATTLEFIELD:
card.moveToZone(zone, source.getSourceId(), game, tapped);
game.informPlayers(new StringBuilder(controller.getName()).append(" moves ").append(card.getName()).append(" to ").append(zone.toString()).toString());
break;
case HAND:
controller.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.EXILED);
break;
case GRAVEYARD:
controller.moveCardToGraveyardWithInfo(card, source.getSourceId(), game, Zone.EXILED);
break;
case LIBRARY:
controller.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.EXILED, true);
break;
default:
card.moveToZone(zone, source.getSourceId(), game, tapped);
game.informPlayers(new StringBuilder(controller.getName()).append(" moves ").append(card.getName()).append(" to ").append(zone.toString()).toString());
}
}
}
game.getExile().getExileZone(exileId).clear();
return true;

View file

@ -52,7 +52,7 @@ public enum CardRepository {
private static final String JDBC_URL = "jdbc:sqlite:db/cards.db";
private static final String VERSION_ENTITY_NAME = "card";
private static final long CARD_DB_VERSION = 29;
private static final long CARD_DB_VERSION = 30;
private final Random random = new Random();
private Dao<CardInfo, Object> cardDao;