diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set15/elven/Card15_022.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set15/elven/Card15_022.java index a5a52028c..74573455b 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set15/elven/Card15_022.java +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set15/elven/Card15_022.java @@ -8,21 +8,15 @@ import com.gempukku.lotro.cards.effects.PutCardsFromDeckBeneathDrawDeckEffect; import com.gempukku.lotro.cards.effects.RevealTopCardsOfDrawDeckEffect; import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect; import com.gempukku.lotro.common.*; -import com.gempukku.lotro.filters.Filters; import com.gempukku.lotro.game.PhysicalCard; import com.gempukku.lotro.game.state.LotroGame; import com.gempukku.lotro.logic.actions.OptionalTriggerAction; -import com.gempukku.lotro.logic.decisions.ArbitraryCardsSelectionDecision; -import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException; +import com.gempukku.lotro.logic.effects.ChooseArbitraryCardsEffect; import com.gempukku.lotro.logic.effects.DrawOneCardEffect; -import com.gempukku.lotro.logic.effects.PlayoutDecisionEffect; import com.gempukku.lotro.logic.effects.PreventEffect; import com.gempukku.lotro.logic.timing.Effect; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Set; +import java.util.*; /** * Set: The Hunters @@ -59,23 +53,20 @@ public class Card15_022 extends AbstractPermanent { @Override protected void cardsRevealed(final List revealedCards) { action.appendEffect( - new PlayoutDecisionEffect(playerId, - new ArbitraryCardsSelectionDecision(1, "Choose card to put into your hand", revealedCards, - Filters.filter(revealedCards, game.getGameState(), game.getModifiersQuerying(), Side.FREE_PEOPLE, Side.FREE_PEOPLE), 1, 1) { - @Override - public void decisionMade(String result) throws DecisionResultInvalidException { - final List selectedCardsByResponse = getSelectedCardsByResponse(result); - Set cardsToPutOnBottom = new HashSet(revealedCards); - for (PhysicalCard physicalCard : selectedCardsByResponse) { - cardsToPutOnBottom.remove(physicalCard); - action.appendEffect( - new PutCardFromDeckIntoHandEffect(physicalCard)); - } + new ChooseArbitraryCardsEffect(playerId, "Choose card to put into your hand", revealedCards, Side.FREE_PEOPLE, 1, 1) { + @Override + protected void cardsSelected(LotroGame game, Collection selectedCards) { + Set cardsToPutOnBottom = new HashSet(revealedCards); + for (PhysicalCard physicalCard : selectedCards) { + cardsToPutOnBottom.remove(physicalCard); + action.appendEffect( + new PutCardFromDeckIntoHandEffect(physicalCard)); + } - action.appendEffect( - new PutCardsFromDeckBeneathDrawDeckEffect(action, self, playerId, cardsToPutOnBottom)); - } - })); + action.appendEffect( + new PutCardsFromDeckBeneathDrawDeckEffect(action, self, playerId, cardsToPutOnBottom)); + } + }); } }); return Collections.singletonList(action); diff --git a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/effects/ChooseArbitraryCardsEffect.java b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/effects/ChooseArbitraryCardsEffect.java index 5e3a160b2..2eb404154 100644 --- a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/effects/ChooseArbitraryCardsEffect.java +++ b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/effects/ChooseArbitraryCardsEffect.java @@ -11,11 +11,12 @@ import com.gempukku.lotro.logic.timing.Effect; import java.util.Collection; import java.util.Collections; +import java.util.HashSet; public abstract class ChooseArbitraryCardsEffect extends AbstractEffect { private String _playerId; private String _choiceText; - private Collection _cards; + private Collection _cards; private Filterable _filter; private int _minimum; private int _maximum; @@ -27,7 +28,7 @@ public abstract class ChooseArbitraryCardsEffect extends AbstractEffect { public ChooseArbitraryCardsEffect(String playerId, String choiceText, Collection cards, Filterable filter, int minimum, int maximum) { _playerId = playerId; _choiceText = choiceText; - _cards = cards; + _cards = new HashSet(cards); _filter = filter; _minimum = minimum; _maximum = maximum; @@ -65,7 +66,7 @@ public abstract class ChooseArbitraryCardsEffect extends AbstractEffect { cardsSelected(game, possibleCards); } else { game.getUserFeedback().sendAwaitingDecision(_playerId, - new ArbitraryCardsSelectionDecision(1, _choiceText, possibleCards, _minimum, _maximum) { + new ArbitraryCardsSelectionDecision(1, _choiceText, _cards, possibleCards, _minimum, _maximum) { @Override public void decisionMade(String result) throws DecisionResultInvalidException { cardsSelected(game, getSelectedCardsByResponse(result)); diff --git a/gemp-lotr/gemp-lotr-web/src/main/webapp/includes/changeLog.html b/gemp-lotr/gemp-lotr-web/src/main/webapp/includes/changeLog.html index 5bfefd59d..ebbe1696e 100644 --- a/gemp-lotr/gemp-lotr-web/src/main/webapp/includes/changeLog.html +++ b/gemp-lotr/gemp-lotr-web/src/main/webapp/includes/changeLog.html @@ -2,6 +2,7 @@ 14 May 2012 - "City of Men" should now correctly discard a minion at the end of the skirmish. - "Extraordinary Resilience" should now work correctly. +- "The Mirror of Galadriel, Dangerous Guide" should no longer freeze the game, if top 3 cards are shadow only. 13 May 2012 - "Isengard Ruined" should now correctly allow to exert companion twice.