From c29988782b58f6143a5b808428472107e65802f6 Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Sun, 20 Nov 2011 02:35:49 +0000 Subject: [PATCH] "Seeing Stone of Minas Anor" --- .../lotro/cards/set9/gondor/Card9_037.java | 103 ++++++++++++++++++ .../com/gempukku/lotro/filters/Filters.java | 9 ++ 2 files changed, 112 insertions(+) create mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set9/gondor/Card9_037.java diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set9/gondor/Card9_037.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set9/gondor/Card9_037.java new file mode 100644 index 000000000..2a8e8f93f --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set9/gondor/Card9_037.java @@ -0,0 +1,103 @@ +package com.gempukku.lotro.cards.set9.gondor; + +import com.gempukku.lotro.cards.AbstractPermanent; +import com.gempukku.lotro.cards.PlayConditions; +import com.gempukku.lotro.cards.actions.PlayPermanentAction; +import com.gempukku.lotro.cards.effects.ChoiceEffect; +import com.gempukku.lotro.cards.effects.SpotEffect; +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.actions.ActivateCardAction; +import com.gempukku.lotro.logic.effects.AddThreatsEffect; +import com.gempukku.lotro.logic.effects.DiscardCardsFromHandEffect; +import com.gempukku.lotro.logic.effects.DiscardCardsFromPlayEffect; +import com.gempukku.lotro.logic.effects.DrawCardEffect; +import com.gempukku.lotro.logic.timing.Action; +import com.gempukku.lotro.logic.timing.Effect; + +import java.util.Collections; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; + +/** + * Set: Reflections + * Side: Free + * Culture: Gondor + * Twilight Cost: 0 + * Type: Artifact • Support Area + * Game Text: To play, spot a [GONDOR] Man with 3 or more vitality (or spot a [GONDOR] Man and add 2 threats). + * Regroup: Exert a [GONDOR] Man or discard this artifact to discard your hand and draw 3 cards. + */ +public class Card9_037 extends AbstractPermanent { + public Card9_037() { + super(Side.FREE_PEOPLE, 0, CardType.ARTIFACT, Culture.GONDOR, Zone.SUPPORT, "Seeing Stone of Minas Anor", true); + } + + @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.GONDOR, Race.MAN, Filters.moreVitalityThan(2)) + || (PlayConditions.canSpot(game, Culture.GONDOR, Race.MAN) && PlayConditions.canAddThreat(game, self, 2))); + } + + @Override + public PlayPermanentAction getPlayCardAction(String playerId, LotroGame game, PhysicalCard self, int twilightModifier, boolean ignoreRoamingPenalty) { + PlayPermanentAction action = super.getPlayCardAction(playerId, game, self, twilightModifier, ignoreRoamingPenalty); + List possibleCosts = new LinkedList(); + possibleCosts.add( + new SpotEffect(1, Culture.GONDOR, Race.MAN, Filters.moreVitalityThan(2)) { + @Override + public String getText(LotroGame game) { + return "Spot a GONDOR Man with 3 or more vitality"; + } + }); + if (PlayConditions.canSpot(game, Culture.GONDOR, Race.MAN)) { + possibleCosts.add( + new AddThreatsEffect(playerId, self, 2) { + @Override + public String getText(LotroGame game) { + return "Spot a GONDOR Man and add 2 threats"; + } + }); + } + action.appendCost( + new ChoiceEffect(action, playerId, possibleCosts)); + + return action; + } + + @Override + protected List getExtraPhaseActions(String playerId, LotroGame game, PhysicalCard self) { + if (PlayConditions.canUseFPCardDuringPhase(game, Phase.REGROUP, self) + && (PlayConditions.canExert(self, game, Culture.GONDOR, Race.MAN) || PlayConditions.canSelfDiscard(self, game))) { + ActivateCardAction action = new ActivateCardAction(self); + List possibleCosts = new LinkedList(); + possibleCosts.add( + new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Culture.GONDOR, Race.MAN) { + @Override + public String getText(LotroGame game) { + return "Exert a GONDOR Man"; + } + }); + possibleCosts.add( + new DiscardCardsFromPlayEffect(self, self) { + @Override + public String getText(LotroGame game) { + return "Discard this artifact"; + } + }); + action.appendCost( + new ChoiceEffect(action, playerId, possibleCosts)); + action.appendEffect( + new DiscardCardsFromHandEffect(self, playerId, new HashSet(game.getGameState().getHand(playerId)), false)); + action.appendEffect( + new DrawCardEffect(playerId, 3)); + return Collections.singletonList(action); + } + return null; + } +} diff --git a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/filters/Filters.java b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/filters/Filters.java index 6f13c643a..855a8adfa 100644 --- a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/filters/Filters.java +++ b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/filters/Filters.java @@ -117,6 +117,15 @@ public class Filters { }; } + public static Filter moreVitalityThan(final int vitality) { + return new Filter() { + @Override + public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) { + return modifiersQuerying.getVitality(gameState, physicalCard) > vitality; + } + }; + } + public static Filter lessStrengthThan(final int strength) { return new Filter() { @Override