From 0c51c01ba7f9c7044bced06167660a7df16253cb Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Thu, 9 Feb 2012 22:03:20 +0000 Subject: [PATCH] "Dwarven Stratagem" --- .../lotro/cards/set17/dwarven/Card17_003.java | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set17/dwarven/Card17_003.java diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set17/dwarven/Card17_003.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set17/dwarven/Card17_003.java new file mode 100644 index 000000000..fb8294b31 --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set17/dwarven/Card17_003.java @@ -0,0 +1,76 @@ +package com.gempukku.lotro.cards.set17.dwarven; + +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.ChoiceEffect; +import com.gempukku.lotro.cards.effects.ReinforceTokenEffect; +import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect; +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.timing.Effect; +import com.gempukku.lotro.logic.timing.UnrespondableEffect; + +import java.util.LinkedList; +import java.util.List; + +/** + * Set: Rise of Saruman + * Side: Free + * Culture: Dwarven + * Twilight Cost: 1 + * Type: Event • Skirmish + * Game Text: Spot a Dwarf hunter and choose one: exert a minion for each hunter you can spot or reinforce + * a [DWARVEN] token for each hunter you can spot. + */ +public class Card17_003 extends AbstractEvent { + public Card17_003() { + super(Side.FREE_PEOPLE, 1, Culture.DWARVEN, "Dwarven Stratagem", Phase.SKIRMISH); + } + + @Override + public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int withTwilightRemoved, int twilightModifier, boolean ignoreRoamingPenalty, boolean ignoreCheckingDeadPile) { + return super.checkPlayRequirements(playerId, game, self, withTwilightRemoved, twilightModifier, ignoreRoamingPenalty, ignoreCheckingDeadPile) + && PlayConditions.canSpot(game, Race.DWARF, Keyword.HUNTER); + } + + @Override + public PlayEventAction getPlayCardAction(final String playerId, LotroGame game, final PhysicalCard self, int twilightModifier, boolean ignoreRoamingPenalty) { + final PlayEventAction action = new PlayEventAction(self); + final int count = Filters.countSpottable(game.getGameState(), game.getModifiersQuerying(), Keyword.HUNTER); + List possibleEffects = new LinkedList(); + possibleEffects.add( + new UnrespondableEffect() { + @Override + public String getText(LotroGame game) { + return "Exert a minion for each hunter you can spot"; + } + + @Override + protected void doPlayEffect(LotroGame game) { + for (int i = 0; i < count; i++) + action.appendEffect( + new ChooseAndExertCharactersEffect(action, playerId, 1, 1, CardType.MINION)); + } + }); + possibleEffects.add( + new UnrespondableEffect() { + @Override + public String getText(LotroGame game) { + return "Reinforce a DWARVEN token for each hunter you can spot"; + } + + @Override + protected void doPlayEffect(LotroGame game) { + for (int i = 0; i < count; i++) + action.appendEffect( + new ReinforceTokenEffect(self, playerId, Token.DWARVEN)); + } + }); + action.appendEffect( + new ChoiceEffect(action, playerId, possibleEffects)); + return action; + } +}