Fixing how limit works.

This commit is contained in:
marcins78@gmail.com
2011-11-10 00:37:40 +00:00
parent 3c877074be
commit d0fcad732e
9 changed files with 46 additions and 38 deletions

View File

@@ -3,8 +3,8 @@ package com.gempukku.lotro.cards.set1.isengard;
import com.gempukku.lotro.cards.AbstractMinion;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.AddUntilEndOfPhaseModifierEffect;
import com.gempukku.lotro.cards.effects.CheckLimitEffect;
import com.gempukku.lotro.cards.effects.RemoveTwilightEffect;
import com.gempukku.lotro.cards.modifiers.evaluator.CardLimitEvaluator;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.common.Phase;
@@ -14,6 +14,7 @@ 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.StrengthModifier;
import com.gempukku.lotro.logic.modifiers.evaluator.ConstantEvaluator;
import com.gempukku.lotro.logic.timing.Action;
import java.util.Collections;
@@ -42,9 +43,10 @@ public class Card1_153 extends AbstractMinion {
final ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(new RemoveTwilightEffect(1));
action.appendEffect(
new CheckLimitEffect(action, self, 3, Phase.SKIRMISH,
new AddUntilEndOfPhaseModifierEffect(
new StrengthModifier(self, Filters.sameCard(self), 1), Phase.SKIRMISH)));
new AddUntilEndOfPhaseModifierEffect(
new StrengthModifier(self, Filters.sameCard(self), null,
new CardLimitEvaluator(game, self, Phase.SKIRMISH, 3,
new ConstantEvaluator(1))), Phase.SKIRMISH));
return Collections.singletonList(action);
}

View File

@@ -3,8 +3,8 @@ package com.gempukku.lotro.cards.set1.sauron;
import com.gempukku.lotro.cards.AbstractAttachable;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.AddUntilEndOfPhaseModifierEffect;
import com.gempukku.lotro.cards.effects.CheckLimitEffect;
import com.gempukku.lotro.cards.effects.RemoveTwilightEffect;
import com.gempukku.lotro.cards.modifiers.evaluator.CardLimitEvaluator;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.filters.Filter;
import com.gempukku.lotro.filters.Filters;
@@ -13,6 +13,7 @@ import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.actions.ActivateCardAction;
import com.gempukku.lotro.logic.modifiers.Modifier;
import com.gempukku.lotro.logic.modifiers.StrengthModifier;
import com.gempukku.lotro.logic.modifiers.evaluator.ConstantEvaluator;
import com.gempukku.lotro.logic.timing.Action;
import java.util.Collections;
@@ -49,9 +50,9 @@ public class Card1_269 extends AbstractAttachable {
action.appendCost(
new RemoveTwilightEffect(1));
action.appendEffect(
new CheckLimitEffect(action, self, 3, Phase.SKIRMISH,
new AddUntilEndOfPhaseModifierEffect(
new StrengthModifier(self, Filters.sameCard(self.getAttachedTo()), 1), Phase.SKIRMISH)));
new AddUntilEndOfPhaseModifierEffect(
new StrengthModifier(self, Filters.sameCard(self.getAttachedTo()), null,
new CardLimitEvaluator(game, self, Phase.SKIRMISH, 3, new ConstantEvaluator(1))), Phase.SKIRMISH));
return Collections.singletonList(action);
}
return null;

View File

