* Opt - Fixed missing reveal window.

This commit is contained in:
LevelX2 2014-10-29 14:18:16 +01:00
parent 5c05e7885c
commit d0c055c5fd
2 changed files with 6 additions and 3 deletions

View file

@ -6,9 +6,11 @@
package mage.abilities.effects.common;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardsImpl;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game;
@ -33,7 +35,8 @@ public class LookLibraryMayPutToBottomEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller == null) {
MageObject sourceObject = game.getObject(source.getSourceId());
if (sourceObject == null || controller == null) {
return false;
}
if (!controller.getLibrary().isEmptyDraw()) {
@ -41,6 +44,7 @@ public class LookLibraryMayPutToBottomEffect extends OneShotEffect {
if (card == null) {
return false;
}
controller.lookAtCards(sourceObject.getLogName(), new CardsImpl(card), game);
boolean toBottom = controller.chooseUse(outcome, "Put card on the bottom of your library?", game);
return controller.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.LIBRARY, !toBottom, false);
}