mirror of
https://github.com/correl/mage.git
synced 2024-11-15 11:09:30 +00:00
Merge pull request #6078 from Tosh94/fix-nicol-bolas-god-pharaoh-+1
Fix NPE when using Nicol Bolas, God-Pharaoh's +1
This commit is contained in:
commit
fa62dac244
1 changed files with 11 additions and 5 deletions
|
@ -98,11 +98,17 @@ class NicolBolasGodPharaohPlusOneEffect extends OneShotEffect {
|
||||||
Player opponent = game.getPlayer(opponentId);
|
Player opponent = game.getPlayer(opponentId);
|
||||||
if (opponent != null) {
|
if (opponent != null) {
|
||||||
int numberOfCardsToExile = Math.min(2, opponent.getHand().size());
|
int numberOfCardsToExile = Math.min(2, opponent.getHand().size());
|
||||||
Target target = new TargetCardInHand(numberOfCardsToExile, new FilterCard());
|
if(numberOfCardsToExile > 0) {
|
||||||
target.setRequired(true);
|
Target target = new TargetCardInHand(numberOfCardsToExile, new FilterCard());
|
||||||
if (opponent.chooseTarget(Outcome.Exile, target, source, game)) {
|
target.setRequired(true);
|
||||||
Cards cards = new CardsImpl(target.getTargets());
|
if (opponent.chooseTarget(Outcome.Exile, target, source, game)) {
|
||||||
cardsToExile.put(opponentId, cards);
|
Cards cards = new CardsImpl(target.getTargets());
|
||||||
|
cardsToExile.put(opponentId, cards);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cardsToExile.put(opponentId, new CardsImpl());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue