"Surrounded by Wraiths"

This commit is contained in:
marcins78@gmail.com
2011-12-06 17:32:04 +00:00
parent 4dc53a6713
commit 10c7a28056

View File

@@ -0,0 +1,66 @@
package com.gempukku.lotro.cards.set11.wraith;
import com.gempukku.lotro.cards.AbstractPermanent;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.TriggerConditions;
import com.gempukku.lotro.cards.effects.ExhaustCharacterEffect;
import com.gempukku.lotro.cards.effects.PayTwilightCostEffect;
import com.gempukku.lotro.cards.effects.PreventableEffect;
import com.gempukku.lotro.common.*;
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.actions.SubAction;
import com.gempukku.lotro.logic.timing.Effect;
import com.gempukku.lotro.logic.timing.EffectResult;
import com.gempukku.lotro.logic.timing.results.PlayCardResult;
import java.util.Collections;
import java.util.List;
/**
* Set: Shadows
* Side: Shadow
* Culture: Wraith
* Twilight Cost: 1
* Type: Condition • Support Area
* Game Text: To play, spot a Nazgul. Each time the Free Peoples player plays a companion, that companion is exhausted
* unless the Free Peoples player pays its twilight cost again.
*/
public class Card11_218 extends AbstractPermanent {
public Card11_218() {
super(Side.SHADOW, 1, CardType.CONDITION, Culture.WRAITH, Zone.SUPPORT, "Surrounded by Wraiths", true);
}
@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.canSpot(game, Race.NAZGUL);
}
@Override
public List<RequiredTriggerAction> getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (TriggerConditions.played(game, effectResult, CardType.COMPANION)) {
PlayCardResult playedResult = (PlayCardResult) effectResult;
final PhysicalCard playedCompanion = playedResult.getPlayedCard();
RequiredTriggerAction action = new RequiredTriggerAction(self);
action.appendEffect(
new PreventableEffect(action,
new ExhaustCharacterEffect(self, action, playedCompanion), game.getGameState().getCurrentPlayerId(),
new PreventableEffect.PreventionCost() {
@Override
public Effect createPreventionCostForPlayer(SubAction subAction, String playerId) {
return new PayTwilightCostEffect(playedCompanion) {
@Override
public String getText(LotroGame game) {
return "Pay twilight cost again";
}
};
}
}));
return Collections.singletonList(action);
}
return null;
}
}