"Winged Mount"

This commit is contained in:
marcins78@gmail.com
2011-11-14 17:29:24 +00:00
parent 1e4add60e7
commit f4716bb544

View File

@@ -0,0 +1,79 @@
package com.gempukku.lotro.cards.set8.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.PreventCardEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndDiscardCardsFromHandEffect;
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.actions.ActivateCardAction;
import com.gempukku.lotro.logic.effects.RemoveThreatsEffect;
import com.gempukku.lotro.logic.effects.WoundCharactersEffect;
import com.gempukku.lotro.logic.modifiers.Modifier;
import com.gempukku.lotro.logic.modifiers.StrengthModifier;
import com.gempukku.lotro.logic.timing.Action;
import com.gempukku.lotro.logic.timing.Effect;
import java.util.Collections;
import java.util.List;
/**
* Set: Siege of Gondor
* Side: Shadow
* Culture: Wraith
* Twilight Cost: 1
* Type: Possession • Mount
* Strength: +2
* Game Text: To play, discard 2 cards from hand. Bearer must be a Nazgul. Response: If bearer is about to take a wound,
* remove a threat to prevent that wound.
*/
public class Card8_083 extends AbstractAttachable {
public Card8_083() {
super(Side.SHADOW, CardType.POSSESSION, 1, Culture.WRAITH, PossessionClass.MOUNT, "Winged Mount");
}
@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 List<? extends Modifier> getAlwaysOnModifiers(LotroGame game, PhysicalCard self) {
return Collections.singletonList(
new StrengthModifier(self, Filters.hasAttached(self), 2));
}
@Override
public AttachPermanentAction getPlayCardAction(String playerId, LotroGame game, PhysicalCard self, Filter additionalAttachmentFilter, int twilightModifier) {
final AttachPermanentAction playCardAction = super.getPlayCardAction(playerId, game, self, additionalAttachmentFilter, twilightModifier);
playCardAction.appendCost(
new ChooseAndDiscardCardsFromHandEffect(playCardAction, playerId, false, 2));
return playCardAction;
}
@Override
public List<? extends Action> getOptionalInPlayBeforeActions(String playerId, LotroGame game, Effect effect, PhysicalCard self) {
if (PlayConditions.isGettingWounded(effect, game, Filters.hasAttached(self))
&& PlayConditions.canRemoveThreat(game, self, 1)) {
WoundCharactersEffect woundEffect = (WoundCharactersEffect) effect;
ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(
new RemoveThreatsEffect(self, 1));
action.appendEffect(
new PreventCardEffect(woundEffect, self.getAttachedTo()));
return Collections.singletonList(action);
}
return null;
}
}