- 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 java.util.Collection;
import java.util.Map;
public class PlayConditions {
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)
&& 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) {
if (TriggerConditions.isGettingWounded(effect, game, self.getAttachedTo())
&& PlayConditions.isPhase(game, Phase.SKIRMISH)
&& PlayConditions.canRemoveTokens(game, Token.DWARVEN, 2, Filters.any)) {
&& PlayConditions.canRemoveTokensFromAnything(game, Token.DWARVEN, 2)) {
ActivateCardAction action = new ActivateCardAction(self);
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(
new PreventCardEffect((AbstractPreventableCardEffect) effect, self.getAttachedTo()));
return Collections.singletonList(action);

View File

@@ -61,10 +61,12 @@ public class Card13_010 extends AbstractAttachableFPPossession {
@Override
protected List<? extends Action> getExtraInPlayPhaseActions(String playerId, LotroGame game, PhysicalCard 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);
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(
new HealCharactersEffect(self, self.getAttachedTo()));
if (PlayConditions.canSpot(game, self.getAttachedTo(), Filters.inSkirmish)

View File

@@ -52,10 +52,12 @@ public class Card13_040 extends AbstractAttachableFPPossession {
@Override
protected List<? extends Action> getExtraInPlayPhaseActions(String playerId, LotroGame game, PhysicalCard 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);
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(
new ChooseAndWoundCharactersEffect(action, playerId, 1, 1, CardType.MINION, Filters.inSkirmishAgainst(self.getAttachedTo())));
return Collections.singletonList(action);

View File

@@ -62,10 +62,12 @@ public class Card13_048 extends AbstractAttachableFPPossession {
ResolveSkirmishEffect resolveEffect = (ResolveSkirmishEffect) effect;
if (resolveEffect.getUpcomingResult(game) == ResolveSkirmishEffect.Result.FELLOWSHIP_OVERWHELMED
&& 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);
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(
new AddUntilEndOfPhaseModifierEffect(
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) {
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.MANEUVER, self)
&& 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);
action.appendCost(
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Filters.hasAttached(self)));
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(
new ChooseAndWoundCharactersEffect(action, playerId, 1, 1, CardType.MINION));
return Collections.singletonList(action);

View File

@@ -49,10 +49,12 @@ public class Card13_126 extends AbstractAttachableFPPossession {
}
if (TriggerConditions.startOfPhase(game, effectResult, Phase.MANEUVER)
&& 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);
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(
new AddUntilStartOfPhaseModifierEffect(
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) {
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.SKIRMISH, self)
&& 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);
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(
new ChooseAndExhaustCharactersEffect(action, playerId, 1, 1, CardType.MINION, Filters.inSkirmishAgainst(Filters.hasAttached(self))));
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) {
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.REGROUP, self)
&& 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);
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(
new ChooseOpponentEffect(playerId) {
@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) {
if (TriggerConditions.startOfPhase(game, effectResult, Phase.MANEUVER)
&& 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);
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>();
possibleEffects.add(
new TakeControlOfASiteEffect(self, playerId));

View File

@@ -55,10 +55,14 @@ public class Card17_036 extends AbstractPermanent {
@Override
protected List<? extends Action> getExtraPhaseActions(String playerId, LotroGame game, PhysicalCard 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);
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(
new ChooseAndDiscardCardsFromPlayEffect(action, playerId, 1, 1, CardType.POSSESSION));
return Collections.singletonList(action);

View File

@@ -26,14 +26,16 @@ public class Card18_109 extends AbstractEvent {
@Override
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)
&& PlayConditions.canRemoveTokens(game, Token.SHIRE, 2, Filters.any);
&& PlayConditions.canRemoveTokensFromAnything(game, Token.SHIRE, 2);
}
@Override
public PlayEventAction getPlayCardAction(String playerId, LotroGame game, PhysicalCard self, int twilightModifier, boolean ignoreRoamingPenalty) {
PlayEventAction action = new PlayEventAction(self);
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(
new CancelSkirmishEffect(Filters.unboundCompanion, Race.HOBBIT));
return action;

View File

@@ -3,6 +3,7 @@
- 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.
- 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>
- "Pippin, Friend to Frodo" now prevents only Shadow player from discarding Tales, not the FP player, if a Shadow card