Fix to 17R98 "Throne of the Golden Hall"

Players may no longer exert a character to prevent that same character's wound.
This commit is contained in:
PhallenCassidy
2018-12-15 11:33:38 -05:00
committed by GitHub
parent 89be5cac6c
commit 47f511cb8a

View File

@@ -3,12 +3,14 @@ package com.gempukku.lotro.cards.set17.rohan;
import com.gempukku.lotro.cards.AbstractPermanent; import com.gempukku.lotro.cards.AbstractPermanent;
import com.gempukku.lotro.cards.PlayConditions; import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.TriggerConditions; import com.gempukku.lotro.cards.TriggerConditions;
import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect;
import com.gempukku.lotro.cards.effects.PreventCardEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect; import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndPreventCardEffect;
import com.gempukku.lotro.common.*; import com.gempukku.lotro.common.*;
import com.gempukku.lotro.filters.Filters; import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard; import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame; import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.GameUtils;
import com.gempukku.lotro.logic.actions.ActivateCardAction; import com.gempukku.lotro.logic.actions.ActivateCardAction;
import com.gempukku.lotro.logic.effects.AddTwilightEffect; import com.gempukku.lotro.logic.effects.AddTwilightEffect;
import com.gempukku.lotro.logic.effects.WoundCharactersEffect; import com.gempukku.lotro.logic.effects.WoundCharactersEffect;
@@ -16,7 +18,8 @@ import com.gempukku.lotro.logic.modifiers.CantBeAssignedToSkirmishModifier;
import com.gempukku.lotro.logic.modifiers.Modifier; import com.gempukku.lotro.logic.modifiers.Modifier;
import com.gempukku.lotro.logic.timing.Effect; import com.gempukku.lotro.logic.timing.Effect;
import java.util.Collections; import java.util.Collection;
import java.util.LinkedList;
import java.util.List; import java.util.List;
/** /**
@@ -49,14 +52,24 @@ public class Card17_098 extends AbstractPermanent {
public List<? extends ActivateCardAction> getOptionalInPlayBeforeActions(String playerId, LotroGame game, Effect effect, PhysicalCard self) { public List<? extends ActivateCardAction> getOptionalInPlayBeforeActions(String playerId, LotroGame game, Effect effect, PhysicalCard self) {
if (TriggerConditions.isGettingWounded(effect, game, Culture.ROHAN, Race.MAN) if (TriggerConditions.isGettingWounded(effect, game, Culture.ROHAN, Race.MAN)
&& PlayConditions.canExert(self, game, Culture.ROHAN, Race.MAN)) { && PlayConditions.canExert(self, game, Culture.ROHAN, Race.MAN)) {
ActivateCardAction action = new ActivateCardAction(self); final WoundCharactersEffect woundEffect = (WoundCharactersEffect) effect;
action.appendCost( Collection<PhysicalCard> woundedCharacters = Filters.filter(woundEffect.getAffectedCardsMinusPrevented(game), game.getGameState(), game.getModifiersQuerying(), Culture.ROHAN, Race.MAN);
new AddTwilightEffect(self, 2)); List<ActivateCardAction> actions = new LinkedList<ActivateCardAction>();
action.appendCost( for (PhysicalCard woundedCharacter : woundedCharacters) {
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Culture.ROHAN, Race.MAN)); if (PlayConditions.canExert(self, game, Culture.ROHAN, Race.MAN, Filters.not(woundedCharacter))) {
action.appendEffect( ActivateCardAction action = new ActivateCardAction(self);
new ChooseAndPreventCardEffect(self, (WoundCharactersEffect) effect, playerId, "Choose character to prevent wound to", Culture.ROHAN, Race.MAN)); action.setText("Prevent for " + GameUtils.getFullName(woundedCharacter));
return Collections.singletonList(action); action.appendCost(
new AddTwilightEffect(self, 2));
action.appendCost(
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Culture.ROHAN, Race.MAN, Filters.not(woundedCharacter)));
action.appendEffect(
new PreventCardEffect(woundEffect, woundedCharacter));
actions.add(action);
}
}
return actions;
} }
return null; return null;
} }