@@ -3,8 +3,8 @@ package com.gempukku.lotro.cards.set1.wraith;
import com.gempukku.lotro.cards.AbstractMinion;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.AddUntilEndOfPhaseModifierEffect;
import com.gempukku.lotro.cards.effects.CheckLimitEffect;
import com.gempukku.lotro.cards.effects.RemoveTwilightEffect;
import com.gempukku.lotro.cards.modifiers.evaluator.CardLimitEvaluator;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.common.Phase;
@@ -14,6 +14,7 @@ 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.StrengthModifier;
import com.gempukku.lotro.logic.modifiers.evaluator.ConstantEvaluator;
import com.gempukku.lotro.logic.timing.Action;
import java.util.Collections;
@@ -42,9 +43,9 @@ public class Card1_229 extends AbstractMinion {
ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(new RemoveTwilightEffect(1));
action.appendEffect(
new CheckLimitEffect(action, self, 5, Phase.SKIRMISH,
new AddUntilEndOfPhaseModifierEffect(
new StrengthModifier(self, Filters.sameCard(self), 1), Phase.SKIRMISH)));
new AddUntilEndOfPhaseModifierEffect(
new StrengthModifier(self, Filters.sameCard(self), null,
new CardLimitEvaluator(game, self, Phase.SKIRMISH, 5, new ConstantEvaluator(1))), Phase.SKIRMISH));
return Collections.singletonList(action);
}
return null;

View File

@@ -4,6 +4,8 @@ import com.gempukku.lotro.cards.AbstractPermanent;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.AddUntilEndOfPhaseModifierEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
import com.gempukku.lotro.cards.modifiers.evaluator.CardLimitEvaluator;
import com.gempukku.lotro.cards.modifiers.evaluator.CountSpottableEvaluator;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
@@ -41,11 +43,11 @@ public class Card3_035 extends AbstractPermanent {
new ChooseActiveCardEffect(self, playerId, "Chooose a companion", Filters.type(CardType.COMPANION)) {
@Override
protected void cardSelected(LotroGame game, PhysicalCard card) {
int gandalfSignet = Filters.countSpottable(game.getGameState(), game.getModifiersQuerying(), new com.gempukku.lotro.filters.Filter[]{Filters.type(CardType.COMPANION), Filters.signet(Signet.GANDALF)});
int bonus = Math.min(3, gandalfSignet);
action.insertEffect(
new AddUntilEndOfPhaseModifierEffect(
new StrengthModifier(self, Filters.sameCard(card), bonus), Phase.SKIRMISH));
new StrengthModifier(self, Filters.sameCard(card), null,
new CardLimitEvaluator(game, self, Phase.SKIRMISH, 3,
new CountSpottableEvaluator(CardType.COMPANION, Signet.GANDALF))), Phase.SKIRMISH));
}
});
return Collections.singletonList(action);

View File

