- Changed how revealing hand or cards from hand works.

This commit is contained in:
marcins78
2014-08-07 10:40:30 +00:00
parent 767ea2f77f
commit bd94aac88b
39 changed files with 402 additions and 191 deletions

View File

@@ -1,4 +1,7 @@
<pre style="font-size:80%">
<b>7 Aug. 2014</b>
- Changed how revealing hand or cards from hand works.
<b>23 July 2014</b>
- It should be now possible to use "Trophy" cards in "My cards" tournaments and leagues (starting with any newly created
league).

View File

@@ -4,7 +4,7 @@ import com.gempukku.lotro.common.Filterable;
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.SubAction;
import com.gempukku.lotro.logic.PlayOrder;
import com.gempukku.lotro.logic.decisions.ArbitraryCardsSelectionDecision;
import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException;
import com.gempukku.lotro.logic.timing.AbstractSubActionEffect;
@@ -12,6 +12,7 @@ import com.gempukku.lotro.logic.timing.Action;
import com.gempukku.lotro.logic.timing.Effect;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
@@ -47,21 +48,32 @@ public abstract class RevealAndChooseCardsFromOpponentHandEffect extends Abstrac
if (game.getModifiersQuerying().canLookOrRevealCardsInHand(game.getGameState(), _opponentId, _playerId)) {
List<PhysicalCard> opponentHand = new LinkedList<PhysicalCard>(game.getGameState().getHand(_opponentId));
SubAction subAction = new SubAction(_action);
subAction.appendEffect(
new RevealCardsFromHandEffect(_source, _opponentId, opponentHand));
processSubAction(game, subAction);
final PlayOrder playOrder = game.getGameState().getPlayerOrder().getCounterClockwisePlayOrder(_opponentId, false);
// Skip hand owner (opponent)
playOrder.getNextPlayer();
Collection<PhysicalCard> selectable = Filters.filter(opponentHand, game.getGameState(), game.getModifiersQuerying(), _selectionFilter);
String nextPlayer;
while ((nextPlayer = playOrder.getNextPlayer()) != null) {
if (nextPlayer.equals(_playerId)) {
Collection<PhysicalCard> selectable = Filters.filter(opponentHand, game.getGameState(), game.getModifiersQuerying(), _selectionFilter);
game.getUserFeedback().sendAwaitingDecision(_playerId,
new ArbitraryCardsSelectionDecision(1, _text, opponentHand, new LinkedList<PhysicalCard>(selectable), Math.min(_minChosen, selectable.size()), Math.min(_maxChosen, selectable.size())) {
@Override
public void decisionMade(String result) throws DecisionResultInvalidException {
List<PhysicalCard> selectedCards = getSelectedCardsByResponse(result);
cardsSelected(selectedCards);
}
});
game.getUserFeedback().sendAwaitingDecision(nextPlayer,
new ArbitraryCardsSelectionDecision(1, _text, opponentHand, new LinkedList<PhysicalCard>(selectable), Math.min(_minChosen, selectable.size()), Math.min(_maxChosen, selectable.size())) {
@Override
public void decisionMade(String result) throws DecisionResultInvalidException {
List<PhysicalCard> selectedCards = getSelectedCardsByResponse(result);
cardsSelected(selectedCards);
}
});
} else if (!nextPlayer.equals(_opponentId)) {
game.getUserFeedback().sendAwaitingDecision(nextPlayer,
new ArbitraryCardsSelectionDecision(1, "Hand of " + _opponentId, opponentHand, Collections.<PhysicalCard>emptySet(), 0, 0) {
@Override
public void decisionMade(String result) throws DecisionResultInvalidException {
}
});
}
}
}
}

View File

@@ -4,18 +4,26 @@ import com.gempukku.lotro.common.Zone;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.GameUtils;
import com.gempukku.lotro.logic.PlayOrder;
import com.gempukku.lotro.logic.decisions.ArbitraryCardsSelectionDecision;
import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException;
import com.gempukku.lotro.logic.timing.AbstractEffect;
import com.gempukku.lotro.logic.timing.Effect;
import com.gempukku.lotro.logic.timing.results.RevealCardFromHandResult;
import java.util.Collection;
import java.util.Collections;
public class RevealCardsFromHandEffect extends AbstractEffect {
public class RevealCardsFromYourHandEffect extends AbstractEffect {
private PhysicalCard _source;
private String _handPlayerId;
private Collection<PhysicalCard> _cards;
private Collection<? extends PhysicalCard> _cards;
public RevealCardsFromHandEffect(PhysicalCard source, String handPlayerId, Collection<PhysicalCard> cards) {
public RevealCardsFromYourHandEffect(PhysicalCard source, String handPlayerId, PhysicalCard card) {
this(source, handPlayerId, Collections.singleton(card));
}
public RevealCardsFromYourHandEffect(PhysicalCard source, String handPlayerId, Collection<? extends PhysicalCard> cards) {
_source = source;
_handPlayerId = handPlayerId;
_cards = cards;
@@ -45,6 +53,20 @@ public class RevealCardsFromHandEffect extends AbstractEffect {
protected FullEffectResult playEffectReturningResult(LotroGame game) {
game.getGameState().sendMessage(GameUtils.getCardLink(_source) + " revealed " + _handPlayerId + " cards in hand - " + getAppendedNames(_cards));
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, _handPlayerId + " revealed card(s) in hand", _cards, Collections.<PhysicalCard>emptySet(), 0, 0) {
@Override
public void decisionMade(String result) throws DecisionResultInvalidException {
}
});
}
for (PhysicalCard card : _cards) {
game.getActionsEnvironment().emitEffectResult(new RevealCardFromHandResult(_source, _handPlayerId, card));
}

View File

@@ -0,0 +1,73 @@
package com.gempukku.lotro.cards.effects;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.GameUtils;
import com.gempukku.lotro.logic.PlayOrder;
import com.gempukku.lotro.logic.decisions.ArbitraryCardsSelectionDecision;
import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException;
import com.gempukku.lotro.logic.timing.AbstractEffect;
import com.gempukku.lotro.logic.timing.results.RevealCardFromHandResult;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
public class RevealHandEffect extends AbstractEffect {
private PhysicalCard _source;
private String _actingPlayer;
private String _handPlayerId;
public RevealHandEffect(PhysicalCard source, String actingPlayer, String handPlayerId) {
_source = source;
_actingPlayer = actingPlayer;
_handPlayerId = handPlayerId;
}
@Override
public String getText(LotroGame game) {
return "Reveal cards from hand";
}
@Override
public Type getType() {
return null;
}
@Override
public boolean isPlayableInFull(LotroGame game) {
return game.getModifiersQuerying().canLookOrRevealCardsInHand(game.getGameState(), _handPlayerId, _actingPlayer);
}
@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));
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 {
}
});
}
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) {
}
}

