From d5e8a22b8ea0f1cc25fa2938b5d01b7cda36bfc2 Mon Sep 17 00:00:00 2001 From: marcins78 Date: Thu, 3 Jan 2013 11:50:22 +0000 Subject: [PATCH] Card20_001 --- .../lotro/cards/set20/Card20_001.java | 105 ++++++++++++++++++ .../src/main/resources/blueprintMapping.txt | 4 +- 2 files changed, 108 insertions(+), 1 deletion(-) create mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set20/Card20_001.java diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set20/Card20_001.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set20/Card20_001.java new file mode 100644 index 000000000..40ba36fdd --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set20/Card20_001.java @@ -0,0 +1,105 @@ +package com.gempukku.lotro.cards.set20; + +import com.gempukku.lotro.cards.AbstractAttachable; +import com.gempukku.lotro.cards.PlayConditions; +import com.gempukku.lotro.cards.TriggerConditions; +import com.gempukku.lotro.cards.effects.*; +import com.gempukku.lotro.cards.modifiers.ResistanceModifier; +import com.gempukku.lotro.cards.modifiers.VitalityModifier; +import com.gempukku.lotro.common.CardType; +import com.gempukku.lotro.common.Keyword; +import com.gempukku.lotro.common.Phase; +import com.gempukku.lotro.filters.Filter; +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.actions.RequiredTriggerAction; +import com.gempukku.lotro.logic.effects.WoundCharactersEffect; +import com.gempukku.lotro.logic.modifiers.KeywordModifier; +import com.gempukku.lotro.logic.modifiers.Modifier; +import com.gempukku.lotro.logic.modifiers.ModifierFlag; +import com.gempukku.lotro.logic.modifiers.StrengthModifier; +import com.gempukku.lotro.logic.timing.Action; +import com.gempukku.lotro.logic.timing.Effect; +import com.gempukku.lotro.logic.timing.EffectResult; + +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; + +/** + * Strength: +1 + * Vitality: +1 + * Resistance: +1 + * While wearing The One Ring, each time the Ring-bearer is about to take a wound, add a burden instead. + * Manuever: Exert bearer or discard a card at random from hand to wear The One Ring until the regroup phase. + */ +public class Card20_001 extends AbstractAttachable { + public Card20_001() { + super(null, CardType.THE_ONE_RING, 0, null, null, "The One Ring", "Doom of Free Peoples", true); + } + + @Override + protected Filter getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self) { + return Filters.none; + } + + @Override + public List getAlwaysOnModifiers(LotroGame game, PhysicalCard self) { + List modifiers = new LinkedList(); + modifiers.add(new KeywordModifier(self, Filters.hasAttached(self), Keyword.RING_BOUND)); + modifiers.add(new StrengthModifier(self, Filters.hasAttached(self), 1)); + modifiers.add(new VitalityModifier(self, Filters.hasAttached(self), 1)); + modifiers.add(new ResistanceModifier(self, Filters.hasAttached(self), 1)); + return modifiers; + } + + @Override + protected List getExtraPhaseActions(String playerId, LotroGame game, final PhysicalCard self) { + if (PlayConditions.canUseFPCardDuringPhase(game, Phase.MANEUVER, self) + && !game.getGameState().isWearingRing() + && (PlayConditions.canExert(self, game, self.getAttachedTo()) || PlayConditions.canDiscardFromHand(game, playerId, 1)) + && !game.getModifiersQuerying().hasFlagActive(game.getGameState(), ModifierFlag.RING_TEXT_INACTIVE)) { + ActivateCardAction action = new ActivateCardAction(self); + + List possibleCosts = new LinkedList(); + possibleCosts.add( + new ExertCharactersEffect(action, self, self.getAttachedTo())); + possibleCosts.add( + new DiscardCardAtRandomFromHandEffect(self, playerId, false)); + + action.appendCost( + new ChoiceEffect(action, playerId, possibleCosts)); + action.appendEffect( + new PutOnTheOneRingEffect()); + return Collections.singletonList(action); + } + return null; + } + + @Override + public List getRequiredBeforeTriggers(LotroGame game, Effect effect, PhysicalCard self) { + if (TriggerConditions.isGettingWounded(effect, game, Filters.hasAttached(self)) + && game.getGameState().isWearingRing() + && !game.getModifiersQuerying().hasFlagActive(game.getGameState(), ModifierFlag.RING_TEXT_INACTIVE)) { + WoundCharactersEffect woundEffect = (WoundCharactersEffect) effect; + RequiredTriggerAction action = new RequiredTriggerAction(self); + action.appendEffect(new NegateWoundEffect(woundEffect, self.getAttachedTo())); + action.appendEffect(new AddBurdenEffect(self.getOwner(), self, 1)); + return Collections.singletonList(action); + } + return null; + } + + @Override + public List getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) { + if ((TriggerConditions.startOfPhase(game, effectResult, Phase.REGROUP) || TriggerConditions.endOfPhase(game, effectResult, Phase.REGROUP)) + && game.getGameState().isWearingRing()) { + RequiredTriggerAction action = new RequiredTriggerAction(self); + action.appendEffect(new TakeOffTheOneRingEffect()); + return Collections.singletonList(action); + } + return null; + } +} diff --git a/gemp-lotr/gemp-lotr-cards/src/main/resources/blueprintMapping.txt b/gemp-lotr/gemp-lotr-cards/src/main/resources/blueprintMapping.txt index 4fc5c7210..6df17c6d4 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/resources/blueprintMapping.txt +++ b/gemp-lotr/gemp-lotr-cards/src/main/resources/blueprintMapping.txt @@ -227,4 +227,6 @@ 18_148,18_102 18_149,18_133 # Gemp-LotR promos -gl_theOneRing,1_2 \ No newline at end of file +gl_theOneRing,1_2 +# 2nd edition +20_2,1_2 \ No newline at end of file