From 1fba5c13f6c531a42c7418c592494d19fb1332fb Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Fri, 4 Nov 2011 11:45:54 +0000 Subject: [PATCH] "Thrice Outnumbered" --- .../gempukku/lotro/cards/PlayConditions.java | 4 ++ .../lotro/cards/set7/raider/Card7_171.java | 47 +++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/raider/Card7_171.java diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/PlayConditions.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/PlayConditions.java index 41096da8b..68a610d73 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/PlayConditions.java +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/PlayConditions.java @@ -147,6 +147,10 @@ public class PlayConditions { return Filters.countSpottable(game.getGameState(), game.getModifiersQuerying(), filters) >= count; } + public static boolean canSpotThreat(LotroGame game, int count) { + return game.getGameState().getThreats() >= count; + } + public static boolean hasInitiative(LotroGame game, Side side) { return game.getModifiersQuerying().hasInitiative(game.getGameState()) == side; } diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/raider/Card7_171.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/raider/Card7_171.java new file mode 100644 index 000000000..620e76633 --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/raider/Card7_171.java @@ -0,0 +1,47 @@ +package com.gempukku.lotro.cards.set7.raider; + +import com.gempukku.lotro.cards.AbstractEvent; +import com.gempukku.lotro.cards.PlayConditions; +import com.gempukku.lotro.cards.actions.PlayEventAction; +import com.gempukku.lotro.cards.effects.ForEachYouSpotEffect; +import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect; +import com.gempukku.lotro.common.*; +import com.gempukku.lotro.game.PhysicalCard; +import com.gempukku.lotro.game.state.LotroGame; + +/** + * Set: The Return of the King + * Side: Shadow + * Culture: Raider + * Twilight Cost: 3 + * Type: Event • Regroup + * Game Text: Spot a threat and X [RAIDER] Men to make the Free Peoples player exert X companions (limit 3). + */ +public class Card7_171 extends AbstractEvent { + public Card7_171() { + super(Side.SHADOW, 3, Culture.RAIDER, "Thrice Outnumbered", Phase.REGROUP); + } + + @Override + public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) { + return super.checkPlayRequirements(playerId, game, self, twilightModifier) + && PlayConditions.canSpotThreat(game, 1); + } + + @Override + public PlayEventAction getPlayCardAction(String playerId, final LotroGame game, PhysicalCard self, int twilightModifier) { + final PlayEventAction action = new PlayEventAction(self); + action.appendCost( + new ForEachYouSpotEffect(playerId, Culture.RAIDER, Race.MAN) { + @Override + protected void spottedCards(int spotCount) { + spotCount = Math.min(3, spotCount); + if (spotCount > 0) { + action.appendEffect( + new ChooseAndExertCharactersEffect(action, game.getGameState().getCurrentPlayerId(), spotCount, spotCount, CardType.COMPANION)); + } + } + }); + return action; + } +}