Simlifying code.
This commit is contained in:
@@ -4,6 +4,7 @@ import com.gempukku.lotro.common.Filterable;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.GameState;
|
||||
import com.gempukku.lotro.logic.modifiers.AbstractModifier;
|
||||
import com.gempukku.lotro.logic.modifiers.Condition;
|
||||
import com.gempukku.lotro.logic.modifiers.ModifierEffect;
|
||||
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
|
||||
|
||||
@@ -15,6 +16,11 @@ public class RoamingPenaltyModifier extends AbstractModifier {
|
||||
_modifier = modifier;
|
||||
}
|
||||
|
||||
public RoamingPenaltyModifier(PhysicalCard source, Filterable affectFilter, Condition condition, int modifier) {
|
||||
super(source, "Roaming penalty " + ((modifier > 0) ? ("+" + modifier) : modifier), affectFilter, condition, ModifierEffect.TWILIGHT_COST_MODIFIER);
|
||||
_modifier = modifier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRoamingPenaltyModifier(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) {
|
||||
return _modifier;
|
||||
|
||||
@@ -2,16 +2,14 @@ package com.gempukku.lotro.cards.set1.elven;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractAttachableFPPossession;
|
||||
import com.gempukku.lotro.cards.effects.SelfDiscardEffect;
|
||||
import com.gempukku.lotro.cards.modifiers.conditions.LocationCondition;
|
||||
import com.gempukku.lotro.common.*;
|
||||
import com.gempukku.lotro.filters.Filter;
|
||||
import com.gempukku.lotro.filters.Filters;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.GameState;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.logic.actions.RequiredTriggerAction;
|
||||
import com.gempukku.lotro.logic.modifiers.Condition;
|
||||
import com.gempukku.lotro.logic.modifiers.Modifier;
|
||||
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
|
||||
import com.gempukku.lotro.logic.modifiers.StrengthModifier;
|
||||
import com.gempukku.lotro.logic.timing.EffectResult;
|
||||
|
||||
@@ -50,12 +48,7 @@ public class Card1_031 extends AbstractAttachableFPPossession {
|
||||
@Override
|
||||
protected List<? extends Modifier> getNonBasicStatsModifiers(PhysicalCard self) {
|
||||
return Collections.singletonList(new StrengthModifier(self, Filters.hasAttached(self),
|
||||
new Condition() {
|
||||
@Override
|
||||
public boolean isFullfilled(GameState gameState, ModifiersQuerying modifiersQuerying) {
|
||||
return modifiersQuerying.hasKeyword(gameState, gameState.getCurrentSite(), Keyword.PLAINS);
|
||||
}
|
||||
}, 2));
|
||||
new LocationCondition(Keyword.PLAINS), 2));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.gempukku.lotro.cards.actions.PlayEventAction;
|
||||
import com.gempukku.lotro.cards.effects.ExhaustCharacterEffect;
|
||||
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
|
||||
import com.gempukku.lotro.common.*;
|
||||
import com.gempukku.lotro.filters.Filters;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect;
|
||||
@@ -46,8 +47,7 @@ public class Card1_113 extends AbstractOldEvent {
|
||||
@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)
|
||||
&& (game.getModifiersQuerying().hasKeyword(game.getGameState(), game.getGameState().getCurrentSite(), Keyword.RIVER)
|
||||
|| game.getModifiersQuerying().hasKeyword(game.getGameState(), game.getGameState().getCurrentSite(), Keyword.FOREST))
|
||||
&& PlayConditions.location(game, Filters.or(Keyword.RIVER, Keyword.FOREST))
|
||||
&& PlayConditions.canExert(self, game, Keyword.RANGER);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,14 +4,12 @@ import com.gempukku.lotro.cards.AbstractPermanent;
|
||||
import com.gempukku.lotro.cards.PlayConditions;
|
||||
import com.gempukku.lotro.cards.actions.PlayPermanentAction;
|
||||
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
|
||||
import com.gempukku.lotro.cards.modifiers.conditions.LocationCondition;
|
||||
import com.gempukku.lotro.cards.modifiers.conditions.NotCondition;
|
||||
import com.gempukku.lotro.common.*;
|
||||
import com.gempukku.lotro.filters.Filter;
|
||||
import com.gempukku.lotro.filters.Filters;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.GameState;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.logic.modifiers.Modifier;
|
||||
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
|
||||
import com.gempukku.lotro.logic.modifiers.TwilightCostModifier;
|
||||
|
||||
/**
|
||||
@@ -43,15 +41,7 @@ public class Card1_129 extends AbstractPermanent {
|
||||
|
||||
@Override
|
||||
public Modifier getAlwaysOnModifier(PhysicalCard self) {
|
||||
return new TwilightCostModifier(self,
|
||||
Filters.and(
|
||||
CardType.COMPANION,
|
||||
new Filter() {
|
||||
@Override
|
||||
public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) {
|
||||
return !modifiersQuerying.hasKeyword(gameState, gameState.getCurrentSite(), Keyword.SANCTUARY);
|
||||
}
|
||||
}
|
||||
), 2);
|
||||
return new TwilightCostModifier(self, CardType.COMPANION,
|
||||
new NotCondition(new LocationCondition(Keyword.SANCTUARY)), 2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,15 +5,14 @@ import com.gempukku.lotro.cards.PlayConditions;
|
||||
import com.gempukku.lotro.cards.actions.AttachPermanentAction;
|
||||
import com.gempukku.lotro.cards.effects.SelfDiscardEffect;
|
||||
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
|
||||
import com.gempukku.lotro.cards.modifiers.conditions.LocationCondition;
|
||||
import com.gempukku.lotro.common.*;
|
||||
import com.gempukku.lotro.filters.Filter;
|
||||
import com.gempukku.lotro.filters.Filters;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.GameState;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.logic.actions.RequiredTriggerAction;
|
||||
import com.gempukku.lotro.logic.modifiers.Modifier;
|
||||
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
|
||||
import com.gempukku.lotro.logic.modifiers.StrengthModifier;
|
||||
import com.gempukku.lotro.logic.timing.EffectResult;
|
||||
|
||||
@@ -57,17 +56,8 @@ public class Card1_135 extends AbstractAttachable {
|
||||
|
||||
@Override
|
||||
public Modifier getAlwaysOnModifier(final PhysicalCard self) {
|
||||
return new StrengthModifier(self,
|
||||
Filters.and(
|
||||
Race.HOBBIT,
|
||||
CardType.COMPANION,
|
||||
new Filter() {
|
||||
@Override
|
||||
public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) {
|
||||
return gameState.getCurrentSite() == self.getAttachedTo();
|
||||
}
|
||||
}
|
||||
), -2);
|
||||
return new StrengthModifier(self, Filters.and(Race.HOBBIT, CardType.COMPANION),
|
||||
new LocationCondition(Filters.hasAttached(self)), -2);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,14 +2,11 @@ package com.gempukku.lotro.cards.set1.site;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractSite;
|
||||
import com.gempukku.lotro.cards.modifiers.RoamingPenaltyModifier;
|
||||
import com.gempukku.lotro.cards.modifiers.conditions.LocationCondition;
|
||||
import com.gempukku.lotro.common.Block;
|
||||
import com.gempukku.lotro.common.Race;
|
||||
import com.gempukku.lotro.filters.Filter;
|
||||
import com.gempukku.lotro.filters.Filters;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.GameState;
|
||||
import com.gempukku.lotro.logic.modifiers.Modifier;
|
||||
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
|
||||
|
||||
/**
|
||||
* Set: The Fellowship of the Ring
|
||||
@@ -26,13 +23,6 @@ public class Card1_328 extends AbstractSite {
|
||||
@Override
|
||||
public Modifier getAlwaysOnModifier(final PhysicalCard self) {
|
||||
return new RoamingPenaltyModifier(self,
|
||||
Filters.and(
|
||||
Race.NAZGUL,
|
||||
new Filter() {
|
||||
@Override
|
||||
public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) {
|
||||
return (gameState.getCurrentSite() == self);
|
||||
}
|
||||
}), -2);
|
||||
Race.NAZGUL, new LocationCondition(self), -2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.gempukku.lotro.cards.set1.site;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractSite;
|
||||
import com.gempukku.lotro.cards.TriggerConditions;
|
||||
import com.gempukku.lotro.cards.effects.ExertCharactersEffect;
|
||||
import com.gempukku.lotro.common.Block;
|
||||
import com.gempukku.lotro.common.CardType;
|
||||
@@ -30,9 +31,7 @@ public class Card1_332 extends AbstractSite {
|
||||
|
||||
@Override
|
||||
public List<RequiredTriggerAction> getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) {
|
||||
if (effectResult.getType() == EffectResult.Type.WHEN_MOVE_TO
|
||||
&& game.getGameState().getCurrentSite() == self) {
|
||||
|
||||
if (TriggerConditions.movesTo(game, effectResult, self)) {
|
||||
if (Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Race.HOBBIT, CardType.COMPANION)) {
|
||||
RequiredTriggerAction action = new RequiredTriggerAction(self);
|
||||
action.appendEffect(new ExertCharactersEffect(self, Filters.and(Race.HOBBIT, CardType.COMPANION)));
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
package com.gempukku.lotro.cards.set1.site;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractSite;
|
||||
import com.gempukku.lotro.cards.modifiers.conditions.LocationCondition;
|
||||
import com.gempukku.lotro.common.Block;
|
||||
import com.gempukku.lotro.common.Keyword;
|
||||
import com.gempukku.lotro.common.Race;
|
||||
import com.gempukku.lotro.filters.Filter;
|
||||
import com.gempukku.lotro.filters.Filters;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.GameState;
|
||||
import com.gempukku.lotro.logic.modifiers.KeywordModifier;
|
||||
import com.gempukku.lotro.logic.modifiers.Modifier;
|
||||
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
|
||||
|
||||
/**
|
||||
* Set: The Fellowship of the Ring
|
||||
@@ -26,15 +23,6 @@ public class Card1_336 extends AbstractSite {
|
||||
|
||||
@Override
|
||||
public Modifier getAlwaysOnModifier(final PhysicalCard self) {
|
||||
return new KeywordModifier(self,
|
||||
Filters.and(
|
||||
Race.NAZGUL,
|
||||
new Filter() {
|
||||
@Override
|
||||
public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) {
|
||||
return gameState.getCurrentSite() == self;
|
||||
}
|
||||
}
|
||||
), Keyword.FIERCE);
|
||||
return new KeywordModifier(self, Race.NAZGUL, new LocationCondition(self), Keyword.FIERCE, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.gempukku.lotro.cards.set1.site;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractSite;
|
||||
import com.gempukku.lotro.cards.PlayConditions;
|
||||
import com.gempukku.lotro.cards.TriggerConditions;
|
||||
import com.gempukku.lotro.common.Block;
|
||||
import com.gempukku.lotro.common.Keyword;
|
||||
@@ -40,7 +41,7 @@ public class Card1_338 extends AbstractSite {
|
||||
new Filter() {
|
||||
@Override
|
||||
public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) {
|
||||
return gameState.getCurrentSite() == self && (self.getData() == null);
|
||||
return (self.getData() == null);
|
||||
}
|
||||
}), -5);
|
||||
}
|
||||
@@ -48,7 +49,7 @@ public class Card1_338 extends AbstractSite {
|
||||
@Override
|
||||
public List<RequiredTriggerAction> getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) {
|
||||
if (TriggerConditions.played(game, effectResult, Race.NAZGUL)
|
||||
&& game.getGameState().getCurrentSite() == self)
|
||||
&& PlayConditions.location(game, self))
|
||||
self.storeData(new Object());
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.gempukku.lotro.cards.set1.site;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractSite;
|
||||
import com.gempukku.lotro.cards.PlayConditions;
|
||||
import com.gempukku.lotro.cards.modifiers.MoveLimitModifier;
|
||||
import com.gempukku.lotro.common.Block;
|
||||
import com.gempukku.lotro.common.Keyword;
|
||||
@@ -28,7 +29,7 @@ public class Card1_342 extends AbstractSite {
|
||||
|
||||
@Override
|
||||
public List<RequiredTriggerAction> getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) {
|
||||
if (game.getGameState().getCurrentSite() == self
|
||||
if (PlayConditions.location(game, self)
|
||||
&& self.getData() == null
|
||||
&& Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Keyword.RANGER)) {
|
||||
self.storeData(new Object());
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.gempukku.lotro.cards.set1.site;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractSite;
|
||||
import com.gempukku.lotro.cards.PlayConditions;
|
||||
import com.gempukku.lotro.cards.TriggerConditions;
|
||||
import com.gempukku.lotro.cards.effects.ChoiceEffect;
|
||||
import com.gempukku.lotro.cards.effects.ExertCharactersEffect;
|
||||
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
|
||||
@@ -34,8 +35,7 @@ public class Card1_344 extends AbstractSite {
|
||||
|
||||
@Override
|
||||
public List<RequiredTriggerAction> getRequiredAfterTriggers(final LotroGame game, EffectResult effectResult, PhysicalCard self) {
|
||||
if (effectResult.getType() == EffectResult.Type.WHEN_MOVE_TO
|
||||
&& game.getGameState().getCurrentSite() == self) {
|
||||
if (TriggerConditions.movesTo(game, effectResult, self)) {
|
||||
String fpPlayerId = game.getGameState().getCurrentPlayerId();
|
||||
boolean gimliCanExert = PlayConditions.canExert(self, game, Filters.gimli);
|
||||
boolean twoOtherCanExert = PlayConditions.canExert(self, game, 1, 2, Filters.not(Filters.gimli), CardType.COMPANION);
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.gempukku.lotro.cards.set1.site;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractSite;
|
||||
import com.gempukku.lotro.cards.PlayConditions;
|
||||
import com.gempukku.lotro.cards.TriggerConditions;
|
||||
import com.gempukku.lotro.cards.effects.ChoiceEffect;
|
||||
import com.gempukku.lotro.cards.effects.ExertCharactersEffect;
|
||||
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
|
||||
@@ -34,8 +35,7 @@ public class Card1_346 extends AbstractSite {
|
||||
|
||||
@Override
|
||||
public List<RequiredTriggerAction> getRequiredAfterTriggers(final LotroGame game, EffectResult effectResult, PhysicalCard self) {
|
||||
if (effectResult.getType() == EffectResult.Type.WHEN_MOVE_TO
|
||||
&& game.getGameState().getCurrentSite() == self) {
|
||||
if (TriggerConditions.movesTo(game, effectResult, self)) {
|
||||
String fpPlayerId = game.getGameState().getCurrentPlayerId();
|
||||
boolean frodoCanExert = PlayConditions.canExert(self, game, Filters.frodo);
|
||||
boolean twoOtherCanExert = PlayConditions.canExert(self, game, 1, 2, Filters.not(Filters.frodo), CardType.COMPANION);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.gempukku.lotro.cards.set1.site;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractSite;
|
||||
import com.gempukku.lotro.cards.TriggerConditions;
|
||||
import com.gempukku.lotro.common.Block;
|
||||
import com.gempukku.lotro.common.CardType;
|
||||
import com.gempukku.lotro.common.Keyword;
|
||||
@@ -28,8 +29,7 @@ public class Card1_353 extends AbstractSite {
|
||||
|
||||
@Override
|
||||
public List<RequiredTriggerAction> getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) {
|
||||
if (effectResult.getType() == EffectResult.Type.WHEN_MOVE_TO
|
||||
&& game.getGameState().getCurrentSite() == self) {
|
||||
if (TriggerConditions.movesTo(game, effectResult, self)) {
|
||||
RequiredTriggerAction action = new RequiredTriggerAction(self);
|
||||
action.appendEffect(
|
||||
new DiscardCardsFromPlayEffect(self, CardType.ALLY));
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.gempukku.lotro.cards.set1.site;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractSite;
|
||||
import com.gempukku.lotro.cards.TriggerConditions;
|
||||
import com.gempukku.lotro.cards.effects.ExertCharactersEffect;
|
||||
import com.gempukku.lotro.common.Block;
|
||||
import com.gempukku.lotro.common.CardType;
|
||||
@@ -29,8 +30,7 @@ public class Card1_355 extends AbstractSite {
|
||||
|
||||
@Override
|
||||
public List<RequiredTriggerAction> getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) {
|
||||
if (effectResult.getType() == EffectResult.Type.WHEN_MOVE_TO
|
||||
&& game.getGameState().getCurrentSite() == self
|
||||
if (TriggerConditions.movesTo(game, effectResult, self)
|
||||
&& !Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Keyword.RANGER)) {
|
||||
RequiredTriggerAction action = new RequiredTriggerAction(self);
|
||||
action.appendEffect(
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.gempukku.lotro.cards.set1.site;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractSite;
|
||||
import com.gempukku.lotro.cards.TriggerConditions;
|
||||
import com.gempukku.lotro.common.Block;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
@@ -25,8 +26,7 @@ public class Card1_362 extends AbstractSite {
|
||||
|
||||
@Override
|
||||
public List<OptionalTriggerAction> getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) {
|
||||
if (effectResult.getType() == EffectResult.Type.WHEN_MOVE_TO
|
||||
&& game.getGameState().getCurrentSite() == self) {
|
||||
if (TriggerConditions.movesTo(game, effectResult, self)) {
|
||||
if (!playerId.equals(game.getGameState().getCurrentPlayerId())) {
|
||||
OptionalTriggerAction action = new OptionalTriggerAction(self);
|
||||
action.appendEffect(
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.gempukku.lotro.cards.set1.wraith;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractAttachable;
|
||||
import com.gempukku.lotro.cards.PlayConditions;
|
||||
import com.gempukku.lotro.cards.effects.SelfDiscardEffect;
|
||||
import com.gempukku.lotro.cards.modifiers.conditions.LocationCondition;
|
||||
import com.gempukku.lotro.common.*;
|
||||
@@ -48,7 +49,7 @@ public class Card1_208 extends AbstractAttachable {
|
||||
|
||||
@Override
|
||||
public List<RequiredTriggerAction> getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) {
|
||||
if (game.getModifiersQuerying().hasKeyword(game.getGameState(), game.getGameState().getCurrentSite(), Keyword.UNDERGROUND)) {
|
||||
if (PlayConditions.location(game, Keyword.UNDERGROUND)) {
|
||||
RequiredTriggerAction action = new RequiredTriggerAction(self);
|
||||
action.appendEffect(new SelfDiscardEffect(self));
|
||||
return Collections.singletonList(action);
|
||||
|
||||
@@ -40,9 +40,8 @@ public class Card1_222 extends AbstractPermanent {
|
||||
if (PlayConditions.canUseShadowCardDuringPhase(game, Phase.SHADOW, self, 3)) {
|
||||
ActivateCardAction action = new ActivateCardAction(self);
|
||||
action.appendCost(new RemoveTwilightEffect(3));
|
||||
if (!game.getGameState().getCurrentSite().getOwner().equals(playerId))
|
||||
action.appendEffect(
|
||||
new PlaySiteEffect(action, playerId, Block.FELLOWSHIP, game.getGameState().getCurrentSiteNumber()));
|
||||
action.appendEffect(
|
||||
new PlaySiteEffect(action, playerId, Block.FELLOWSHIP, game.getGameState().getCurrentSiteNumber()));
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -8,7 +8,6 @@ import com.gempukku.lotro.cards.effects.ShuffleDeckEffect;
|
||||
import com.gempukku.lotro.cards.effects.choose.ChooseAndPutCardFromDeckIntoHandEffect;
|
||||
import com.gempukku.lotro.cards.effects.choose.ChooseOpponentEffect;
|
||||
import com.gempukku.lotro.common.*;
|
||||
import com.gempukku.lotro.filters.Filters;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.logic.actions.ActivateCardAction;
|
||||
@@ -44,7 +43,7 @@ public class Card10_028 extends AbstractCompanion {
|
||||
@Override
|
||||
protected List<ActivateCardAction> getExtraInPlayPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
|
||||
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.FELLOWSHIP, self)
|
||||
&& Filters.and(Keyword.SANCTUARY).accepts(game.getGameState(), game.getModifiersQuerying(), game.getGameState().getCurrentSite())
|
||||
&& PlayConditions.location(game, Keyword.SANCTUARY)
|
||||
&& PlayConditions.canSelfExert(self, game)) {
|
||||
final ActivateCardAction action = new ActivateCardAction(self);
|
||||
action.appendCost(
|
||||
|
||||
@@ -47,7 +47,7 @@ public class Card11_009 extends AbstractAttachableFPPossession {
|
||||
protected List<? extends Action> getExtraInPlayPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
|
||||
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.SKIRMISH, self)
|
||||
&& PlayConditions.canExert(self, game, Filters.hasAttached(self), Filters.gimli)
|
||||
&& game.getModifiersQuerying().hasKeyword(game.getGameState(), game.getGameState().getCurrentSite(), Keyword.BATTLEGROUND)) {
|
||||
&& PlayConditions.location(game, Keyword.BATTLEGROUND)) {
|
||||
ActivateCardAction action = new ActivateCardAction(self);
|
||||
action.appendCost(
|
||||
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Filters.hasAttached(self)));
|
||||
|
||||
@@ -2,13 +2,12 @@ package com.gempukku.lotro.cards.set11.gandalf;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractEvent;
|
||||
import com.gempukku.lotro.cards.PlayConditions;
|
||||
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
|
||||
import com.gempukku.lotro.cards.effects.RemoveBurdenEffect;
|
||||
import com.gempukku.lotro.cards.actions.PlayEventAction;
|
||||
import com.gempukku.lotro.cards.effects.RemoveBurdenEffect;
|
||||
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
|
||||
import com.gempukku.lotro.common.*;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.filters.Filters;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
|
||||
/**
|
||||
* Set: Shadows
|
||||
@@ -34,7 +33,7 @@ public class Card11_029 extends AbstractEvent {
|
||||
PlayEventAction action = new PlayEventAction(self);
|
||||
action.appendCost(
|
||||
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Culture.GANDALF, Race.WIZARD));
|
||||
int count = Filters.and(Keyword.DWELLING).accepts(game.getGameState(), game.getModifiersQuerying(), game.getGameState().getCurrentSite()) ? 2 : 1;
|
||||
int count = PlayConditions.location(game, Keyword.DWELLING) ? 2 : 1;
|
||||
action.appendEffect(
|
||||
new RemoveBurdenEffect(playerId, self, count));
|
||||
return action;
|
||||
|
||||
@@ -38,7 +38,7 @@ public class Card11_036 extends AbstractEvent {
|
||||
action.appendEffect(
|
||||
new RevealCardsFromHandEffect(self, playerId, new HashSet<PhysicalCard>(game.getGameState().getHand(playerId))));
|
||||
int companionCount = Filters.filter(game.getGameState().getHand(playerId), game.getGameState(), game.getModifiersQuerying(), CardType.COMPANION).size();
|
||||
int penalty = companionCount * ((Filters.and(Keyword.BATTLEGROUND).accepts(game.getGameState(), game.getModifiersQuerying(), game.getGameState().getCurrentSite())) ? -4 : -3);
|
||||
int penalty = companionCount * (PlayConditions.location(game, Keyword.BATTLEGROUND) ? -4 : -3);
|
||||
action.appendEffect(
|
||||
new ChooseAndAddUntilEOPStrengthBonusEffect(action, self, playerId, penalty, CardType.MINION));
|
||||
return action;
|
||||
|
||||
@@ -10,7 +10,6 @@ import com.gempukku.lotro.cards.effects.SelfExertEffect;
|
||||
import com.gempukku.lotro.common.Culture;
|
||||
import com.gempukku.lotro.common.Keyword;
|
||||
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.actions.ActivateCardAction;
|
||||
@@ -62,7 +61,7 @@ public class Card11_051 extends AbstractCompanion {
|
||||
protected List<ActivateCardAction> getExtraInPlayPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
|
||||
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.SKIRMISH, self)
|
||||
&& PlayConditions.canSelfExert(self, game)
|
||||
&& Filters.and(Keyword.MARSH).accepts(game.getGameState(), game.getModifiersQuerying(), game.getGameState().getCurrentSite())) {
|
||||
&& PlayConditions.location(game, Keyword.MARSH)) {
|
||||
ActivateCardAction action = new ActivateCardAction(self);
|
||||
action.appendCost(
|
||||
new SelfExertEffect(self));
|
||||
|
||||
@@ -5,7 +5,6 @@ import com.gempukku.lotro.cards.PlayConditions;
|
||||
import com.gempukku.lotro.cards.actions.PlayEventAction;
|
||||
import com.gempukku.lotro.cards.effects.choose.ChooseAndPlayCardFromDiscardEffect;
|
||||
import com.gempukku.lotro.common.*;
|
||||
import com.gempukku.lotro.filters.Filters;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
|
||||
@@ -26,7 +25,7 @@ public class Card11_052 extends AbstractEvent {
|
||||
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.canSpot(game, Culture.GOLLUM, CardType.MINION)
|
||||
&& Filters.and(Keyword.MOUNTAIN).accepts(game.getGameState(), game.getModifiersQuerying(), game.getGameState().getCurrentSite())
|
||||
&& PlayConditions.location(game, Keyword.MOUNTAIN)
|
||||
&& PlayConditions.canPlayFromDiscard(playerId, game, CardType.MINION);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,12 +4,10 @@ import com.gempukku.lotro.cards.AbstractMinion;
|
||||
import com.gempukku.lotro.common.Culture;
|
||||
import com.gempukku.lotro.common.Keyword;
|
||||
import com.gempukku.lotro.common.Race;
|
||||
import com.gempukku.lotro.filters.Filter;
|
||||
import com.gempukku.lotro.filters.Filters;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.GameState;
|
||||
import com.gempukku.lotro.logic.modifiers.KeywordModifier;
|
||||
import com.gempukku.lotro.logic.modifiers.Modifier;
|
||||
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
|
||||
|
||||
/**
|
||||
* Set: Shadows
|
||||
@@ -29,12 +27,6 @@ public class Card11_082 extends AbstractMinion {
|
||||
|
||||
@Override
|
||||
public Modifier getAlwaysOnModifier(PhysicalCard self) {
|
||||
return new KeywordModifier(self,
|
||||
new Filter() {
|
||||
@Override
|
||||
public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) {
|
||||
return physicalCard == gameState.getCurrentSite();
|
||||
}
|
||||
}, Keyword.PLAINS);
|
||||
return new KeywordModifier(self, Filters.currentSite, Keyword.PLAINS);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,12 +4,10 @@ import com.gempukku.lotro.cards.AbstractMinion;
|
||||
import com.gempukku.lotro.common.Culture;
|
||||
import com.gempukku.lotro.common.Keyword;
|
||||
import com.gempukku.lotro.common.Race;
|
||||
import com.gempukku.lotro.filters.Filter;
|
||||
import com.gempukku.lotro.filters.Filters;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.GameState;
|
||||
import com.gempukku.lotro.logic.modifiers.KeywordModifier;
|
||||
import com.gempukku.lotro.logic.modifiers.Modifier;
|
||||
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
|
||||
|
||||
/**
|
||||
* Set: Shadows
|
||||
@@ -29,12 +27,6 @@ public class Card11_138 extends AbstractMinion {
|
||||
|
||||
@Override
|
||||
public Modifier getAlwaysOnModifier(PhysicalCard self) {
|
||||
return new KeywordModifier(self,
|
||||
new Filter() {
|
||||
@Override
|
||||
public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) {
|
||||
return gameState.getCurrentSite() == physicalCard;
|
||||
}
|
||||
}, Keyword.UNDERGROUND);
|
||||
return new KeywordModifier(self, Filters.currentSite, Keyword.UNDERGROUND);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,15 +3,13 @@ package com.gempukku.lotro.cards.set2.dwarven;
|
||||
import com.gempukku.lotro.cards.AbstractPermanent;
|
||||
import com.gempukku.lotro.cards.TriggerConditions;
|
||||
import com.gempukku.lotro.cards.effects.SelfDiscardEffect;
|
||||
import com.gempukku.lotro.cards.modifiers.conditions.LocationCondition;
|
||||
import com.gempukku.lotro.common.*;
|
||||
import com.gempukku.lotro.filters.Filter;
|
||||
import com.gempukku.lotro.filters.Filters;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.GameState;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.logic.actions.RequiredTriggerAction;
|
||||
import com.gempukku.lotro.logic.modifiers.Modifier;
|
||||
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
|
||||
import com.gempukku.lotro.logic.modifiers.TwilightCostModifier;
|
||||
import com.gempukku.lotro.logic.timing.EffectResult;
|
||||
|
||||
@@ -41,16 +39,8 @@ public class Card2_008 extends AbstractPermanent {
|
||||
@Override
|
||||
public Modifier getAlwaysOnModifier(PhysicalCard self) {
|
||||
return new TwilightCostModifier(self,
|
||||
Filters.and(
|
||||
Culture.MORIA,
|
||||
Race.ORC,
|
||||
new Filter() {
|
||||
@Override
|
||||
public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) {
|
||||
return !modifiersQuerying.hasKeyword(gameState, gameState.getCurrentSite(), Keyword.UNDERGROUND);
|
||||
}
|
||||
}
|
||||
), 2);
|
||||
Filters.and(Culture.MORIA, Race.ORC),
|
||||
new LocationCondition(Filters.not(Keyword.UNDERGROUND)), 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -47,7 +47,7 @@ public class Card2_012 extends AbstractPermanent {
|
||||
new CheckLimitEffect(action, self, 3, Phase.SKIRMISH,
|
||||
new AddUntilEndOfPhaseModifierEffect(
|
||||
new StrengthModifier(self, Filters.sameCard(dwarf), 1), Phase.SKIRMISH)));
|
||||
if (game.getModifiersQuerying().hasKeyword(game.getGameState(), game.getGameState().getCurrentSite(), Keyword.UNDERGROUND))
|
||||
if (PlayConditions.location(game, Keyword.UNDERGROUND))
|
||||
action.appendEffect(
|
||||
new CheckLimitEffect(action, self, 3, Phase.SKIRMISH,
|
||||
new AddUntilEndOfPhaseModifierEffect(
|
||||
|
||||
@@ -40,7 +40,7 @@ public class Card2_019 extends AbstractOldEvent {
|
||||
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Race.ELF));
|
||||
action.appendEffect(
|
||||
new WoundCharactersEffect(self, Race.NAZGUL));
|
||||
if (game.getModifiersQuerying().hasKeyword(game.getGameState(), game.getGameState().getCurrentSite(), Keyword.RIVER))
|
||||
if (PlayConditions.location(game, Keyword.RIVER))
|
||||
action.appendEffect(
|
||||
new WoundCharactersEffect(self, Race.NAZGUL));
|
||||
return action;
|
||||
|
||||
@@ -2,14 +2,12 @@ package com.gempukku.lotro.cards.set2.gondor;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractPermanent;
|
||||
import com.gempukku.lotro.cards.modifiers.ArcheryTotalModifier;
|
||||
import com.gempukku.lotro.cards.modifiers.conditions.LocationCondition;
|
||||
import com.gempukku.lotro.common.*;
|
||||
import com.gempukku.lotro.filters.Filters;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.GameState;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.logic.modifiers.Condition;
|
||||
import com.gempukku.lotro.logic.modifiers.Modifier;
|
||||
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
|
||||
|
||||
/**
|
||||
* Set: Mines of Moria
|
||||
@@ -33,12 +31,6 @@ public class Card2_035 extends AbstractPermanent {
|
||||
|
||||
@Override
|
||||
public Modifier getAlwaysOnModifier(PhysicalCard self) {
|
||||
return new ArcheryTotalModifier(self, Side.SHADOW,
|
||||
new Condition() {
|
||||
@Override
|
||||
public boolean isFullfilled(GameState gameState, ModifiersQuerying modifiersQuerying) {
|
||||
return modifiersQuerying.hasKeyword(gameState, gameState.getCurrentSite(), Keyword.FOREST);
|
||||
}
|
||||
}, -2);
|
||||
return new ArcheryTotalModifier(self, Side.SHADOW, new LocationCondition(Keyword.FOREST), -2);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user