"Pass of Caradhras"

This commit is contained in:
marcins78@gmail.com
2011-09-01 00:03:57 +00:00
parent caf57cf782
commit ae25555ae4
2 changed files with 73 additions and 1 deletions

View File

@@ -0,0 +1,72 @@
package com.gempukku.lotro.cards.set1.site;
import com.gempukku.lotro.cards.AbstractSite;
import com.gempukku.lotro.cards.PlayConditions;
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.filters.Filter;
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.actions.CostToEffectAction;
import com.gempukku.lotro.logic.effects.ChooseArbitraryCardsEffect;
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
import com.gempukku.lotro.logic.timing.Action;
import com.gempukku.lotro.logic.timing.EffectResult;
import java.util.Collections;
import java.util.List;
/**
* Set: The Fellowship of the Ring
* Twilight Cost: 2
* Type: Site
* Site: 4
* Game Text: Mountain. Shadow: Spot a [ISENGARD] minion to play a weather card from your draw deck (limit one per
* turn).
*/
public class Card1_348 extends AbstractSite {
public Card1_348() {
super("Pass of Caradhras", 4, 2, Direction.RIGHT);
addKeyword(Keyword.MOUNTAIN);
}
@Override
public List<? extends Action> getPlayablePhaseActions(final String playerId, final LotroGame game, final PhysicalCard self) {
if (PlayConditions.canUseSiteDuringPhase(game.getGameState(), Phase.SHADOW, self)
&& Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.culture(Culture.ISENGARD), Filters.type(CardType.MINION))
&& self.getData() == null) {
final CostToEffectAction action = new CostToEffectAction(self, Keyword.SHADOW, "Play a weather card from your draw deck (limit one per turn).");
action.addEffect(
new ChooseArbitraryCardsEffect(playerId, "Choose a weather card to play", Filters.filter(game.getGameState().getDiscard(playerId), game.getGameState(), game.getModifiersQuerying(),
Filters.keyword(Keyword.WEATHER),
new Filter() {
@Override
public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) {
List<? extends Action> playableActions = physicalCard.getBlueprint().getPlayablePhaseActions(playerId, game, physicalCard);
return (playableActions != null && playableActions.size() > 0);
}
}), 1, 1) {
@Override
protected void cardsSelected(List<PhysicalCard> selectedCards) {
PhysicalCard selectedCard = selectedCards.get(0);
self.storeData(new Object());
game.getActionsEnvironment().addActionToStack(selectedCard.getBlueprint().getPlayablePhaseActions(playerId, game, selectedCard).get(0));
}
});
return Collections.singletonList(action);
}
return null;
}
@Override
public List<? extends Action> getRequiredWhenActions(LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (effectResult.getType() == EffectResult.Type.END_OF_TURN
&& self.getData() != null)
self.removeData();
return null;
}
}

View File

@@ -14,7 +14,7 @@ public enum Keyword {
WEATHER("Weather"), TALE("Tale"), SPELL("Spell"), SEARCH("Search"), STEALTH("Stealth"),
RIVER("River"), PLAINS("Plains"), UNDERGROUND("Underground"), SANCTUARY("Sanctuary"), FOREST("Forest"), MARSH("Marsh"),
RIVER("River"), PLAINS("Plains"), UNDERGROUND("Underground"), SANCTUARY("Sanctuary"), FOREST("Forest"), MARSH("Marsh"), MOUNTAIN("Mountain"),
DAMAGE("Damage"), DEFENDER("Defender"), FIERCE("Fierce"), ARCHER("Archer"), RANGER("Ranger"),