- If you have "No Business of Ours" in play, you can still reveal or look at FP player's hand.

This commit is contained in:
marcins78@gmail.com
2013-01-05 19:11:41 +00:00
parent 10bebc8f2a
commit d479b3d44e
13 changed files with 29 additions and 22 deletions

View File

@@ -32,12 +32,12 @@ public class LookAtOpponentsHandEffect extends AbstractEffect {
@Override
public boolean isPlayableInFull(LotroGame game) {
return game.getModifiersQuerying().canLookOrRevealCardsInHand(game.getGameState(), _opponentId);
return game.getModifiersQuerying().canLookOrRevealCardsInHand(game.getGameState(), _opponentId, _playerId);
}
@Override
protected FullEffectResult playEffectReturningResult(LotroGame game) {
if (game.getModifiersQuerying().canLookOrRevealCardsInHand(game.getGameState(), _opponentId)) {
if (game.getModifiersQuerying().canLookOrRevealCardsInHand(game.getGameState(), _opponentId, _playerId)) {
List<PhysicalCard> opponentHand = new LinkedList<PhysicalCard>(game.getGameState().getHand(_opponentId));
game.getUserFeedback().sendAwaitingDecision(_playerId,

View File

@@ -38,13 +38,13 @@ public abstract class RevealAndChooseCardsFromOpponentHandEffect extends Abstrac
@Override
public boolean isPlayableInFull(LotroGame game) {
return (game.getModifiersQuerying().canLookOrRevealCardsInHand(game.getGameState(), _opponentId))
return (game.getModifiersQuerying().canLookOrRevealCardsInHand(game.getGameState(), _opponentId, _playerId))
&& game.getGameState().getHand(_opponentId).size() >= _minChosen;
}
@Override
public void playEffect(LotroGame game) {
if (game.getModifiersQuerying().canLookOrRevealCardsInHand(game.getGameState(), _opponentId)) {
if (game.getModifiersQuerying().canLookOrRevealCardsInHand(game.getGameState(), _opponentId, _playerId)) {
List<PhysicalCard> opponentHand = new LinkedList<PhysicalCard>(game.getGameState().getHand(_opponentId));
SubAction subAction = new SubAction(_action);

View File

@@ -34,7 +34,7 @@ public abstract class RevealRandomCardsFromHandEffect extends AbstractEffect {
@Override
protected FullEffectResult playEffectReturningResult(LotroGame game) {
if (_actingPlayer.equals(_playerHand) || game.getModifiersQuerying().canLookOrRevealCardsInHand(game.getGameState(), _playerHand)) {
if (_actingPlayer.equals(_playerHand) || game.getModifiersQuerying().canLookOrRevealCardsInHand(game.getGameState(), _playerHand, _actingPlayer)) {
List<PhysicalCard> randomCards = GameUtils.getRandomCards(game.getGameState().getHand(_playerHand), _count);
if (randomCards.size() > 0)
game.getGameState().sendMessage(GameUtils.getCardLink(_source) + " revealed cards from " + _playerHand + " hand at random - " + getAppendedNames(randomCards));
@@ -51,7 +51,7 @@ public abstract class RevealRandomCardsFromHandEffect extends AbstractEffect {
public boolean isPlayableInFull(LotroGame game) {
if (game.getGameState().getHand(_playerHand).size() < _count)
return false;
return _actingPlayer.equals(_playerHand) || game.getModifiersQuerying().canLookOrRevealCardsInHand(game.getGameState(), _playerHand);
return _actingPlayer.equals(_playerHand) || game.getModifiersQuerying().canLookOrRevealCardsInHand(game.getGameState(), _playerHand, _actingPlayer);
}
protected abstract void cardsRevealed(List<PhysicalCard> revealedCards);

View File

@@ -7,20 +7,24 @@ import com.gempukku.lotro.logic.modifiers.ModifierEffect;
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
public class OpponentsCantLookOrRevealCardsFromHand extends AbstractModifier {
private String _playerId;
private String _revealingPlayerId;
private String _actingPlayerId;
public OpponentsCantLookOrRevealCardsFromHand(PhysicalCard source, String playerId) {
public OpponentsCantLookOrRevealCardsFromHand(PhysicalCard source, String revealingPlayerId) {
super(source, "Opponents can't look or reveal cards from hand", null, ModifierEffect.LOOK_OR_REVEAL_MODIFIER);
_playerId = playerId;
_revealingPlayerId = revealingPlayerId;
}
public OpponentsCantLookOrRevealCardsFromHand(PhysicalCard source) {
this(source, null);
public OpponentsCantLookOrRevealCardsFromHand(PhysicalCard source, String revealingPlayerId, String actingPlayerId) {
this(source, revealingPlayerId);
_actingPlayerId = actingPlayerId;
}
@Override
public boolean canLookOrRevealCardsInHand(GameState gameState, ModifiersQuerying modifiersQuerying, String playerId) {
if (_playerId == null || _playerId.equals(playerId))
public boolean canLookOrRevealCardsInHand(GameState gameState, ModifiersQuerying modifiersQuerying, String revealingPlayerId, String actingPlayerId) {
if (_revealingPlayerId == null || _revealingPlayerId.equals(revealingPlayerId))
return false;
if (_actingPlayerId == null || _actingPlayerId.equals(actingPlayerId))
return false;
return true;
}

View File

@@ -50,7 +50,7 @@ public class Card1_055 extends AbstractPermanent {
new MultipleChoiceAwaitingDecision(1, "Choose opponent with at least 7 cards in hand", opponentsHavingAtLeast7Cards(game, playerId)) {
@Override
protected void validDecisionMade(int index, final String chosenOpponent) {
if (game.getModifiersQuerying().canLookOrRevealCardsInHand(game.getGameState(), chosenOpponent)) {
if (game.getModifiersQuerying().canLookOrRevealCardsInHand(game.getGameState(), chosenOpponent, playerId)) {
List<? extends PhysicalCard> hand = game.getGameState().getHand(chosenOpponent);
List<PhysicalCard> randomCardsFromHand = GameUtils.getRandomCards(hand, 2);
action.appendEffect(

View File

@@ -56,7 +56,7 @@ public class Card1_120 extends AbstractPermanent {
final ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(new RemoveTwilightEffect(3));
final String fpPlayer = gameState.getCurrentPlayerId();
if (game.getModifiersQuerying().canLookOrRevealCardsInHand(game.getGameState(), fpPlayer)) {
if (game.getModifiersQuerying().canLookOrRevealCardsInHand(game.getGameState(), fpPlayer, playerId)) {
action.appendEffect(
new ForEachBurdenYouSpotEffect(playerId) {
@Override

View File

@@ -36,6 +36,6 @@ public class Card2_044 extends AbstractPermanent {
@Override
public List<? extends Modifier> getAlwaysOnModifiers(LotroGame game, PhysicalCard self) {
return Collections.singletonList(new OpponentsCantLookOrRevealCardsFromHand(self));
return Collections.singletonList(new OpponentsCantLookOrRevealCardsFromHand(self, null, game.getGameState().getCurrentPlayerId()));
}
}

View File

@@ -288,7 +288,7 @@ public abstract class AbstractModifier implements Modifier {
}
@Override
public boolean canLookOrRevealCardsInHand(GameState gameState, ModifiersQuerying modifiersQuerying, String playerId) {
public boolean canLookOrRevealCardsInHand(GameState gameState, ModifiersQuerying modifiersQuerying, String revealingPlayerId, String actingPlayerId) {
return true;
}

View File

@@ -114,7 +114,7 @@ public interface Modifier {
public boolean canRemoveThreat(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard source);
public boolean canLookOrRevealCardsInHand(GameState gameState, ModifiersQuerying modifiersQuerying, String playerId);
public boolean canLookOrRevealCardsInHand(GameState gameState, ModifiersQuerying modifiersQuerying, String revealingPlayerId, String actingPlayerId);
public boolean canDiscardCardsFromHand(GameState gameState, ModifiersQuerying modifiersQuerying, String playerId, PhysicalCard source);

View File

@@ -879,9 +879,9 @@ public class ModifiersLogic implements ModifiersEnvironment, ModifiersQuerying {
}
@Override
public boolean canLookOrRevealCardsInHand(GameState gameState, String playerId) {
public boolean canLookOrRevealCardsInHand(GameState gameState, String revealingPlayerId, String performingPlayerId) {
for (Modifier modifier : getModifiers(gameState, ModifierEffect.LOOK_OR_REVEAL_MODIFIER))
if (!modifier.canLookOrRevealCardsInHand(gameState, this, playerId))
if (!modifier.canLookOrRevealCardsInHand(gameState, this, revealingPlayerId, performingPlayerId))
return false;
return true;
}

View File

@@ -120,7 +120,7 @@ public interface ModifiersQuerying {
public boolean canDrawCardAndIncrement(GameState gameState, String playerId);
public boolean canLookOrRevealCardsInHand(GameState gameState, String playerId);
public boolean canLookOrRevealCardsInHand(GameState gameState, String revealingPlayerId, String performingPlayerId);
public boolean canDiscardCardsFromHand(GameState gameState, String playerId, PhysicalCard source);

View File

@@ -156,7 +156,7 @@ public class TournamentService {
}
public List<TournamentQueueInfo> getUnstartedScheduledTournamentQueues(long tillDate) {
return _tournamentDao.getUnstartedScheduledTournamentQueues();
return _tournamentDao.getUnstartedScheduledTournamentQueues(tillDate);
}
public void updateScheduledTournamentStarted(String scheduledTournamentId) {

View File

@@ -5,6 +5,9 @@ response.setHeader("Pragma","no-cache");
response.setDateHeader ("Expires", -1);
%>
<pre style="font-size:80%">
<b>05 Jan. 2013</b>
- If you have "No Business of Ours" in play, you can still reveal or look at FP player's hand.
<b>04 Jan. 2013</b>
- If FP player uses Muster, shadow player is now also able to use it.
- "Gnawing, Biting, Hacking, Burning" and similar cards should now allow to stack multiple minions if they are discarded