From ee523548ee269df0e9a0ec237cd2a4af1396752c Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Sat, 22 Oct 2011 16:46:20 +0000 Subject: [PATCH] "Fell Beast" --- .../gempukku/lotro/cards/PlayConditions.java | 4 ++ .../lotro/cards/set6/wraith/Card6_083.java | 61 +++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set6/wraith/Card6_083.java diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/PlayConditions.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/PlayConditions.java index 9d5571289..82a0e6eb6 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/PlayConditions.java +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/PlayConditions.java @@ -41,6 +41,10 @@ public class PlayConditions { return false; } + public static boolean canDiscardCardsFromHandToPlay(PhysicalCard source, LotroGame game, String playerId, int count, Filterable... cardFilter) { + return Filters.filter(game.getGameState().getHand(playerId), game.getGameState(), game.getModifiersQuerying(), Filters.and(cardFilter, Filters.not(source))).size() >= count; + } + public static boolean canPlayCardDuringPhase(LotroGame game, Phase phase, PhysicalCard self) { return (phase == null || game.getGameState().getCurrentPhase() == phase) && self.getZone() == Zone.HAND diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set6/wraith/Card6_083.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set6/wraith/Card6_083.java new file mode 100644 index 000000000..32765cd70 --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set6/wraith/Card6_083.java @@ -0,0 +1,61 @@ +package com.gempukku.lotro.cards.set6.wraith; + +import com.gempukku.lotro.cards.AbstractAttachable; +import com.gempukku.lotro.cards.PlayConditions; +import com.gempukku.lotro.cards.actions.AttachPermanentAction; +import com.gempukku.lotro.cards.effects.choose.ChooseAndDiscardCardsFromHandEffect; +import com.gempukku.lotro.cards.modifiers.StrengthModifier; +import com.gempukku.lotro.common.*; +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.modifiers.KeywordModifier; +import com.gempukku.lotro.logic.modifiers.Modifier; + +import java.util.LinkedList; +import java.util.List; + +/** + * Set: Ents of Fangorn + * Side: Shadow + * Culture: Wraith + * Twilight Cost: 0 + * Type: Possession • Mount + * Strength: +2 + * Game Text: To play, discard 2 cards from hand. Bearer must be a Nazgul. Bearer is fierce. + */ +public class Card6_083 extends AbstractAttachable { + public Card6_083() { + super(Side.SHADOW, CardType.POSSESSION, 0, Culture.WRAITH, PossessionClass.MOUNT, "Fell Beast"); + } + + @Override + public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, Filter additionalAttachmentFilter, int twilightModifier) { + return super.checkPlayRequirements(playerId, game, self, additionalAttachmentFilter, twilightModifier) + && PlayConditions.canDiscardCardsFromHandToPlay(self, game, playerId, 2, Filters.any); + } + + @Override + protected Filterable getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self) { + return Race.NAZGUL; + } + + @Override + public AttachPermanentAction getPlayCardAction(String playerId, LotroGame game, PhysicalCard self, Filter additionalAttachmentFilter, int twilightModifier) { + AttachPermanentAction action = super.getPlayCardAction(playerId, game, self, additionalAttachmentFilter, twilightModifier); + action.appendCost( + new ChooseAndDiscardCardsFromHandEffect(action, playerId, false, 2)); + return action; + } + + @Override + public List getAlwaysOnModifiers(LotroGame game, PhysicalCard self) { + List modifiers = new LinkedList(); + modifiers.add( + new StrengthModifier(self, Filters.hasAttached(self), 2)); + modifiers.add( + new KeywordModifier(self, Filters.hasAttached(self), Keyword.FIERCE)); + return modifiers; + } +}