Fixed - "Underground Lake"
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
package com.gempukku.lotro.cards.effects;
|
||||
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.logic.actions.SubAction;
|
||||
import com.gempukku.lotro.logic.timing.Action;
|
||||
import com.gempukku.lotro.logic.timing.Effect;
|
||||
import com.gempukku.lotro.logic.timing.UnrespondableEffect;
|
||||
|
||||
public class CheckTurnLimitPerPlayerEffect extends UnrespondableEffect {
|
||||
private Action _action;
|
||||
private PhysicalCard _card;
|
||||
private String _playerId;
|
||||
private int _limit;
|
||||
private Effect _limitedEffect;
|
||||
|
||||
public CheckTurnLimitPerPlayerEffect(Action action, PhysicalCard card, String playerId, int limit, Effect limitedEffect) {
|
||||
_card = card;
|
||||
this._playerId = playerId;
|
||||
_limit = limit;
|
||||
_limitedEffect = limitedEffect;
|
||||
_action = action;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doPlayEffect(LotroGame game) {
|
||||
int incrementedBy = game.getModifiersQuerying().getUntilEndOfTurnLimitCounter(_card, _playerId +"-").incrementToLimit(_limit, 1);
|
||||
if (incrementedBy > 0) {
|
||||
SubAction subAction = new SubAction(_action);
|
||||
subAction.appendEffect(
|
||||
_limitedEffect);
|
||||
game.getActionsEnvironment().addActionToStack(subAction);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.gempukku.lotro.cards.set31.site;
|
||||
import com.gempukku.lotro.cards.AbstractSite;
|
||||
import com.gempukku.lotro.cards.PlayConditions;
|
||||
import com.gempukku.lotro.cards.effects.CheckTurnLimitEffect;
|
||||
import com.gempukku.lotro.cards.effects.CheckTurnLimitPerPlayerEffect;
|
||||
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
|
||||
import com.gempukku.lotro.cards.effects.choose.ChooseAndPlayCardFromDeckEffect;
|
||||
import com.gempukku.lotro.common.*;
|
||||
@@ -34,10 +35,8 @@ public class Card31_048 extends AbstractSite {
|
||||
public List<? extends Action> getPhaseActions(final String playerId, final LotroGame game, final PhysicalCard self) {
|
||||
if (PlayConditions.canUseSiteDuringPhase(game, Phase.MANEUVER, self)) {
|
||||
final ActivateCardAction action = new ActivateCardAction(self);
|
||||
action.appendEffect(new CheckTurnLimitEffect(action, self, 1,
|
||||
new ChooseAndPlayCardFromDeckEffect(playerId, Side.FREE_PEOPLE, Filters.name("The One Ring"))));
|
||||
action.appendEffect(new CheckTurnLimitEffect(action, self, 1,
|
||||
new ChooseAndPlayCardFromDeckEffect(playerId, Side.SHADOW, CardType.CONDITION)));
|
||||
action.appendEffect(new CheckTurnLimitPerPlayerEffect(action, self, playerId, 1,
|
||||
new ChooseAndPlayCardFromDeckEffect(playerId, Filters.or(Filters.and(Side.SHADOW, CardType.CONDITION), Filters.name("The One Ring")))));
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -22,7 +22,7 @@ public class ModifiersLogic implements ModifiersEnvironment, ModifiersQuerying {
|
||||
|
||||
private Map<Phase, Map<String, LimitCounter>> _endOfPhaseLimitCounters = new HashMap<Phase, Map<String, LimitCounter>>();
|
||||
private Map<Phase, Map<String, LimitCounter>> _startOfPhaseLimitCounters = new HashMap<Phase, Map<String, LimitCounter>>();
|
||||
private Map<Integer, LimitCounter> _turnLimitCounters = new HashMap<Integer, LimitCounter>();
|
||||
private Map<String, LimitCounter> _turnLimitCounters = new HashMap<String, LimitCounter>();
|
||||
|
||||
private int _drawnThisPhaseCount = 0;
|
||||
private Map<Integer, Integer> _woundsPerPhaseMap = new HashMap<Integer, Integer>();
|
||||
@@ -69,10 +69,15 @@ public class ModifiersLogic implements ModifiersEnvironment, ModifiersQuerying {
|
||||
|
||||
@Override
|
||||
public LimitCounter getUntilEndOfTurnLimitCounter(PhysicalCard card) {
|
||||
return getUntilEndOfTurnLimitCounter(card, "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public LimitCounter getUntilEndOfTurnLimitCounter(PhysicalCard card, String prefix) {
|
||||
LimitCounter limitCounter = _turnLimitCounters.get(card.getCardId());
|
||||
if (limitCounter == null) {
|
||||
limitCounter = new DefaultLimitCounter();
|
||||
_turnLimitCounters.put(card.getCardId(), limitCounter);
|
||||
_turnLimitCounters.put(prefix + card.getCardId(), limitCounter);
|
||||
}
|
||||
return limitCounter;
|
||||
}
|
||||
|
||||
@@ -24,6 +24,8 @@ public interface ModifiersQuerying {
|
||||
|
||||
public LimitCounter getUntilEndOfTurnLimitCounter(PhysicalCard card);
|
||||
|
||||
public LimitCounter getUntilEndOfTurnLimitCounter(PhysicalCard card, String prefix);
|
||||
|
||||
public Collection<Modifier> getModifiersAffecting(GameState gameState, PhysicalCard card);
|
||||
|
||||
public Evaluator getFpStrengthOverrideEvaluator(GameState gameState, PhysicalCard fpCharacter);
|
||||
|
||||
Reference in New Issue
Block a user