* Cursed Scroll - Fixed that the card name dialog was not opened.

This commit is contained in:
LevelX2 2015-10-21 20:24:39 +02:00
parent 4629366ae7
commit 305712806c
2 changed files with 8 additions and 9 deletions

View file

@ -29,9 +29,6 @@ package mage.sets.tempest;
import java.util.UUID; import java.util.UUID;
import mage.MageObject; import mage.MageObject;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.common.TapSourceCost;
@ -42,7 +39,9 @@ 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.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone; import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
@ -91,15 +90,15 @@ class CursedScrollEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player you = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = game.getObject(source.getSourceId()); MageObject sourceObject = game.getObject(source.getSourceId());
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY); String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY);
if (sourceObject != null && you != null && cardName != null && !cardName.isEmpty()) { if (sourceObject != null && controller != null && cardName != null && !cardName.isEmpty()) {
if (you.getHand().size() > 0) { if (controller.getHand().size() > 0) {
Cards revealed = new CardsImpl(); Cards revealed = new CardsImpl();
Card card = you.getHand().getRandom(game); Card card = controller.getHand().getRandom(game);
revealed.add(card); revealed.add(card);
you.revealCards(sourceObject.getName(), revealed, game); controller.revealCards(sourceObject.getIdName(), revealed, game);
if (card.getName().equals(cardName)) { if (card.getName().equals(cardName)) {
Permanent creature = game.getPermanent(targetPointer.getFirst(game, source)); Permanent creature = game.getPermanent(targetPointer.getFirst(game, source));
if (creature != null) { if (creature != null) {

View file

@ -73,7 +73,7 @@ public class NameACardEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = game.getPermanentEntering(source.getSourceId()); MageObject sourceObject = game.getPermanentEntering(source.getSourceId());
if (sourceObject == null) { if (sourceObject == null) {
game.getObject(source.getSourceId()); sourceObject = game.getObject(source.getSourceId());
} }
if (controller != null && sourceObject != null) { if (controller != null && sourceObject != null) {
Choice cardChoice = new ChoiceImpl(); Choice cardChoice = new ChoiceImpl();