"Encirclement"

This commit is contained in:
marcins78@gmail.com
2011-11-07 17:47:50 +00:00
parent dee76032cb
commit f57846b2ff

View File

@@ -0,0 +1,62 @@
package com.gempukku.lotro.cards.set7.sauron;
import com.gempukku.lotro.cards.AbstractPermanent;
import com.gempukku.lotro.cards.PlayConditions;
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.effects.DiscardCardsFromPlayEffect;
import com.gempukku.lotro.logic.effects.DrawCardEffect;
import com.gempukku.lotro.logic.modifiers.Modifier;
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
import com.gempukku.lotro.logic.modifiers.TwilightCostModifier;
import com.gempukku.lotro.logic.modifiers.evaluator.Evaluator;
import com.gempukku.lotro.logic.timing.Action;
import java.util.Collections;
import java.util.List;
/**
* Set: The Return of the King
* Side: Shadow
* Culture: Sauron
* Twilight Cost: 2
* Type: Condition • Support Area
* Game Text: For each 2 sites you control, the twilight cost of each of your [SAURON] cards is -1. Regroup: Spot
* a [SAURON] minion to draw a card (or draw 2 cards instead if that minion is a besieger). Discard this condition.
*/
public class Card7_268 extends AbstractPermanent {
public Card7_268() {
super(Side.SHADOW, 2, CardType.CONDITION, Culture.SAURON, Zone.SUPPORT, "Encirclement", true);
}
@Override
public List<? extends Modifier> getAlwaysOnModifiers(LotroGame game, final PhysicalCard self) {
return Collections.singletonList(
new TwilightCostModifier(self, Filters.and(Filters.owner(self.getOwner()), Culture.SAURON), null,
new Evaluator() {
@Override
public int evaluateExpression(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard cardAffected) {
return -(Filters.countActive(gameState, modifiersQuerying, Filters.siteControlled(self.getOwner())) / 2);
}
}));
}
@Override
protected List<? extends Action> getExtraPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
if (PlayConditions.canUseShadowCardDuringPhase(game, Phase.REGROUP, self, 0)
&& PlayConditions.canSpot(game, Culture.SAURON, CardType.MINION)) {
ActivateCardAction action = new ActivateCardAction(self);
int cards = Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Keyword.BESIEGER) ? 2 : 1;
action.appendEffect(
new DrawCardEffect(playerId, cards));
action.appendEffect(
new DiscardCardsFromPlayEffect(self, self));
return Collections.singletonList(action);
}
return null;
}
}