"Easterling Berserker"
This commit is contained in:
@@ -215,6 +215,25 @@ public class PlayConditions {
|
||||
});
|
||||
}
|
||||
|
||||
public static boolean canWound(final LotroGame game, final int times, final int count, Filterable... filters) {
|
||||
final GameState gameState = game.getGameState();
|
||||
final ModifiersQuerying modifiersQuerying = game.getModifiersQuerying();
|
||||
final Filter filter = Filters.and(filters);
|
||||
return gameState.iterateActiveCards(
|
||||
new PhysicalCardVisitor() {
|
||||
private int _woundableCount;
|
||||
|
||||
@Override
|
||||
public boolean visitPhysicalCard(PhysicalCard physicalCard) {
|
||||
if (filter.accepts(gameState, modifiersQuerying, physicalCard)
|
||||
&& modifiersQuerying.getVitality(gameState, physicalCard) > times
|
||||
&& modifiersQuerying.canTakeWound(gameState, physicalCard))
|
||||
_woundableCount++;
|
||||
return _woundableCount >= count;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static boolean canPlayFromHand(String playerId, LotroGame game, Filterable... filters) {
|
||||
return Filters.filter(game.getGameState().getHand(playerId), game.getGameState(), game.getModifiersQuerying(), Filters.and(filters, Filters.playable(game))).size() > 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.gempukku.lotro.cards.set10.raider;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractMinion;
|
||||
import com.gempukku.lotro.cards.PlayConditions;
|
||||
import com.gempukku.lotro.common.Culture;
|
||||
import com.gempukku.lotro.common.Keyword;
|
||||
import com.gempukku.lotro.common.Phase;
|
||||
import com.gempukku.lotro.common.Race;
|
||||
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.ChooseAndWoundCharactersEffect;
|
||||
import com.gempukku.lotro.logic.effects.HealCharactersEffect;
|
||||
import com.gempukku.lotro.logic.modifiers.Condition;
|
||||
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.timing.Action;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Set: Mount Doom
|
||||
* Side: Shadow
|
||||
* Culture: Raider
|
||||
* Twilight Cost: 6
|
||||
* Type: Minion • Man
|
||||
* Strength: 11
|
||||
* Vitality: 3
|
||||
* Site: 4
|
||||
* Game Text: Easterling. To play, spot an Easterling. While this minion is unwounded, he is damage +2. Skirmish: Wound
|
||||
* 2 other [RAIDER] Men to heal this minion.
|
||||
*/
|
||||
public class Card10_040 extends AbstractMinion {
|
||||
public Card10_040() {
|
||||
super(6, 11, 3, 4, Race.MAN, Culture.RAIDER, "Easterling Berserker");
|
||||
addKeyword(Keyword.EASTERLING);
|
||||
}
|
||||
|
||||
@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, Keyword.EASTERLING);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends Modifier> getAlwaysOnModifiers(final LotroGame game, final PhysicalCard self) {
|
||||
return Collections.singletonList(
|
||||
new KeywordModifier(self, self, new Condition() {
|
||||
@Override
|
||||
public boolean isFullfilled(GameState gameState, ModifiersQuerying modifiersQuerying) {
|
||||
return gameState.getWounds(self) == 0;
|
||||
}
|
||||
}, Keyword.DAMAGE, 2));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<? extends Action> getExtraPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
|
||||
if (PlayConditions.canUseShadowCardDuringPhase(game, Phase.SKIRMISH, self, 0)
|
||||
&& PlayConditions.canWound(game, 1, 2, Filters.not(self), Culture.RAIDER, Race.MAN)) {
|
||||
ActivateCardAction action = new ActivateCardAction(self);
|
||||
action.appendCost(
|
||||
new ChooseAndWoundCharactersEffect(action, playerId, 2, 2, Filters.not(self), Culture.RAIDER, Race.MAN));
|
||||
action.appendEffect(
|
||||
new HealCharactersEffect(self, self));
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user