"Nan Curunir"

This commit is contained in:
marcins78@gmail.com
2011-10-19 15:38:54 +00:00
parent 23a14bf189
commit 38bc433b93
2 changed files with 59 additions and 1 deletions

View File

@@ -268,7 +268,7 @@ public class PlayConditions {
return false;
}
public static boolean isGettingWounded(Effect effect, LotroGame game, Filter... filters) {
public static boolean isGettingWounded(Effect effect, LotroGame game, Filterable... filters) {
if (effect.getType() == EffectResult.Type.WOUND) {
WoundCharactersEffect woundEffect = (WoundCharactersEffect) effect;
return Filters.filter(woundEffect.getAffectedCardsMinusPrevented(game), game.getGameState(), game.getModifiersQuerying(), filters).size() > 0;

View File

@@ -0,0 +1,58 @@
package com.gempukku.lotro.cards.set5.site;
import com.gempukku.lotro.cards.AbstractSite;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.actions.PlayEventAction;
import com.gempukku.lotro.cards.effects.PreventCardEffect;
import com.gempukku.lotro.cards.effects.RemoveTwilightEffect;
import com.gempukku.lotro.common.Block;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect;
import com.gempukku.lotro.logic.effects.WoundCharactersEffect;
import com.gempukku.lotro.logic.timing.Action;
import com.gempukku.lotro.logic.timing.Effect;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
/**
* Set: Battle of Helm's Deep
* Twilight Cost: 8
* Type: Site
* Site: 8T
* Game Text: Plains. Response: If your mounted minion is about to take a wound, remove (2) to prevent that wound.
*/
public class Card5_119 extends AbstractSite {
public Card5_119() {
super("Nan Curunir", Block.TWO_TOWERS, 8, 8, Direction.RIGHT);
addKeyword(Keyword.PLAINS);
}
@Override
public List<? extends Action> getOptionalBeforeActions(String playerId, LotroGame game, Effect effect, PhysicalCard self) {
if (PlayConditions.isGettingWounded(effect, game, CardType.MINION, Filters.owner(playerId))
&& game.getGameState().getTwilightPool() >= 2) {
final WoundCharactersEffect woundEffect = (WoundCharactersEffect) effect;
final Collection<PhysicalCard> cardsToBeWounded = woundEffect.getAffectedCardsMinusPrevented(game);
final PlayEventAction action = new PlayEventAction(self);
action.appendCost(
new RemoveTwilightEffect(2));
action.appendEffect(
new ChooseActiveCardEffect(self, playerId, "Choose minion", CardType.MINION, Filters.owner(playerId), Filters.in(cardsToBeWounded)) {
@Override
protected void cardSelected(LotroGame game, PhysicalCard minion) {
action.appendEffect(
new PreventCardEffect(woundEffect, minion));
}
});
return Collections.singletonList(action);
}
return null;
}
}