- Cards that remove culture tokens like "Throne of Minas Tirith", now allow to remove the tokens from multiple cards.

This commit is contained in:
marcins78@gmail.com
2012-06-02 19:26:45 +00:00
parent 41867e03d0
commit b6116878f5
13 changed files with 72 additions and 22 deletions

View File

@@ -12,6 +12,7 @@ import com.gempukku.lotro.logic.modifiers.ModifierFlag;
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying; import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
import java.util.Collection; import java.util.Collection;
import java.util.Map;
public class PlayConditions { public class PlayConditions {
public static boolean canPayForShadowCard(LotroGame game, PhysicalCard self, int withTwilightRemoved, int twilightModifier, boolean ignoreRoamingPenalty) { public static boolean canPayForShadowCard(LotroGame game, PhysicalCard self, int withTwilightRemoved, int twilightModifier, boolean ignoreRoamingPenalty) {
@@ -362,4 +363,26 @@ public class PlayConditions {
return !game.getModifiersQuerying().hasFlagActive(game.getGameState(), ModifierFlag.CANT_TOUCH_CULTURE_TOKENS) return !game.getModifiersQuerying().hasFlagActive(game.getGameState(), ModifierFlag.CANT_TOUCH_CULTURE_TOKENS)
&& Filters.filterActive(game.getGameState(), game.getModifiersQuerying(), Filters.and(fromFilters, Filters.hasToken(token, count))).size() > 0; && Filters.filterActive(game.getGameState(), game.getModifiersQuerying(), Filters.and(fromFilters, Filters.hasToken(token, count))).size() > 0;
} }
public static boolean canRemoveTokensFromAnything(LotroGame game, Token token, int count) {
if (count <= 0)
return true;
GameState gameState = game.getGameState();
if (game.getModifiersQuerying().hasFlagActive(gameState, ModifierFlag.CANT_TOUCH_CULTURE_TOKENS))
return false;
int total = 0;
for (PhysicalCard physicalCard : Filters.filterActive(gameState, game.getModifiersQuerying(), Filters.hasAnyCultureTokens(1))) {
for (Map.Entry<Token, Integer> tokenCountEntry : gameState.getTokens(physicalCard).entrySet()) {
if (tokenCountEntry.getKey() == token) {
total += tokenCountEntry.getValue();
if (total >= count)
return true;
}
}
}
return false;
}
} }

View File

@@ -63,10 +63,12 @@ public class Card13_001 extends AbstractAttachableFPPossession {
public List<? extends Action> getOptionalInPlayBeforeActions(String playerId, LotroGame game, Effect effect, PhysicalCard self) { public List<? extends Action> getOptionalInPlayBeforeActions(String playerId, LotroGame game, Effect effect, PhysicalCard self) {
if (TriggerConditions.isGettingWounded(effect, game, self.getAttachedTo()) if (TriggerConditions.isGettingWounded(effect, game, self.getAttachedTo())
&& PlayConditions.isPhase(game, Phase.SKIRMISH) && PlayConditions.isPhase(game, Phase.SKIRMISH)
&& PlayConditions.canRemoveTokens(game, Token.DWARVEN, 2, Filters.any)) { && PlayConditions.canRemoveTokensFromAnything(game, Token.DWARVEN, 2)) {
ActivateCardAction action = new ActivateCardAction(self); ActivateCardAction action = new ActivateCardAction(self);
action.appendCost( action.appendCost(
new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.DWARVEN, 2, Filters.any)); new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.DWARVEN, 1, Filters.any));
action.appendCost(
new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.DWARVEN, 1, Filters.any));
action.appendEffect( action.appendEffect(
new PreventCardEffect((AbstractPreventableCardEffect) effect, self.getAttachedTo())); new PreventCardEffect((AbstractPreventableCardEffect) effect, self.getAttachedTo()));
return Collections.singletonList(action); return Collections.singletonList(action);

View File

@@ -61,10 +61,12 @@ public class Card13_010 extends AbstractAttachableFPPossession {
@Override @Override
protected List<? extends Action> getExtraInPlayPhaseActions(String playerId, LotroGame game, PhysicalCard self) { protected List<? extends Action> getExtraInPlayPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.SKIRMISH, self) if (PlayConditions.canUseFPCardDuringPhase(game, Phase.SKIRMISH, self)
&& PlayConditions.canRemoveTokens(game, Token.ELVEN, 2, Filters.any)) { && PlayConditions.canRemoveTokensFromAnything(game, Token.ELVEN, 2)) {
ActivateCardAction action = new ActivateCardAction(self); ActivateCardAction action = new ActivateCardAction(self);
action.appendCost( action.appendCost(
new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.ELVEN, 2, Filters.any)); new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.ELVEN, 1, Filters.any));
action.appendCost(
new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.ELVEN, 1, Filters.any));
action.appendEffect( action.appendEffect(
new HealCharactersEffect(self, self.getAttachedTo())); new HealCharactersEffect(self, self.getAttachedTo()));
if (PlayConditions.canSpot(game, self.getAttachedTo(), Filters.inSkirmish) if (PlayConditions.canSpot(game, self.getAttachedTo(), Filters.inSkirmish)

View File

@@ -52,10 +52,12 @@ public class Card13_040 extends AbstractAttachableFPPossession {
@Override @Override
protected List<? extends Action> getExtraInPlayPhaseActions(String playerId, LotroGame game, PhysicalCard self) { protected List<? extends Action> getExtraInPlayPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.SKIRMISH, self) if (PlayConditions.canUseFPCardDuringPhase(game, Phase.SKIRMISH, self)
&& PlayConditions.canRemoveTokens(game, Token.GANDALF, 2, Filters.any)) { && PlayConditions.canRemoveTokensFromAnything(game, Token.GANDALF, 2)) {
ActivateCardAction action = new ActivateCardAction(self); ActivateCardAction action = new ActivateCardAction(self);
action.appendCost( action.appendCost(
new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.GANDALF, 2, Filters.any)); new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.GANDALF, 1, Filters.any));
action.appendCost(
new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.GANDALF, 1, Filters.any));
action.appendEffect( action.appendEffect(
new ChooseAndWoundCharactersEffect(action, playerId, 1, 1, CardType.MINION, Filters.inSkirmishAgainst(self.getAttachedTo()))); new ChooseAndWoundCharactersEffect(action, playerId, 1, 1, CardType.MINION, Filters.inSkirmishAgainst(self.getAttachedTo())));
return Collections.singletonList(action); return Collections.singletonList(action);

View File

@@ -62,10 +62,12 @@ public class Card13_048 extends AbstractAttachableFPPossession {
ResolveSkirmishEffect resolveEffect = (ResolveSkirmishEffect) effect; ResolveSkirmishEffect resolveEffect = (ResolveSkirmishEffect) effect;
if (resolveEffect.getUpcomingResult(game) == ResolveSkirmishEffect.Result.FELLOWSHIP_OVERWHELMED if (resolveEffect.getUpcomingResult(game) == ResolveSkirmishEffect.Result.FELLOWSHIP_OVERWHELMED
&& game.getGameState().getSkirmish().getFellowshipCharacter() == self.getAttachedTo()) { && game.getGameState().getSkirmish().getFellowshipCharacter() == self.getAttachedTo()) {
if (PlayConditions.canRemoveTokens(game, Token.GOLLUM, 2, Filters.any)) { if (PlayConditions.canRemoveTokensFromAnything(game, Token.GOLLUM, 2)) {
ActivateCardAction action = new ActivateCardAction(self); ActivateCardAction action = new ActivateCardAction(self);
action.appendCost( action.appendCost(
new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.GOLLUM, 2, Filters.any)); new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.GOLLUM, 1, Filters.any));
action.appendCost(
new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.GOLLUM, 1, Filters.any));
action.appendEffect( action.appendEffect(
new AddUntilEndOfPhaseModifierEffect( new AddUntilEndOfPhaseModifierEffect(
new StrengthModifier(self, Filters.hasAttached(self), 2), Phase.SKIRMISH)); new StrengthModifier(self, Filters.hasAttached(self), 2), Phase.SKIRMISH));

View File

@@ -53,12 +53,14 @@ public class Card13_063 extends AbstractAttachableFPPossession {
protected List<? extends Action> getExtraInPlayPhaseActions(String playerId, LotroGame game, PhysicalCard self) { protected List<? extends Action> getExtraInPlayPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.MANEUVER, self) if (PlayConditions.canUseFPCardDuringPhase(game, Phase.MANEUVER, self)
&& PlayConditions.canExert(self, game, self.getAttachedTo()) && PlayConditions.canExert(self, game, self.getAttachedTo())
&& PlayConditions.canRemoveTokens(game, Token.GONDOR, 2, Filters.any)) { && PlayConditions.canRemoveTokensFromAnything(game, Token.GONDOR, 2)) {
ActivateCardAction action = new ActivateCardAction(self); ActivateCardAction action = new ActivateCardAction(self);
action.appendCost( action.appendCost(
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Filters.hasAttached(self))); new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Filters.hasAttached(self)));
action.appendCost( action.appendCost(
new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.GONDOR, 2, Filters.any)); new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.GONDOR, 1, Filters.any));
action.appendCost(
new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.GONDOR, 1, Filters.any));
action.appendEffect( action.appendEffect(
new ChooseAndWoundCharactersEffect(action, playerId, 1, 1, CardType.MINION)); new ChooseAndWoundCharactersEffect(action, playerId, 1, 1, CardType.MINION));
return Collections.singletonList(action); return Collections.singletonList(action);

View File

@@ -49,10 +49,12 @@ public class Card13_126 extends AbstractAttachableFPPossession {
} }
if (TriggerConditions.startOfPhase(game, effectResult, Phase.MANEUVER) if (TriggerConditions.startOfPhase(game, effectResult, Phase.MANEUVER)
&& self.getAttachedTo().getBlueprint().getName().equals(Names.eomer) && self.getAttachedTo().getBlueprint().getName().equals(Names.eomer)
&& PlayConditions.canRemoveTokens(game, Token.ROHAN, 2, Filters.any)) { && PlayConditions.canRemoveTokensFromAnything(game, Token.ROHAN, 2)) {
OptionalTriggerAction action = new OptionalTriggerAction(self); OptionalTriggerAction action = new OptionalTriggerAction(self);
action.appendCost( action.appendCost(
new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.ROHAN, 2, Filters.any)); new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.ROHAN, 1, Filters.any));
action.appendCost(
new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.ROHAN, 1, Filters.any));
action.appendEffect( action.appendEffect(
new AddUntilStartOfPhaseModifierEffect( new AddUntilStartOfPhaseModifierEffect(
new KeywordModifier(self, self.getAttachedTo(), Keyword.DEFENDER, 1), Phase.REGROUP)); new KeywordModifier(self, self.getAttachedTo(), Keyword.DEFENDER, 1), Phase.REGROUP));

