From 316b65936890b2be5eb8ed8c6eb3c392e4a9d982 Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Thu, 29 Sep 2011 23:53:14 +0000 Subject: [PATCH] "Resistance Becomes Unbearable" --- .../lotro/cards/set2/wraith/Card2_079.java | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set2/wraith/Card2_079.java diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set2/wraith/Card2_079.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set2/wraith/Card2_079.java new file mode 100644 index 000000000..449b7a63a --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set2/wraith/Card2_079.java @@ -0,0 +1,92 @@ +package com.gempukku.lotro.cards.set2.wraith; + +import com.gempukku.lotro.cards.AbstractEvent; +import com.gempukku.lotro.cards.PlayConditions; +import com.gempukku.lotro.cards.actions.PlayEventAction; +import com.gempukku.lotro.cards.costs.ChooseAndExertCharactersCost; +import com.gempukku.lotro.cards.effects.ExertCharacterEffect; +import com.gempukku.lotro.cards.effects.PutOnTheOneRingEffect; +import com.gempukku.lotro.cards.effects.TakeOffTheOneRingEffect; +import com.gempukku.lotro.common.*; +import com.gempukku.lotro.filters.Filters; +import com.gempukku.lotro.game.AbstractActionProxy; +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.Action; +import com.gempukku.lotro.logic.timing.Effect; +import com.gempukku.lotro.logic.timing.EffectResult; + +import java.util.Collections; +import java.util.List; + +/** + * Set: Mines of Moria + * Side: Shadow + * Culture: Wraith + * Twilight Cost: 1 + * Type: Event + * Game Text: Maneuver: Exert a twilight Nazgul to exert the Ring-bearer. If the Ring-bearer is then exhausted, he puts + * on The One Ring until the regroup phase. + */ +public class Card2_079 extends AbstractEvent { + public Card2_079() { + super(Side.SHADOW, Culture.WRAITH, "Resistance Becomes Unbearable"); + } + + @Override + public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) { + return super.checkPlayRequirements(playerId, game, self, twilightModifier) + && PlayConditions.canExert(self, game.getGameState(), game.getModifiersQuerying(), Filters.race(Race.NAZGUL), Filters.keyword(Keyword.TWILIGHT)); + } + + @Override + public int getTwilightCost() { + return 1; + } + + @Override + public PlayEventAction getPlayCardAction(String playerId, LotroGame game, final PhysicalCard self, int twilightModifier) { + final PlayEventAction action = new PlayEventAction(self); + action.appendCost( + new ChooseAndExertCharactersCost(action, playerId, 1, 1, Filters.race(Race.NAZGUL), Filters.keyword(Keyword.TWILIGHT))); + action.appendEffect( + new ExertCharacterEffect(self, Filters.keyword(Keyword.RING_BEARER))); + action.appendEffect( + new Effect() { + @Override + public String getText(LotroGame game) { + return null; + } + + @Override + public EffectResult.Type getType() { + return null; + } + + @Override + public EffectResult[] playEffect(LotroGame game) { + if (Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.keyword(Keyword.RING_BEARER), Filters.exhausted())) { + action.insertEffect( + new PutOnTheOneRingEffect()); + game.getActionsEnvironment().addUntilEndOfPhaseActionProxy( + new AbstractActionProxy() { + @Override + public List getRequiredAfterTriggers(LotroGame lotroGame, EffectResult effectResults) { + if (effectResults.getType() == EffectResult.Type.START_OF_PHASE + && lotroGame.getGameState().getCurrentPhase() == Phase.REGROUP) { + RequiredTriggerAction action = new RequiredTriggerAction(self); + action.appendEffect( + new TakeOffTheOneRingEffect()); + return Collections.singletonList(action); + } + return null; + } + }, Phase.REGROUP); + } + return null; + } + }); + return action; + } +}