From 232523fb430e87015506e563ddd75db5ec2c47e1 Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Fri, 28 Oct 2011 09:39:35 +0000 Subject: [PATCH] "Leaving Forever" --- .../lotro/cards/set7/elven/Card7_024.java | 82 +++++++++++++++++++ .../lotro/logic/effects/AddThreatsEffect.java | 2 +- 2 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/elven/Card7_024.java diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/elven/Card7_024.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/elven/Card7_024.java new file mode 100644 index 000000000..1bbd4aa51 --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/elven/Card7_024.java @@ -0,0 +1,82 @@ +package com.gempukku.lotro.cards.set7.elven; + +import com.gempukku.lotro.cards.AbstractPermanent; +import com.gempukku.lotro.cards.PlayConditions; +import com.gempukku.lotro.cards.effects.ChoiceEffect; +import com.gempukku.lotro.cards.effects.choose.ChooseAndDiscardCardsFromPlayEffect; +import com.gempukku.lotro.common.*; +import com.gempukku.lotro.game.PhysicalCard; +import com.gempukku.lotro.game.state.LotroGame; +import com.gempukku.lotro.logic.actions.ActivateCardAction; +import com.gempukku.lotro.logic.actions.RequiredTriggerAction; +import com.gempukku.lotro.logic.effects.AddThreatsEffect; +import com.gempukku.lotro.logic.effects.DiscardCardsFromPlayEffect; +import com.gempukku.lotro.logic.effects.DrawCardEffect; +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.LinkedList; +import java.util.List; + +/** + * Set: The Return of the King + * Side: Free + * Culture: Elven + * Twilight Cost: 0 + * Type: Condition • Support Area + * Game Text: To play, spot 3 Elves. Each time the fellowship moves, add a threat or discard this condition. + * Regroup: Discard this condition to discard a condition or draw 2 cards. + */ +public class Card7_024 extends AbstractPermanent { + public Card7_024() { + super(Side.FREE_PEOPLE, 0, CardType.CONDITION, Culture.ELVEN, Zone.SUPPORT, "Leaving Forever"); + } + + @Override + public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) { + return super.checkPlayRequirements(playerId, game, self, twilightModifier) + && PlayConditions.canSpot(game, 3, Race.ELF); + } + + @Override + public List getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) { + if (effectResult.getType() == EffectResult.Type.WHEN_FELLOWSHIP_MOVES) { + RequiredTriggerAction action = new RequiredTriggerAction(self); + List possibleEffects = new LinkedList(); + possibleEffects.add( + new AddThreatsEffect(self.getOwner(), self, 1)); + possibleEffects.add( + new DiscardCardsFromPlayEffect(self, self)); + action.appendEffect( + new ChoiceEffect(action, self.getOwner(), possibleEffects)); + return Collections.singletonList(action); + } + return null; + } + + @Override + protected List getExtraPhaseActions(String playerId, LotroGame game, PhysicalCard self) { + if (PlayConditions.canUseFPCardDuringPhase(game.getGameState(), Phase.REGROUP, self) + && PlayConditions.canSelfDiscard(self, game)) { + ActivateCardAction action = new ActivateCardAction(self); + action.appendCost( + new DiscardCardsFromPlayEffect(self, self)); + List possibleEffects = new LinkedList(); + possibleEffects.add( + new ChooseAndDiscardCardsFromPlayEffect(action, playerId, 1, 1, CardType.CONDITION) { + @Override + public String getText(LotroGame game) { + return "Discard a condition"; + } + }); + possibleEffects.add( + new DrawCardEffect(playerId, 2)); + action.appendEffect( + new ChoiceEffect(action, playerId, possibleEffects)); + return Collections.singletonList(action); + } + return null; + } +} diff --git a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/effects/AddThreatsEffect.java b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/effects/AddThreatsEffect.java index d2cc3e2a0..3561b087c 100644 --- a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/effects/AddThreatsEffect.java +++ b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/effects/AddThreatsEffect.java @@ -27,7 +27,7 @@ public class AddThreatsEffect extends AbstractEffect { @Override public String getText(LotroGame game) { - return "Add " + _count + " threats"; + return "Add " + _count + " threat" + ((_count > 1) ? "s" : ""); } @Override