RevealHandEffect now correctly checks the "can't reveal" effects.

This commit is contained in:
MarcinSc
2016-12-05 13:42:17 -08:00
parent be8a883c40
commit edb09087cf

View File

@@ -41,30 +41,34 @@ public class RevealHandEffect extends AbstractEffect {
@Override @Override
protected FullEffectResult playEffectReturningResult(LotroGame game) { protected FullEffectResult playEffectReturningResult(LotroGame game) {
final List<? extends PhysicalCard> hand = game.getGameState().getHand(_handPlayerId); if (game.getModifiersQuerying().canLookOrRevealCardsInHand(game.getGameState(), _handPlayerId, _actingPlayer)) {
game.getGameState().sendMessage(GameUtils.getCardLink(_source) + " revealed " + _handPlayerId + " cards in hand - " + getAppendedNames(hand)); final List<? extends PhysicalCard> hand = game.getGameState().getHand(_handPlayerId);
game.getGameState().sendMessage(GameUtils.getCardLink(_source) + " revealed " + _handPlayerId + " cards in hand - " + getAppendedNames(hand));
final PlayOrder playerOrder = game.getGameState().getPlayerOrder().getCounterClockwisePlayOrder(_handPlayerId, false); final PlayOrder playerOrder = game.getGameState().getPlayerOrder().getCounterClockwisePlayOrder(_handPlayerId, false);
// Skip hand owner // Skip hand owner
playerOrder.getNextPlayer(); playerOrder.getNextPlayer();
String nextPlayer; String nextPlayer;
while ((nextPlayer = playerOrder.getNextPlayer()) != null) { while ((nextPlayer = playerOrder.getNextPlayer()) != null) {
game.getUserFeedback().sendAwaitingDecision(nextPlayer, game.getUserFeedback().sendAwaitingDecision(nextPlayer,
new ArbitraryCardsSelectionDecision(1, "Hand of " + _handPlayerId, hand, Collections.<PhysicalCard>emptySet(), 0, 0) { new ArbitraryCardsSelectionDecision(1, "Hand of " + _handPlayerId, hand, Collections.<PhysicalCard>emptySet(), 0, 0) {
@Override @Override
public void decisionMade(String result) throws DecisionResultInvalidException { public void decisionMade(String result) throws DecisionResultInvalidException {
} }
}); });
}
cardsRevealed(hand);
for (PhysicalCard card : hand) {
game.getActionsEnvironment().emitEffectResult(new RevealCardFromHandResult(_source, _handPlayerId, card));
}
return new FullEffectResult(true);
} else {
return new FullEffectResult(false);
} }
cardsRevealed(hand);
for (PhysicalCard card : hand) {
game.getActionsEnvironment().emitEffectResult(new RevealCardFromHandResult(_source, _handPlayerId, card));
}
return new FullEffectResult(true);
} }
protected void cardsRevealed(Collection<? extends PhysicalCard> cards) { protected void cardsRevealed(Collection<? extends PhysicalCard> cards) {