"The Gaffer's Pipe"

This commit is contained in:
marcins78
2013-02-12 17:39:00 +00:00
parent de4f4e3c89
commit 254269f58e

View File

@@ -0,0 +1,53 @@
package com.gempukku.lotro.cards.set20.shire;
import com.gempukku.lotro.cards.AbstractAttachableFPPossession;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.ForEachYouSpotEffect;
import com.gempukku.lotro.cards.effects.RemoveTwilightEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndDiscardCardsFromPlayEffect;
import com.gempukku.lotro.common.*;
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.timing.Action;
import java.util.Collections;
import java.util.List;
/**
* 1
* •The Gaffer's Pipe
* Shire Possession • Pipe
* Bearer must be a Hobbit.
* Fellowship: Discard a Pipeweed possesion and spot X pipes to remove (X).
*/
public class Card20_414 extends AbstractAttachableFPPossession {
public Card20_414() {
super(1, 0, 0, Culture.SHIRE, PossessionClass.PIPE, "The Gaffer's Pipe", null, true);
}
@Override
protected Filterable getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self) {
return Race.HOBBIT;
}
@Override
protected List<? extends Action> getExtraInPlayPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.FELLOWSHIP, self)
&& PlayConditions.canDiscardFromPlay(self, game, CardType.POSSESSION, Keyword.PIPEWEED)) {
final ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(
new ChooseAndDiscardCardsFromPlayEffect(action, playerId, 1, 1, CardType.POSSESSION, Keyword.PIPEWEED));
action.appendCost(
new ForEachYouSpotEffect(playerId, PossessionClass.PIPE) {
@Override
protected void spottedCards(int spotCount) {
action.appendEffect(
new RemoveTwilightEffect(spotCount));
}
});
return Collections.singletonList(action);
}
return null;
}
}