@@ -53,7 +53,7 @@ public class Card4_082 extends AbstractPermanent {
new ChooseActiveCardEffect(self, playerId, "Choose minion", Filters.type(CardType.MINION), Filters.inSkirmishAgainst(Filters.race(Race.ELF))) {
@Override
protected void cardSelected(LotroGame game, PhysicalCard card) {
int bonus = -game.getGameState().getTokenCount(self, Token.ELVEN);
int bonus = Math.max(-3, -game.getGameState().getTokenCount(self, Token.ELVEN));
action.insertEffect(
new AddUntilEndOfPhaseModifierEffect(
new StrengthModifier(self, Filters.sameCard(card), bonus), Phase.SKIRMISH));

View File

@@ -45,23 +45,23 @@ public class Card4_365 extends AbstractCompanion {
final Filter additionalAttachmentFilter = Filters.and(Culture.ROHAN, CardType.COMPANION);
final ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(
new CheckLimitEffect(action, self, 1, Phase.FELLOWSHIP,
new ChooseArbitraryCardsEffect(playerId, "Choose card to play", game.getGameState().getHand(playerId),
Filters.and(
Culture.ROHAN,
CardType.POSSESSION,
ExtraFilters.attachableTo(game, additionalAttachmentFilter)), 1, 1) {
@Override
protected void cardsSelected(LotroGame game, Collection<PhysicalCard> selectedCards) {
if (selectedCards.size() > 0) {
PhysicalCard selectedCard = selectedCards.iterator().next();
AttachPermanentAction attachPermanentAction = ((AbstractAttachable) selectedCard.getBlueprint()).getPlayCardAction(playerId, game, selectedCard, additionalAttachmentFilter, 0);
game.getActionsEnvironment().addActionToStack(attachPermanentAction);
action.appendEffect(
new AppendHealTargetEffect(action, attachPermanentAction));
}
}
}));
new ChooseArbitraryCardsEffect(playerId, "Choose card to play", game.getGameState().getHand(playerId),
Filters.and(
Culture.ROHAN,
CardType.POSSESSION,
ExtraFilters.attachableTo(game, additionalAttachmentFilter)), 1, 1) {
@Override
protected void cardsSelected(LotroGame game, Collection<PhysicalCard> selectedCards) {
if (selectedCards.size() > 0) {
PhysicalCard selectedCard = selectedCards.iterator().next();
AttachPermanentAction attachPermanentAction = ((AbstractAttachable) selectedCard.getBlueprint()).getPlayCardAction(playerId, game, selectedCard, additionalAttachmentFilter, 0);
game.getActionsEnvironment().addActionToStack(attachPermanentAction);
action.appendEffect(
new CheckLimitEffect(action, self, 1, Phase.FELLOWSHIP,
new AppendHealTargetEffect(action, attachPermanentAction)));
}
}
});
return Collections.singletonList(action);
}
return null;

View File

@@ -44,7 +44,7 @@ public class Card4_305 extends AbstractPermanent {
@Override
protected List<? extends Action> getExtraPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
if (PlayConditions.canUseFPCardDuringPhase(game.getGameState(), Phase.FELLOWSHIP, self)) {
int tokenCount = game.getGameState().getTokenCount(self, Token.SHIRE);
int tokenCount = Math.min(3, game.getGameState().getTokenCount(self, Token.SHIRE));
ActivateCardAction action = new ActivateCardAction(self);
for (int i = 0; i < tokenCount; i++)
action.appendEffect(

View File

@@ -3,7 +3,7 @@ package com.gempukku.lotro.cards.set6.rohan;
import com.gempukku.lotro.cards.AbstractCompanion;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.AddUntilEndOfPhaseModifierEffect;
import com.gempukku.lotro.cards.effects.CheckLimitEffect;
import com.gempukku.lotro.cards.modifiers.evaluator.CardLimitEvaluator;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Phase;
@@ -14,6 +14,7 @@ import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.actions.ActivateCardAction;
import com.gempukku.lotro.logic.effects.ChooseAndHealCharactersEffect;
import com.gempukku.lotro.logic.modifiers.StrengthModifier;
import com.gempukku.lotro.logic.modifiers.evaluator.ConstantEvaluator;
import java.util.Collections;
import java.util.List;
@@ -49,9 +50,9 @@ public class Card6_095 extends AbstractCompanion {
action.appendCost(
new ChooseAndHealCharactersEffect(action, playerId, 1, 1, CardType.MINION, Filters.inSkirmishAgainst(self)));
action.appendEffect(
new CheckLimitEffect(action, self, 1, Phase.SKIRMISH,
new AddUntilEndOfPhaseModifierEffect(
new StrengthModifier(self, self, 3), Phase.SKIRMISH)));
new AddUntilEndOfPhaseModifierEffect(
new StrengthModifier(self, self, null,
new CardLimitEvaluator(game, self, Phase.SKIRMISH, 3, new ConstantEvaluator(3))), Phase.SKIRMISH));
return Collections.singletonList(action);
}
return null;

View File

@@ -41,6 +41,7 @@ public class Card7_051 extends AbstractEvent {
new ForEachTwilightTokenYouSpotEffect(playerId) {
@Override
protected void twilightTokensSpotted(int twilightTokens) {
twilightTokens = Math.min(8, twilightTokens);
action.insertEffect(
new ChooseAndAddUntilEOPStrengthBonusEffect(action, self, playerId, twilightTokens, Filters.gandalf));
}