"Field of the Fallen"

This commit is contained in:
marcins78@gmail.com
2011-11-16 17:15:37 +00:00
parent 53094f9d29
commit 9e93d08bae

View File

@@ -0,0 +1,76 @@
package com.gempukku.lotro.cards.set10.raider;
import com.gempukku.lotro.cards.AbstractPermanent;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.AddUntilEndOfPhaseModifierEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.filters.Filter;
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.Modifier;
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
import com.gempukku.lotro.logic.modifiers.StrengthModifier;
import com.gempukku.lotro.logic.timing.Action;
import java.util.Collections;
import java.util.List;
/**
* Set: Mount Doom
* Side: Shadow
* Culture: Raider
* Twilight Cost: 1
* Type: Condition • Support Area
* Game Text: To play, spot a [RAIDER] Man. While there is a character in the dead pile, each companion of the same
* culture as that character is strength -1. Skirmish: Exert your Southron to make him strength +1.
*/
public class Card10_043 extends AbstractPermanent {
public Card10_043() {
super(Side.SHADOW, 1, CardType.CONDITION, Culture.RAIDER, Zone.SUPPORT, "Field of the Fallen");
}
@Override
public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int twilightModifier, boolean ignoreRoamingPenalty) {
return super.checkPlayRequirements(playerId, game, self, twilightModifier, ignoreRoamingPenalty)
&& PlayConditions.canSpot(game, Culture.RAIDER, Race.MAN);
}
@Override
public List<? extends Modifier> getAlwaysOnModifiers(LotroGame game, PhysicalCard self) {
return Collections.singletonList(
new StrengthModifier(self,
Filters.and(
CardType.COMPANION,
new Filter() {
@Override
public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) {
Culture culture = physicalCard.getBlueprint().getCulture();
return Filters.filter(gameState.getDeadPile(gameState.getCurrentPlayerId()), gameState, modifiersQuerying, culture).size() > 0;
}
}
), -1));
}
@Override
protected List<? extends Action> getExtraPhaseActions(String playerId, LotroGame game, final PhysicalCard self) {
if (PlayConditions.canUseShadowCardDuringPhase(game, Phase.SKIRMISH, self, 0)
&& PlayConditions.canExert(self, game, Filters.owner(playerId), Keyword.SOUTHRON)) {
final ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Filters.owner(playerId), Keyword.SOUTHRON) {
@Override
protected void forEachCardExertedCallback(PhysicalCard character) {
action.appendEffect(
new AddUntilEndOfPhaseModifierEffect(
new StrengthModifier(self, character, 1), Phase.SKIRMISH));
}
});
return Collections.singletonList(action);
}
return null;
}
}