"Gleaming Spires Will Crumble"
This commit is contained in:
@@ -114,6 +114,15 @@ public class PlayConditions {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean losesSkirmish(GameState gameState, ModifiersQuerying modifiersQuerying, EffectResult effectResult, Filter filter) {
|
||||
EffectResult.Type effectType = effectResult.getType();
|
||||
if (effectType == EffectResult.Type.RESOLVE_SKIRMISH || effectType == EffectResult.Type.OVERWHELM_IN_SKIRMISH) {
|
||||
SkirmishResult skirmishResult = (SkirmishResult) effectResult;
|
||||
return (Filters.filter(skirmishResult.getLosers(), gameState, modifiersQuerying, filter).size() > 0);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isWounded(EffectResult effectResult, PhysicalCard character) {
|
||||
if (effectResult.getType() == EffectResult.Type.WOUND) {
|
||||
PhysicalCard woundedCard = ((WoundResult) effectResult).getWoundedCard();
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
package com.gempukku.lotro.cards.set1.sauron;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractLotroCardBlueprint;
|
||||
import com.gempukku.lotro.cards.PlayConditions;
|
||||
import com.gempukku.lotro.cards.actions.PlayPermanentAction;
|
||||
import com.gempukku.lotro.cards.modifiers.StrengthModifier;
|
||||
import com.gempukku.lotro.common.*;
|
||||
import com.gempukku.lotro.filters.Filter;
|
||||
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.game.state.Skirmish;
|
||||
import com.gempukku.lotro.logic.actions.DefaultCostToEffectAction;
|
||||
import com.gempukku.lotro.logic.effects.DiscardCardFromPlayEffect;
|
||||
import com.gempukku.lotro.logic.modifiers.Modifier;
|
||||
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
|
||||
import com.gempukku.lotro.logic.timing.Action;
|
||||
import com.gempukku.lotro.logic.timing.EffectResult;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Set: The Fellowship of the Ring
|
||||
* Side: Shadow
|
||||
* Culture: Sauron
|
||||
* Twilight Cost: 1
|
||||
* Type: Condition
|
||||
* Game Text: Plays to your support area. Each [SAURON] Orc skirmishing a [GONDOR] character is strength +2. Discard
|
||||
* this condition if your [SAURON] Orc loses a skirmish.
|
||||
*/
|
||||
public class Card1_249 extends AbstractLotroCardBlueprint {
|
||||
public Card1_249() {
|
||||
super(Side.SHADOW, CardType.CONDITION, Culture.SAURON, "Gleaming Spires Will Crumble");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) {
|
||||
return PlayConditions.canPayForShadowCard(game, self, twilightModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Action getPlayCardAction(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) {
|
||||
return new PlayPermanentAction(self, Zone.SHADOW_SUPPORT, twilightModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTwilightCost() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends Action> getPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
|
||||
if (PlayConditions.canPlayCardDuringPhase(game, Phase.SHADOW, self)
|
||||
&& checkPlayRequirements(playerId, game, self, 0))
|
||||
return Collections.singletonList(getPlayCardAction(playerId, game, self, 0));
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Modifier getAlwaysOnEffect(PhysicalCard self) {
|
||||
return new StrengthModifier(self,
|
||||
Filters.and(
|
||||
Filters.culture(Culture.SAURON),
|
||||
Filters.keyword(Keyword.ORC),
|
||||
new Filter() {
|
||||
@Override
|
||||
public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) {
|
||||
Skirmish skirmish = gameState.getSkirmish();
|
||||
return (skirmish != null && skirmish.getShadowCharacters().contains(physicalCard)
|
||||
&& skirmish.getFellowshipCharacter() != null
|
||||
&& skirmish.getFellowshipCharacter().getBlueprint().getCulture() == Culture.GONDOR);
|
||||
}
|
||||
}
|
||||
), 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends Action> getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) {
|
||||
if (PlayConditions.losesSkirmish(game.getGameState(), game.getModifiersQuerying(), effectResult, Filters.and(Filters.culture(Culture.SAURON), Filters.keyword(Keyword.ORC)))) {
|
||||
DefaultCostToEffectAction action = new DefaultCostToEffectAction(self, null, "Discard this condition");
|
||||
action.addEffect(
|
||||
new DiscardCardFromPlayEffect(self, self));
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user