- "Aragorn's Bow, Ranger's Longbow" now correctly can wound minions that have their strength based off number of threats.
This commit is contained in:
@@ -2,15 +2,19 @@ package com.gempukku.lotro.cards.set15.gondor;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractAttachableFPPossession;
|
||||
import com.gempukku.lotro.cards.PlayConditions;
|
||||
import com.gempukku.lotro.cards.modifiers.evaluator.SingleMemoryEvaluator;
|
||||
import com.gempukku.lotro.common.*;
|
||||
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.logic.actions.ActivateCardAction;
|
||||
import com.gempukku.lotro.logic.effects.AddThreatsEffect;
|
||||
import com.gempukku.lotro.logic.effects.ChooseAndWoundCharactersEffect;
|
||||
import com.gempukku.lotro.logic.modifiers.KeywordModifier;
|
||||
import com.gempukku.lotro.logic.modifiers.Modifier;
|
||||
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
|
||||
import com.gempukku.lotro.logic.modifiers.evaluator.Evaluator;
|
||||
import com.gempukku.lotro.logic.timing.Action;
|
||||
|
||||
import java.util.Collections;
|
||||
@@ -44,15 +48,22 @@ public class Card15_056 extends AbstractAttachableFPPossession {
|
||||
protected List<? extends Action> getExtraInPlayPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
|
||||
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.ARCHERY, self)
|
||||
&& PlayConditions.canAddThreat(game, self, 1)) {
|
||||
int lowestStrength = Integer.MAX_VALUE;
|
||||
for (PhysicalCard physicalCard : Filters.filterActive(game.getGameState(), game.getModifiersQuerying(), CardType.MINION))
|
||||
lowestStrength = Math.min(lowestStrength, game.getModifiersQuerying().getStrength(game.getGameState(), physicalCard));
|
||||
|
||||
ActivateCardAction action = new ActivateCardAction(self);
|
||||
action.appendCost(
|
||||
new AddThreatsEffect(playerId, self, 1));
|
||||
action.appendEffect(
|
||||
new ChooseAndWoundCharactersEffect(action, playerId, 1, 1, CardType.MINION, Filters.lessStrengthThan(lowestStrength + 1)));
|
||||
new ChooseAndWoundCharactersEffect(action, playerId, 1, 1, CardType.MINION, Filters.strengthEqual(
|
||||
new SingleMemoryEvaluator(
|
||||
new Evaluator() {
|
||||
@Override
|
||||
public int evaluateExpression(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard cardAffected) {
|
||||
int minStrength = Integer.MAX_VALUE;
|
||||
for (PhysicalCard minion : Filters.filterActive(gameState, modifiersQuerying, CardType.MINION))
|
||||
minStrength = Math.min(minStrength, modifiersQuerying.getStrength(gameState, minion));
|
||||
return minStrength;
|
||||
}
|
||||
}
|
||||
))));
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.game.state.Skirmish;
|
||||
import com.gempukku.lotro.logic.GameUtils;
|
||||
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
|
||||
import com.gempukku.lotro.logic.modifiers.evaluator.Evaluator;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@@ -153,6 +154,15 @@ public class Filters {
|
||||
};
|
||||
}
|
||||
|
||||
public static Filter strengthEqual(final Evaluator evaluator) {
|
||||
return new Filter() {
|
||||
@Override
|
||||
public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) {
|
||||
return modifiersQuerying.getStrength(gameState, physicalCard) == evaluator.evaluateExpression(gameState, modifiersQuerying, null);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public static Filter lessStrengthThan(final int strength) {
|
||||
return new Filter() {
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<pre style="font-size:80%">
|
||||
<b>9 Aug. 2012</b>
|
||||
- "That Is No Orc Horn" is now allowing to heal a companion and liberate a site, rather than one of the effects.
|
||||
- "Aragorn's Bow, Ranger's Longbow" now correctly can wound minions that have their strength based off number of threats.
|
||||
|
||||
<b>1 Aug. 2012</b>
|
||||
- "Gorbag's Sword" now gives the option to put the possession on top of the deck to the owner of the card.
|
||||
|
||||
Reference in New Issue
Block a user