- 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:
@@ -0,0 +1,41 @@
|
||||
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.timing.AbstractSuccessfulEffect;
|
||||
import com.gempukku.lotro.logic.timing.EffectResult;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
public class RevealCardEffect extends AbstractSuccessfulEffect {
|
||||
private PhysicalCard _source;
|
||||
private Collection<PhysicalCard> _cards;
|
||||
|
||||
public RevealCardEffect(PhysicalCard source, PhysicalCard card) {
|
||||
this(source, Collections.singleton(card));
|
||||
}
|
||||
|
||||
public RevealCardEffect(PhysicalCard source, Collection<PhysicalCard> cards) {
|
||||
_source = source;
|
||||
_cards = cards;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText(LotroGame game) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EffectResult.Type getType() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EffectResult[] playEffect(LotroGame game) {
|
||||
if (_cards.size() > 0)
|
||||
game.getGameState().sendMessage(GameUtils.getCardLink(_source) + " revealed cards - " + getAppendedNames(_cards));
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -9,11 +9,15 @@ import com.gempukku.lotro.logic.timing.EffectResult;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class RevealRandomCardsFromHandEffect extends AbstractEffect {
|
||||
private String _playerId;
|
||||
private PhysicalCard _source;
|
||||
private int _count;
|
||||
private String _actingPlayer;
|
||||
private String _playerHand;
|
||||
|
||||
protected RevealRandomCardsFromHandEffect(String playerId, int count) {
|
||||
_playerId = playerId;
|
||||
protected RevealRandomCardsFromHandEffect(String actingPlayer, String handOfPlayer, PhysicalCard source, int count) {
|
||||
_actingPlayer = actingPlayer;
|
||||
_playerHand = handOfPlayer;
|
||||
_source = source;
|
||||
_count = count;
|
||||
}
|
||||
|
||||
@@ -29,14 +33,21 @@ public abstract class RevealRandomCardsFromHandEffect extends AbstractEffect {
|
||||
|
||||
@Override
|
||||
protected FullEffectResult playEffectReturningResult(LotroGame game) {
|
||||
List<PhysicalCard> randomCards = GameUtils.getRandomCards(game.getGameState().getHand(_playerId), _count);
|
||||
cardsRevealed(randomCards);
|
||||
return new FullEffectResult(null, randomCards.size() == _count, randomCards.size() == _count);
|
||||
if (_actingPlayer.equals(_playerHand) || game.getModifiersQuerying().canLookOrRevealCardsInHand(game.getGameState(), _playerHand)) {
|
||||
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));
|
||||
cardsRevealed(randomCards);
|
||||
return new FullEffectResult(null, randomCards.size() == _count, randomCards.size() == _count);
|
||||
}
|
||||
return new FullEffectResult(null, false, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPlayableInFull(LotroGame game) {
|
||||
return game.getGameState().getHand(_playerId).size() >= _count;
|
||||
if (game.getGameState().getHand(_playerHand).size() < _count)
|
||||
return false;
|
||||
return _actingPlayer.equals(_playerHand) || game.getModifiersQuerying().canLookOrRevealCardsInHand(game.getGameState(), _playerHand);
|
||||
}
|
||||
|
||||
protected abstract void cardsRevealed(List<PhysicalCard> revealedCards);
|
||||
|
||||
@@ -2,16 +2,19 @@ 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.timing.UnrespondableEffect;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class RevealTopCardsOfDrawDeckEffect extends UnrespondableEffect {
|
||||
private PhysicalCard _source;
|
||||
private String _playerId;
|
||||
private int _count;
|
||||
|
||||
public RevealTopCardsOfDrawDeckEffect(String playerId, int count) {
|
||||
public RevealTopCardsOfDrawDeckEffect(PhysicalCard source, String playerId, int count) {
|
||||
_source = source;
|
||||
_playerId = playerId;
|
||||
_count = count;
|
||||
}
|
||||
@@ -20,7 +23,10 @@ public abstract class RevealTopCardsOfDrawDeckEffect extends UnrespondableEffect
|
||||
public void doPlayEffect(LotroGame game) {
|
||||
List<? extends PhysicalCard> deck = game.getGameState().getDeck(_playerId);
|
||||
int count = Math.min(deck.size(), _count);
|
||||
cardsRevealed(new LinkedList<PhysicalCard>(deck.subList(0, count)));
|
||||
LinkedList<PhysicalCard> topCards = new LinkedList<PhysicalCard>(deck.subList(0, count));
|
||||
if (topCards.size() > 0)
|
||||
game.getGameState().sendMessage(GameUtils.getCardLink(_source) + " revealed cards from top of " + _playerId + " deck - " + getAppendedNames(topCards));
|
||||
cardsRevealed(topCards);
|
||||
}
|
||||
|
||||
protected abstract void cardsRevealed(List<PhysicalCard> cards);
|
||||
|
||||
@@ -4,6 +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.DiscardCardFromDeckEffect;
|
||||
import com.gempukku.lotro.cards.effects.RevealTopCardsOfDrawDeckEffect;
|
||||
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
|
||||
import com.gempukku.lotro.cards.effects.choose.ChooseArbitraryCardsEffect;
|
||||
import com.gempukku.lotro.common.Culture;
|
||||
@@ -49,7 +50,7 @@ public class Card1_018 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.DWARF)));
|
||||
@@ -58,34 +59,35 @@ public class Card1_018 extends AbstractOldEvent {
|
||||
new MultipleChoiceAwaitingDecision(1, "Choose player", GameUtils.getAllPlayers(game)) {
|
||||
@Override
|
||||
protected void validDecisionMade(int index, final String chosenPlayerId) {
|
||||
List<? extends PhysicalCard> deck = game.getGameState().getDeck(chosenPlayerId);
|
||||
int topCards = Math.min(deck.size(), 3);
|
||||
final List<PhysicalCard> topDeckCards = new LinkedList<PhysicalCard>(deck.subList(0, topCards));
|
||||
action.insertEffect(
|
||||
new RevealTopCardsOfDrawDeckEffect(self, chosenPlayerId, 3) {
|
||||
@Override
|
||||
protected void cardsRevealed(final List<PhysicalCard> topDeckCards) {
|
||||
if (topDeckCards.size() > 0) {
|
||||
Collection<PhysicalCard> shadowCards = Filters.filter(topDeckCards, game.getGameState(), game.getModifiersQuerying(), Filters.side(Side.SHADOW));
|
||||
|
||||
if (topDeckCards.size() > 0) {
|
||||
Collection<PhysicalCard> shadowCards = Filters.filter(topDeckCards, game.getGameState(), game.getModifiersQuerying(), Filters.side(Side.SHADOW));
|
||||
if (shadowCards.size() > 0) {
|
||||
action.appendEffect(
|
||||
new ChooseArbitraryCardsEffect(playerId, "Choose shadow card to discard", new LinkedList<PhysicalCard>(shadowCards), 0, 1) {
|
||||
@Override
|
||||
protected void cardsSelected(LotroGame game, Collection<PhysicalCard> selectedCards) {
|
||||
if (selectedCards.size() > 0) {
|
||||
action.appendEffect(new DiscardCardFromDeckEffect(selectedCards.iterator().next()));
|
||||
topDeckCards.removeAll(selectedCards);
|
||||
}
|
||||
|
||||
if (shadowCards.size() > 0) {
|
||||
action.appendEffect(
|
||||
new ChooseArbitraryCardsEffect(playerId, "Choose shadow card to discard", new LinkedList<PhysicalCard>(shadowCards), 0, 1) {
|
||||
@Override
|
||||
protected void cardsSelected(LotroGame game, Collection<PhysicalCard> selectedCards) {
|
||||
if (selectedCards.size() > 0) {
|
||||
action.appendEffect(new DiscardCardFromDeckEffect(selectedCards.iterator().next()));
|
||||
topDeckCards.removeAll(selectedCards);
|
||||
}
|
||||
|
||||
if (topDeckCards.size() > 0)
|
||||
game.getGameState().removeCardsFromZone(topDeckCards);
|
||||
if (topDeckCards.size() > 0)
|
||||
game.getGameState().removeCardsFromZone(topDeckCards);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
action.appendEffect(new ChooseCardToPutOnTop(action, playerId, topDeckCards));
|
||||
}
|
||||
action.appendEffect(new ChooseCardToPutOnTop(action, playerId, topDeckCards));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
);
|
||||
}));
|
||||
return action;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ public class Card1_028 extends AbstractOldEvent {
|
||||
public PlayEventAction getPlayCardAction(final String playerId, LotroGame game, PhysicalCard self, int twilightModifier) {
|
||||
final PlayEventAction action = new PlayEventAction(self);
|
||||
action.appendEffect(
|
||||
new RevealTopCardsOfDrawDeckEffect(playerId, 3) {
|
||||
new RevealTopCardsOfDrawDeckEffect(self, playerId, 3) {
|
||||
@Override
|
||||
protected void cardsRevealed(List<PhysicalCard> cards) {
|
||||
for (PhysicalCard card : cards) {
|
||||
|
||||
@@ -3,6 +3,7 @@ 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.cards.effects.choose.ChooseArbitraryCardsEffect;
|
||||
import com.gempukku.lotro.common.*;
|
||||
import com.gempukku.lotro.filters.Filters;
|
||||
@@ -30,7 +31,7 @@ public class Card1_054 extends AbstractPermanent {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends Action> getExtraPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
|
||||
public List<? extends Action> getExtraPhaseActions(String playerId, LotroGame game, final PhysicalCard self) {
|
||||
if (PlayConditions.canUseFPCardDuringPhase(game.getGameState(), Phase.FELLOWSHIP, self)) {
|
||||
final ActivateCardAction action = new ActivateCardAction(self);
|
||||
action.appendEffect(
|
||||
@@ -38,6 +39,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 PutCardFromHandOnBottomOfDeckEffect(selectedCard));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,13 +5,13 @@ import com.gempukku.lotro.cards.PlayConditions;
|
||||
import com.gempukku.lotro.cards.actions.PlayPermanentAction;
|
||||
import com.gempukku.lotro.cards.effects.ForEachBurdenYouSpotEffect;
|
||||
import com.gempukku.lotro.cards.effects.RemoveTwilightEffect;
|
||||
import com.gempukku.lotro.cards.effects.RevealRandomCardsFromHandEffect;
|
||||
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
|
||||
import com.gempukku.lotro.common.*;
|
||||
import com.gempukku.lotro.filters.Filters;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.GameState;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.logic.GameUtils;
|
||||
import com.gempukku.lotro.logic.actions.ActivateCardAction;
|
||||
import com.gempukku.lotro.logic.decisions.ArbitraryCardsSelectionDecision;
|
||||
import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException;
|
||||
@@ -63,15 +63,24 @@ public class Card1_120 extends AbstractPermanent {
|
||||
@Override
|
||||
protected void burdensSpotted(int burdensSpotted) {
|
||||
action.insertEffect(
|
||||
new PlayoutDecisionEffect(game.getUserFeedback(), playerId,
|
||||
new ArbitraryCardsSelectionDecision(1, "Choose card to discard", GameUtils.getRandomCards(gameState.getHand(fpPlayer), burdensSpotted), 0, 1) {
|
||||
@Override
|
||||
public void decisionMade(String result) throws DecisionResultInvalidException {
|
||||
List<PhysicalCard> cards = getSelectedCardsByResponse(result);
|
||||
if (cards.size() > 0)
|
||||
action.appendEffect(new DiscardCardsFromHandEffect(self, fpPlayer, cards, true));
|
||||
}
|
||||
}));
|
||||
new RevealRandomCardsFromHandEffect(playerId, fpPlayer, self, burdensSpotted) {
|
||||
@Override
|
||||
protected void cardsRevealed(List<PhysicalCard> revealedCards) {
|
||||
if (revealedCards.size() > 0)
|
||||
action.insertEffect(
|
||||
new PlayoutDecisionEffect(game.getUserFeedback(), playerId,
|
||||
new ArbitraryCardsSelectionDecision(1, "Choose card to discard", revealedCards, 0, 1) {
|
||||
@Override
|
||||
public void decisionMade(String result) throws DecisionResultInvalidException {
|
||||
List<PhysicalCard> cards = getSelectedCardsByResponse(result);
|
||||
if (cards.size() > 0)
|
||||
action.appendEffect(new DiscardCardsFromHandEffect(self, fpPlayer, cards, true));
|
||||
}
|
||||
}));
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ public class Card1_170 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 UnrespondableEffect() {
|
||||
@@ -47,6 +47,9 @@ public class Card1_170 extends AbstractOldEvent {
|
||||
LotroCardBlueprint blueprint = physicalCard.getBlueprint();
|
||||
if (blueprint.getCulture() != Culture.MORIA || blueprint.getCardType() != CardType.MINION)
|
||||
break;
|
||||
}
|
||||
for (PhysicalCard physicalCard : cardsToPutIntoHand) {
|
||||
|
||||
}
|
||||
for (PhysicalCard cardToPutIntoHand : cardsToPutIntoHand) {
|
||||
action.appendEffect(
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.gempukku.lotro.cards.PlayConditions;
|
||||
import com.gempukku.lotro.cards.effects.DiscardCardFromDeckEffect;
|
||||
import com.gempukku.lotro.cards.effects.PutCardFromDeckIntoHandOrDiscardEffect;
|
||||
import com.gempukku.lotro.cards.effects.RemoveTwilightEffect;
|
||||
import com.gempukku.lotro.cards.effects.RevealCardEffect;
|
||||
import com.gempukku.lotro.common.*;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
@@ -30,7 +31,7 @@ public class Card1_200 extends AbstractPermanent {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends Action> getExtraPhaseActions(final String playerId, final LotroGame game, PhysicalCard self) {
|
||||
public List<? extends Action> getExtraPhaseActions(final String playerId, final LotroGame game, final PhysicalCard self) {
|
||||
if (PlayConditions.canUseShadowCardDuringPhase(game.getGameState(), Phase.SHADOW, self, 3)) {
|
||||
final ActivateCardAction action = new ActivateCardAction(self);
|
||||
action.appendCost(new RemoveTwilightEffect(3));
|
||||
@@ -41,6 +42,8 @@ public class Card1_200 extends AbstractPermanent {
|
||||
List<? extends PhysicalCard> deck = game.getGameState().getDeck(playerId);
|
||||
if (deck.size() > 0) {
|
||||
PhysicalCard bottomCard = deck.get(deck.size() - 1);
|
||||
action.appendEffect(
|
||||
new RevealCardEffect(self, bottomCard));
|
||||
if (bottomCard.getBlueprint().getCulture() == Culture.MORIA
|
||||
&& bottomCard.getBlueprint().getRace() == Race.ORC) {
|
||||
action.appendEffect(
|
||||
|
||||
@@ -45,7 +45,7 @@ public class Card1_242 extends AbstractPermanent {
|
||||
final ActivateCardAction action = new ActivateCardAction(self);
|
||||
action.appendCost(new RemoveTwilightEffect(3));
|
||||
action.appendEffect(
|
||||
new RevealTopCardsOfDrawDeckEffect(playerId, 1) {
|
||||
new RevealTopCardsOfDrawDeckEffect(self, playerId, 1) {
|
||||
@Override
|
||||
protected void cardsRevealed(List<PhysicalCard> cards) {
|
||||
if (cards.size() == 0) {
|
||||
|
||||
@@ -42,7 +42,7 @@ public class Card1_301 extends AbstractAlly {
|
||||
final ActivateCardAction action = new ActivateCardAction(self);
|
||||
action.appendCost(new AddTwilightEffect(self, 2));
|
||||
action.appendEffect(
|
||||
new RevealTopCardsOfDrawDeckEffect(playerId, 3) {
|
||||
new RevealTopCardsOfDrawDeckEffect(self, playerId, 3) {
|
||||
@Override
|
||||
protected void cardsRevealed(List<PhysicalCard> cards) {
|
||||
for (PhysicalCard card : cards) {
|
||||
|
||||
@@ -31,7 +31,7 @@ public class Card1_215 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.appendEffect(
|
||||
new PlayoutDecisionEffect(game.getUserFeedback(), playerId,
|
||||
@@ -40,7 +40,7 @@ public class Card1_215 extends AbstractOldEvent {
|
||||
public void decisionMade(String result) throws DecisionResultInvalidException {
|
||||
int spotCount = getValidatedResult(result);
|
||||
action.appendEffect(
|
||||
new RevealTopCardsOfDrawDeckEffect(playerId, spotCount) {
|
||||
new RevealTopCardsOfDrawDeckEffect(self, playerId, spotCount) {
|
||||
@Override
|
||||
protected void cardsRevealed(List<PhysicalCard> cards) {
|
||||
for (PhysicalCard revealedCard : cards) {
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.gempukku.lotro.cards.AbstractAlly;
|
||||
import com.gempukku.lotro.cards.PlayConditions;
|
||||
import com.gempukku.lotro.cards.effects.ExertCharactersEffect;
|
||||
import com.gempukku.lotro.cards.effects.PutCardFromDiscardOnBottomOfDeckEffect;
|
||||
import com.gempukku.lotro.cards.effects.RevealCardEffect;
|
||||
import com.gempukku.lotro.cards.effects.choose.ChooseCardsFromDiscardEffect;
|
||||
import com.gempukku.lotro.common.Block;
|
||||
import com.gempukku.lotro.common.Culture;
|
||||
@@ -43,7 +44,7 @@ public class Card2_024 extends AbstractAlly {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<? extends Action> getExtraInPlayPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
|
||||
protected List<? extends Action> getExtraInPlayPhaseActions(String playerId, LotroGame game, final PhysicalCard self) {
|
||||
if (PlayConditions.canUseFPCardDuringPhase(game.getGameState(), Phase.FELLOWSHIP, self)
|
||||
&& PlayConditions.canExert(self, game.getGameState(), game.getModifiersQuerying(), self)) {
|
||||
final ActivateCardAction action = new ActivateCardAction(self);
|
||||
@@ -53,6 +54,8 @@ public class Card2_024 extends AbstractAlly {
|
||||
new ChooseCardsFromDiscardEffect(playerId, 1, 1, Filters.any) {
|
||||
@Override
|
||||
protected void cardsSelected(LotroGame game, Collection<PhysicalCard> cards) {
|
||||
action.appendEffect(
|
||||
new RevealCardEffect(self, cards));
|
||||
for (PhysicalCard card : cards) {
|
||||
action.appendEffect(
|
||||
new PutCardFromDiscardOnBottomOfDeckEffect(card));
|
||||
|
||||
@@ -2,6 +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.choose.ChooseAndPlayCardFromHandEffect;
|
||||
import com.gempukku.lotro.cards.effects.choose.ChooseCardsFromHandEffect;
|
||||
import com.gempukku.lotro.common.Culture;
|
||||
@@ -41,12 +42,14 @@ public class Card2_070 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 ChooseCardsFromHandEffect(playerId, 0, Integer.MAX_VALUE, Filters.culture(Culture.MORIA), Filters.race(Race.ORC)) {
|
||||
@Override
|
||||
protected void cardsSelected(LotroGame game, Collection<PhysicalCard> selectedCards) {
|
||||
action.appendEffect(
|
||||
new RevealCardEffect(self, selectedCards));
|
||||
int cardsRevealed = selectedCards.size();
|
||||
action.appendEffect(
|
||||
new ChooseAndPlayCardFromHandEffect(playerId, game.getGameState().getHand(playerId), -2 * cardsRevealed, Filters.name("The Balrog")));
|
||||
|
||||
@@ -43,7 +43,7 @@ public class Card3_006 extends AbstractOldEvent {
|
||||
@Override
|
||||
protected void opponentChosen(String opponentId) {
|
||||
action.insertEffect(
|
||||
new RevealRandomCardsFromHandEffect(opponentId, 1) {
|
||||
new RevealRandomCardsFromHandEffect(playerId, opponentId, self, 1) {
|
||||
@Override
|
||||
protected void cardsRevealed(List<PhysicalCard> revealedCards) {
|
||||
if (revealedCards.size() > 0) {
|
||||
|
||||
@@ -35,14 +35,14 @@ public class Card3_016 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.insertEffect(
|
||||
new RevealRandomCardsFromHandEffect(opponentId, 1) {
|
||||
new RevealRandomCardsFromHandEffect(playerId, opponentId, self, 1) {
|
||||
@Override
|
||||
protected void cardsRevealed(List<PhysicalCard> revealedCards) {
|
||||
if (revealedCards.size() > 0) {
|
||||
|
||||
@@ -50,7 +50,7 @@ public class Card3_033 extends AbstractOldEvent {
|
||||
@Override
|
||||
protected void opponentChosen(final String opponentId) {
|
||||
action.insertEffect(
|
||||
new RevealRandomCardsFromHandEffect(opponentId, 1) {
|
||||
new RevealRandomCardsFromHandEffect(playerId, opponentId, self, 1) {
|
||||
@Override
|
||||
protected void cardsRevealed(final List<PhysicalCard> revealedCards) {
|
||||
if (revealedCards.size() > 0) {
|
||||
|
||||
@@ -39,14 +39,14 @@ public class Card3_043 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.insertEffect(
|
||||
new RevealRandomCardsFromHandEffect(opponentId, 1) {
|
||||
new RevealRandomCardsFromHandEffect(playerId, opponentId, self, 1) {
|
||||
@Override
|
||||
protected void cardsRevealed(List<PhysicalCard> revealedCards) {
|
||||
if (revealedCards.size() > 0) {
|
||||
|
||||
@@ -37,7 +37,7 @@ public class Card3_051 extends AbstractOldEvent {
|
||||
public PlayEventAction getPlayCardAction(final String playerId, LotroGame game, PhysicalCard self, int twilightModifier) {
|
||||
final PlayEventAction action = new PlayEventAction(self);
|
||||
action.appendEffect(
|
||||
new RevealRandomCardsFromHandEffect(game.getGameState().getCurrentPlayerId(), 1) {
|
||||
new RevealRandomCardsFromHandEffect(playerId, game.getGameState().getCurrentPlayerId(), self, 1) {
|
||||
@Override
|
||||
protected void cardsRevealed(List<PhysicalCard> revealedCards) {
|
||||
if (revealedCards.size() > 0) {
|
||||
|
||||
@@ -42,7 +42,7 @@ public class Card3_067 extends AbstractPermanent {
|
||||
action.appendCost(
|
||||
new RemoveTwilightEffect(1));
|
||||
action.appendEffect(
|
||||
new RevealRandomCardsFromHandEffect(game.getGameState().getCurrentPlayerId(), 1) {
|
||||
new RevealRandomCardsFromHandEffect(playerId, game.getGameState().getCurrentPlayerId(), self, 1) {
|
||||
@Override
|
||||
protected void cardsRevealed(List<PhysicalCard> revealedCards) {
|
||||
for (PhysicalCard revealedCard : revealedCards) {
|
||||
|
||||
@@ -43,7 +43,7 @@ public class Card3_076 extends AbstractOldEvent {
|
||||
public PlayEventAction getPlayCardAction(String playerId, LotroGame game, final PhysicalCard self, int twilightModifier) {
|
||||
final PlayEventAction action = new PlayEventAction(self);
|
||||
action.appendEffect(
|
||||
new RevealRandomCardsFromHandEffect(game.getGameState().getCurrentPlayerId(), 1) {
|
||||
new RevealRandomCardsFromHandEffect(playerId, game.getGameState().getCurrentPlayerId(), self, 1) {
|
||||
@Override
|
||||
protected void cardsRevealed(List<PhysicalCard> revealedCards) {
|
||||
if (revealedCards.size() > 0) {
|
||||
|
||||
@@ -46,7 +46,7 @@ public class Card3_087 extends AbstractOldEvent {
|
||||
action.appendCost(
|
||||
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Filters.culture(Culture.SAURON), Filters.type(CardType.MINION)));
|
||||
action.appendEffect(
|
||||
new RevealRandomCardsFromHandEffect(game.getGameState().getCurrentPlayerId(), 1) {
|
||||
new RevealRandomCardsFromHandEffect(playerId, game.getGameState().getCurrentPlayerId(), self, 1) {
|
||||
@Override
|
||||
protected void cardsRevealed(List<PhysicalCard> revealedCards) {
|
||||
if (revealedCards.size() > 0) {
|
||||
|
||||
@@ -38,14 +38,14 @@ public class Card3_109 extends AbstractOldEvent {
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlayEventAction getPlayCardAction(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.insertEffect(
|
||||
new RevealRandomCardsFromHandEffect(opponentId, 1) {
|
||||
new RevealRandomCardsFromHandEffect(playerId, opponentId, self, 1) {
|
||||
@Override
|
||||
protected void cardsRevealed(List<PhysicalCard> revealedCards) {
|
||||
if (revealedCards.size() > 0) {
|
||||
|
||||
@@ -41,7 +41,7 @@ public class Card3_084 extends AbstractOldEvent {
|
||||
public PlayEventAction getPlayCardAction(final String playerId, LotroGame game, final PhysicalCard self, int twilightModifier) {
|
||||
final PlayEventAction action = new PlayEventAction(self);
|
||||
action.appendEffect(
|
||||
new RevealRandomCardsFromHandEffect(game.getGameState().getCurrentPlayerId(), 1) {
|
||||
new RevealRandomCardsFromHandEffect(playerId, game.getGameState().getCurrentPlayerId(), self, 1) {
|
||||
@Override
|
||||
protected void cardsRevealed(List<PhysicalCard> revealedCards) {
|
||||
if (revealedCards.size() > 0) {
|
||||
|
||||
@@ -53,7 +53,7 @@ public class Card4_107 extends AbstractAttachable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends Action> getOptionalInPlayAfterActions(final String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) {
|
||||
public List<? extends Action> getOptionalInPlayAfterActions(final String playerId, LotroGame game, EffectResult effectResult, final PhysicalCard self) {
|
||||
if (effectResult.getType() == EffectResult.Type.KILL) {
|
||||
KillResult killResult = (KillResult) effectResult;
|
||||
if (Filters.filter(killResult.getKilledCards(), game.getGameState(), game.getModifiersQuerying(), Filters.type(CardType.MINION), Filters.culture(Culture.ISENGARD)).size() > 0) {
|
||||
@@ -65,7 +65,7 @@ public class Card4_107 extends AbstractAttachable {
|
||||
@Override
|
||||
protected void opponentChosen(final String opponentId) {
|
||||
action.insertEffect(
|
||||
new RevealTopCardsOfDrawDeckEffect(opponentId, 10) {
|
||||
new RevealTopCardsOfDrawDeckEffect(self, opponentId, 10) {
|
||||
@Override
|
||||
protected void cardsRevealed(final List<PhysicalCard> cards) {
|
||||
action.appendEffect(
|
||||
|
||||
@@ -4,6 +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.choose.ChooseCardsFromDiscardEffect;
|
||||
import com.gempukku.lotro.common.Culture;
|
||||
import com.gempukku.lotro.common.Phase;
|
||||
@@ -39,6 +40,8 @@ public class Card4_162 extends AbstractOldEvent {
|
||||
@Override
|
||||
public PlayEventAction getPlayCardAction(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) {
|
||||
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(), Filters.side(Side.FREE_PEOPLE)), false));
|
||||
action.appendEffect(
|
||||
|
||||
@@ -52,7 +52,7 @@ public class Card4_166 extends AbstractPermanent {
|
||||
@Override
|
||||
protected void validDecisionMade(int index, String deckId) {
|
||||
action.insertEffect(
|
||||
new RevealTopCardsOfDrawDeckEffect(deckId, 1) {
|
||||
new RevealTopCardsOfDrawDeckEffect(self, deckId, 1) {
|
||||
@Override
|
||||
protected void cardsRevealed(List<PhysicalCard> cards) {
|
||||
if (cards.size() > 0) {
|
||||
|
||||
@@ -57,7 +57,7 @@ public class Card4_171 extends AbstractAttachable {
|
||||
if (killEffect.getCharactersToBeKilled().contains(self.getAttachedTo())) {
|
||||
final RequiredTriggerAction action = new RequiredTriggerAction(self);
|
||||
action.appendEffect(
|
||||
new RevealTopCardsOfDrawDeckEffect(game.getGameState().getCurrentPlayerId(), 10) {
|
||||
new RevealTopCardsOfDrawDeckEffect(self, game.getGameState().getCurrentPlayerId(), 10) {
|
||||
@Override
|
||||
protected void cardsRevealed(final List<PhysicalCard> cards) {
|
||||
action.appendEffect(
|
||||
|
||||
@@ -57,7 +57,7 @@ public class Card5_028 extends AbstractCompanion {
|
||||
action.appendCost(
|
||||
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, 2, Filters.or(Filters.name("Gollum"), Filters.name("Smeagol"))));
|
||||
action.appendEffect(
|
||||
new RevealTopCardsOfDrawDeckEffect(playerId, 4) {
|
||||
new RevealTopCardsOfDrawDeckEffect(self, playerId, 4) {
|
||||
@Override
|
||||
protected void cardsRevealed(List<PhysicalCard> cards) {
|
||||
int shadowCards = Filters.filter(cards, game.getGameState(), game.getModifiersQuerying(), Side.SHADOW).size();
|
||||
@@ -106,17 +106,17 @@ public class Card5_028 extends AbstractCompanion {
|
||||
} else if (_cards.size() > 1) {
|
||||
game.getUserFeedback().sendAwaitingDecision(
|
||||
_playerId, new ArbitraryCardsSelectionDecision(1, "Choose card to put on bottom of deck", _cards, 1, 1) {
|
||||
@Override
|
||||
public void decisionMade(String result) throws DecisionResultInvalidException {
|
||||
final List<PhysicalCard> selectedCards = getSelectedCardsByResponse(result);
|
||||
if (selectedCards.size() == 1) {
|
||||
PhysicalCard card = selectedCards.iterator().next();
|
||||
_cards.remove(card);
|
||||
game.getGameState().removeCardsFromZone(Collections.singleton(card));
|
||||
game.getGameState().putCardOnBottomOfDeck(card);
|
||||
}
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void decisionMade(String result) throws DecisionResultInvalidException {
|
||||
final List<PhysicalCard> selectedCards = getSelectedCardsByResponse(result);
|
||||
if (selectedCards.size() == 1) {
|
||||
PhysicalCard card = selectedCards.iterator().next();
|
||||
_cards.remove(card);
|
||||
game.getGameState().removeCardsFromZone(Collections.singleton(card));
|
||||
game.getGameState().putCardOnBottomOfDeck(card);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -86,10 +86,10 @@ public class GameState {
|
||||
private int _charsCount = _possibleChars.length();
|
||||
|
||||
private String randomUid() {
|
||||
int length = 10;
|
||||
int length = 16;
|
||||
char[] chars = new char[length];
|
||||
Random rnd = new Random();
|
||||
for (int i = 0; i < 10; i++)
|
||||
for (int i = 0; i < length; i++)
|
||||
chars[i] = _possibleChars.charAt(rnd.nextInt(_charsCount));
|
||||
|
||||
return new String(chars);
|
||||
@@ -119,6 +119,8 @@ public class GameState {
|
||||
gameReplay.appendChild(serializer.serializeEvent(doc, gameEvent));
|
||||
}
|
||||
|
||||
doc.appendChild(gameReplay);
|
||||
|
||||
// Prepare the DOM document for writing
|
||||
Source source = new DOMSource(doc);
|
||||
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
- Increased the time for playing game per player to 80 minutes (for testing only).
|
||||
- When players join or leave the room now, everyone in the room will be notified.
|
||||
- Added Mulligan rule to "Community..." formats and "Towers Standard" format.
|
||||
- Added revealing effect to all cards, for now the revealed cards will be only shown in the log, until I figure out
|
||||
something better.
|
||||
|
||||
<b>17 Oct. 2011</b>
|
||||
- "Coming for the Ring" is no longed considered Free People card by the game.
|
||||
|
||||
Reference in New Issue
Block a user