"Proud and Able"

This commit is contained in:
marcins78@gmail.com
2011-12-08 16:55:42 +00:00
parent 49ab3f7a4a
commit b72e9a51a6

View File

@@ -0,0 +1,61 @@
package com.gempukku.lotro.cards.set12.dwarven;
import com.gempukku.lotro.cards.AbstractPermanent;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.SelfDiscardEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndPlayCardFromDiscardEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.GameState;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.actions.ActivateCardAction;
import com.gempukku.lotro.logic.modifiers.KeywordModifier;
import com.gempukku.lotro.logic.modifiers.Modifier;
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
import com.gempukku.lotro.logic.modifiers.evaluator.Evaluator;
import com.gempukku.lotro.logic.timing.Action;
import java.util.Collections;
import java.util.List;
/**
* Set: Black Rider
* Side: Free
* Culture: Dwarven
* Twilight Cost: 2
* Type: Condition • Support Area
* Game Text: Each Dwarf is damage +1 for each possession he bears. Fellowship: Discard this condition to play
* a [DWARVEN] possession from your discard pile.
*/
public class Card12_012 extends AbstractPermanent {
public Card12_012() {
super(Side.FREE_PEOPLE, 2, CardType.CONDITION, Culture.DWARVEN, Zone.SUPPORT, "Proud and Able", true);
}
@Override
public Modifier getAlwaysOnModifier(PhysicalCard self) {
return new KeywordModifier(self, Race.DWARF, null, Keyword.DAMAGE,
new Evaluator() {
@Override
public int evaluateExpression(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard cardAffected) {
return Filters.countActive(gameState, modifiersQuerying, CardType.POSSESSION, Filters.attachedTo(cardAffected));
}
});
}
@Override
protected List<? extends Action> getExtraPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.FELLOWSHIP, self)
&& PlayConditions.canSelfDiscard(self, game)
&& PlayConditions.canPlayFromDiscard(playerId, game, Culture.DWARVEN, CardType.POSSESSION)) {
ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(
new SelfDiscardEffect(self));
action.appendEffect(
new ChooseAndPlayCardFromDiscardEffect(playerId, game, Culture.DWARVEN, CardType.POSSESSION));
return Collections.singletonList(action);
}
return null;
}
}