"Mumak Commander"
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
package com.gempukku.lotro.cards.set20.fallenRealms;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractMinion;
|
||||
import com.gempukku.lotro.cards.PlayConditions;
|
||||
import com.gempukku.lotro.cards.effects.RemoveTwilightEffect;
|
||||
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.actions.ActivateCardAction;
|
||||
import com.gempukku.lotro.logic.effects.ChooseAndWoundCharactersEffect;
|
||||
import com.gempukku.lotro.logic.timing.Action;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 6
|
||||
* •Mumak Commander
|
||||
* Fallen Realms Minion • Man
|
||||
* 11 4 4
|
||||
* Southron.
|
||||
* Regroup: Remove (3) to make the free people's player wound an unbound companion (or 2 companions if you can spot 6 companions).
|
||||
*/
|
||||
public class Card20_131 extends AbstractMinion {
|
||||
public Card20_131() {
|
||||
super(6, 11, 4, 4, Race.MAN, Culture.FALLEN_REALMS, "Mumak Commander", null, true);
|
||||
addKeyword(Keyword.SOUTHRON);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<? extends Action> getExtraPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
|
||||
if (PlayConditions.canUseShadowCardDuringPhase(game, Phase.REGROUP, self, 3)) {
|
||||
ActivateCardAction action = new ActivateCardAction(self);
|
||||
action.appendCost(
|
||||
new RemoveTwilightEffect(3));
|
||||
int count = (Filters.countSpottable(game.getGameState(), game.getModifiersQuerying(), CardType.COMPANION) >= 6) ? 2 : 1;
|
||||
action.appendEffect(
|
||||
new ChooseAndWoundCharactersEffect(action, game.getGameState().getCurrentPlayerId(), count, count, Filters.unboundCompanion));
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -92,6 +92,12 @@ public class Filters {
|
||||
return visitor.getCard();
|
||||
}
|
||||
|
||||
public static int countSpottable(GameState gameState, ModifiersQuerying modifiersQuerying, Filterable... filters) {
|
||||
GetCardsMatchingFilterVisitor matchingFilterVisitor = new GetCardsMatchingFilterVisitor(gameState, modifiersQuerying, Filters.and(filters, Filters.spottable));
|
||||
gameState.iterateActiveCards(matchingFilterVisitor);
|
||||
return matchingFilterVisitor.getCounter();
|
||||
}
|
||||
|
||||
public static int countActive(GameState gameState, ModifiersQuerying modifiersQuerying, Filterable... filters) {
|
||||
GetCardsMatchingFilterVisitor matchingFilterVisitor = new GetCardsMatchingFilterVisitor(gameState, modifiersQuerying, Filters.and(filters));
|
||||
gameState.iterateActiveCards(matchingFilterVisitor);
|
||||
@@ -927,6 +933,13 @@ public class Filters {
|
||||
public static final Filter roamingMinion = Filters.and(CardType.MINION, Keyword.ROAMING);
|
||||
public static final Filter mounted = Filters.or(Filters.hasAttached(PossessionClass.MOUNT), Keyword.MOUNTED);
|
||||
|
||||
public static Filter spottable = new Filter() {
|
||||
@Override
|
||||
public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) {
|
||||
return modifiersQuerying.canBeSpotted(gameState, physicalCard);
|
||||
}
|
||||
};
|
||||
|
||||
private static class SpotFilterCardInPlayVisitor implements PhysicalCardVisitor {
|
||||
private GameState _gameState;
|
||||
private ModifiersQuerying _modifiersQuerying;
|
||||
|
||||
@@ -936,6 +936,11 @@ public class ModifiersLogic implements ModifiersEnvironment, ModifiersQuerying {
|
||||
return Side.FREE_PEOPLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeSpotted(GameState gameState, PhysicalCard card) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSpotBonus(GameState gameState, Filterable filter) {
|
||||
int result = 0;
|
||||
|
||||
@@ -130,6 +130,8 @@ public interface ModifiersQuerying {
|
||||
|
||||
public Side hasInitiative(GameState gameState);
|
||||
|
||||
public boolean canBeSpotted(GameState gameState, PhysicalCard card);
|
||||
|
||||
public int getSpotBonus(GameState gameState, Filterable filter);
|
||||
|
||||
public boolean hasFlagActive(GameState gameState, ModifierFlag modifierFlag);
|
||||
|
||||
Reference in New Issue
Block a user