"Secret Sentinels"
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package com.gempukku.lotro.cards.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.LotroGame;
|
||||
import com.gempukku.lotro.logic.actions.CostToEffectAction;
|
||||
import com.gempukku.lotro.logic.effects.ChooseActiveCardsEffect;
|
||||
import com.gempukku.lotro.logic.effects.DiscardCardsFromPlayEffect;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
public class ChooseAndDiscardCardsFromPlayEffect extends ChooseActiveCardsEffect {
|
||||
private CostToEffectAction _action;
|
||||
|
||||
public ChooseAndDiscardCardsFromPlayEffect(CostToEffectAction action, String playerId, int minimum, int maximum, Filter... filters) {
|
||||
super(playerId, "Choose cards to discard", minimum, maximum, filters);
|
||||
_action = action;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText(LotroGame game) {
|
||||
return "Choose card(s) to discard from play";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void cardsSelected(Collection<PhysicalCard> cards) {
|
||||
_action.insertEffect(new DiscardCardsFromPlayEffect(_action.getActionSource(), Filters.in(cards)));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.gempukku.lotro.cards.set2.elven;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractEvent;
|
||||
import com.gempukku.lotro.cards.actions.PlayEventAction;
|
||||
import com.gempukku.lotro.cards.costs.ChooseAndExertCharactersCost;
|
||||
import com.gempukku.lotro.cards.effects.ChooseAndDiscardCardsFromPlayEffect;
|
||||
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.decisions.MultipleChoiceAwaitingDecision;
|
||||
import com.gempukku.lotro.logic.effects.PlayoutDecisionEffect;
|
||||
|
||||
/**
|
||||
* Set: Mines of Moria
|
||||
* Side: Free
|
||||
* Culture: Elven
|
||||
* Twilight Cost: 2
|
||||
* Type: Event
|
||||
* Game Text: Maneuver: Exert an Elf ally to discard a condition (or 2 conditions if you spot an Orc).
|
||||
*/
|
||||
public class Card2_020 extends AbstractEvent {
|
||||
public Card2_020() {
|
||||
super(Side.FREE_PEOPLE, Culture.ELVEN, "Secret Sentinels", Phase.MANEUVER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTwilightCost() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) {
|
||||
return super.checkPlayRequirements(playerId, game, self, twilightModifier)
|
||||
&& Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.race(Race.ELF), Filters.type(CardType.ALLY), Filters.canExert());
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlayEventAction getPlayCardAction(final String playerId, LotroGame game, PhysicalCard self, int twilightModifier) {
|
||||
final PlayEventAction action = new PlayEventAction(self);
|
||||
action.appendCost(
|
||||
new ChooseAndExertCharactersCost(action, playerId, 1, 1, Filters.race(Race.ELF), Filters.type(CardType.ALLY)));
|
||||
if (Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.race(Race.ORC)))
|
||||
action.appendEffect(
|
||||
new PlayoutDecisionEffect(game.getUserFeedback(), playerId,
|
||||
new MultipleChoiceAwaitingDecision(1, "Do you wish to spot an Orc?", new String[]{"Yes", "No"}) {
|
||||
@Override
|
||||
protected void validDecisionMade(int index, String result) {
|
||||
if (result.equals("Yes")) {
|
||||
action.appendEffect(
|
||||
new ChooseAndDiscardCardsFromPlayEffect(action, playerId, 2, 2, Filters.type(CardType.CONDITION)));
|
||||
} else {
|
||||
action.appendEffect(
|
||||
new ChooseAndDiscardCardsFromPlayEffect(action, playerId, 1, 1, Filters.type(CardType.CONDITION)));
|
||||
}
|
||||
}
|
||||
}));
|
||||
else
|
||||
action.appendEffect(
|
||||
new ChooseAndDiscardCardsFromPlayEffect(action, playerId, 1, 1, Filters.type(CardType.CONDITION)));
|
||||
|
||||
return action;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user