"Endurance of the Dwarves"

This commit is contained in:
marcins78@gmail.com
2013-01-06 02:05:17 +00:00
parent 6c9f51bce5
commit f0f9a194c5

View File

@@ -0,0 +1,57 @@
package com.gempukku.lotro.cards.set20.dwarven;
import com.gempukku.lotro.cards.AbstractAttachable;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.AddUntilEndOfPhaseModifierEffect;
import com.gempukku.lotro.cards.effects.SelfDiscardEffect;
import com.gempukku.lotro.cards.modifiers.VitalityModifier;
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.modifiers.Modifier;
import com.gempukku.lotro.logic.modifiers.StrengthModifier;
import com.gempukku.lotro.logic.timing.Action;
import java.util.Collections;
import java.util.List;
/**
* 1
* Endurance of Dwarves
* Dwarven Condition • Companion
* 1
* Bearer must be a Dwarf.
* Skirmish: Discard this condition to make bearer strength +1.
*/
public class Card20_049 extends AbstractAttachable {
public Card20_049() {
super(Side.FREE_PEOPLE, CardType.CONDITION, 1, Culture.DWARVEN, null, "Endurance of the Dwarves");
}
@Override
public Modifier getAlwaysOnModifier(PhysicalCard self) {
return new VitalityModifier(self, Filters.hasAttached(self), 1);
}
@Override
protected Filterable getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self) {
return Race.DWARF;
}
@Override
protected List<? extends Action> getExtraPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.SKIRMISH, self)
&& PlayConditions.canSelfDiscard(self, game)) {
ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(
new SelfDiscardEffect(self));
action.appendEffect(
new AddUntilEndOfPhaseModifierEffect(
new StrengthModifier(self, self.getAttachedTo(), 1), Phase.SKIRMISH));
return Collections.singletonList(action);
}
return null;
}
}