From 7d27c0bf78577bdb7689c247e49d1aa9b1394655 Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Mon, 7 Nov 2011 12:09:37 +0000 Subject: [PATCH] "With Strength to Fight" --- .../lotro/cards/set7/rohan/Card7_261.java | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/rohan/Card7_261.java diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/rohan/Card7_261.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/rohan/Card7_261.java new file mode 100644 index 000000000..69098ec91 --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/rohan/Card7_261.java @@ -0,0 +1,76 @@ +package com.gempukku.lotro.cards.set7.rohan; + +import com.gempukku.lotro.cards.AbstractPermanent; +import com.gempukku.lotro.cards.PlayConditions; +import com.gempukku.lotro.cards.effects.ChoiceEffect; +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.ChooseAndHealCharactersEffect; +import com.gempukku.lotro.logic.effects.DiscardCardsFromPlayEffect; +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: Rohan + * Twilight Cost: 0 + * Type: Condition • Support Area + * Game Text: To play, spot a [ROHAN] companion. Each time the fellowship moves, add a threat or discard this condition. + * Regroup: Discard this condition to heal up to 2 [ROHAN] companions. + */ +public class Card7_261 extends AbstractPermanent { + public Card7_261() { + super(Side.FREE_PEOPLE, 0, CardType.CONDITION, Culture.ROHAN, Zone.SUPPORT, "With Strength to Fight"); + } + + @Override + public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) { + return super.checkPlayRequirements(playerId, game, self, twilightModifier) + && PlayConditions.canSpot(game, Culture.ROHAN, CardType.COMPANION); + } + + @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) { + @Override + public String getText(LotroGame game) { + return "Discard this condition"; + } + }); + 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, Phase.REGROUP, self) + && PlayConditions.canSelfDiscard(self, game)) { + ActivateCardAction action = new ActivateCardAction(self); + action.appendCost( + new DiscardCardsFromPlayEffect(self, self)); + action.appendEffect( + new ChooseAndHealCharactersEffect(action, playerId, 0, 2, Culture.ROHAN, CardType.COMPANION)); + return Collections.singletonList(action); + } + return null; + } +}