Fixing exertion so it doesn't kill the character if it is forced.
This commit is contained in:
@@ -30,9 +30,8 @@ public class ExertCharacterEffect extends AbstractEffect {
|
|||||||
|
|
||||||
public List<PhysicalCard> getCardsToBeExerted(LotroGame game) {
|
public List<PhysicalCard> getCardsToBeExerted(LotroGame game) {
|
||||||
List<PhysicalCard> cardsToExert = new LinkedList<PhysicalCard>();
|
List<PhysicalCard> cardsToExert = new LinkedList<PhysicalCard>();
|
||||||
for (PhysicalCard physicalCard : Filters.filterActive(game.getGameState(), game.getModifiersQuerying(), _filter)) {
|
for (PhysicalCard physicalCard : Filters.filterActive(game.getGameState(), game.getModifiersQuerying(), _filter, Filters.canExert()))
|
||||||
cardsToExert.add(physicalCard);
|
cardsToExert.add(physicalCard);
|
||||||
}
|
|
||||||
cardsToExert.removeAll(_prevented);
|
cardsToExert.removeAll(_prevented);
|
||||||
return cardsToExert;
|
return cardsToExert;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import com.gempukku.lotro.game.state.LotroGame;
|
|||||||
import com.gempukku.lotro.logic.actions.RequiredTriggerAction;
|
import com.gempukku.lotro.logic.actions.RequiredTriggerAction;
|
||||||
import com.gempukku.lotro.logic.timing.EffectResult;
|
import com.gempukku.lotro.logic.timing.EffectResult;
|
||||||
|
|
||||||
import java.util.LinkedList;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -31,14 +31,10 @@ public class Card1_355 extends AbstractSite {
|
|||||||
if (effectResult.getType() == EffectResult.Type.WHEN_MOVE_TO
|
if (effectResult.getType() == EffectResult.Type.WHEN_MOVE_TO
|
||||||
&& game.getGameState().getCurrentSite() == self
|
&& game.getGameState().getCurrentSite() == self
|
||||||
&& !Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.keyword(Keyword.RANGER))) {
|
&& !Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.keyword(Keyword.RANGER))) {
|
||||||
List<PhysicalCard> companions = Filters.filterActive(game.getGameState(), game.getModifiersQuerying(), Filters.type(CardType.COMPANION));
|
RequiredTriggerAction action = new RequiredTriggerAction(self, null, "Every companion must exert");
|
||||||
List<RequiredTriggerAction> actions = new LinkedList<RequiredTriggerAction>();
|
action.addEffect(
|
||||||
for (PhysicalCard companion : companions) {
|
new ExertCharacterEffect(game.getGameState().getCurrentPlayerId(), Filters.type(CardType.COMPANION)));
|
||||||
RequiredTriggerAction action = new RequiredTriggerAction(self, null, "Exert companion");
|
return Collections.singletonList(action);
|
||||||
action.addEffect(new ExertCharacterEffect(companion.getOwner(), companion));
|
|
||||||
actions.add(action);
|
|
||||||
}
|
|
||||||
return actions;
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user