* 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

@ -28,7 +28,6 @@
package mage.sets.invasion;
import java.util.UUID;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.LookLibraryMayPutToBottomEffect;
import mage.cards.CardImpl;
@ -48,8 +47,8 @@ public class Opt extends CardImpl {
this.color.setBlue(true);
// Look at the top card of your library. You may put that card on the bottom of your library.
// This is functionally the same as scry, copy scry effect, removing "scry", unless theres a simpler way im overlooking?
this.getSpellAbility().addEffect(new LookLibraryMayPutToBottomEffect());
// Draw a card.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1));
}

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);
}