From 36883cc4d1b4d2c1e4876f27441675515ce3d2eb Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Mon, 21 Jan 2019 16:07:17 +0100 Subject: [PATCH] * Parallel Thoughts - Fixed handling of replacement effect (was not optional). --- .../src/mage/cards/p/ParallelThoughts.java | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/Mage.Sets/src/mage/cards/p/ParallelThoughts.java b/Mage.Sets/src/mage/cards/p/ParallelThoughts.java index 16858edec0..e000b52815 100644 --- a/Mage.Sets/src/mage/cards/p/ParallelThoughts.java +++ b/Mage.Sets/src/mage/cards/p/ParallelThoughts.java @@ -1,4 +1,3 @@ - package mage.cards.p; import java.util.Arrays; @@ -86,7 +85,7 @@ class ParallelThoughtsSearchEffect extends OneShotEffect { } } // shuffle that exiled pile - + UUID[] shuffled = cardsInExilePile.toArray(new UUID[0]); for (int n = shuffled.length - 1; n > 0; n--) { int r = RandomUtil.nextInt(n + 1); @@ -96,16 +95,15 @@ class ParallelThoughtsSearchEffect extends OneShotEffect { } cardsInExilePile.clear(); cardsInExilePile.addAll(Arrays.asList(shuffled)); - + // move to exile zone and turn face down - + String exileName = permanent.getIdName() + " (" + game.getState().getZoneChangeCounter(source.getSourceId()) + ")"; for (Card card : cardsInExilePile.getCards(game)) { - controller.moveCardsToExile(card, source, game, false, CardUtil.getCardExileZoneId(game, source), permanent.getLogName()); + controller.moveCardsToExile(card, source, game, false, CardUtil.getCardExileZoneId(game, source), exileName); card.setFaceDown(true, game); } - + // shuffle controller library - controller.shuffleLibrary(source, game); } return true; @@ -118,7 +116,7 @@ class ParallelThoughtsReplacementEffect extends ReplacementEffectImpl { ParallelThoughtsReplacementEffect() { super(Duration.WhileOnBattlefield, Outcome.DrawCard); - staticText = "If you would draw a card, you may instead put the top card of the pile you exiled with Parallel Thoughts into your hand"; + staticText = "If you would draw a card, you may instead put the top card of the pile you exiled with {this} into your hand"; } ParallelThoughtsReplacementEffect(final ParallelThoughtsReplacementEffect effect) { @@ -135,12 +133,15 @@ class ParallelThoughtsReplacementEffect extends ReplacementEffectImpl { Player controller = game.getPlayer(source.getControllerId()); if (controller != null && !game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, source)).getCards(game).isEmpty()) { - Card card = game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, source)).getCards(game).iterator().next(); - if (card != null) { - controller.moveCards(card, Zone.HAND, source, game); + if (controller.chooseUse(outcome, "Draw a card from the pile you exiled instead drawing from your library?", source, game)) { + Card card = game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, source)).getCards(game).iterator().next(); + if (card != null) { + controller.moveCards(card, Zone.HAND, source, game); + } + return true; } } - return true; + return false; } @Override