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
protected FullEffectResult playEffectReturningResult(LotroGame game) {
final List<? extends PhysicalCard> hand = game.getGameState().getHand(_handPlayerId);
game.getGameState().sendMessage(GameUtils.getCardLink(_source) + " revealed " + _handPlayerId + " cards in hand - " + getAppendedNames(hand));
if (game.getModifiersQuerying().canLookOrRevealCardsInHand(game.getGameState(), _handPlayerId, _actingPlayer)) {
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);
// Skip hand owner
playerOrder.getNextPlayer();
final PlayOrder playerOrder = game.getGameState().getPlayerOrder().getCounterClockwisePlayOrder(_handPlayerId, false);
// Skip hand owner
playerOrder.getNextPlayer();
String nextPlayer;
while ((nextPlayer = playerOrder.getNextPlayer()) != null) {
game.getUserFeedback().sendAwaitingDecision(nextPlayer,
new ArbitraryCardsSelectionDecision(1, "Hand of " + _handPlayerId, hand, Collections.<PhysicalCard>emptySet(), 0, 0) {
@Override
public void decisionMade(String result) throws DecisionResultInvalidException {
}
});
String nextPlayer;
while ((nextPlayer = playerOrder.getNextPlayer()) != null) {
game.getUserFeedback().sendAwaitingDecision(nextPlayer,
new ArbitraryCardsSelectionDecision(1, "Hand of " + _handPlayerId, hand, Collections.<PhysicalCard>emptySet(), 0, 0) {
@Override
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) {