"Erkenbrand's Shield"

This commit is contained in:
marcins78@gmail.com
2012-03-08 15:18:24 +00:00
parent 28b6889507
commit 711cacc7d9

View File

@@ -0,0 +1,79 @@
package com.gempukku.lotro.cards.set18.rohan;
import com.gempukku.lotro.cards.AbstractAttachableFPPossession;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.TriggerConditions;
import com.gempukku.lotro.cards.effects.CancelSkirmishEffect;
import com.gempukku.lotro.cards.effects.ExertCharactersEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndPreventCardEffect;
import com.gempukku.lotro.cards.modifiers.ArcheryTotalModifier;
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.actions.ActivateCardAction;
import com.gempukku.lotro.logic.effects.AddTwilightEffect;
import com.gempukku.lotro.logic.effects.WoundCharactersEffect;
import com.gempukku.lotro.logic.modifiers.Modifier;
import com.gempukku.lotro.logic.timing.Action;
import com.gempukku.lotro.logic.timing.Effect;
import java.util.Collections;
import java.util.List;
/**
* Set: Treachery & Deceit
* Side: Free
* Culture: Rohan
* Twilight Cost: 0
* Type: Possession • Shield
* Game Text: Bearer must be a [ROHAN] Man. The minion archery total is -1. Skirmish: If bearer is Erkenbrand, you may
* add (2) to cancel a fierce skirmish involving him. Response: If a [ROHAN] Man is about to take a wound, spot Gandalf
* and exert bearer to prevent that wound.
*/
public class Card18_097 extends AbstractAttachableFPPossession {
public Card18_097() {
super(0, 0, 0, Culture.ROHAN, PossessionClass.SHIELD, "Erkenbrand's Shield", true);
}
@Override
protected Filterable getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self) {
return Filters.and(Culture.ROHAN, Race.MAN);
}
@Override
protected List<? extends Modifier> getNonBasicStatsModifiers(PhysicalCard self) {
return Collections.singletonList(
new ArcheryTotalModifier(self, Side.SHADOW, -1));
}
@Override
protected List<? extends Action> getExtraInPlayPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.SKIRMISH, self)
&& PlayConditions.canSpot(game, Filters.hasAttached(self), Filters.name("Erkenbrand"))) {
ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(
new AddTwilightEffect(self, 2));
if (game.getGameState().isFierceSkirmishes())
action.appendEffect(
new CancelSkirmishEffect(Filters.hasAttached(self)));
return Collections.singletonList(action);
}
return null;
}
@Override
public List<? extends Action> getOptionalInPlayBeforeActions(String playerId, LotroGame game, Effect effect, PhysicalCard self) {
if (TriggerConditions.isGettingWounded(effect, game, Culture.ROHAN, Race.MAN)
&& PlayConditions.canSpot(game, Filters.gandalf)
&& PlayConditions.canExert(self, game, self.getAttachedTo())) {
ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(
new ExertCharactersEffect(self, self.getAttachedTo()));
action.appendEffect(
new ChooseAndPreventCardEffect(self, (WoundCharactersEffect) effect, playerId, "Choose a ROHAN Man to prevent wound to", Culture.ROHAN, Race.MAN));
return Collections.singletonList(action);
}
return null;
}
}