* Mirror-Mad Phantasm - Fixed that you wrongly directly lost if there was no Mirror-Mad Phantasm at all in your library while revealing the cards from top of it.
@@ -40,8 +40,8 @@ import mage.cards.CardSetInfo;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.CardType;
-import mage.constants.SubType;
import mage.constants.Outcome;
+import mage.constants.SubType;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
@@ -96,19 +96,21 @@ class MirrorMadPhantasmEffect extends OneShotEffect {
perm.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
player.shuffleLibrary(source, game);
Cards cards = new CardsImpl();
- while (true) {
+ while (player.getLibrary().hasCards()) {
Card card = player.getLibrary().removeFromTop(game);
if (card == null) {
break;
}
if (card.getName().equals("Mirror-Mad Phantasm")) {
- card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), player.getId());
+ player.moveCards(card, Zone.BATTLEFIELD, source, game);
break;
}
cards.add(card);
}
+ if (!cards.isEmpty()) {
player.revealCards("Mirror-Mad Phantasm", cards, game);
player.moveCards(cards, Zone.GRAVEYARD, source, game);
+ }
return true;
}
}
