- Added revealing effect to all cards, for now the revealed cards will be only shown in the log, until I figure out
something better.
This commit is contained in:
@@ -4,6 +4,7 @@ import com.gempukku.lotro.filters.Filter;
|
||||
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.decisions.ArbitraryCardsSelectionDecision;
|
||||
import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException;
|
||||
import com.gempukku.lotro.logic.timing.UnrespondableEffect;
|
||||
@@ -15,14 +16,16 @@ import java.util.List;
|
||||
public abstract class RevealAndChooseCardsFromOpponentHandEffect extends UnrespondableEffect {
|
||||
private String _playerId;
|
||||
private String _opponentId;
|
||||
private PhysicalCard _source;
|
||||
private String _text;
|
||||
private Filter _selectionFilter;
|
||||
private int _minChosen;
|
||||
private int _maxChosen;
|
||||
|
||||
protected RevealAndChooseCardsFromOpponentHandEffect(String playerId, String opponentId, String text, Filter selectionFilter, int minChosen, int maxChosen) {
|
||||
protected RevealAndChooseCardsFromOpponentHandEffect(String playerId, String opponentId, PhysicalCard source, String text, Filter selectionFilter, int minChosen, int maxChosen) {
|
||||
_playerId = playerId;
|
||||
_opponentId = opponentId;
|
||||
_source = source;
|
||||
_text = text;
|
||||
_selectionFilter = selectionFilter;
|
||||
_minChosen = minChosen;
|
||||
@@ -33,6 +36,7 @@ public abstract class RevealAndChooseCardsFromOpponentHandEffect extends Unrespo
|
||||
public void doPlayEffect(LotroGame game) {
|
||||
if (game.getModifiersQuerying().canLookOrRevealCardsInHand(game.getGameState(), _opponentId)) {
|
||||
List<PhysicalCard> opponentHand = new LinkedList<PhysicalCard>(game.getGameState().getHand(_opponentId));
|
||||
game.getGameState().sendMessage(GameUtils.getCardLink(_source) + " revealed " + _opponentId + " hand - " + getAppendedNames(opponentHand));
|
||||
Collection<PhysicalCard> selectable = Filters.filter(opponentHand, game.getGameState(), game.getModifiersQuerying(), _selectionFilter);
|
||||
|
||||
game.getUserFeedback().sendAwaitingDecision(_playerId,
|
||||
|
||||
@@ -43,7 +43,7 @@ public class Card1_036 extends AbstractOldEvent {
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlayEventAction getPlayCardAction(final String playerId, final LotroGame game, PhysicalCard self, int twilightModifier) {
|
||||
public PlayEventAction getPlayCardAction(final String playerId, final LotroGame game, final PhysicalCard self, int twilightModifier) {
|
||||
final PlayEventAction action = new PlayEventAction(self);
|
||||
action.appendCost(
|
||||
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Filters.race(Race.ELF)));
|
||||
@@ -53,7 +53,7 @@ public class Card1_036 extends AbstractOldEvent {
|
||||
protected void opponentChosen(String opponentId) {
|
||||
List<? extends PhysicalCard> hand = game.getGameState().getHand(opponentId);
|
||||
int orcsCount = Filters.filter(hand, game.getGameState(), game.getModifiersQuerying(), Filters.race(Race.ORC)).size();
|
||||
action.appendEffect(new RevealAndChooseCardsFromOpponentHandEffect(playerId, opponentId, "Opponent's hand", Filters.none, 0, 0) {
|
||||
action.appendEffect(new RevealAndChooseCardsFromOpponentHandEffect(playerId, opponentId, self, "Opponent's hand", Filters.none, 0, 0) {
|
||||
@Override
|
||||
protected void cardsSelected(List<PhysicalCard> selectedCards) {
|
||||
// Do nothing
|
||||
|
||||
@@ -50,7 +50,7 @@ public class Card1_044 extends AbstractOldEvent {
|
||||
@Override
|
||||
protected void opponentChosen(final String opponentId) {
|
||||
action.appendEffect(
|
||||
new RevealAndChooseCardsFromOpponentHandEffect(playerId, opponentId, "Choose an ISENGARD minion", Filters.and(Filters.culture(Culture.ISENGARD), Filters.type(CardType.MINION)), 0, 1) {
|
||||
new RevealAndChooseCardsFromOpponentHandEffect(playerId, opponentId, self, "Choose an ISENGARD minion", Filters.and(Filters.culture(Culture.ISENGARD), Filters.type(CardType.MINION)), 0, 1) {
|
||||
@Override
|
||||
protected void cardsSelected(List<PhysicalCard> selectedCards) {
|
||||
if (selectedCards.size() > 0) {
|
||||
|
||||
@@ -46,7 +46,7 @@ public class Card1_075 extends AbstractAttachableFPPossession {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<? extends Action> getExtraInPlayPhaseActions(final String playerId, final LotroGame game, PhysicalCard self) {
|
||||
protected List<? extends Action> getExtraInPlayPhaseActions(final String playerId, final LotroGame game, final PhysicalCard self) {
|
||||
if ((PlayConditions.canUseFPCardDuringPhase(game.getGameState(), Phase.FELLOWSHIP, self)
|
||||
|| PlayConditions.canUseFPCardDuringPhase(game.getGameState(), Phase.REGROUP, self))
|
||||
&& PlayConditions.canExert(self, game.getGameState(), game.getModifiersQuerying(), self.getAttachedTo())) {
|
||||
@@ -57,7 +57,7 @@ public class Card1_075 extends AbstractAttachableFPPossession {
|
||||
@Override
|
||||
protected void opponentChosen(final String opponentId) {
|
||||
action.appendEffect(
|
||||
new RevealAndChooseCardsFromOpponentHandEffect(playerId, opponentId, "Opponent's hand", Filters.none, 0, 0) {
|
||||
new RevealAndChooseCardsFromOpponentHandEffect(playerId, opponentId, self, "Opponent's hand", Filters.none, 0, 0) {
|
||||
@Override
|
||||
protected void cardsSelected(List<PhysicalCard> selectedCards) {
|
||||
Collection<PhysicalCard> orcs = Filters.filter(game.getGameState().getHand(opponentId), game.getGameState(), game.getModifiersQuerying(), Filters.race(Race.ORC));
|
||||
|
||||
@@ -35,14 +35,14 @@ public class Card1_086 extends AbstractOldEvent {
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlayEventAction getPlayCardAction(final String playerId, LotroGame game, PhysicalCard self, int twilightModifier) {
|
||||
public PlayEventAction getPlayCardAction(final String playerId, LotroGame game, final PhysicalCard self, int twilightModifier) {
|
||||
final PlayEventAction action = new PlayEventAction(self);
|
||||
action.appendEffect(
|
||||
new ChooseOpponentEffect(playerId) {
|
||||
@Override
|
||||
protected void opponentChosen(String opponentId) {
|
||||
action.appendEffect(
|
||||
new RevealAndChooseCardsFromOpponentHandEffect(playerId, opponentId, "Opponent's hand", Filters.none, 0, 0) {
|
||||
new RevealAndChooseCardsFromOpponentHandEffect(playerId, opponentId, self, "Opponent's hand", Filters.none, 0, 0) {
|
||||
@Override
|
||||
protected void cardsSelected(List<PhysicalCard> selectedCards) {
|
||||
// Do nothing, just revealing
|
||||
|
||||
@@ -23,7 +23,7 @@ import java.util.List;
|
||||
*/
|
||||
public class Card1_305 extends AbstractPermanent {
|
||||
public Card1_305() {
|
||||
super(Side.FREE_PEOPLE, 1, CardType.POSSESSION, Culture.SHIRE, Zone.SUPPORT, "Old Tobby");
|
||||
super(Side.FREE_PEOPLE, 1, CardType.POSSESSION, Culture.SHIRE, Zone.SUPPORT, "Old Toby");
|
||||
addKeyword(Keyword.PIPEWEED);
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ public class Card1_313 extends AbstractAttachableFPPossession {
|
||||
@Override
|
||||
protected void opponentChosen(final String opponentId) {
|
||||
action.appendEffect(
|
||||
new RevealAndChooseCardsFromOpponentHandEffect(playerId, opponentId, "Opponent's hand", Filters.none, 0, 0) {
|
||||
new RevealAndChooseCardsFromOpponentHandEffect(playerId, opponentId, self, "Opponent's hand", Filters.none, 0, 0) {
|
||||
@Override
|
||||
protected void cardsSelected(List<PhysicalCard> selectedCards) {
|
||||
Collection<PhysicalCard> orcs = Filters.filter(game.getGameState().getHand(opponentId), game.getGameState(), game.getModifiersQuerying(), Filters.race(Race.ORC));
|
||||
|
||||
Reference in New Issue
Block a user