View File

@@ -62,10 +62,12 @@ public class Card13_136 extends AbstractAttachableFPPossession {
protected List<? extends Action> getExtraInPlayPhaseActions(String playerId, LotroGame game, PhysicalCard self) { protected List<? extends Action> getExtraInPlayPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.SKIRMISH, self) if (PlayConditions.canUseFPCardDuringPhase(game, Phase.SKIRMISH, self)
&& self.getAttachedTo().getBlueprint().getName().equals(Names.theoden) && self.getAttachedTo().getBlueprint().getName().equals(Names.theoden)
&& PlayConditions.canRemoveTokens(game, Token.ROHAN, 2, Filters.any)) { && PlayConditions.canRemoveTokensFromAnything(game, Token.ROHAN, 2)) {
ActivateCardAction action = new ActivateCardAction(self); ActivateCardAction action = new ActivateCardAction(self);
action.appendCost( action.appendCost(
new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.ROHAN, 2, Filters.any)); new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.ROHAN, 1, Filters.any));
action.appendCost(
new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.ROHAN, 1, Filters.any));
action.appendEffect( action.appendEffect(
new ChooseAndExhaustCharactersEffect(action, playerId, 1, 1, CardType.MINION, Filters.inSkirmishAgainst(Filters.hasAttached(self)))); new ChooseAndExhaustCharactersEffect(action, playerId, 1, 1, CardType.MINION, Filters.inSkirmishAgainst(Filters.hasAttached(self))));
return Collections.singletonList(action); return Collections.singletonList(action);

