From cc7f84399182cc247a1b82ebeb4f29b3697d9ad3 Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Sun, 11 Sep 2011 01:07:49 +0000 Subject: [PATCH] "Thin and Stretched" --- .../lotro/cards/set1/sauron/Card1_279.java | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/sauron/Card1_279.java diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/sauron/Card1_279.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/sauron/Card1_279.java new file mode 100644 index 000000000..4e7fb4391 --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/sauron/Card1_279.java @@ -0,0 +1,74 @@ +package com.gempukku.lotro.cards.set1.sauron; + +import com.gempukku.lotro.cards.AbstractAttachable; +import com.gempukku.lotro.cards.actions.AttachPermanentAction; +import com.gempukku.lotro.cards.effects.AddBurdenEffect; +import com.gempukku.lotro.cards.effects.ChooseAndExertCharacterEffect; +import com.gempukku.lotro.common.CardType; +import com.gempukku.lotro.common.Culture; +import com.gempukku.lotro.common.Keyword; +import com.gempukku.lotro.common.Side; +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.DefaultCostToEffectAction; +import com.gempukku.lotro.logic.timing.Action; +import com.gempukku.lotro.logic.timing.EffectResult; +import com.gempukku.lotro.logic.timing.results.AssignmentResult; + +import java.util.Collections; +import java.util.List; + +/** + * Set: The Fellowship of the Ring + * Side: Shadow + * Culture: Sauron + * Twilight Cost: 0 + * Type: Condition + * Game Text: To play, exert a [SAURON] Orc. Plays on the Ring-bearer. Add a burden at the end of each turn during which + * bearer was not assigned to a skirmish (and another companion was). + */ +public class Card1_279 extends AbstractAttachable { + public Card1_279() { + super(Side.SHADOW, CardType.CONDITION, 0, Culture.SAURON, null, "Thin and Stretched", true); + } + + @Override + protected Filter getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self) { + return Filters.keyword(Keyword.RING_BEARER); + } + + @Override + public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, Filter additionalAttachmentFilter, int twilightModifier) { + return super.checkPlayRequirements(playerId, game, self, additionalAttachmentFilter, twilightModifier) + && Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.culture(Culture.SAURON), Filters.keyword(Keyword.ORC), Filters.canExert()); + } + + @Override + public Action getPlayCardAction(String playerId, LotroGame game, PhysicalCard self, Filter additionalAttachmentFilter, int twilightModifier) { + AttachPermanentAction action = (AttachPermanentAction) super.getPlayCardAction(playerId, game, self, additionalAttachmentFilter, twilightModifier); + action.addCost( + new ChooseAndExertCharacterEffect(action, playerId, "Choose SAURON Orc", true, Filters.culture(Culture.SAURON), Filters.keyword(Keyword.ORC), Filters.canExert())); + return action; + } + + @Override + public List getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) { + if (effectResult.getType() == EffectResult.Type.ASSIGNMENT) { + AssignmentResult assignmentResult = (AssignmentResult) effectResult; + if (assignmentResult.getAssignments().containsKey(self.getAttachedTo())) + self.storeData(true); + else if (self.getData() == null) + self.storeData(false); + } + if (effectResult.getType() == EffectResult.Type.END_OF_TURN + && self.getData() != null && (!((Boolean) self.getData()))) { + DefaultCostToEffectAction action = new DefaultCostToEffectAction(self, null, "Add a burden"); + action.addEffect( + new AddBurdenEffect(game.getGameState().getCurrentPlayerId())); + return Collections.singletonList(action); + } + return null; + } +}