"Grace of the Valar"

This commit is contained in:
marcins78
2013-01-24 15:58:18 +00:00
parent e363874d77
commit 9b3a144a63

View File

@@ -0,0 +1,64 @@
package com.gempukku.lotro.cards.set20.gandalf;
import com.gempukku.lotro.cards.AbstractAttachable;
import com.gempukku.lotro.cards.TriggerConditions;
import com.gempukku.lotro.cards.effects.SelfDiscardEffect;
import com.gempukku.lotro.cards.modifiers.CantTakeMoreThanXWoundsModifier;
import com.gempukku.lotro.cards.modifiers.conditions.InitiativeCondition;
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.RequiredTriggerAction;
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.EffectResult;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
/**
* 1
* •Grace of the Valar
* Gandalf Condition • Companion
* 1
* Spell.
* Bearer must be Gandalf.
* While you have initiative, Gandalf takes no more than one wound in a skirmish. If you lose initiative, discard this condition and wound Gandalf.
*/
public class Card20_161 extends AbstractAttachable {
public Card20_161() {
super(Side.FREE_PEOPLE, CardType.CONDITION, 1, Culture.GANDALF, null, "Grace of the Valar", null, true);
addKeyword(Keyword.SPELL);
}
@Override
protected Filterable getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self) {
return Filters.gandalf;
}
@Override
public List<? extends Modifier> getAlwaysOnModifiers(LotroGame game, PhysicalCard self) {
List<Modifier> modifiers = new LinkedList<Modifier>();
modifiers.add(
new StrengthModifier(self, Filters.hasAttached(self), 1));
modifiers.add(
new CantTakeMoreThanXWoundsModifier(self, Phase.SKIRMISH, 1, new InitiativeCondition(Side.FREE_PEOPLE), Filters.hasAttached(self)));
return modifiers;
}
@Override
public List<RequiredTriggerAction> getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (TriggerConditions.losesInitiative(effectResult, Side.FREE_PEOPLE)) {
RequiredTriggerAction action = new RequiredTriggerAction(self);
action.appendEffect(
new SelfDiscardEffect(self));
action.appendEffect(
new WoundCharactersEffect(self, Filters.gandalf));
return Collections.singletonList(action);
}
return null;
}
}