"Westfold in Flames"
This commit is contained in:
@@ -159,6 +159,12 @@ public class TriggerConditions {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean forEachDiscardedFromHand(LotroGame game, EffectResult effectResult, Filterable... filters) {
|
||||
if (effectResult.getType() == EffectResult.Type.FOR_EACH_DISCARDED_FROM_HAND)
|
||||
return Filters.and(filters).accepts(game.getGameState(), game.getModifiersQuerying(), ((DiscardCardFromHandResult) effectResult).getDiscardedCard());
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean forEachWounded(LotroGame game, EffectResult effectResult, Filterable... filters) {
|
||||
if (effectResult.getType() == EffectResult.Type.FOR_EACH_WOUNDED)
|
||||
return Filters.and(filters).accepts(game.getGameState(), game.getModifiersQuerying(), ((WoundResult) effectResult).getWoundedCard());
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.gempukku.lotro.cards.set20.dunland;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractPermanent;
|
||||
import com.gempukku.lotro.cards.PlayConditions;
|
||||
import com.gempukku.lotro.cards.TriggerConditions;
|
||||
import com.gempukku.lotro.cards.effects.choose.ChooseAndPlayCardFromStackedEffect;
|
||||
import com.gempukku.lotro.cards.effects.choose.ChooseAndStackCardsFromDiscardEffect;
|
||||
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.actions.OptionalTriggerAction;
|
||||
import com.gempukku.lotro.logic.timing.Action;
|
||||
import com.gempukku.lotro.logic.timing.EffectResult;
|
||||
import com.gempukku.lotro.logic.timing.results.DiscardCardFromHandResult;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 1
|
||||
* Westfold in Flames
|
||||
* Dunland Condition • Support Area
|
||||
* Each time you discard a [Dunland] card from hand during the Shadow phase, you may stack that card here.
|
||||
* Shadow or Skirmish: Spot 3 [Dunland] cards stacked here to play a card stacked here as if from hand.
|
||||
*/
|
||||
public class Card20_034 extends AbstractPermanent {
|
||||
public Card20_034() {
|
||||
super(Side.SHADOW, 1, CardType.CONDITION, Culture.DUNLAND, Zone.SUPPORT, "Westfold in Flames");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OptionalTriggerAction> getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) {
|
||||
if (TriggerConditions.forEachDiscardedFromHand(game, effectResult, Culture.DUNLAND)
|
||||
&& PlayConditions.isPhase(game, Phase.SHADOW)) {
|
||||
OptionalTriggerAction action = new OptionalTriggerAction(self);
|
||||
action.appendEffect(
|
||||
new ChooseAndStackCardsFromDiscardEffect(action, playerId, 1, 1, self, ((DiscardCardFromHandResult) effectResult).getDiscardedCard()));
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<? extends Action> getExtraPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
|
||||
if ((PlayConditions.canUseShadowCardDuringPhase(game, Phase.SHADOW, self, 0)
|
||||
|| PlayConditions.canUseShadowCardDuringPhase(game, Phase.SKIRMISH, self, 0))
|
||||
&& Filters.filter(game.getGameState().getStackedCards(self), game.getGameState(), game.getModifiersQuerying(), Culture.DUNLAND).size()>=3
|
||||
&& PlayConditions.canPlayFromStacked(playerId, game, self, Filters.any)) {
|
||||
ActivateCardAction action = new ActivateCardAction(self);
|
||||
action.appendEffect(
|
||||
new ChooseAndPlayCardFromStackedEffect(playerId, self, Filters.any));
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -28,4 +28,8 @@ public class DiscardCardFromHandResult extends EffectResult {
|
||||
public String getHandPlayerId() {
|
||||
return _handPlayerId;
|
||||
}
|
||||
|
||||
public PhysicalCard getDiscardedCard() {
|
||||
return _card;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user