Fixing exertion so it doesn't kill the character if it is forced.

This commit is contained in:
marcins78@gmail.com
2011-09-21 12:38:23 +00:00
parent 281a056aad
commit b4d1ecd97a
2 changed files with 6 additions and 11 deletions

View File

@@ -30,9 +30,8 @@ public class ExertCharacterEffect extends AbstractEffect {
public List<PhysicalCard> getCardsToBeExerted(LotroGame game) {
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.removeAll(_prevented);
return cardsToExert;
}

View File

@@ -10,7 +10,7 @@ import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.actions.RequiredTriggerAction;
import com.gempukku.lotro.logic.timing.EffectResult;
import java.util.LinkedList;
import java.util.Collections;
import java.util.List;
/**
@@ -31,14 +31,10 @@ public class Card1_355 extends AbstractSite {
if (effectResult.getType() == EffectResult.Type.WHEN_MOVE_TO
&& game.getGameState().getCurrentSite() == self
&& !Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.keyword(Keyword.RANGER))) {
List<PhysicalCard> companions = Filters.filterActive(game.getGameState(), game.getModifiersQuerying(), Filters.type(CardType.COMPANION));
List<RequiredTriggerAction> actions = new LinkedList<RequiredTriggerAction>();
for (PhysicalCard companion : companions) {
RequiredTriggerAction action = new RequiredTriggerAction(self, null, "Exert companion");
action.addEffect(new ExertCharacterEffect(companion.getOwner(), companion));
actions.add(action);
}
return actions;
RequiredTriggerAction action = new RequiredTriggerAction(self, null, "Every companion must exert");
action.addEffect(
new ExertCharacterEffect(game.getGameState().getCurrentPlayerId(), Filters.type(CardType.COMPANION)));
return Collections.singletonList(action);
}
return null;
}