"Merry's Dagger"

This commit is contained in:
marcins78@gmail.com
2011-11-20 00:59:16 +00:00
parent d555b6fc6b
commit 4fbe40e4c1

View File

@@ -0,0 +1,85 @@
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 Merry. Skirmish: Exert Merry twice or discard this possession to wound a minion he
* is skirmishing. Any Shadow player may remove (1) to prevent this.
*/
public class Card9_018 extends AbstractAttachableFPPossession {
public Card9_018() {
super(1, 2, 0, Culture.ELVEN, PossessionClass.HAND_WEAPON, "Merry's Dagger", true);
}
@Override
protected Filterable getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self) {
return Filters.name("Merry");
}
@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 Merry 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(self.getAttachedTo())) {
@Override
public String getText(LotroGame game) {
return "Wound a minion Merry 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;
}
}