- "Southron Archer Legion" should now use the +4 limit for the entire phase.

This commit is contained in:
marcins78@gmail.com
2012-01-01 16:17:59 +00:00
parent 37cdfbeae0
commit e90dad8f3d
5 changed files with 19 additions and 9 deletions

View File

@@ -29,13 +29,7 @@ public class CardLimitEvaluator implements Evaluator {
private int evaluateOnce(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard cardAffected) {
LimitCounter limitCounter = _game.getModifiersEnvironment().getUntilEndOfPhaseLimitCounter(_source, _phase);
int internalResult = _evaluator.evaluateExpression(gameState, modifiersQuerying, cardAffected);
int availableBonusWithLimit = 0;
for (int i = 0; i < internalResult; i++) {
int limitResult = limitCounter.incrementCounter();
if (limitResult <= _limit)
availableBonusWithLimit++;
}
return availableBonusWithLimit;
return limitCounter.incrementToLimit(_limit, internalResult);
}
@Override

View File

@@ -10,6 +10,7 @@ import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.actions.ActivateCardAction;
import com.gempukku.lotro.logic.modifiers.LimitCounter;
import com.gempukku.lotro.logic.timing.Action;
import java.util.Collections;
@@ -40,10 +41,12 @@ public class Card6_080 extends AbstractMinion {
ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(
new RemoveTwilightEffect(3));
int bonus = Math.min(4, Filters.countActive(game.getGameState(), game.getModifiersQuerying(), CardType.COMPANION) - 4);
LimitCounter limitCounter = game.getModifiersEnvironment().getUntilEndOfPhaseLimitCounter(self, Phase.ARCHERY);
int bonus = Math.max(0, Filters.countActive(game.getGameState(), game.getModifiersQuerying(), CardType.COMPANION) - 4);
int archeryBonus = limitCounter.incrementToLimit(4, bonus);
action.appendEffect(
new AddUntilEndOfPhaseModifierEffect(
new ArcheryTotalModifier(self, Side.SHADOW, bonus), Phase.ARCHERY));
new ArcheryTotalModifier(self, Side.SHADOW, archeryBonus), Phase.ARCHERY));
return Collections.singletonList(action);
}
return null;

View File

@@ -8,4 +8,12 @@ public class DefaultLimitCounter implements LimitCounter {
_count++;
return _count;
}
@Override
public int incrementToLimit(int limit, int incrementBy) {
int maxIncrement = limit - _count;
int finalIncrement = Math.min(maxIncrement, incrementBy);
_count += finalIncrement;
return finalIncrement;
}
}

View File

@@ -2,4 +2,6 @@ package com.gempukku.lotro.logic.modifiers;
public interface LimitCounter {
public int incrementCounter();
public int incrementToLimit(int limit, int incrementBy);
}

View File

@@ -1,4 +1,7 @@
<pre style="font-size:80%">
<b>1 Jan. 2012</b>
- "Southron Archer Legion" should now use the +4 limit for the entire phase.
<b>29 Dec. 2011</b>
- "Till Durin Wakes Again" now allows to heal as many dwarves as you want, rather than just one.
- "All Thought Bent on It" now makes the FP player to exert the characters, rather than the Shadow player.