* Lord of the Void - Fixed card move handling.

This commit is contained in:
LevelX2 2015-12-09 22:10:43 +01:00
parent af793c30fe
commit 7f105fb123

View file

@ -29,10 +29,6 @@
package mage.sets.gatecrash; package mage.sets.gatecrash;
import java.util.UUID; import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
@ -42,6 +38,10 @@ import mage.cards.Card;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.Cards; import mage.cards.Cards;
import mage.cards.CardsImpl; import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterCreatureCard; import mage.filter.common.FilterCreatureCard;
import mage.game.Game; import mage.game.Game;
import mage.players.Player; import mage.players.Player;
@ -58,7 +58,6 @@ public class LordOfTheVoid extends CardImpl {
this.expansionSetCode = "GTC"; this.expansionSetCode = "GTC";
this.subtype.add("Demon"); this.subtype.add("Demon");
this.power = new MageInt(7); this.power = new MageInt(7);
this.toughness = new MageInt(7); this.toughness = new MageInt(7);
@ -79,11 +78,10 @@ public class LordOfTheVoid extends CardImpl {
} }
} }
class LordOfTheVoidEffect extends OneShotEffect { class LordOfTheVoidEffect extends OneShotEffect {
public LordOfTheVoidEffect() { public LordOfTheVoidEffect() {
super(Outcome.PutCardInPlay); super(Outcome.PutCreatureInPlay);
this.staticText = "exile the top seven cards of that player's library, then put a creature card from among them onto the battlefield under your control"; this.staticText = "exile the top seven cards of that player's library, then put a creature card from among them onto the battlefield under your control";
} }
@ -105,20 +103,14 @@ class LordOfTheVoidEffect extends OneShotEffect {
} }
Cards cards = new CardsImpl(); Cards cards = new CardsImpl();
int max = Math.min(player.getLibrary().size(), 7); cards.addAll(player.getLibrary().getTopCards(game, 7));
for(int i = 0; i < max; i++){ controller.moveCards(cards, Zone.EXILED, source, game);
Card card = player.getLibrary().removeFromTop(game);
if (card != null) {
card.moveToExile(null, "", source.getSourceId(), game);
cards.add(card);
}
}
if (cards.getCards(new FilterCreatureCard(), game).size() > 0) { if (cards.getCards(new FilterCreatureCard(), game).size() > 0) {
TargetCard target = new TargetCard(Zone.EXILED, new FilterCreatureCard()); TargetCard target = new TargetCard(Zone.EXILED, new FilterCreatureCard());
if(controller.chooseTarget(Outcome.PutCreatureInPlay, cards, target, source, game)){ if (controller.chooseTarget(outcome, cards, target, source, game)) {
Card card = cards.get(target.getFirstTarget(), game); Card card = cards.get(target.getFirstTarget(), game);
if (card != null) { if (card != null) {
card.putOntoBattlefield(game, Zone.EXILED, source.getSourceId(), source.getControllerId()); controller.moveCards(cards.getCards(game), Zone.BATTLEFIELD, source, game, false, false, false, null);
} }
} }
} }