"Glimpse of Twilight"

This commit is contained in:
marcins78
2013-02-05 11:20:57 +00:00
parent 417fde067d
commit 17e9d30eec

View File

@@ -0,0 +1,95 @@
package com.gempukku.lotro.cards.set20.wraith;
import com.gempukku.lotro.cards.AbstractPermanent;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.actions.PlayPermanentAction;
import com.gempukku.lotro.cards.effects.ChoiceEffect;
import com.gempukku.lotro.cards.effects.SelfDiscardEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndDiscardCardsFromPlayEffect;
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.actions.ActivateCardAction;
import com.gempukku.lotro.logic.modifiers.Condition;
import com.gempukku.lotro.logic.modifiers.KeywordModifier;
import com.gempukku.lotro.logic.modifiers.Modifier;
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
import com.gempukku.lotro.logic.timing.Action;
import com.gempukku.lotro.logic.timing.Effect;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
/**
* 2
* Glimpse of Twilight
* Ringwraith Condition • Support Area
* Twilight. To play, exert a Nazgul.
* While the Ring-bearer wears The One Ring, Nazgul are twilight and fierce.
* Regroup: Discard this condition (or a Nazgul) to exert the Ring-bearer.
*/
public class Card20_292 extends AbstractPermanent {
public Card20_292() {
super(Side.SHADOW, 2, CardType.CONDITION, Culture.WRAITH, Zone.SUPPORT, "Glimpse of Twilight");
addKeyword(Keyword.TWILIGHT);
}
@Override
public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int withTwilightRemoved, int twilightModifier, boolean ignoreRoamingPenalty, boolean ignoreCheckingDeadPile) {
return super.checkPlayRequirements(playerId, game, self, withTwilightRemoved, twilightModifier, ignoreRoamingPenalty, ignoreCheckingDeadPile)
&& PlayConditions.canExert(self, game, Race.NAZGUL);
}
@Override
public PlayPermanentAction getPlayCardAction(String playerId, LotroGame game, PhysicalCard self, int twilightModifier, boolean ignoreRoamingPenalty) {
PlayPermanentAction action = super.getPlayCardAction(playerId, game, self, twilightModifier, ignoreRoamingPenalty);
action.appendCost(
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Race.NAZGUL));
return action;
}
@Override
public List<? extends Modifier> getAlwaysOnModifiers(LotroGame game, PhysicalCard self) {
List<Modifier> modifiers = new LinkedList<Modifier>();
Condition wearRingCondition = new Condition() {
@Override
public boolean isFullfilled(GameState gameState, ModifiersQuerying modifiersQuerying) {
return gameState.isWearingRing();
}
};
modifiers.add(
new KeywordModifier(self, Race.NAZGUL, wearRingCondition, Keyword.FIERCE, 1));
modifiers.add(
new KeywordModifier(self, Race.NAZGUL, wearRingCondition, Keyword.TWILIGHT, 1));
return modifiers;
}
@Override
protected List<? extends Action> getExtraPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
if (PlayConditions.canUseShadowCardDuringPhase(game, Phase.REGROUP, self, 0)
&& (PlayConditions.canSelfDiscard(self, game)
|| PlayConditions.canDiscardFromPlay(self, game, Race.NAZGUL))) {
ActivateCardAction action = new ActivateCardAction(self);
List<Effect> possibleCosts = new LinkedList<Effect>();
possibleCosts.add(
new SelfDiscardEffect(self));
possibleCosts.add(
new ChooseAndDiscardCardsFromPlayEffect(action, playerId, 1, 1, Race.NAZGUL) {
@Override
public String getText(LotroGame game) {
return "Discard a Nazgul";
}
});
action.appendCost(
new ChoiceEffect(action, playerId, possibleCosts));
action.appendEffect(
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Filters.ringBearer));
return Collections.singletonList(action);
}
return null;
}
}