From 1dcfe871282e6b152fe924601489f92c2c90dc9d Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Mon, 17 Oct 2011 14:28:18 +0000 Subject: [PATCH] "Citadel of the Stars" --- .../lotro/cards/effects/SpotEffect.java | 40 +++++++++ .../lotro/cards/set5/gondor/Card5_032.java | 88 +++++++++++++++++++ 2 files changed, 128 insertions(+) create mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/effects/SpotEffect.java create mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set5/gondor/Card5_032.java diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/effects/SpotEffect.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/effects/SpotEffect.java new file mode 100644 index 000000000..f463309cd --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/effects/SpotEffect.java @@ -0,0 +1,40 @@ +package com.gempukku.lotro.cards.effects; + +import com.gempukku.lotro.common.Filterable; +import com.gempukku.lotro.filters.Filters; +import com.gempukku.lotro.game.state.LotroGame; +import com.gempukku.lotro.logic.timing.AbstractEffect; +import com.gempukku.lotro.logic.timing.EffectResult; + +public class SpotEffect extends AbstractEffect { + private int _count; + private Filterable[] _filters; + + public SpotEffect(int count, Filterable... filters) { + _count = count; + _filters = filters; + } + + @Override + public boolean isPlayableInFull(LotroGame game) { + return Filters.countSpottable(game.getGameState(), game.getModifiersQuerying(), _filters) >= _count; + } + + @Override + public String getText(LotroGame game) { + return "Spot cards"; + } + + @Override + public EffectResult.Type getType() { + return null; + } + + @Override + protected FullEffectResult playEffectReturningResult(LotroGame game) { + if (isPlayableInFull(game)) { + return new FullEffectResult(null, true, true); + } + return new FullEffectResult(null, false, false); + } +} diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set5/gondor/Card5_032.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set5/gondor/Card5_032.java new file mode 100644 index 000000000..231f693ab --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set5/gondor/Card5_032.java @@ -0,0 +1,88 @@ +package com.gempukku.lotro.cards.set5.gondor; + +import com.gempukku.lotro.cards.AbstractPermanent; +import com.gempukku.lotro.cards.PlayConditions; +import com.gempukku.lotro.cards.effects.ChoiceEffect; +import com.gempukku.lotro.cards.effects.SpotEffect; +import com.gempukku.lotro.cards.effects.TransferPermanentEffect; +import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect; +import com.gempukku.lotro.cards.modifiers.StrengthModifier; +import com.gempukku.lotro.cards.modifiers.VitalityModifier; +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.ChooseActiveCardEffect; +import com.gempukku.lotro.logic.modifiers.Modifier; +import com.gempukku.lotro.logic.timing.Action; +import com.gempukku.lotro.logic.timing.Effect; + +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; + +/** + * Set: Battle of Helm's Deep + * Side: Free + * Culture: Gondor + * Twilight Cost: 1 + * Type: Condition + * Strength: -2 + * Vitality: -1 + * Game Text: Fortification. Plays to your support area. Skirmish: Exert a [GONDOR] Man or spot 3 knights to transfer + * this condition from your support area to a minion skirmishing a [GONDOR] Man. + */ +public class Card5_032 extends AbstractPermanent { + public Card5_032() { + super(Side.FREE_PEOPLE, 1, CardType.CONDITION, Culture.GONDOR, Zone.SUPPORT, "Citadel of the Stars", true); + } + + @Override + public List getAlwaysOnModifiers(LotroGame game, PhysicalCard self) { + List modifiers = new LinkedList(); + modifiers.add( + new StrengthModifier(self, Filters.hasAttached(self), -2)); + modifiers.add( + new VitalityModifier(self, Filters.hasAttached(self), -1)); + return modifiers; + } + + @Override + protected List getExtraPhaseActions(String playerId, LotroGame game, final PhysicalCard self) { + if (PlayConditions.canUseFPCardDuringPhase(game.getGameState(), Phase.SKIRMISH, self) + && self.getZone() == Zone.SUPPORT + && ( + PlayConditions.canExert(self, game, Culture.GONDOR, Race.MAN) + || PlayConditions.canSpot(game, 3, Keyword.KNIGHT))) { + final 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 GONDOR Man"; + } + }); + possibleCosts.add( + new SpotEffect(3, Keyword.KNIGHT) { + @Override + public String getText(LotroGame game) { + return "Spot 3 Knights"; + } + }); + action.appendCost( + new ChoiceEffect(action, playerId, possibleCosts)); + action.appendEffect( + new ChooseActiveCardEffect(self, playerId, "Choose minion", CardType.MINION, Filters.inSkirmishAgainst(Culture.GONDOR, Race.MAN)) { + @Override + protected void cardSelected(LotroGame game, PhysicalCard card) { + action.insertEffect( + new TransferPermanentEffect(self, card)); + } + }); + return Collections.singletonList(action); + } + return null; + } +}