"Peering Forward"

This commit is contained in:
marcins78
2013-01-07 16:40:14 +00:00
parent a556dd8d97
commit dc9116ceaf
5 changed files with 86 additions and 3 deletions

View File

@@ -217,6 +217,14 @@ public class TriggerConditions {
return false;
}
public static boolean revealedCardsFromTopOfDeck(EffectResult effectResult, String playerId) {
if (effectResult.getType() == EffectResult.Type.REVEAL_CARDS_FROM_TOP_OF_DECK) {
RevealCardFromTopOfDeckResult revealCardFromTopOfDeckResult = (RevealCardFromTopOfDeckResult) effectResult;
return revealCardFromTopOfDeckResult.getPlayerId().equals(playerId);
}
return false;
}
public static boolean isAddingBurden(Effect effect, LotroGame game, Filterable... filters) {
if (effect.getType() == Effect.Type.BEFORE_ADD_BURDENS) {
AddBurdenEffect addBurdenEffect = (AddBurdenEffect) effect;

View File

@@ -5,6 +5,7 @@ import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.GameUtils;
import com.gempukku.lotro.logic.timing.AbstractEffect;
import com.gempukku.lotro.logic.timing.Effect;
import com.gempukku.lotro.logic.timing.results.RevealCardFromTopOfDeckResult;
import java.util.LinkedList;
import java.util.List;
@@ -40,9 +41,12 @@ public abstract class RevealTopCardsOfDrawDeckEffect extends AbstractEffect {
List<? extends PhysicalCard> deck = game.getGameState().getDeck(_playerId);
int count = Math.min(deck.size(), _count);
LinkedList<PhysicalCard> topCards = new LinkedList<PhysicalCard>(deck.subList(0, count));
if (topCards.size() > 0)
if (topCards.size() > 0) {
game.getGameState().sendMessage(GameUtils.getCardLink(_source) + " revealed cards from top of " + _playerId + " deck - " + getAppendedNames(topCards));
cardsRevealed(topCards);
game.getActionsEnvironment().emitEffectResult(
new RevealCardFromTopOfDeckResult(_playerId, topCards));
cardsRevealed(topCards);
}
return new FullEffectResult(topCards.size() == _count);
}

View File

@@ -0,0 +1,46 @@
package com.gempukku.lotro.cards.set20.elven;
import com.gempukku.lotro.cards.AbstractPermanent;
import com.gempukku.lotro.cards.TriggerConditions;
import com.gempukku.lotro.cards.effects.choose.ChooseAndAddUntilEOPStrengthBonusEffect;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
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.actions.RequiredTriggerAction;
import com.gempukku.lotro.logic.timing.EffectResult;
import com.gempukku.lotro.logic.timing.results.RevealCardFromTopOfDeckResult;
import java.util.LinkedList;
import java.util.List;
/**
* 0
* •Peering Forward
* Elven Condition • Support Area
* Each time you reveal an [Elven] card from the top of your draw deck, make a minion strength -1 until the regroup phase.
*/
public class Card20_100 extends AbstractPermanent {
public Card20_100() {
super(Side.FREE_PEOPLE, 0, CardType.CONDITION, Culture.ELVEN, Zone.SUPPORT, "Peering Forward", null, true);
}
@Override
public List<RequiredTriggerAction> getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (TriggerConditions.revealedCardsFromTopOfDeck(effectResult, self.getOwner())) {
RevealCardFromTopOfDeckResult revealedCardsResult = (RevealCardFromTopOfDeckResult) effectResult;
List<RequiredTriggerAction> actions = new LinkedList<RequiredTriggerAction>();
for (PhysicalCard revealedElvenCard : Filters.filter(revealedCardsResult.getRevealedCards(), game.getGameState(), game.getModifiersQuerying(), Culture.ELVEN)) {
RequiredTriggerAction action = new RequiredTriggerAction(self);
action.appendEffect(
new ChooseAndAddUntilEOPStrengthBonusEffect(action, self, self.getOwner(), -1, CardType.MINION));
actions.add(action);
}
return actions;
}
return null;
}
}

View File

@@ -44,7 +44,7 @@ public abstract class EffectResult {
REMOVE_BURDEN, ADD_BURDEN, ADD_THREAT,
REVEAL_CARDS_FROM_HAND,
REVEAL_CARDS_FROM_HAND, REVEAL_CARDS_FROM_TOP_OF_DECK,
SKIRMISH_FINISHED_WITH_OVERWHELM, SKIRMISH_FINISHED_NORMALLY,

View File

@@ -0,0 +1,25 @@
package com.gempukku.lotro.logic.timing.results;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.logic.timing.EffectResult;
import java.util.Collection;
public class RevealCardFromTopOfDeckResult extends EffectResult {
private String _playerId;
private Collection<PhysicalCard> _revealedCards;
public RevealCardFromTopOfDeckResult(String playerId, Collection<PhysicalCard> revealedCards) {
super(Type.REVEAL_CARDS_FROM_TOP_OF_DECK);
_playerId = playerId;
_revealedCards = revealedCards;
}
public String getPlayerId() {
return _playerId;
}
public Collection<PhysicalCard> getRevealedCards() {
return _revealedCards;
}
}