"Feasting and Smoking"

This commit is contained in:
marcins78
2013-02-08 11:20:43 +00:00
parent d8bf4d379e
commit f16767570d

View File

@@ -0,0 +1,56 @@
package com.gempukku.lotro.cards.set20.shire;
import com.gempukku.lotro.cards.AbstractEvent;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.actions.PlayEventAction;
import com.gempukku.lotro.cards.effects.CancelSkirmishEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndAddUntilEOPStrengthBonusEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndDiscardCardsFromPlayEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.filters.Filter;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.GameState;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
/**
* 1
* Feasting and Smoking
* Shire Event • Skirmish
* Tale.
* At sites 1-5, spot 2 Hobbits and discard a pipeweed possession to cancel a skirmish involving a Hobbit.
* At any other site, make a Hobbit strength +2.
*/
public class Card20_386 extends AbstractEvent {
public Card20_386() {
super(Side.FREE_PEOPLE, 1, Culture.SHIRE, "Feasting and Smoking", Phase.SKIRMISH);
addKeyword(Keyword.TALE);
}
@Override
public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int withTwilightRemoved, int twilightModifier, boolean ignoreRoamingPenalty, boolean ignoreCheckingDeadPile) {
return super.checkPlayRequirements(playerId, game, self, withTwilightRemoved, twilightModifier, ignoreRoamingPenalty, ignoreCheckingDeadPile)
&& (PlayConditions.location(game,
new Filter() {
@Override
public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) {
return physicalCard.getSiteNumber() > 5;
}
}) || (PlayConditions.canSpot(game, 2, Race.HOBBIT) && PlayConditions.canDiscardFromPlay(self, game, CardType.POSSESSION, Keyword.PIPEWEED)));
}
@Override
public PlayEventAction getPlayCardAction(String playerId, LotroGame game, PhysicalCard self, int twilightModifier, boolean ignoreRoamingPenalty) {
PlayEventAction action = new PlayEventAction(self);
if (game.getGameState().getCurrentSite().getSiteNumber() <= 5) {
action.appendCost(
new ChooseAndDiscardCardsFromPlayEffect(action, playerId, 1, 1, CardType.POSSESSION, Keyword.PIPEWEED));
action.appendEffect(
new CancelSkirmishEffect(Race.HOBBIT));
} else {
action.appendEffect(
new ChooseAndAddUntilEOPStrengthBonusEffect(action, self, playerId, 2, Race.HOBBIT));
}
return action;
}
}