"Defend It and Hope"

This commit is contained in:
marcins78@gmail.com
2011-10-08 14:33:27 +00:00
parent c7cd017f4b
commit 143afceab4
3 changed files with 67 additions and 8 deletions

View File

@@ -0,0 +1,57 @@
package com.gempukku.lotro.cards.set4.gondor;
import com.gempukku.lotro.cards.AbstractEvent;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.actions.PlayEventAction;
import com.gempukku.lotro.cards.effects.ChooseAndExertCharactersEffect;
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.effects.ChooseActiveCardEffect;
import com.gempukku.lotro.logic.effects.WoundCharactersEffect;
/**
* Set: The Two Towers
* Side: Free
* Culture: Gondor
* Twilight Cost: 0
* Type: Event
* Game Text: Maneuver: Exert a [GONDOR] Man to wound a minion once (or twice if that minion is an Uruk-hai).
*/
public class Card4_115 extends AbstractEvent {
public Card4_115() {
super(Side.FREE_PEOPLE, Culture.GONDOR, "Defend It and Hope", Phase.MANEUVER);
}
@Override
public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) {
return super.checkPlayRequirements(playerId, game, self, twilightModifier)
&& PlayConditions.canExert(self, game.getGameState(), game.getModifiersQuerying(), Filters.culture(Culture.GONDOR), Filters.race(Race.MAN));
}
@Override
public int getTwilightCost() {
return 0;
}
@Override
public PlayEventAction getPlayCardAction(String playerId, LotroGame game, final PhysicalCard self, int twilightModifier) {
final PlayEventAction action = new PlayEventAction(self);
action.appendCost(
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Filters.culture(Culture.GONDOR), Filters.race(Race.MAN)));
action.appendEffect(
new ChooseActiveCardEffect(self, playerId, "Choose minion", Filters.type(CardType.MINION), Filters.canTakeWound()) {
@Override
protected void cardSelected(PhysicalCard card) {
boolean urukHai = (card.getBlueprint().getRace() == Race.URUK_HAI);
action.insertEffect(
new WoundCharactersEffect(self, card));
if (urukHai)
action.insertEffect(
new WoundCharactersEffect(self, card));
}
});
return action;
}
}

View File

@@ -139,6 +139,15 @@ public class Filters {
};
}
public static Filter canTakeWound() {
return new Filter() {
@Override
public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) {
return modifiersQuerying.canTakeWound(gameState, physicalCard);
}
};
}
public static Filter exhausted() {
return new Filter() {
@Override

View File

@@ -3,11 +3,9 @@ package com.gempukku.lotro.logic.effects;
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.CostToEffectAction;
import com.gempukku.lotro.logic.actions.SubAction;
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
import java.util.Collection;
@@ -27,12 +25,7 @@ public class ChooseAndWoundCharactersEffect extends ChooseActiveCardsEffect {
@Override
protected Filter getExtraFilter() {
return new Filter() {
@Override
public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) {
return modifiersQuerying.canTakeWound(gameState, physicalCard);
}
};
return Filters.canTakeWound();
}
@Override