Fixed some more possible exception bugs.

This commit is contained in:
LevelX2 2016-04-06 20:45:33 +02:00
parent 1ec61abb8e
commit 74c310de3e
4 changed files with 35 additions and 32 deletions

View file

@ -112,16 +112,18 @@ class StorageMatrixRestrictionEffect extends RestrictionEffect {
}
}
String choosenType = choiceImpl.getChoice();
game.informPlayers(storageMatrix.getLogName() + ": " + player.getLogName() + " chose to untap " + choosenType);
if (choosenType != null) {
game.informPlayers(storageMatrix.getLogName() + ": " + player.getLogName() + " chose to untap " + choosenType);
if (choosenType.equals(CardType.ARTIFACT.toString())) {
type = CardType.ARTIFACT;
} else if (choosenType.equals(CardType.LAND.toString())) {
type = CardType.LAND;
} else {
type = CardType.CREATURE;
if (choosenType.equals(CardType.ARTIFACT.toString())) {
type = CardType.ARTIFACT;
} else if (choosenType.equals(CardType.LAND.toString())) {
type = CardType.LAND;
} else {
type = CardType.CREATURE;
}
applies = true;
}
applies = true;
}
}
}

View file

@ -108,8 +108,10 @@ class SarkhanTheMadRevealAndDrawEffect extends OneShotEffect {
Card card = controller.getLibrary().getFromTop(game);
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
if (card != null) {
controller.moveCards(card, null, Zone.HAND, source, game);
sourcePermanent.damage(card.getManaCost().convertedManaCost(), source.getSourceId(), game, false, false);
controller.moveCards(card, Zone.HAND, source, game);
if (sourcePermanent != null) {
sourcePermanent.damage(card.getManaCost().convertedManaCost(), source.getSourceId(), game, false, false);
}
controller.revealCards(sourceObject.getIdName(), new CardsImpl(card), game);
}
return true;