From 1f4580a4fb6b8eacb237a4c7d9ba7a1b4d076a3a Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Tue, 11 Oct 2011 10:21:43 +0000 Subject: [PATCH] "Weapons of Isengard" --- .../lotro/cards/set4/isengard/Card4_211.java | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set4/isengard/Card4_211.java diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set4/isengard/Card4_211.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set4/isengard/Card4_211.java new file mode 100644 index 000000000..f6afb8637 --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set4/isengard/Card4_211.java @@ -0,0 +1,62 @@ +package com.gempukku.lotro.cards.set4.isengard; + +import com.gempukku.lotro.cards.AbstractPermanent; +import com.gempukku.lotro.cards.PlayConditions; +import com.gempukku.lotro.cards.effects.AddTokenEffect; +import com.gempukku.lotro.cards.effects.AddUntilEndOfPhaseModifierEffect; +import com.gempukku.lotro.cards.effects.ChooseAndPlayCardFromHandEffect; +import com.gempukku.lotro.cards.effects.RemoveTokenEffect; +import com.gempukku.lotro.cards.modifiers.ArcheryTotalModifier; +import com.gempukku.lotro.common.*; +import com.gempukku.lotro.filters.Filters; +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.effects.DiscardCardsFromPlayEffect; +import com.gempukku.lotro.logic.timing.Action; + +import java.util.Collections; +import java.util.List; + +/** + * Set: The Two Towers + * Side: Shadow + * Culture: Isengard + * Twilight Cost: 2 + * Type: Condition + * Game Text: Machine. Plays to your support area. Shadow: Play an [ISENGARD] archer to place an [ISENGARD] token on + * this card. Archery: Remove 2 [ISENGARD] tokens from this card to make the minion archery total +2. Discard this + * condition. + */ +public class Card4_211 extends AbstractPermanent { + public Card4_211() { + super(Side.SHADOW, 2, CardType.CONDITION, Culture.ISENGARD, Zone.SUPPORT, "Weapons of Isengard"); + addKeyword(Keyword.MACHINE); + } + + @Override + protected List getExtraPhaseActions(String playerId, LotroGame game, PhysicalCard self) { + if (PlayConditions.canUseShadowCardDuringPhase(game.getGameState(), Phase.SHADOW, self, 0) + && PlayConditions.canPlayFromHand(playerId, game, Filters.culture(Culture.ISENGARD), Filters.keyword(Keyword.ARCHER))) { + ActivateCardAction action = new ActivateCardAction(self, Keyword.SHADOW); + action.appendCost( + new ChooseAndPlayCardFromHandEffect(playerId, game.getGameState().getHand(playerId), Filters.and(Filters.culture(Culture.ISENGARD), Filters.keyword(Keyword.ARCHER)))); + action.appendEffect( + new AddTokenEffect(self, self, Token.ISENGARD)); + return Collections.singletonList(action); + } + if (PlayConditions.canUseShadowCardDuringPhase(game.getGameState(), Phase.ARCHERY, self, 0) + && game.getGameState().getTokenCount(self, Token.ISENGARD) >= 2) { + ActivateCardAction action = new ActivateCardAction(self, Keyword.ARCHERY); + action.appendCost( + new RemoveTokenEffect(self, self, Token.ISENGARD, 2)); + action.appendEffect( + new AddUntilEndOfPhaseModifierEffect( + new ArcheryTotalModifier(self, Side.SHADOW, 2), Phase.ARCHERY)); + action.appendEffect( + new DiscardCardsFromPlayEffect(self, self)); + return Collections.singletonList(action); + } + return null; + } +}