"Pippin's Dagger"

This commit is contained in:
marcins78@gmail.com
2011-11-20 01:07:52 +00:00
parent 4c322b1145
commit b96238fecf

View File

@@ -0,0 +1,86 @@
package com.gempukku.lotro.cards.set9.elven;
import com.gempukku.lotro.cards.AbstractAttachableFPPossession;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.ChoiceEffect;
import com.gempukku.lotro.cards.effects.PreventableEffect;
import com.gempukku.lotro.cards.effects.RemoveTwilightEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.GameUtils;
import com.gempukku.lotro.logic.actions.ActivateCardAction;
import com.gempukku.lotro.logic.actions.SubAction;
import com.gempukku.lotro.logic.effects.ChooseAndWoundCharactersEffect;
import com.gempukku.lotro.logic.effects.DiscardCardsFromPlayEffect;
import com.gempukku.lotro.logic.timing.Action;
import com.gempukku.lotro.logic.timing.Effect;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
/**
* Set: Reflections
* Side: Free
* Culture: Elven
* Twilight Cost: 1
* Type: Possession • Hand Weapon
* Strength: +2
* Game Text: Bearer must be Pippin. Skirmish: Exert Pippin twice or discard this possession to wound a minion an Elf
* is skirmishing. Any Shadow player may remove (1) to prevent this.
*/
public class Card9_021 extends AbstractAttachableFPPossession {
public Card9_021() {
super(1, 2, 0, Culture.ELVEN, PossessionClass.HAND_WEAPON, "Pippin's Dagger", true);
}
@Override
protected Filterable getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self) {
return Filters.name("Pippin");
}
@Override
protected List<? extends Action> getExtraInPlayPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.SKIRMISH, self)
&& (PlayConditions.canExert(self, game, 2, Filters.hasAttached(self)) || PlayConditions.canSelfDiscard(self, game))) {
ActivateCardAction action = new ActivateCardAction(self);
List<Effect> possibleCosts = new LinkedList<Effect>();
possibleCosts.add(
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, 2, Filters.hasAttached(self)) {
@Override
public String getText(LotroGame game) {
return "Exert Pippin twice";
}
});
possibleCosts.add(
new DiscardCardsFromPlayEffect(self, self) {
@Override
public String getText(LotroGame game) {
return "Discard this possession";
}
});
action.appendCost(
new ChoiceEffect(action, playerId, possibleCosts));
action.appendEffect(
new PreventableEffect(action,
new ChooseAndWoundCharactersEffect(action, playerId, 1, 1, CardType.MINION, Filters.inSkirmishAgainst(Race.ELF)) {
@Override
public String getText(LotroGame game) {
return "Wound a minion an Elf is skirmishing";
}
}, GameUtils.getOpponents(game, playerId),
new PreventableEffect.PreventionCost() {
@Override
public Effect createPreventionCostForPlayer(SubAction subAction, String playerId) {
return new RemoveTwilightEffect(1);
}
}));
return Collections.singletonList(action);
}
return null;
}
}