From c1c35d37b99ce3cdb6f4613df98a5fd9ff068970 Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Thu, 8 Sep 2011 17:31:24 +0000 Subject: [PATCH] "Fool of a Took!" --- .../lotro/cards/set1/moria/Card1_170.java | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/moria/Card1_170.java diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/moria/Card1_170.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/moria/Card1_170.java new file mode 100644 index 000000000..7adc767af --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/moria/Card1_170.java @@ -0,0 +1,65 @@ +package com.gempukku.lotro.cards.set1.moria; + +import com.gempukku.lotro.cards.AbstractEvent; +import com.gempukku.lotro.cards.actions.PlayEventAction; +import com.gempukku.lotro.cards.effects.PutCardFromDeckIntoHandOrDiscardEffect; +import com.gempukku.lotro.common.*; +import com.gempukku.lotro.filters.Filters; +import com.gempukku.lotro.game.LotroCardBlueprint; +import com.gempukku.lotro.game.PhysicalCard; +import com.gempukku.lotro.game.state.LotroGame; +import com.gempukku.lotro.logic.timing.UnrespondableEffect; + +import java.util.LinkedList; +import java.util.List; + +/** + * Set: The Fellowship of the Ring + * Side: Shadow + * Culture: Moria + * Twilight Cost: 0 + * Type: Event + * Game Text: Shadow: Spot a Hobbit (except the Ring-bearer) to reveal cards from the top of your draw deck until you + * reveal one that is not a [MORIA] minion. Take the revealed cards into hand. + */ +public class Card1_170 extends AbstractEvent { + public Card1_170() { + super(Side.SHADOW, Culture.MORIA, "Fool of a Took!", Phase.SHADOW); + } + + @Override + public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) { + return super.checkPlayRequirements(playerId, game, self, twilightModifier) + && Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.keyword(Keyword.HOBBIT), Filters.not(Filters.keyword(Keyword.RING_BEARER))); + } + + @Override + public PlayEventAction getPlayCardAction(final String playerId, LotroGame game, PhysicalCard self, int twilightModifier) { + final PlayEventAction action = new PlayEventAction(self); + action.addEffect( + new UnrespondableEffect() { + @Override + public void playEffect(LotroGame game) { + List deck = game.getGameState().getDeck(playerId); + List cardsToPutIntoHand = new LinkedList(); + for (PhysicalCard physicalCard : deck) { + cardsToPutIntoHand.add(physicalCard); + LotroCardBlueprint blueprint = physicalCard.getBlueprint(); + if (blueprint.getCulture() != Culture.MORIA || blueprint.getCardType() != CardType.MINION) + break; + } + for (PhysicalCard cardToPutIntoHand : cardsToPutIntoHand) { + action.addEffect( + new PutCardFromDeckIntoHandOrDiscardEffect(cardToPutIntoHand)); + } + } + }); + + return action; + } + + @Override + public int getTwilightCost() { + return 0; + } +}