"Power and Terror"
This commit is contained in:
@@ -6,13 +6,15 @@ import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.logic.decisions.CardsSelectionDecision;
|
||||
import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException;
|
||||
import com.gempukku.lotro.logic.timing.Cost;
|
||||
import com.gempukku.lotro.logic.timing.CostResolution;
|
||||
import com.gempukku.lotro.logic.timing.Effect;
|
||||
import com.gempukku.lotro.logic.timing.EffectResult;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
|
||||
public abstract class ChooseCardsFromHandEffect implements Effect {
|
||||
public abstract class ChooseCardsFromHandEffect implements Effect, Cost {
|
||||
private String _playerId;
|
||||
private int _minimum;
|
||||
private int _maximum;
|
||||
@@ -35,6 +37,11 @@ public abstract class ChooseCardsFromHandEffect implements Effect {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CostResolution playCost(LotroGame game) {
|
||||
return new CostResolution(playEffect(game), true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EffectResult[] playEffect(LotroGame game) {
|
||||
Collection<PhysicalCard> selectableCards = Filters.filter(game.getGameState().getHand(_playerId), game.getGameState(), game.getModifiersQuerying(), _filter);
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.gempukku.lotro.cards.set2.moria;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractEvent;
|
||||
import com.gempukku.lotro.cards.actions.PlayEventAction;
|
||||
import com.gempukku.lotro.cards.effects.ChooseAndPlayCardFromHandEffect;
|
||||
import com.gempukku.lotro.cards.effects.ChooseCardsFromHandEffect;
|
||||
import com.gempukku.lotro.common.Culture;
|
||||
import com.gempukku.lotro.common.Phase;
|
||||
import com.gempukku.lotro.common.Race;
|
||||
import com.gempukku.lotro.common.Side;
|
||||
import com.gempukku.lotro.filters.Filters;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* Set: Mines of Moria
|
||||
* Side: Shadow
|
||||
* Culture: Moria
|
||||
* Twilight Cost: 0
|
||||
* Type: Event
|
||||
* Game Text: Shadow: Reveal any number of [MORIA] Orcs from your hand to play The Balrog. Its twilight cost is -2 for
|
||||
* each Orc revealed.
|
||||
*/
|
||||
public class Card2_070 extends AbstractEvent {
|
||||
public Card2_070() {
|
||||
super(Side.SHADOW, Culture.MORIA, "Power and Terror", Phase.SHADOW);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTwilightCost() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) {
|
||||
return super.checkPlayRequirements(playerId, game, self, twilightModifier)
|
||||
&& Filters.filter(game.getGameState().getHand(playerId), game.getGameState(), game.getModifiersQuerying(), Filters.name("The Balrog"),
|
||||
Filters.playable(game, -2 * Filters.filter(game.getGameState().getHand(playerId), game.getGameState(), game.getModifiersQuerying(), Filters.culture(Culture.MORIA), Filters.race(Race.ORC)).size())).size() > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlayEventAction getPlayCardAction(final String playerId, final LotroGame game, PhysicalCard self, int twilightModifier) {
|
||||
final PlayEventAction action = new PlayEventAction(self);
|
||||
action.appendCost(
|
||||
new ChooseCardsFromHandEffect(playerId, 0, Integer.MAX_VALUE, Filters.culture(Culture.MORIA), Filters.race(Race.ORC)) {
|
||||
@Override
|
||||
protected void cardsSelected(Collection<PhysicalCard> selectedCards) {
|
||||
int cardsRevealed = selectedCards.size();
|
||||
action.appendEffect(
|
||||
new ChooseAndPlayCardFromHandEffect(playerId, game.getGameState().getHand(playerId), Filters.name("The Balrog"), -2 * cardsRevealed));
|
||||
}
|
||||
});
|
||||
return action;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user