From 614e6489c62cdc5f1c6d8335fadc00b8cb224241 Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Wed, 31 Aug 2011 14:30:29 +0000 Subject: [PATCH] "Worry" --- .../lotro/cards/effects/AddBurdenEffect.java | 5 ++ .../cards/effects/ExertCharacterEffect.java | 5 ++ .../lotro/cards/set1/isengard/Card1_162.java | 76 +++++++++++++++++++ 3 files changed, 86 insertions(+) create mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/isengard/Card1_162.java diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/effects/AddBurdenEffect.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/effects/AddBurdenEffect.java index 1dca7048d..f4025d26c 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/effects/AddBurdenEffect.java +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/effects/AddBurdenEffect.java @@ -10,6 +10,11 @@ public class AddBurdenEffect extends UnrespondableEffect { _playerId = playerId; } + @Override + public String getText() { + return "Add a burder"; + } + @Override public void playEffect(LotroGame game) { game.getGameState().addBurdens(_playerId, 1); diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/effects/ExertCharacterEffect.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/effects/ExertCharacterEffect.java index 8320b891e..7279ba5dc 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/effects/ExertCharacterEffect.java +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/effects/ExertCharacterEffect.java @@ -12,6 +12,11 @@ public class ExertCharacterEffect extends UnrespondableEffect { _physicalCard = physicalCard; } + @Override + public String getText() { + return "Exert " + _physicalCard.getBlueprint().getName(); + } + @Override public boolean canPlayEffect(LotroGame game) { return PlayConditions.canExert(game.getGameState(), game.getModifiersQuerying(), _physicalCard); diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/isengard/Card1_162.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/isengard/Card1_162.java new file mode 100644 index 000000000..81098c8b9 --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/isengard/Card1_162.java @@ -0,0 +1,76 @@ +package com.gempukku.lotro.cards.set1.isengard; + +import com.gempukku.lotro.cards.AbstractLotroCardBlueprint; +import com.gempukku.lotro.cards.PlayConditions; +import com.gempukku.lotro.cards.actions.PlayPermanentAction; +import com.gempukku.lotro.cards.effects.AddBurdenEffect; +import com.gempukku.lotro.cards.effects.ChoiceEffect; +import com.gempukku.lotro.cards.effects.ExertCharacterEffect; +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.CostToEffectAction; +import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect; +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 Fellowship of the Ring + * Side: Shadow + * Culture: Isengard + * Twilight Cost: 2 + * Type: Condition + * Game Text: To play, exert an Uruk-hai. Plays to your support area. Each time a companion or ally loses a skirmish + * involving an Uruk-hai, the opponent must choose to either exert the Ring-bearer or add a burden. + */ +public class Card1_162 extends AbstractLotroCardBlueprint { + public Card1_162() { + super(Side.SHADOW, CardType.CONDITION, Culture.ISENGARD, "Worry", "1_162", true); + } + + @Override + public int getTwilightCost() { + return 2; + } + + @Override + public List getPlayablePhaseActions(String playerId, LotroGame game, PhysicalCard self) { + if (PlayConditions.canPlayShadowCardDuringPhase(game, Phase.SHADOW, self) + && Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.keyword(Keyword.URUK_HAI), Filters.canExert())) { + final PlayPermanentAction action = new PlayPermanentAction(self, Zone.SHADOW_SUPPORT); + action.addCost( + new ChooseActiveCardEffect(playerId, "Choose an Uruk-hai", Filters.keyword(Keyword.URUK_HAI), Filters.canExert()) { + @Override + protected void cardSelected(LotroGame game, PhysicalCard urukHai) { + action.addCost(new ExertCharacterEffect(urukHai)); + } + } + ); + return Collections.singletonList(action); + } + return null; + } + + @Override + public List getRequiredWhenActions(LotroGame game, EffectResult effectResult, PhysicalCard self) { + GameState gameState = game.getGameState(); + if (PlayConditions.winsSkirmish(gameState, game.getModifiersQuerying(), effectResult, Filters.keyword(Keyword.URUK_HAI))) { + CostToEffectAction action = new CostToEffectAction(self, "Each time a companion or ally loses a skirmish involving an Uruk-hai, the opponent must choose to either exert the Ring-bearer or add a burden."); + List possibleEffects = new LinkedList(); + possibleEffects.add(new ExertCharacterEffect(gameState.getRingBearer(gameState.getCurrentPlayerId()))); + possibleEffects.add(new AddBurdenEffect(gameState.getCurrentPlayerId())); + + action.addEffect( + new ChoiceEffect(action, game.getGameState().getCurrentPlayerId(), possibleEffects, false)); + return Collections.singletonList(action); + } + return null; + } +}