From b2b56ec2a12a2dd8b293508a4c34e9315c7911ab Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Thu, 10 Nov 2011 13:25:40 +0000 Subject: [PATCH] "Troop Tower" --- .../lotro/cards/set7/sauron/Card7_316.java | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/sauron/Card7_316.java diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/sauron/Card7_316.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/sauron/Card7_316.java new file mode 100644 index 000000000..91db30143 --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/sauron/Card7_316.java @@ -0,0 +1,79 @@ +package com.gempukku.lotro.cards.set7.sauron; + +import com.gempukku.lotro.cards.AbstractPermanent; +import com.gempukku.lotro.cards.PlayConditions; +import com.gempukku.lotro.cards.effects.TakeControlOfASiteEffect; +import com.gempukku.lotro.cards.effects.choose.ChooseAndDiscardCardsFromPlayEffect; +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.ActivateCardAction; +import com.gempukku.lotro.logic.effects.DiscardCardsFromPlayEffect; +import com.gempukku.lotro.logic.modifiers.Modifier; +import com.gempukku.lotro.logic.modifiers.ModifiersQuerying; +import com.gempukku.lotro.logic.modifiers.StrengthModifier; +import com.gempukku.lotro.logic.modifiers.evaluator.Evaluator; +import com.gempukku.lotro.logic.timing.Action; + +import java.util.Collections; +import java.util.List; + +/** + * Set: The Return of the King + * Side: Shadow + * Culture: Sauron + * Twilight Cost: 1 + * Type: Condition • Support Area + * Game Text: Engine. To play, spot a [SAURON] Orc. All [SAURON] Orcs are strength +1 for each besieger stacked on + * a site. Regroup: Discard a besieger to take control of a site. Discard this condition. + */ +public class Card7_316 extends AbstractPermanent { + public Card7_316() { + super(Side.SHADOW, 1, CardType.CONDITION, Culture.SAURON, Zone.SUPPORT, "Troop Tower", true); + addKeyword(Keyword.ENGINE); + } + + @Override + public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int twilightModifier, boolean ignoreRoamingPenalty) { + return super.checkPlayRequirements(playerId, game, self, twilightModifier, ignoreRoamingPenalty) + && PlayConditions.canSpot(game, Culture.SAURON, Race.ORC); + } + + @Override + public List getAlwaysOnModifiers(LotroGame game, PhysicalCard self) { + return Collections.singletonList( + new StrengthModifier(self, Filters.and(Culture.SAURON, Race.ORC), null, + new Evaluator() { + @Override + public int evaluateExpression(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard cardAffected) { + int counter = 0; + for (PhysicalCard site : Filters.filterActive(gameState, modifiersQuerying, CardType.SITE)) { + for (PhysicalCard physicalCard : gameState.getStackedCards(site)) { + if (modifiersQuerying.hasKeyword(gameState, physicalCard, Keyword.BESIEGER)) + counter++; + } + } + + return counter; + } + })); + } + + @Override + protected List getExtraPhaseActions(String playerId, LotroGame game, PhysicalCard self) { + if (PlayConditions.canUseShadowCardDuringPhase(game, Phase.REGROUP, self, 0) + && PlayConditions.canDiscardFromPlay(self, game, Keyword.BESIEGER)) { + ActivateCardAction action = new ActivateCardAction(self); + action.appendCost( + new ChooseAndDiscardCardsFromPlayEffect(action, playerId, 1, 1, Keyword.BESIEGER)); + action.appendEffect( + new TakeControlOfASiteEffect(self, playerId)); + action.appendEffect( + new DiscardCardsFromPlayEffect(self, self)); + return Collections.singletonList(action); + } + return null; + } +}