View File

@@ -0,0 +1,21 @@
package com.gempukku.lotro.cards.modifiers;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.GameState;
import com.gempukku.lotro.logic.modifiers.AbstractModifier;
import com.gempukku.lotro.logic.modifiers.ModifierEffect;
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
public class FPPlayerCantLookAtShadowPlayersHandModifier extends AbstractModifier {
public FPPlayerCantLookAtShadowPlayersHandModifier(PhysicalCard source) {
super(source, "The Free Peoples player may not look at or reveal cards in any Shadow player's hand", null, ModifierEffect.LOOK_OR_REVEAL_MODIFIER);
}
@Override
public boolean canLookOrRevealCardsInHand(GameState gameState, ModifiersQuerying modifiersQuerying, String revealingPlayerId, String actingPlayerId) {
if (actingPlayerId.equals(gameState.getCurrentPlayerId())
&& !revealingPlayerId.equals(gameState.getCurrentPlayerId()))
return false;
return true;
}
}

View File

@@ -1,31 +0,0 @@
package com.gempukku.lotro.cards.modifiers;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.GameState;
import com.gempukku.lotro.logic.modifiers.AbstractModifier;
import com.gempukku.lotro.logic.modifiers.ModifierEffect;
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
public class OpponentsCantLookOrRevealCardsFromHand extends AbstractModifier {
private String _revealingPlayerId;
private String _actingPlayerId;
public OpponentsCantLookOrRevealCardsFromHand(PhysicalCard source, String revealingPlayerId) {
super(source, "Opponents can't look or reveal cards from hand", null, ModifierEffect.LOOK_OR_REVEAL_MODIFIER);
_revealingPlayerId = revealingPlayerId;
}
public OpponentsCantLookOrRevealCardsFromHand(PhysicalCard source, String revealingPlayerId, String actingPlayerId) {
this(source, revealingPlayerId);
_actingPlayerId = actingPlayerId;
}
@Override
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

@@ -0,0 +1,24 @@
package com.gempukku.lotro.cards.modifiers;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.GameState;
import com.gempukku.lotro.logic.modifiers.AbstractModifier;
import com.gempukku.lotro.logic.modifiers.ModifierEffect;
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
public class ShadowPlayersCantLookAtYourHandModifier extends AbstractModifier {
private String _revealingPlayerId;
public ShadowPlayersCantLookAtYourHandModifier(PhysicalCard source, String revealingPlayerId) {
super(source, "Shadow players may not look at or reveal cards in your hand", null, ModifierEffect.LOOK_OR_REVEAL_MODIFIER);
_revealingPlayerId = revealingPlayerId;
}
@Override
public boolean canLookOrRevealCardsInHand(GameState gameState, ModifiersQuerying modifiersQuerying, String revealingPlayerId, String actingPlayerId) {
if (_revealingPlayerId != null && _revealingPlayerId.equals(revealingPlayerId)
&& actingPlayerId != null && !actingPlayerId.equals(gameState.getCurrentPlayerId()))
return false;
return true;
}
}

View File

@@ -3,7 +3,7 @@ package com.gempukku.lotro.cards.set1.elven;
import com.gempukku.lotro.cards.AbstractOldEvent;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.actions.PlayEventAction;
import com.gempukku.lotro.cards.effects.RevealAndChooseCardsFromOpponentHandEffect;
import com.gempukku.lotro.cards.effects.RevealHandEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseOpponentEffect;
import com.gempukku.lotro.common.Culture;
@@ -15,7 +15,7 @@ import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.effects.ChooseAndDiscardCardsFromHandEffect;
import java.util.List;
import java.util.Collection;
/**
* Set: The Fellowship of the Ring
@@ -51,14 +51,16 @@ public class Card1_036 extends AbstractOldEvent {
new ChooseOpponentEffect(playerId) {
@Override
protected void opponentChosen(final String opponentId) {
List<? extends PhysicalCard> hand = game.getGameState().getHand(opponentId);
final int orcsCount = Filters.filter(hand, game.getGameState(), game.getModifiersQuerying(), Race.ORC).size();
action.appendEffect(new RevealAndChooseCardsFromOpponentHandEffect(action, playerId, opponentId, self, "Opponent's hand", Filters.none, 0, 0) {
@Override
protected void cardsSelected(List<PhysicalCard> selectedCards) {
action.appendEffect(new ChooseAndDiscardCardsFromHandEffect(action, opponentId, true, orcsCount));
}
});
action.appendEffect(
new RevealHandEffect(self, playerId, opponentId) {
@Override
protected void cardsRevealed(Collection<? extends PhysicalCard> cards) {
final int orcsCount = Filters.filter(cards, game.getGameState(), game.getModifiersQuerying(), Race.ORC).size();
action.appendEffect(
new ChooseAndDiscardCardsFromHandEffect(action, opponentId, true, orcsCount));
}
});
}
});
return action;

View File

@@ -3,8 +3,12 @@ package com.gempukku.lotro.cards.set1.elven;
import com.gempukku.lotro.cards.AbstractPermanent;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.PutCardFromHandOnBottomOfDeckEffect;
import com.gempukku.lotro.cards.effects.RevealCardEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.cards.effects.RevealCardsFromYourHandEffect;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.Side;
import com.gempukku.lotro.common.Zone;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.actions.ActivateCardAction;
@@ -30,7 +34,7 @@ public class Card1_054 extends AbstractPermanent {
}
@Override
public List<? extends Action> getExtraPhaseActions(String playerId, LotroGame game, final PhysicalCard self) {
public List<? extends Action> getExtraPhaseActions(final String playerId, LotroGame game, final PhysicalCard self) {
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.FELLOWSHIP, self)) {
final ActivateCardAction action = new ActivateCardAction(self);
action.appendEffect(
@@ -38,7 +42,7 @@ public class Card1_054 extends AbstractPermanent {
@Override
protected void cardsSelected(LotroGame game, Collection<PhysicalCard> selectedCards) {
for (PhysicalCard selectedCard : selectedCards) {
action.appendEffect(new RevealCardEffect(self, selectedCard));
action.appendEffect(new RevealCardsFromYourHandEffect(self, playerId, selectedCard));
action.appendEffect(new PutCardFromHandOnBottomOfDeckEffect(selectedCard));
}
}

View File

@@ -4,9 +4,13 @@ import com.gempukku.lotro.cards.AbstractAttachableFPPossession;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.ExertCharactersEffect;
import com.gempukku.lotro.cards.effects.RemoveTwilightEffect;
import com.gempukku.lotro.cards.effects.RevealAndChooseCardsFromOpponentHandEffect;
import com.gempukku.lotro.cards.effects.RevealHandEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseOpponentEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.PossessionClass;
import com.gempukku.lotro.common.Race;
import com.gempukku.lotro.filters.Filter;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
@@ -57,10 +61,11 @@ public class Card1_075 extends AbstractAttachableFPPossession {
@Override
protected void opponentChosen(final String opponentId) {
action.appendEffect(
new RevealAndChooseCardsFromOpponentHandEffect(action, playerId, opponentId, self, "Opponent's hand", Filters.none, 0, 0) {
new RevealHandEffect(self, playerId, opponentId) {
@Override
protected void cardsSelected(List<PhysicalCard> selectedCards) {
protected void cardsRevealed(Collection<? extends PhysicalCard> cards) {
Collection<PhysicalCard> orcs = Filters.filter(game.getGameState().getHand(opponentId), game.getGameState(), game.getModifiersQuerying(), Race.ORC);
action.appendEffect(new RemoveTwilightEffect(orcs.size()));
}
});

View File

@@ -2,7 +2,7 @@ package com.gempukku.lotro.cards.set1.gandalf;
import com.gempukku.lotro.cards.AbstractOldEvent;
import com.gempukku.lotro.cards.actions.PlayEventAction;
import com.gempukku.lotro.cards.effects.RevealAndChooseCardsFromOpponentHandEffect;
import com.gempukku.lotro.cards.effects.RevealHandEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseOpponentEffect;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Keyword;
@@ -12,8 +12,6 @@ import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import java.util.List;
/**
* Set: The Fellowship of the Ring
* Side: Free
@@ -42,12 +40,7 @@ public class Card1_086 extends AbstractOldEvent {
@Override
protected void opponentChosen(String opponentId) {
action.appendEffect(
new RevealAndChooseCardsFromOpponentHandEffect(action, playerId, opponentId, self, "Opponent's hand", Filters.none, 0, 0) {
@Override
protected void cardsSelected(List<PhysicalCard> selectedCards) {
// Do nothing, just revealing
}
});
new RevealHandEffect(self, playerId, opponentId));
}
});
return action;

View File

@@ -4,7 +4,7 @@ import com.gempukku.lotro.cards.AbstractAttachableFPPossession;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.ExertCharactersEffect;
import com.gempukku.lotro.cards.effects.RemoveTwilightEffect;
import com.gempukku.lotro.cards.effects.RevealAndChooseCardsFromOpponentHandEffect;
import com.gempukku.lotro.cards.effects.RevealHandEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseOpponentEffect;
import com.gempukku.lotro.cards.modifiers.evaluator.CardPhaseLimitEvaluator;
import com.gempukku.lotro.common.Culture;
@@ -55,9 +55,9 @@ public class Card1_313 extends AbstractAttachableFPPossession {
@Override
protected void opponentChosen(final String opponentId) {
action.appendEffect(
new RevealAndChooseCardsFromOpponentHandEffect(action, playerId, opponentId, self, "Opponent's hand", Filters.none, 0, 0) {
new RevealHandEffect(self, playerId, opponentId) {
@Override
protected void cardsSelected(List<PhysicalCard> selectedCards) {
protected void cardsRevealed(Collection<? extends PhysicalCard> cards) {
Collection<PhysicalCard> orcs = Filters.filter(game.getGameState().getHand(opponentId), game.getGameState(), game.getModifiersQuerying(), Race.ORC);
int toRemove = Math.min(orcs.size(), game.getGameState().getTwilightPool());
action.appendEffect(

View File

@@ -3,14 +3,19 @@ package com.gempukku.lotro.cards.set11.gandalf;
import com.gempukku.lotro.cards.AbstractEvent;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.actions.PlayEventAction;
import com.gempukku.lotro.cards.effects.RevealCardsFromHandEffect;
import com.gempukku.lotro.cards.effects.RevealHandEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndAddUntilEOPStrengthBonusEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.Race;
import com.gempukku.lotro.common.Side;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import java.util.HashSet;
import java.util.Collection;
/**
* Set: Shadows
@@ -33,14 +38,18 @@ public class Card11_036 extends AbstractEvent {
}
@Override
public PlayEventAction getPlayCardAction(String playerId, LotroGame game, PhysicalCard self, int twilightModifier, boolean ignoreRoamingPenalty) {
PlayEventAction action = new PlayEventAction(self);
public PlayEventAction getPlayCardAction(final String playerId, final LotroGame game, final PhysicalCard self, int twilightModifier, boolean ignoreRoamingPenalty) {
final PlayEventAction action = new PlayEventAction(self);
action.appendEffect(
new RevealCardsFromHandEffect(self, playerId, new HashSet<PhysicalCard>(game.getGameState().getHand(playerId))));
int companionCount = Filters.filter(game.getGameState().getHand(playerId), game.getGameState(), game.getModifiersQuerying(), CardType.COMPANION).size();
int penalty = companionCount * (PlayConditions.location(game, Keyword.BATTLEGROUND) ? -4 : -3);
action.appendEffect(
new ChooseAndAddUntilEOPStrengthBonusEffect(action, self, playerId, penalty, CardType.MINION));
new RevealHandEffect(self, playerId, playerId) {
@Override
protected void cardsRevealed(Collection<? extends PhysicalCard> cards) {
int companionCount = Filters.filter(cards, game.getGameState(), game.getModifiersQuerying(), CardType.COMPANION).size();
int penalty = companionCount * (PlayConditions.location(game, Keyword.BATTLEGROUND) ? -4 : -3);
action.appendEffect(
new ChooseAndAddUntilEOPStrengthBonusEffect(action, self, playerId, penalty, CardType.MINION));
}
});
return action;
}
}

View File

@@ -5,17 +5,17 @@ import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.actions.PlayEventAction;
import com.gempukku.lotro.cards.effects.AddBurdenEffect;
import com.gempukku.lotro.cards.effects.ChoiceEffect;
import com.gempukku.lotro.cards.effects.RevealAndChooseCardsFromOpponentHandEffect;
import com.gempukku.lotro.cards.effects.RevealHandEffect;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.Side;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.effects.ChooseAndDiscardCardsFromHandEffect;
import com.gempukku.lotro.logic.timing.Effect;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
@@ -44,9 +44,9 @@ public class Card11_110 extends AbstractEvent {
final PlayEventAction action = new PlayEventAction(self);
final String fpPlayer = game.getGameState().getCurrentPlayerId();
action.appendEffect(
new RevealAndChooseCardsFromOpponentHandEffect(action, playerId, fpPlayer, self, "Opponent's hand", Filters.none, 0, 0) {
new RevealHandEffect(self, playerId, fpPlayer) {
@Override
protected void cardsSelected(List<PhysicalCard> selectedCards) {
protected void cardsRevealed(Collection<? extends PhysicalCard> cards) {
List<Effect> possibleEffects = new LinkedList<Effect>();
possibleEffects.add(
new ChooseAndDiscardCardsFromHandEffect(action, fpPlayer, false, 1, Side.FREE_PEOPLE, CardType.EVENT) {

View File

@@ -5,9 +5,13 @@ import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.TriggerConditions;
import com.gempukku.lotro.cards.effects.AddBurdenEffect;
import com.gempukku.lotro.cards.effects.PreventableEffect;
import com.gempukku.lotro.cards.effects.RevealCardsFromHandEffect;
import com.gempukku.lotro.cards.effects.RevealCardsFromYourHandEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseCardsFromHandEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.common.Race;
import com.gempukku.lotro.common.Side;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.actions.RequiredTriggerAction;
@@ -63,7 +67,7 @@ public class Card11_135 extends AbstractMinion {
@Override
protected void cardsSelected(LotroGame game, Collection<PhysicalCard> selectedCards) {
subAction.insertEffect(
new RevealCardsFromHandEffect(self, playerId, selectedCards));
new RevealCardsFromYourHandEffect(self, playerId, selectedCards));
}
};
}

View File

@@ -3,9 +3,14 @@ package com.gempukku.lotro.cards.set11.wraith;
import com.gempukku.lotro.cards.AbstractPermanent;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.PutCardsFromHandBeneathDrawDeckEffect;
import com.gempukku.lotro.cards.effects.RevealCardsFromHandEffect;
import com.gempukku.lotro.cards.effects.RevealCardsFromYourHandEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseCardsFromHandEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.Race;
import com.gempukku.lotro.common.Side;
import com.gempukku.lotro.common.Zone;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
@@ -42,7 +47,7 @@ public class Card11_213 extends AbstractPermanent {
@Override
protected void cardsSelected(LotroGame game, Collection<PhysicalCard> selectedCards) {
action.appendCost(
new RevealCardsFromHandEffect(self, playerId, selectedCards));
new RevealCardsFromYourHandEffect(self, playerId, selectedCards));
for (PhysicalCard selectedCard : selectedCards) {
action.appendCost(
new PutCardsFromHandBeneathDrawDeckEffect(action, playerId, selectedCard));

View File

@@ -2,7 +2,7 @@ package com.gempukku.lotro.cards.set11.wraith;
import com.gempukku.lotro.cards.AbstractEvent;
import com.gempukku.lotro.cards.actions.PlayEventAction;
import com.gempukku.lotro.cards.effects.RevealCardsFromHandEffect;
import com.gempukku.lotro.cards.effects.RevealHandEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndAddUntilEOPStrengthBonusEffect;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
@@ -15,7 +15,7 @@ import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
import com.gempukku.lotro.logic.modifiers.evaluator.Evaluator;
import java.util.HashSet;
import java.util.Collection;
/**
* Set: Shadows
@@ -31,18 +31,21 @@ public class Card11_215 extends AbstractEvent {
}
@Override
public PlayEventAction getPlayCardAction(final String playerId, final LotroGame game, PhysicalCard self, int twilightModifier, boolean ignoreRoamingPenalty) {
PlayEventAction action = new PlayEventAction(self);
public PlayEventAction getPlayCardAction(final String playerId, final LotroGame game, final PhysicalCard self, int twilightModifier, boolean ignoreRoamingPenalty) {
final PlayEventAction action = new PlayEventAction(self);
action.appendCost(
new RevealCardsFromHandEffect(self, playerId, new HashSet<PhysicalCard>(game.getGameState().getHand(playerId))));
action.appendEffect(
new ChooseAndAddUntilEOPStrengthBonusEffect(action, self, playerId,
new Evaluator() {
@Override
public int evaluateExpression(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard cardAffected) {
return Filters.filter(gameState.getHand(playerId), game.getGameState(), game.getModifiersQuerying(), Culture.WRAITH, CardType.MINION).size();
}
}, Culture.WRAITH, CardType.MINION));
new RevealHandEffect(self, playerId, playerId) {
@Override
protected void cardsRevealed(final Collection<? extends PhysicalCard> cards) {
new ChooseAndAddUntilEOPStrengthBonusEffect(action, self, playerId,
new Evaluator() {
@Override
public int evaluateExpression(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard cardAffected) {
return Filters.filter(cards, game.getGameState(), game.getModifiersQuerying(), Culture.WRAITH, CardType.MINION).size();
}
}, Culture.WRAITH, CardType.MINION);
}
});
return action;
}
}

View File

@@ -2,8 +2,13 @@ package com.gempukku.lotro.cards.set12.moria;
import com.gempukku.lotro.cards.AbstractAttachable;
import com.gempukku.lotro.cards.TriggerConditions;
import com.gempukku.lotro.cards.effects.RevealAndChooseCardsFromOpponentHandEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.cards.effects.RevealHandEffect;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Filterable;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.common.PossessionClass;
import com.gempukku.lotro.common.Side;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
@@ -54,9 +59,9 @@ public class Card12_080 extends AbstractAttachable {
if (TriggerConditions.played(game, effectResult, self)) {
final RequiredTriggerAction action = new RequiredTriggerAction(self);
action.appendEffect(
new RevealAndChooseCardsFromOpponentHandEffect(action, self.getOwner(), game.getGameState().getCurrentPlayerId(), self, "Free Peoples player hand", Filters.none, 0, 0) {
new RevealHandEffect(self, self.getOwner(), game.getGameState().getCurrentPlayerId()) {
@Override
protected void cardsSelected(List<PhysicalCard> selectedCards) {
protected void cardsRevealed(Collection<? extends PhysicalCard> cards) {
final Collection<PhysicalCard> cardsToDiscard = Filters.filter(game.getGameState().getHand(game.getGameState().getCurrentPlayerId()), game.getGameState(), game.getModifiersQuerying(), Side.FREE_PEOPLE, Filters.or(Filters.printedTwilightCost(1), Filters.printedTwilightCost(0)));
action.appendEffect(
new DiscardCardsFromHandEffect(self, game.getGameState().getCurrentPlayerId(), cardsToDiscard, true));

View File

@@ -2,7 +2,7 @@ package com.gempukku.lotro.cards.set12.orc;
import com.gempukku.lotro.cards.AbstractMinion;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.RevealCardsFromHandEffect;
import com.gempukku.lotro.cards.effects.RevealHandEffect;
import com.gempukku.lotro.cards.effects.SelfExertEffect;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Keyword;
@@ -15,8 +15,8 @@ import com.gempukku.lotro.logic.actions.ActivateCardAction;
import com.gempukku.lotro.logic.effects.AddTwilightEffect;
import com.gempukku.lotro.logic.timing.Action;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
/**
@@ -38,17 +38,21 @@ public class Card12_105 extends AbstractMinion {
}
@Override
protected List<? extends Action> getExtraPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
protected List<? extends Action> getExtraPhaseActions(final String playerId, final LotroGame game, final PhysicalCard self) {
if (PlayConditions.canUseShadowCardDuringPhase(game, Phase.SHADOW, self, 0)
&& PlayConditions.canSelfExert(self, game)) {
ActivateCardAction action = new ActivateCardAction(self);
final ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(
new SelfExertEffect(action, self));
action.appendCost(
new RevealCardsFromHandEffect(self, playerId, new HashSet<PhysicalCard>(game.getGameState().getHand(playerId))));
int count = Filters.filter(game.getGameState().getHand(playerId), game.getGameState(), game.getModifiersQuerying(), Culture.ORC, Race.TROLL).size();
action.appendEffect(
new AddTwilightEffect(self, count));
new RevealHandEffect(self, playerId, playerId) {
@Override
protected void cardsRevealed(Collection<? extends PhysicalCard> cards) {
int count = Filters.filter(game.getGameState().getHand(playerId), game.getGameState(), game.getModifiersQuerying(), Culture.ORC, Race.TROLL).size();
action.appendEffect(
new AddTwilightEffect(self, count));
}
});
return Collections.singletonList(action);
}
return null;

View File

@@ -2,9 +2,13 @@ package com.gempukku.lotro.cards.set12.wraith;
import com.gempukku.lotro.cards.AbstractMinion;
import com.gempukku.lotro.cards.TriggerConditions;
import com.gempukku.lotro.cards.effects.RevealCardEffect;
import com.gempukku.lotro.cards.effects.RevealCardsFromYourHandEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.common.Names;
import com.gempukku.lotro.common.Race;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.GameState;
@@ -45,7 +49,7 @@ public class Card12_183 extends AbstractMinion {
&& !playerId.equals(game.getGameState().getCurrentPlayerId())) {
OptionalTriggerAction action = new OptionalTriggerAction(self);
action.appendCost(
new RevealCardEffect(self, self));
new RevealCardsFromYourHandEffect(self, playerId, self));
action.appendEffect(
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Filters.ringBearer));
return Collections.singletonList(action);

View File

@@ -5,11 +5,15 @@ import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.TriggerConditions;
import com.gempukku.lotro.cards.actions.AttachPermanentAction;
import com.gempukku.lotro.cards.effects.AddBurdenEffect;
import com.gempukku.lotro.cards.effects.RevealAndChooseCardsFromOpponentHandEffect;
import com.gempukku.lotro.cards.effects.RevealHandEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndDiscardCardsFromPlayEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseOpponentEffect;
import com.gempukku.lotro.cards.modifiers.ResistanceModifier;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Filterable;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.PossessionClass;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
@@ -18,6 +22,7 @@ import com.gempukku.lotro.logic.effects.ChooseAndDiscardCardsFromHandEffect;
import com.gempukku.lotro.logic.modifiers.Modifier;
import com.gempukku.lotro.logic.timing.EffectResult;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
@@ -73,9 +78,9 @@ public class Card13_036 extends AbstractAttachableFPPossession {
@Override
protected void opponentChosen(final String opponentId) {
action.appendEffect(
new RevealAndChooseCardsFromOpponentHandEffect(action, playerId, opponentId, self, "Opponent's hand", Filters.none, 0, 0) {
new RevealHandEffect(self, playerId, opponentId) {
@Override
protected void cardsSelected(List<PhysicalCard> selectedCards) {
protected void cardsRevealed(Collection<? extends PhysicalCard> cards) {
action.appendEffect(
new ChooseAndDiscardCardsFromHandEffect(action, opponentId, true, 1, CardType.MINION));
}

View File

@@ -3,10 +3,14 @@ package com.gempukku.lotro.cards.set13.men;
import com.gempukku.lotro.cards.AbstractMinion;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.TriggerConditions;
import com.gempukku.lotro.cards.effects.RevealCardEffect;
import com.gempukku.lotro.cards.effects.RevealCardsFromYourHandEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
import com.gempukku.lotro.cards.modifiers.conditions.NotCondition;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.common.Race;
import com.gempukku.lotro.common.Side;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
@@ -48,7 +52,7 @@ public class Card13_084 extends AbstractMinion {
&& !playerId.equals(game.getGameState().getCurrentPlayerId())) {
OptionalTriggerAction action = new OptionalTriggerAction(self);
action.appendCost(
new RevealCardEffect(self, self));
new RevealCardsFromYourHandEffect(self, playerId, self));
action.appendEffect(
new ChooseAndExertCharactersEffect(action, game.getGameState().getCurrentPlayerId(), 1, 1, CardType.COMPANION));
return Collections.singletonList(action);

View File

@@ -4,7 +4,7 @@ import com.gempukku.lotro.cards.AbstractMinion;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.TriggerConditions;
import com.gempukku.lotro.cards.effects.AddBurdenEffect;
import com.gempukku.lotro.cards.effects.RevealCardEffect;
import com.gempukku.lotro.cards.effects.RevealCardsFromYourHandEffect;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Keyword;
@@ -56,7 +56,7 @@ public class Card13_112 extends AbstractMinion {
&& !playerId.equals(game.getGameState().getCurrentPlayerId())) {
OptionalTriggerAction action = new OptionalTriggerAction(self);
action.appendCost(
new RevealCardEffect(self, self));
new RevealCardsFromYourHandEffect(self, playerId, self));
action.appendEffect(
new AddBurdenEffect(self.getOwner(), self, 1));
return Collections.singletonList(action);

View File

@@ -2,17 +2,22 @@ package com.gempukku.lotro.cards.set17.orc;
import com.gempukku.lotro.cards.AbstractPermanent;
import com.gempukku.lotro.cards.TriggerConditions;
import com.gempukku.lotro.cards.effects.RevealCardsFromHandEffect;
import com.gempukku.lotro.cards.effects.RevealHandEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndPutCardsFromHandBeneathDrawDeckEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Race;
import com.gempukku.lotro.common.Side;
import com.gempukku.lotro.common.Zone;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.GameUtils;
import com.gempukku.lotro.logic.actions.RequiredTriggerAction;
import com.gempukku.lotro.logic.timing.EffectResult;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
/**
@@ -30,13 +35,17 @@ public class Card17_069 extends AbstractPermanent {
}
@Override
public List<RequiredTriggerAction> getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) {
public List<RequiredTriggerAction> getRequiredAfterTriggers(final LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (TriggerConditions.winsSkirmish(game, effectResult, Culture.ORC, Race.ORC, Filters.mounted)) {
RequiredTriggerAction action = new RequiredTriggerAction(self);
final RequiredTriggerAction action = new RequiredTriggerAction(self);
action.appendEffect(
new RevealCardsFromHandEffect(self, game.getGameState().getCurrentPlayerId(), new HashSet<PhysicalCard>(game.getGameState().getHand(game.getGameState().getCurrentPlayerId()))));
action.appendEffect(
new ChooseAndPutCardsFromHandBeneathDrawDeckEffect(action, game.getGameState().getCurrentPlayerId(), 2, Side.FREE_PEOPLE));
new RevealHandEffect(self, self.getOwner(), GameUtils.getFreePeoplePlayer(game)) {
@Override
protected void cardsRevealed(Collection<? extends PhysicalCard> cards) {
action.appendEffect(
new ChooseAndPutCardsFromHandBeneathDrawDeckEffect(action, game.getGameState().getCurrentPlayerId(), 2, Filters.in(cards), Side.FREE_PEOPLE));
}
});
return Collections.singletonList(action);
}
return null;

View File

@@ -3,7 +3,7 @@ package com.gempukku.lotro.cards.set17.orc;
import com.gempukku.lotro.cards.AbstractMinion;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.TriggerConditions;
import com.gempukku.lotro.cards.effects.RevealCardEffect;
import com.gempukku.lotro.cards.effects.RevealCardsFromYourHandEffect;
import com.gempukku.lotro.cards.effects.SelfDiscardEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseCardsFromHandEffect;
import com.gempukku.lotro.common.CardType;
@@ -39,7 +39,7 @@ public class Card17_079 extends AbstractMinion {
}
@Override
public List<OptionalTriggerAction> getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, final PhysicalCard self) {
public List<OptionalTriggerAction> getOptionalAfterTriggers(final String playerId, LotroGame game, EffectResult effectResult, final PhysicalCard self) {
if (TriggerConditions.startOfPhase(game, effectResult, Phase.SKIRMISH)
&& PlayConditions.canSpot(game, self, Filters.inSkirmish)
&& Filters.filter(game.getGameState().getHand(playerId), game.getGameState(), game.getModifiersQuerying(), Culture.ORC, CardType.CONDITION).size() > 0) {
@@ -50,7 +50,7 @@ public class Card17_079 extends AbstractMinion {
protected void cardsSelected(LotroGame game, Collection<PhysicalCard> selectedCards) {
for (PhysicalCard selectedCard : selectedCards) {
action.appendCost(
new RevealCardEffect(self, selectedCard));
new RevealCardsFromYourHandEffect(self, playerId, selectedCard));
}
}
});

View File

@@ -1,7 +1,7 @@
package com.gempukku.lotro.cards.set2.gandalf;
import com.gempukku.lotro.cards.AbstractAlly;
import com.gempukku.lotro.cards.modifiers.OpponentsCantLookOrRevealCardsFromHand;
import com.gempukku.lotro.cards.modifiers.ShadowPlayersCantLookAtYourHandModifier;
import com.gempukku.lotro.common.Block;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Race;
@@ -34,6 +34,6 @@ public class Card2_021 extends AbstractAlly {
@Override
public Modifier getAlwaysOnModifier(LotroGame game, PhysicalCard self) {
return new OpponentsCantLookOrRevealCardsFromHand(self, self.getOwner());
return new ShadowPlayersCantLookAtYourHandModifier(self, self.getOwner());
}
}

View File

@@ -1,7 +1,7 @@
package com.gempukku.lotro.cards.set2.isengard;
import com.gempukku.lotro.cards.AbstractPermanent;
import com.gempukku.lotro.cards.modifiers.OpponentsCantLookOrRevealCardsFromHand;
import com.gempukku.lotro.cards.modifiers.FPPlayerCantLookAtShadowPlayersHandModifier;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Side;
@@ -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, null, game.getGameState().getCurrentPlayerId()));
return Collections.singletonList(new FPPlayerCantLookAtShadowPlayersHandModifier(self));
}
}

View File

@@ -2,7 +2,7 @@ package com.gempukku.lotro.cards.set2.moria;
import com.gempukku.lotro.cards.AbstractOldEvent;
import com.gempukku.lotro.cards.actions.PlayEventAction;
import com.gempukku.lotro.cards.effects.RevealCardEffect;
import com.gempukku.lotro.cards.effects.RevealCardsFromYourHandEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndPlayCardFromHandEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseCardsFromHandEffect;
import com.gempukku.lotro.common.Culture;
@@ -49,7 +49,7 @@ public class Card2_070 extends AbstractOldEvent {
@Override
protected void cardsSelected(LotroGame game, Collection<PhysicalCard> selectedCards) {
action.appendEffect(
new RevealCardEffect(self, selectedCards));
new RevealCardsFromYourHandEffect(self, playerId, selectedCards));
int cardsRevealed = selectedCards.size();
action.appendEffect(
new ChooseAndPlayCardFromHandEffect(playerId, game, -2 * cardsRevealed, Filters.balrog));

View File

@@ -2,7 +2,7 @@ package com.gempukku.lotro.cards.set20.moria;
import com.gempukku.lotro.cards.AbstractEvent;
import com.gempukku.lotro.cards.actions.PlayEventAction;
import com.gempukku.lotro.cards.effects.RevealCardEffect;
import com.gempukku.lotro.cards.effects.RevealCardsFromYourHandEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndPlayCardFromHandEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseCardsFromHandEffect;
import com.gempukku.lotro.common.Culture;
@@ -42,7 +42,7 @@ public class Card20_278 extends AbstractEvent {
@Override
protected void cardsSelected(LotroGame game, Collection<PhysicalCard> selectedCards) {
action.appendEffect(
new RevealCardEffect(self, selectedCards));
new RevealCardsFromYourHandEffect(self, playerId, selectedCards));
int cardsRevealed = selectedCards.size();
action.appendEffect(
new ChooseAndPlayCardFromHandEffect(playerId, game, -2 * cardsRevealed, Filters.balrog));

View File

@@ -4,7 +4,7 @@ import com.gempukku.lotro.cards.AbstractMinion;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.TriggerConditions;
import com.gempukku.lotro.cards.effects.AddBurdenEffect;
import com.gempukku.lotro.cards.effects.RevealCardEffect;
import com.gempukku.lotro.cards.effects.RevealCardsFromYourHandEffect;
import com.gempukku.lotro.cards.effects.SelfExertEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndAddUntilEOPStrengthBonusEffect;
import com.gempukku.lotro.cards.modifiers.evaluator.CountActiveEvaluator;
@@ -47,7 +47,7 @@ public class Card20_360 extends AbstractMinion {
&& !playerId.equals(game.getGameState().getCurrentPlayerId())) {
OptionalTriggerAction action = new OptionalTriggerAction(self);
action.appendCost(
new RevealCardEffect(self, self));
new RevealCardsFromYourHandEffect(self, playerId, self));
action.appendEffect(
new AddBurdenEffect(playerId, self, 1));
return Collections.singletonList(action);

View File

@@ -4,7 +4,7 @@ import com.gempukku.lotro.cards.AbstractOldEvent;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.actions.PlayEventAction;
import com.gempukku.lotro.cards.effects.PutCardFromDiscardIntoHandEffect;
import com.gempukku.lotro.cards.effects.RevealCardEffect;
import com.gempukku.lotro.cards.effects.RevealHandEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseCardsFromDiscardEffect;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Phase;
@@ -38,12 +38,16 @@ public class Card4_162 extends AbstractOldEvent {
}
@Override
public PlayEventAction getPlayCardAction(String playerId, LotroGame game, PhysicalCard self, int twilightModifier, boolean ignoreRoamingPenalty) {
public PlayEventAction getPlayCardAction(final String playerId, final LotroGame game, final PhysicalCard self, int twilightModifier, boolean ignoreRoamingPenalty) {
final PlayEventAction action = new PlayEventAction(self);
action.appendCost(
new RevealCardEffect(self, Filters.filter(game.getGameState().getHand(playerId), game.getGameState(), game.getModifiersQuerying(), Filters.not(self))));
action.appendCost(
new DiscardCardsFromHandEffect(self, playerId, Filters.filter(game.getGameState().getHand(playerId), game.getGameState(), game.getModifiersQuerying(), Side.FREE_PEOPLE), false));
new RevealHandEffect(self, playerId, playerId) {
@Override
protected void cardsRevealed(Collection<? extends PhysicalCard> cards) {
action.appendCost(
new DiscardCardsFromHandEffect(self, playerId, Filters.filter(cards, game.getGameState(), game.getModifiersQuerying(), Side.FREE_PEOPLE), false));
}
});
action.appendEffect(
new ChooseCardsFromDiscardEffect(playerId, 1, 1, Culture.ISENGARD) {
@Override

View File

@@ -3,7 +3,7 @@ package com.gempukku.lotro.cards.set6.shire;
import com.gempukku.lotro.cards.AbstractEvent;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.actions.PlayEventAction;
import com.gempukku.lotro.cards.effects.RevealAndChooseCardsFromOpponentHandEffect;
import com.gempukku.lotro.cards.effects.RevealHandEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseOpponentEffect;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
@@ -14,8 +14,8 @@ import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.effects.ChooseAndWoundCharactersEffect;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
@@ -47,11 +47,11 @@ public class Card6_110 extends AbstractEvent {
@Override
protected void opponentChosen(final String opponentId) {
action.insertEffect(
new RevealAndChooseCardsFromOpponentHandEffect(action, playerId, opponentId, self, "Opponent's hand", Filters.none, 0, 0) {
new RevealHandEffect(self, playerId, opponentId) {
@Override
protected void cardsSelected(List<PhysicalCard> selectedCards) {
protected void cardsRevealed(Collection<? extends PhysicalCard> cards) {
Set<Culture> cultures = new HashSet<Culture>();
for (PhysicalCard cardInHand : game.getGameState().getHand(opponentId))
for (PhysicalCard cardInHand : cards)
cultures.add(cardInHand.getBlueprint().getCulture());
action.appendEffect(

View File

@@ -3,7 +3,7 @@ package com.gempukku.lotro.cards.set7.gollum;
import com.gempukku.lotro.cards.AbstractEvent;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.actions.PlayEventAction;
import com.gempukku.lotro.cards.effects.RevealAndChooseCardsFromOpponentHandEffect;
import com.gempukku.lotro.cards.effects.RevealHandEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseOpponentEffect;
import com.gempukku.lotro.common.Culture;
@@ -14,8 +14,8 @@ import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.effects.ChooseAndDiscardCardsFromHandEffect;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
@@ -48,11 +48,11 @@ public class Card7_066 extends AbstractEvent {
@Override
protected void opponentChosen(final String opponentId) {
action.insertEffect(
new RevealAndChooseCardsFromOpponentHandEffect(action, playerId, opponentId, self, "Opponent's hand", Filters.none, 0, 0) {
new RevealHandEffect(self, playerId, opponentId) {
@Override
protected void cardsSelected(List<PhysicalCard> selectedCards) {
protected void cardsRevealed(Collection<? extends PhysicalCard> cards) {
Set<Culture> cultures = new HashSet<Culture>();
for (PhysicalCard physicalCard : game.getGameState().getHand(opponentId))
for (PhysicalCard physicalCard : cards)
cultures.add(physicalCard.getBlueprint().getCulture());
int cultureCount = cultures.size();

View File

@@ -4,9 +4,14 @@ import com.gempukku.lotro.cards.AbstractPermanent;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.AddBurdenEffect;
import com.gempukku.lotro.cards.effects.PutCardsFromHandBeneathDrawDeckEffect;
import com.gempukku.lotro.cards.effects.RevealCardsFromHandEffect;
import com.gempukku.lotro.cards.effects.RevealCardsFromYourHandEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.Race;
import com.gempukku.lotro.common.Side;
import com.gempukku.lotro.common.Zone;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
@@ -14,7 +19,6 @@ import com.gempukku.lotro.logic.actions.ActivateCardAction;
import com.gempukku.lotro.logic.timing.Action;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
/**
@@ -41,7 +45,7 @@ public class Card8_109 extends AbstractPermanent {
action.appendCost(
new AddBurdenEffect(self.getOwner(), self, 1));
action.appendEffect(
new RevealCardsFromHandEffect(self, playerId, new HashSet<PhysicalCard>(game.getGameState().getHand(playerId))));
new RevealCardsFromYourHandEffect(self, playerId, game.getGameState().getHand(playerId)));
action.appendEffect(
new PutCardsFromHandBeneathDrawDeckEffect(action, playerId, Side.FREE_PEOPLE));
return Collections.singletonList(action);

View File

@@ -3,10 +3,15 @@ package com.gempukku.lotro.cards.set9.gollum;
import com.gempukku.lotro.cards.AbstractPermanent;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.PutCardsFromHandBeneathDrawDeckEffect;
import com.gempukku.lotro.cards.effects.RevealCardsFromHandEffect;
import com.gempukku.lotro.cards.effects.RevealCardsFromYourHandEffect;
import com.gempukku.lotro.cards.effects.SelfDiscardEffect;
import com.gempukku.lotro.cards.modifiers.conditions.LocationCondition;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.Side;
import com.gempukku.lotro.common.Zone;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
@@ -45,7 +50,7 @@ public class Card9_029 extends AbstractPermanent {
&& PlayConditions.canSpot(game, Filters.gollum)) {
ActivateCardAction action = new ActivateCardAction(self);
action.appendEffect(
new RevealCardsFromHandEffect(self, playerId, new LinkedList<PhysicalCard>(game.getGameState().getHand(playerId))));
new RevealCardsFromYourHandEffect(self, playerId, new LinkedList<PhysicalCard>(game.getGameState().getHand(playerId))));
action.appendEffect(
new PutCardsFromHandBeneathDrawDeckEffect(action, playerId, Side.SHADOW));
action.appendEffect(

View File

@@ -1,6 +1,17 @@
package com.gempukku.lotro.filters;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.common.Block;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Filterable;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.common.Names;
import com.gempukku.lotro.common.PossessionClass;
import com.gempukku.lotro.common.Race;
import com.gempukku.lotro.common.Side;
import com.gempukku.lotro.common.Signet;
import com.gempukku.lotro.common.Token;
import com.gempukku.lotro.common.Zone;
import com.gempukku.lotro.game.CompletePhysicalCardVisitor;
import com.gempukku.lotro.game.LotroCardBlueprint;
import com.gempukku.lotro.game.PhysicalCard;
@@ -14,7 +25,14 @@ import com.gempukku.lotro.logic.modifiers.Condition;
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
import com.gempukku.lotro.logic.modifiers.evaluator.Evaluator;
import java.util.*;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
public class Filters {
private static final Map<CardType, Filter> _typeFilterMap = new HashMap<CardType, Filter>();
@@ -754,7 +772,7 @@ public class Filters {
};
}
public static Filter in(final Collection<PhysicalCard> cards) {
public static Filter in(final Collection<? extends PhysicalCard> cards) {
final Set<Integer> cardIds = new HashSet<Integer>();
for (PhysicalCard card : cards)
cardIds.add(card.getCardId());

View File

@@ -131,7 +131,7 @@ public class GameUtils {
return sb.substring(0, sb.length() - 2);
}
public static String getAppendedNames(Collection<PhysicalCard> cards) {
public static String getAppendedNames(Collection<? extends PhysicalCard> cards) {
StringBuilder sb = new StringBuilder();
for (PhysicalCard card : cards)
sb.append(GameUtils.getCardLink(card) + ", ");

View File

@@ -7,20 +7,20 @@ import java.util.LinkedList;
import java.util.List;
public abstract class ArbitraryCardsSelectionDecision extends AbstractAwaitingDecision {
private Collection<PhysicalCard> _physicalCards;
private Collection<PhysicalCard> _selectable;
private Collection<? extends PhysicalCard> _physicalCards;
private Collection<? extends PhysicalCard> _selectable;
private int _minimum;
private int _maximum;
public ArbitraryCardsSelectionDecision(int id, String text, Collection<PhysicalCard> physicalCard) {
public ArbitraryCardsSelectionDecision(int id, String text, Collection<? extends PhysicalCard> physicalCard) {
this(id, text, physicalCard, 0, physicalCard.size());
}
public ArbitraryCardsSelectionDecision(int id, String text, Collection<PhysicalCard> physicalCards, int minimum, int maximum) {
public ArbitraryCardsSelectionDecision(int id, String text, Collection<? extends PhysicalCard> physicalCards, int minimum, int maximum) {
this(id, text, physicalCards, physicalCards, minimum, maximum);
}
public ArbitraryCardsSelectionDecision(int id, String text, Collection<PhysicalCard> physicalCards, Collection<PhysicalCard> selectable, int minimum, int maximum) {
public ArbitraryCardsSelectionDecision(int id, String text, Collection<? extends PhysicalCard> physicalCards, Collection<? extends PhysicalCard> selectable, int minimum, int maximum) {
super(id, text, AwaitingDecisionType.ARBITRARY_CARDS);
_physicalCards = physicalCards;
_selectable = selectable;
@@ -33,7 +33,7 @@ public abstract class ArbitraryCardsSelectionDecision extends AbstractAwaitingDe
setParam("selectable", getSelectable(physicalCards, selectable));
}
private String[] getSelectable(Collection<PhysicalCard> physicalCards, Collection<PhysicalCard> selectable) {
private String[] getSelectable(Collection<? extends PhysicalCard> physicalCards, Collection<? extends PhysicalCard> selectable) {
String[] result = new String[physicalCards.size()];
int index = 0;
for (PhysicalCard physicalCard : physicalCards) {
@@ -43,14 +43,14 @@ public abstract class ArbitraryCardsSelectionDecision extends AbstractAwaitingDe
return result;
}
private String[] getCardIds(Collection<PhysicalCard> physicalCards) {
private String[] getCardIds(Collection<? extends PhysicalCard> physicalCards) {
String[] result = new String[physicalCards.size()];
for (int i = 0; i < physicalCards.size(); i++)
result[i] = "temp" + i;
return result;
}
private String[] getBlueprintIds(Collection<PhysicalCard> physicalCards) {
private String[] getBlueprintIds(Collection<? extends PhysicalCard> physicalCards) {
String[] result = new String[physicalCards.size()];
int index = 0;
for (PhysicalCard physicalCard : physicalCards) {

View File

@@ -29,7 +29,7 @@ public abstract class AbstractEffect implements Effect {
return GameUtils.getAppendedTextNames(cards);
}
protected final String getAppendedNames(Collection<PhysicalCard> cards) {
protected final String getAppendedNames(Collection<? extends PhysicalCard> cards) {
return GameUtils.getAppendedNames(cards);
}