- "The Mirror of Galadriel, Dangerous Guide" should no longer freeze the game, if top 3 cards are shadow only.

This commit is contained in:
marcins78@gmail.com
2012-05-14 15:19:37 +00:00
parent dc3e579758
commit cffc754e86
3 changed files with 20 additions and 27 deletions

View File

@@ -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<PhysicalCard> 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<PhysicalCard> selectedCardsByResponse = getSelectedCardsByResponse(result);
Set<PhysicalCard> cardsToPutOnBottom = new HashSet<PhysicalCard>(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<PhysicalCard> selectedCards) {
Set<PhysicalCard> cardsToPutOnBottom = new HashSet<PhysicalCard>(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);

View File

@@ -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<? extends PhysicalCard> _cards;
private Collection<PhysicalCard> _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<? extends PhysicalCard> cards, Filterable filter, int minimum, int maximum) {
_playerId = playerId;
_choiceText = choiceText;
_cards = cards;
_cards = new HashSet<PhysicalCard>(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));

View File

@@ -2,6 +2,7 @@
<b>14 May 2012</b>
- "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.
<b>13 May 2012</b>
- "Isengard Ruined" should now correctly allow to exert companion twice.