* Fixed card movement handling for face down cards.

This commit is contained in:
LevelX2 2015-08-16 19:16:41 +02:00
parent 5ee01868a9
commit f50e67e385
8 changed files with 53 additions and 47 deletions

View file

@ -143,10 +143,10 @@ class NecropotenceEffect extends OneShotEffect {
Card card = controller.getLibrary().removeFromTop(game);
if (controller.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, Zone.LIBRARY, false)) {
card.setFaceDown(true, game);
Effect returnToHandeffect = new ReturnToHandTargetEffect(false);
returnToHandeffect.setText("put that face down card into your hand");
returnToHandeffect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game)));
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(returnToHandeffect, TargetController.YOU);
Effect returnToHandEffect = new ReturnToHandTargetEffect(false);
returnToHandEffect.setText("put that face down card into your hand");
returnToHandEffect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game)));
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(returnToHandEffect, TargetController.YOU);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game), game);

View file

@ -103,7 +103,7 @@ class VillainousWealthEffect extends OneShotEffect {
if (player != null) {
Cards cardsToExile = new CardsImpl();
cardsToExile.addAll(player.getLibrary().getTopCards(game, source.getManaCostsToPay().getX()));
controller.moveCards(cardsToExile, null, Zone.EXILED, source, game, true);
controller.moveCards(cardsToExile, null, Zone.EXILED, source, game);
if (controller.chooseUse(Outcome.PlayForFree, "Cast cards exiled with " + mageObject.getLogName() + " without paying its mana cost?", source, game)) {
OuterLoop:
while (cardsToExile.count(filter, game) > 0) {

View file

@ -153,7 +153,7 @@ class LobotomyEffect extends OneShotEffect {
}
if (!cardsToExile.isEmpty()) {
controller.moveCards(cardsToExile, null, Zone.EXILED, source, game, true);
controller.moveCards(cardsToExile, null, Zone.EXILED, source, game);
}
targetPlayer.shuffleLibrary(game);
return true;

View file

@ -27,6 +27,7 @@
*/
package mage.sets.tempest;
import java.util.Set;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
@ -110,7 +111,11 @@ class ScrollRackEffect extends OneShotEffect {
}
// Put that many cards from the top of your library into your hand.
if (amountExiled > 0) {
controller.moveCards(controller.getLibrary().getTopCards(game, amountExiled), null, Zone.HAND, source, game, false);
Set<Card> cards = controller.getLibrary().getTopCards(game, amountExiled);
for (Card card : cards) {
card.setFaceDown(true, game);
}
controller.moveCards(cards, null, Zone.HAND, source, game);
}
// Then look at the exiled cards and put them on top of your library in any order
controller.putCardsOnTopOfLibrary(game.getExile().getExileZone(source.getSourceId()), game, source, true);