- "Eregion's Trails" now makes a snapshot of affected cards upon being played and does not apply to any other cards.

This commit is contained in:
marcins78
2013-02-12 10:23:55 +00:00
parent b00f2b017c
commit 1075420e45
3 changed files with 59 additions and 8 deletions

View File

@@ -1,4 +1,7 @@
<pre style="font-size:80%">
<b>12 Feb. 2013</b>
- "Eregion's Trails" now makes a snapshot of affected cards upon being played and does not apply to any other cards.
<b>05 Feb. 2013</b>
- "Throne of the Dark Lord" should now correctly apply the resistance penalty.

View File

@@ -0,0 +1,51 @@
package com.gempukku.lotro.cards.effects;
import com.gempukku.lotro.common.Filterable;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.modifiers.StrengthModifier;
import com.gempukku.lotro.logic.modifiers.evaluator.Evaluator;
import com.gempukku.lotro.logic.timing.AbstractEffect;
public class SnapshotAndApplyStrengthModifierUntilStartOfPhaseEffect extends AbstractEffect {
private PhysicalCard _source;
private Filterable[] _filters;
private Evaluator _evaluator;
private Phase _phase;
public SnapshotAndApplyStrengthModifierUntilStartOfPhaseEffect(PhysicalCard source, Evaluator evaluator, Phase phase, Filterable... filter) {
_source = source;
_evaluator = evaluator;
_phase = phase;
_filters = filter;
}
@Override
public String getText(LotroGame game) {
return "Apply strength modifier";
}
@Override
protected FullEffectResult playEffectReturningResult(LotroGame game) {
for (PhysicalCard physicalCard : Filters.filterActive(game.getGameState(), game.getModifiersQuerying(), _filters)) {
final int modifier = _evaluator.evaluateExpression(game.getGameState(), game.getModifiersQuerying(), physicalCard);
if (modifier != 0)
game.getModifiersEnvironment().addUntilStartOfPhaseModifier(
new StrengthModifier(_source, physicalCard, modifier), _phase);
}
return new FullEffectResult(true);
}
@Override
public Type getType() {
return null;
}
@Override
public boolean isPlayableInFull(LotroGame game) {
return true;
}
}

View File

@@ -3,15 +3,12 @@ package com.gempukku.lotro.cards.set1.gondor;
import com.gempukku.lotro.cards.AbstractOldEvent;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.actions.PlayEventAction;
import com.gempukku.lotro.cards.effects.AddUntilStartOfPhaseModifierEffect;
import com.gempukku.lotro.cards.effects.SnapshotAndApplyStrengthModifierUntilStartOfPhaseEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.Side;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.modifiers.StrengthModifier;
import com.gempukku.lotro.logic.modifiers.evaluator.ConstantEvaluator;
/**
* Set: The Fellowship of the Ring
@@ -38,8 +35,8 @@ public class Card1_104 extends AbstractOldEvent {
action.appendCost(
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Keyword.RANGER));
action.appendEffect(
new AddUntilStartOfPhaseModifierEffect(
new StrengthModifier(self, Keyword.ROAMING, -3), Phase.REGROUP));
new SnapshotAndApplyStrengthModifierUntilStartOfPhaseEffect(
self, new ConstantEvaluator(-3), Phase.REGROUP, CardType.MINION, Keyword.ROAMING));
return action;
}