View File

@@ -53,10 +53,12 @@ public class Card13_143 extends AbstractAttachableFPPossession {
protected List<? extends Action> getExtraInPlayPhaseActions(String playerId, LotroGame game, PhysicalCard self) { protected List<? extends Action> getExtraInPlayPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.REGROUP, self) if (PlayConditions.canUseFPCardDuringPhase(game, Phase.REGROUP, self)
&& PlayConditions.canSpot(game, 2, CardType.MINION) && PlayConditions.canSpot(game, 2, CardType.MINION)
&& PlayConditions.canRemoveTokens(game, Token.SHIRE, 2, Filters.any)) { && PlayConditions.canRemoveTokensFromAnything(game, Token.SHIRE, 2)) {
final ActivateCardAction action = new ActivateCardAction(self); final ActivateCardAction action = new ActivateCardAction(self);
action.appendCost( action.appendCost(
new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.SHIRE, 2, Filters.any)); new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.SHIRE, 1, Filters.any));
action.appendCost(
new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.SHIRE, 1, Filters.any));
action.appendEffect( action.appendEffect(
new ChooseOpponentEffect(playerId) { new ChooseOpponentEffect(playerId) {
@Override @Override

View File

@@ -41,10 +41,14 @@ public class Card15_176 extends AbstractMinion {
public List<OptionalTriggerAction> getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) { public List<OptionalTriggerAction> getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (TriggerConditions.startOfPhase(game, effectResult, Phase.MANEUVER) if (TriggerConditions.startOfPhase(game, effectResult, Phase.MANEUVER)
&& PlayConditions.canSpot(game, Filters.not(self), Culture.URUK_HAI, CardType.MINION) && PlayConditions.canSpot(game, Filters.not(self), Culture.URUK_HAI, CardType.MINION)
&& PlayConditions.canRemoveTokens(game, Token.URUK_HAI, 3, Filters.any)) { && PlayConditions.canRemoveTokensFromAnything(game, Token.URUK_HAI, 3)) {
OptionalTriggerAction action = new OptionalTriggerAction(self); OptionalTriggerAction action = new OptionalTriggerAction(self);
action.appendCost( action.appendCost(
new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.URUK_HAI, 3, Filters.any)); new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.URUK_HAI, 1, Filters.any));
action.appendCost(
new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.URUK_HAI, 1, Filters.any));
action.appendCost(
new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.URUK_HAI, 1, Filters.any));
List<Effect> possibleEffects = new LinkedList<Effect>(); List<Effect> possibleEffects = new LinkedList<Effect>();
possibleEffects.add( possibleEffects.add(
new TakeControlOfASiteEffect(self, playerId)); new TakeControlOfASiteEffect(self, playerId));

View File

@@ -55,10 +55,14 @@ public class Card17_036 extends AbstractPermanent {
@Override @Override
protected List<? extends Action> getExtraPhaseActions(String playerId, LotroGame game, PhysicalCard self) { protected List<? extends Action> getExtraPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.SKIRMISH, self) if (PlayConditions.canUseFPCardDuringPhase(game, Phase.SKIRMISH, self)
&& PlayConditions.canRemoveTokens(game, Token.GONDOR, 3, Filters.any)) { && PlayConditions.canRemoveTokensFromAnything(game, Token.GONDOR, 3)) {
ActivateCardAction action = new ActivateCardAction(self); ActivateCardAction action = new ActivateCardAction(self);
action.appendCost( action.appendCost(
new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.GONDOR, 3, Filters.any)); new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.GONDOR, 1, Filters.any));
action.appendCost(
new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.GONDOR, 1, Filters.any));
action.appendCost(
new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.GONDOR, 1, Filters.any));
action.appendEffect( action.appendEffect(
new ChooseAndDiscardCardsFromPlayEffect(action, playerId, 1, 1, CardType.POSSESSION)); new ChooseAndDiscardCardsFromPlayEffect(action, playerId, 1, 1, CardType.POSSESSION));
return Collections.singletonList(action); return Collections.singletonList(action);

View File

@@ -26,14 +26,16 @@ public class Card18_109 extends AbstractEvent {
@Override @Override
public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int withTwilightRemoved, int twilightModifier, boolean ignoreRoamingPenalty, boolean ignoreCheckingDeadPile) { public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int withTwilightRemoved, int twilightModifier, boolean ignoreRoamingPenalty, boolean ignoreCheckingDeadPile) {
return super.checkPlayRequirements(playerId, game, self, withTwilightRemoved, twilightModifier, ignoreRoamingPenalty, ignoreCheckingDeadPile) return super.checkPlayRequirements(playerId, game, self, withTwilightRemoved, twilightModifier, ignoreRoamingPenalty, ignoreCheckingDeadPile)
&& PlayConditions.canRemoveTokens(game, Token.SHIRE, 2, Filters.any); && PlayConditions.canRemoveTokensFromAnything(game, Token.SHIRE, 2);
} }
@Override @Override
public PlayEventAction getPlayCardAction(String playerId, LotroGame game, PhysicalCard self, int twilightModifier, boolean ignoreRoamingPenalty) { public PlayEventAction getPlayCardAction(String playerId, LotroGame game, PhysicalCard self, int twilightModifier, boolean ignoreRoamingPenalty) {
PlayEventAction action = new PlayEventAction(self); PlayEventAction action = new PlayEventAction(self);
action.appendCost( action.appendCost(
new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.SHIRE, 2, Filters.any)); new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.SHIRE, 1, Filters.any));
action.appendCost(
new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, Token.SHIRE, 1, Filters.any));
action.appendEffect( action.appendEffect(
new CancelSkirmishEffect(Filters.unboundCompanion, Race.HOBBIT)); new CancelSkirmishEffect(Filters.unboundCompanion, Race.HOBBIT));
return action; return action;

View File

@@ -3,6 +3,7 @@
- The drop-downs for deck and format in Game Hall no longer reset periodically. - The drop-downs for deck and format in Game Hall no longer reset periodically.
- The formats for each week in League tab are now clickable to show the details for the format. - The formats for each week in League tab are now clickable to show the details for the format.
- Attached cards which have cars attached (like in case of "Whisper in the Dark") now should be displayed proparly. - Attached cards which have cars attached (like in case of "Whisper in the Dark") now should be displayed proparly.
- Cards that remove culture tokens like "Throne of Minas Tirith", now allow to remove the tokens from multiple cards.
<b>30 May 2012</b> <b>30 May 2012</b>
- "Pippin, Friend to Frodo" now prevents only Shadow player from discarding Tales, not the FP player, if a Shadow card - "Pippin, Friend to Frodo" now prevents only Shadow player from discarding Tales, not the FP player, if a Shadow card