"Gimli's Pipe"
You can now have an effect that modifies number of cards you can spot.
This commit is contained in:
@@ -24,7 +24,7 @@ public abstract class ForEachYouSpotDecision extends IntegerAwaitingDecision {
|
||||
@Override
|
||||
public Map<String, Object> getDecisionParameters() {
|
||||
Map<String, Object> result = super.getDecisionParameters();
|
||||
int count = Filters.countActive(_lotroGame.getGameState(), _lotroGame.getModifiersQuerying(), _filter);
|
||||
int count = Filters.countSpottable(_lotroGame.getGameState(), _lotroGame.getModifiersQuerying(), _filter);
|
||||
_max = count;
|
||||
result.put("max", String.valueOf(count));
|
||||
if (_defaultValue > _max)
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.gempukku.lotro.cards.modifiers;
|
||||
|
||||
import com.gempukku.lotro.cards.modifiers.spotting.SimpleLotroCardBlueprint;
|
||||
import com.gempukku.lotro.cards.modifiers.spotting.SimplePhysicalCard;
|
||||
import com.gempukku.lotro.common.Keyword;
|
||||
import com.gempukku.lotro.filters.Filter;
|
||||
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.ModifierEffect;
|
||||
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
|
||||
|
||||
public class KeywordSpotModifier extends AbstractModifier {
|
||||
private Keyword _keyword;
|
||||
|
||||
public KeywordSpotModifier(PhysicalCard source, Keyword keyword) {
|
||||
super(source, "Spotting modifier", null, new ModifierEffect[]{ModifierEffect.SPOT_MODIFIER});
|
||||
_keyword = keyword;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSpotCount(GameState gameState, ModifiersQuerying modifiersQuerying, Filter filter, int result) {
|
||||
if (filter.accepts(gameState, modifiersQuerying,
|
||||
new SimplePhysicalCard(
|
||||
new SimpleLotroCardBlueprint() {
|
||||
@Override
|
||||
public boolean hasKeyword(Keyword keyword) {
|
||||
return keyword == _keyword;
|
||||
}
|
||||
})))
|
||||
return result + 1;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
package com.gempukku.lotro.cards.modifiers.spotting;
|
||||
|
||||
import com.gempukku.lotro.common.*;
|
||||
import com.gempukku.lotro.game.LotroCardBlueprint;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.logic.actions.OptionalTriggerAction;
|
||||
import com.gempukku.lotro.logic.actions.RequiredTriggerAction;
|
||||
import com.gempukku.lotro.logic.modifiers.Modifier;
|
||||
import com.gempukku.lotro.logic.timing.Action;
|
||||
import com.gempukku.lotro.logic.timing.Effect;
|
||||
import com.gempukku.lotro.logic.timing.EffectResult;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SimpleLotroCardBlueprint implements LotroCardBlueprint {
|
||||
@Override
|
||||
public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends Modifier> getAlwaysOnModifiers(PhysicalCard self) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CardType getCardType() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Culture getCulture() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getKeywordCount(Keyword keyword) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends Action> getOptionalAfterActions(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OptionalTriggerAction> getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends Action> getOptionalBeforeActions(String playerId, LotroGame game, Effect effect, PhysicalCard self) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OptionalTriggerAction> getOptionalBeforeTriggers(String playerId, LotroGame game, Effect effect, PhysicalCard self) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends Action> getPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Action getPlayCardAction(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Race getRace() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RequiredTriggerAction> getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RequiredTriggerAction> getRequiredBeforeTriggers(LotroGame game, Effect effect, PhysicalCard self) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getResistance() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Side getSide() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Signet getSignet() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Direction getSiteDirection() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSiteNumber() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getStrength() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTwilightCost() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getVitality() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasKeyword(Keyword keyword) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUnique() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.gempukku.lotro.cards.modifiers.spotting;
|
||||
|
||||
import com.gempukku.lotro.common.Zone;
|
||||
import com.gempukku.lotro.game.LotroCardBlueprint;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
|
||||
public class SimplePhysicalCard implements PhysicalCard {
|
||||
private LotroCardBlueprint _blueprint;
|
||||
|
||||
public SimplePhysicalCard(LotroCardBlueprint blueprint) {
|
||||
_blueprint = blueprint;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PhysicalCard getAttachedTo() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LotroCardBlueprint getBlueprint() {
|
||||
return _blueprint;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBlueprintId() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCardId() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getData() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwner() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PhysicalCard getStackedOn() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Zone getZone() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeData() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void storeData(Object object) {
|
||||
}
|
||||
}
|
||||
@@ -37,7 +37,7 @@ public class Card1_049 extends AbstractAttachable {
|
||||
return new AbstractModifier(self, "Strength +1 for each Elf you can spot (limit +3)", Filters.hasAttached(self), new ModifierEffect[]{ModifierEffect.STRENGTH_MODIFIER}) {
|
||||
@Override
|
||||
public int getStrength(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard, int result) {
|
||||
int count = Math.min(3, Filters.countActive(gameState, modifiersQuerying, Filters.race(Race.ELF)));
|
||||
int count = Math.min(3, Filters.countSpottable(gameState, modifiersQuerying, Filters.race(Race.ELF)));
|
||||
return result + count;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -56,7 +56,7 @@ public class Card1_091 extends AbstractAttachableFPPossession {
|
||||
@Override
|
||||
public void decisionMade(String result) throws DecisionResultInvalidException {
|
||||
int spotCount = getValidatedResult(result);
|
||||
int companionsCount = Filters.countActive(game.getGameState(), game.getModifiersQuerying(), Filters.type(CardType.COMPANION));
|
||||
int companionsCount = Filters.countSpottable(game.getGameState(), game.getModifiersQuerying(), Filters.type(CardType.COMPANION));
|
||||
spotCount = Math.min(spotCount, companionsCount);
|
||||
action.appendEffect(
|
||||
new ChooseActiveCardsEffect(playerId, "Choose companion(s) to heal", spotCount, spotCount, Filters.type(CardType.COMPANION)) {
|
||||
|
||||
@@ -37,7 +37,7 @@ public class Card1_123 extends AbstractEvent {
|
||||
public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) {
|
||||
return super.checkPlayRequirements(playerId, game, self, twilightModifier)
|
||||
&& PlayConditions.canExert(self, game.getGameState(), game.getModifiersQuerying(), Filters.culture(Culture.ISENGARD), Filters.type(CardType.MINION))
|
||||
&& Filters.countActive(game.getGameState(), game.getModifiersQuerying(), Filters.type(CardType.COMPANION)) >= 5;
|
||||
&& Filters.countSpottable(game.getGameState(), game.getModifiersQuerying(), Filters.type(CardType.COMPANION)) >= 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -39,7 +39,7 @@ public class Card1_125 extends AbstractPermanent {
|
||||
@Override
|
||||
public List<? extends Action> getExtraPhaseActions(final String playerId, LotroGame game, final PhysicalCard self) {
|
||||
if (PlayConditions.canUseShadowCardDuringPhase(game.getGameState(), Phase.MANEUVER, self, 2)
|
||||
&& Filters.countActive(game.getGameState(), game.getModifiersQuerying(), Filters.type(CardType.COMPANION)) >= 6) {
|
||||
&& Filters.countSpottable(game.getGameState(), game.getModifiersQuerying(), Filters.type(CardType.COMPANION)) >= 6) {
|
||||
final ActivateCardAction action = new ActivateCardAction(self, Keyword.MANEUVER);
|
||||
action.appendCost(new RemoveTwilightEffect(2));
|
||||
action.appendEffect(
|
||||
|
||||
@@ -40,7 +40,7 @@ public class Card1_139 extends AbstractEvent {
|
||||
@Override
|
||||
protected void cardSelected(PhysicalCard urukHai) {
|
||||
action.appendEffect(new CardAffectsCardEffect(self, urukHai));
|
||||
if (Filters.countActive(game.getGameState(), game.getModifiersQuerying(), Filters.type(CardType.COMPANION)) >= 5) {
|
||||
if (Filters.countSpottable(game.getGameState(), game.getModifiersQuerying(), Filters.type(CardType.COMPANION)) >= 5) {
|
||||
action.appendEffect(
|
||||
new AddUntilStartOfPhaseModifierEffect(
|
||||
new StrengthModifier(self, Filters.sameCard(urukHai), 4), Phase.REGROUP));
|
||||
|
||||
@@ -34,7 +34,7 @@ public class Card1_146 extends AbstractMinion {
|
||||
@Override
|
||||
protected List<? extends Action> getExtraPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
|
||||
if (PlayConditions.canUseShadowCardDuringPhase(game.getGameState(), Phase.MANEUVER, self, 0)
|
||||
&& Filters.countActive(game.getGameState(), game.getModifiersQuerying(), Filters.type(CardType.COMPANION)) >= 5) {
|
||||
&& Filters.countSpottable(game.getGameState(), game.getModifiersQuerying(), Filters.type(CardType.COMPANION)) >= 5) {
|
||||
|
||||
ActivateCardAction action = new ActivateCardAction(self, Keyword.MANEUVER);
|
||||
action.appendEffect(new AddUntilStartOfPhaseModifierEffect(new KeywordModifier(self, Filters.sameCard(self), Keyword.FIERCE), Phase.REGROUP));
|
||||
|
||||
@@ -34,7 +34,7 @@ public class Card1_148 extends AbstractMinion {
|
||||
return new AbstractModifier(self, "Strength +1 for each other Uruk-hai you can spot", Filters.sameCard(self), new ModifierEffect[]{ModifierEffect.STRENGTH_MODIFIER}) {
|
||||
@Override
|
||||
public int getStrength(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard, int result) {
|
||||
return result + Filters.countActive(gameState, modifiersQuerying, Filters.and(Filters.race(Race.URUK_HAI), Filters.not(Filters.sameCard(self))));
|
||||
return result + Filters.countSpottable(gameState, modifiersQuerying, Filters.and(Filters.race(Race.URUK_HAI), Filters.not(Filters.sameCard(self))));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -40,7 +40,8 @@ public class Card1_155 extends AbstractMinion {
|
||||
&& PlayConditions.canExert(self, game.getGameState(), game.getModifiersQuerying(), self)) {
|
||||
final ActivateCardAction action = new ActivateCardAction(self, Keyword.RESPONSE);
|
||||
action.appendCost(new ExertCharactersCost(self, self));
|
||||
int isengardMinionCount = Filters.countActive(game.getGameState(), game.getModifiersQuerying(), Filters.culture(Culture.ISENGARD), Filters.type(CardType.MINION));
|
||||
// TODO this should give option to player to spot less
|
||||
int isengardMinionCount = Filters.countSpottable(game.getGameState(), game.getModifiersQuerying(), Filters.culture(Culture.ISENGARD), Filters.type(CardType.MINION));
|
||||
for (int i = 0; i < isengardMinionCount; i++) {
|
||||
action.appendEffect(
|
||||
new UnrespondableEffect() {
|
||||
|
||||
@@ -34,7 +34,7 @@ public class Card1_156 extends AbstractMinion {
|
||||
@Override
|
||||
protected List<? extends Action> getExtraPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
|
||||
if (PlayConditions.canUseShadowCardDuringPhase(game.getGameState(), Phase.SHADOW, self, 0)
|
||||
&& Filters.countActive(game.getGameState(), game.getModifiersQuerying(), Filters.type(CardType.COMPANION)) >= 6) {
|
||||
&& Filters.countSpottable(game.getGameState(), game.getModifiersQuerying(), Filters.type(CardType.COMPANION)) >= 6) {
|
||||
ActivateCardAction action = new ActivateCardAction(self, Keyword.MANEUVER);
|
||||
action.appendEffect(
|
||||
new AddUntilStartOfPhaseModifierEffect(
|
||||
|
||||
@@ -32,7 +32,7 @@ public class Card1_163 extends AbstractMinion {
|
||||
return new AbstractModifier(self, "For each other MORIA Orc you can spot, Ancient Chieftain is strength +1.", Filters.sameCard(self), new ModifierEffect[]{ModifierEffect.STRENGTH_MODIFIER}) {
|
||||
@Override
|
||||
public int getStrength(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard, int result) {
|
||||
return result + Filters.countActive(gameState, modifiersQuerying, Filters.culture(Culture.MORIA), Filters.race(Race.ORC), Filters.not(Filters.sameCard(physicalCard)));
|
||||
return result + Filters.countSpottable(gameState, modifiersQuerying, Filters.culture(Culture.MORIA), Filters.race(Race.ORC), Filters.not(Filters.sameCard(physicalCard)));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ public class Card1_167 extends AbstractEvent {
|
||||
new ChooseActiveCardEffect(playerId, "Choose MORIA Orc", Filters.culture(Culture.MORIA), Filters.race(Race.ORC)) {
|
||||
@Override
|
||||
protected void cardSelected(PhysicalCard orc) {
|
||||
int bonus = Math.min(4, Filters.countActive(game.getGameState(), game.getModifiersQuerying(), Filters.culture(Culture.MORIA), Filters.race(Race.ORC), Filters.not(Filters.sameCard(orc))));
|
||||
int bonus = Math.min(4, Filters.countSpottable(game.getGameState(), game.getModifiersQuerying(), Filters.culture(Culture.MORIA), Filters.race(Race.ORC), Filters.not(Filters.sameCard(orc))));
|
||||
action.appendEffect(new CardAffectsCardEffect(self, orc));
|
||||
action.appendEffect(
|
||||
new AddUntilEndOfPhaseModifierEffect(
|
||||
|
||||
@@ -33,7 +33,7 @@ public class Card1_169 extends AbstractEvent {
|
||||
@Override
|
||||
public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) {
|
||||
return super.checkPlayRequirements(playerId, game, self, twilightModifier)
|
||||
&& Filters.countActive(game.getGameState(), game.getModifiersQuerying(), Filters.culture(Culture.MORIA), Filters.type(CardType.MINION)) >= 5;
|
||||
&& Filters.countSpottable(game.getGameState(), game.getModifiersQuerying(), Filters.culture(Culture.MORIA), Filters.type(CardType.MINION)) >= 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -39,7 +39,7 @@ public class Card1_194 extends AbstractResponseEvent {
|
||||
@Override
|
||||
public List<PlayEventAction> getOptionalBeforeActions(String playerId, LotroGame game, Effect effect, PhysicalCard self) {
|
||||
if (PlayConditions.played(game.getGameState(), game.getModifiersQuerying(), effect, Filters.and(Filters.type(CardType.EVENT), Filters.keyword(Keyword.STEALTH)))
|
||||
&& Filters.countActive(game.getGameState(), game.getModifiersQuerying(), Filters.culture(Culture.MORIA), Filters.type(CardType.MINION)) >= 3
|
||||
&& Filters.countSpottable(game.getGameState(), game.getModifiersQuerying(), Filters.culture(Culture.MORIA), Filters.type(CardType.MINION)) >= 3
|
||||
&& PlayConditions.canPayForShadowCard(game, self, 0)) {
|
||||
PlayEventAction action = new PlayEventAction(self);
|
||||
action.appendEffect(new CancelEventEffect(playerId, (PlayEventEffect) effect));
|
||||
|
||||
@@ -27,7 +27,7 @@ public class Card1_239 extends AbstractEvent {
|
||||
public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) {
|
||||
return super.checkPlayRequirements(playerId, game, self, twilightModifier)
|
||||
&& Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.culture(Culture.SAURON), Filters.race(Race.ORC))
|
||||
&& Filters.countActive(game.getGameState(), game.getModifiersQuerying(), Filters.type(CardType.COMPANION)) >= 5;
|
||||
&& Filters.countSpottable(game.getGameState(), game.getModifiersQuerying(), Filters.type(CardType.COMPANION)) >= 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -27,7 +27,8 @@ public class Card1_248 extends AbstractEvent {
|
||||
@Override
|
||||
public PlayEventAction getPlayCardAction(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) {
|
||||
PlayEventAction action = new PlayEventAction(self);
|
||||
int sauronMinions = Filters.countActive(game.getGameState(), game.getModifiersQuerying(), Filters.culture(Culture.SAURON), Filters.type(CardType.MINION));
|
||||
// TODO This should give an option to spot less
|
||||
int sauronMinions = Filters.countSpottable(game.getGameState(), game.getModifiersQuerying(), Filters.culture(Culture.SAURON), Filters.type(CardType.MINION));
|
||||
action.appendEffect(
|
||||
new AddTwilightEffect(sauronMinions));
|
||||
return action;
|
||||
|
||||
@@ -29,7 +29,7 @@ public class Card1_251 extends AbstractEvent {
|
||||
public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) {
|
||||
return super.checkPlayRequirements(playerId, game, self, twilightModifier)
|
||||
&& Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.culture(Culture.SAURON), Filters.race(Race.ORC))
|
||||
&& Filters.countActive(game.getGameState(), game.getModifiersQuerying(), Filters.type(CardType.COMPANION)) >= 6;
|
||||
&& Filters.countSpottable(game.getGameState(), game.getModifiersQuerying(), Filters.type(CardType.COMPANION)) >= 6;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -51,7 +51,7 @@ public class Card1_253 extends AbstractPermanent {
|
||||
new Filter() {
|
||||
@Override
|
||||
public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) {
|
||||
return Filters.countActive(gameState, modifiersQuerying, Filters.type(CardType.COMPANION)) >= 5;
|
||||
return Filters.countSpottable(gameState, modifiersQuerying, Filters.type(CardType.COMPANION)) >= 5;
|
||||
}
|
||||
}
|
||||
), 2);
|
||||
|
||||
@@ -33,7 +33,7 @@ public class Card1_256 extends AbstractMinion {
|
||||
return new AbstractModifier(self, "For each companion you can spot, this minion is strength +1.", Filters.sameCard(self), new ModifierEffect[]{ModifierEffect.STRENGTH_MODIFIER}) {
|
||||
@Override
|
||||
public int getStrength(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard, int result) {
|
||||
int companions = Filters.countActive(gameState, modifiersQuerying, Filters.type(CardType.COMPANION));
|
||||
int companions = Filters.countSpottable(gameState, modifiersQuerying, Filters.type(CardType.COMPANION));
|
||||
return companions + result;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -32,7 +32,7 @@ public class Card1_259 extends AbstractMinion {
|
||||
return new AbstractModifier(self, "For each other [SAURON] Orc you can spot, Morgul Warden is strength +1.", Filters.sameCard(self), new ModifierEffect[]{ModifierEffect.STRENGTH_MODIFIER}) {
|
||||
@Override
|
||||
public int getStrength(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard, int result) {
|
||||
int otherSauronOrcs = Filters.countActive(gameState, modifiersQuerying, Filters.culture(Culture.SAURON), Filters.race(Race.ORC), Filters.not(Filters.sameCard(self)));
|
||||
int otherSauronOrcs = Filters.countSpottable(gameState, modifiersQuerying, Filters.culture(Culture.SAURON), Filters.race(Race.ORC), Filters.not(Filters.sameCard(self)));
|
||||
return otherSauronOrcs + result;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -31,7 +31,7 @@ public class Card1_260 extends AbstractPermanent {
|
||||
new Condition() {
|
||||
@Override
|
||||
public boolean isFullfilled(GameState gameState, ModifiersQuerying modifiersQuerying) {
|
||||
return Filters.countActive(gameState, modifiersQuerying, Filters.type(CardType.COMPANION)) >= 7;
|
||||
return Filters.countSpottable(gameState, modifiersQuerying, Filters.type(CardType.COMPANION)) >= 7;
|
||||
}
|
||||
},
|
||||
-1);
|
||||
|
||||
@@ -43,7 +43,7 @@ public class Card1_262 extends AbstractMinion {
|
||||
@Override
|
||||
protected List<? extends Action> getExtraPhaseActions(final String playerId, LotroGame game, final PhysicalCard self) {
|
||||
if (PlayConditions.canUseShadowCardDuringPhase(game.getGameState(), Phase.ASSIGNMENT, self, 0)
|
||||
&& Filters.countActive(game.getGameState(), game.getModifiersQuerying(), Filters.race(Race.HOBBIT), Filters.type(CardType.COMPANION)) >= 2
|
||||
&& Filters.countSpottable(game.getGameState(), game.getModifiersQuerying(), Filters.race(Race.HOBBIT), Filters.type(CardType.COMPANION)) >= 2
|
||||
&& Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.sameCard(self), Filters.notAssigned())) {
|
||||
final ActivateCardAction action = new ActivateCardAction(self, Keyword.ASSIGNMENT);
|
||||
action.appendEffect(
|
||||
|
||||
@@ -57,7 +57,7 @@ public class Card1_316 extends AbstractPermanent {
|
||||
), new ModifierEffect[]{ModifierEffect.TWILIGHT_COST_MODIFIER}) {
|
||||
@Override
|
||||
public int getTwilightCost(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard, int result) {
|
||||
int hobbitsCount = Filters.countActive(gameState, modifiersQuerying, Filters.type(CardType.COMPANION), Filters.race(Race.HOBBIT));
|
||||
int hobbitsCount = Filters.countSpottable(gameState, modifiersQuerying, Filters.type(CardType.COMPANION), Filters.race(Race.HOBBIT));
|
||||
if (hobbitsCount >= 4)
|
||||
return result - 2;
|
||||
if (hobbitsCount >= 2)
|
||||
|
||||
@@ -32,7 +32,7 @@ public class Card1_359 extends AbstractSite {
|
||||
@Override
|
||||
public List<? extends Action> getPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
|
||||
if (PlayConditions.canUseSiteDuringPhase(game.getGameState(), Phase.SHADOW, self)
|
||||
&& Filters.countActive(game.getGameState(), game.getModifiersQuerying(), Filters.race(Race.ORC)) >= 5) {
|
||||
&& Filters.countSpottable(game.getGameState(), game.getModifiersQuerying(), Filters.race(Race.ORC)) >= 5) {
|
||||
ActivateCardAction action = new ActivateCardAction(self, Keyword.SHADOW);
|
||||
action.appendEffect(
|
||||
new AddUntilEndOfTurnModifierEffect(
|
||||
|
||||
@@ -39,7 +39,7 @@ public class Card1_231 extends AbstractMinion {
|
||||
if (PlayConditions.canUseShadowCardDuringPhase(game.getGameState(), Phase.MANEUVER, self, 0)
|
||||
&& PlayConditions.canExert(self, game.getGameState(), game.getModifiersQuerying(), self)
|
||||
&& (
|
||||
Filters.countActive(game.getGameState(), game.getModifiersQuerying(), Filters.type(CardType.COMPANION)) >= 6
|
||||
Filters.countSpottable(game.getGameState(), game.getModifiersQuerying(), Filters.type(CardType.COMPANION)) >= 6
|
||||
|| game.getGameState().getBurdens() >= 5)) {
|
||||
final ActivateCardAction action = new ActivateCardAction(self, Keyword.MANEUVER);
|
||||
action.appendCost(
|
||||
|
||||
@@ -34,7 +34,7 @@ public class Card1_237 extends AbstractMinion {
|
||||
return new AbstractModifier(self, "For each other Nazgul you can spot, The Witch-king is strength +2.", Filters.sameCard(self), new ModifierEffect[]{ModifierEffect.STRENGTH_MODIFIER}) {
|
||||
@Override
|
||||
public int getStrength(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard, int result) {
|
||||
int otherNazgul = Filters.countActive(gameState, modifiersQuerying, Filters.race(Race.NAZGUL), Filters.not(Filters.sameCard(self)));
|
||||
int otherNazgul = Filters.countSpottable(gameState, modifiersQuerying, Filters.race(Race.NAZGUL), Filters.not(Filters.sameCard(self)));
|
||||
return result + (otherNazgul * 2);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -33,7 +33,7 @@ public class Card2_007 extends AbstractCompanion {
|
||||
return new AbstractModifier(self, "For each DWARVEN tale you can spot, Gloin is strength +1 (limit +4)", Filters.sameCard(self), new ModifierEffect[]{ModifierEffect.STRENGTH_MODIFIER}) {
|
||||
@Override
|
||||
public int getStrength(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard, int result) {
|
||||
int bonus = Math.max(4, Filters.countActive(gameState, modifiersQuerying, Filters.culture(Culture.DWARVEN), Filters.keyword(Keyword.TALE)));
|
||||
int bonus = Math.max(4, Filters.countSpottable(gameState, modifiersQuerying, Filters.culture(Culture.DWARVEN), Filters.keyword(Keyword.TALE)));
|
||||
return result + bonus;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -41,7 +41,7 @@ public class Card2_039 extends AbstractEvent {
|
||||
PlayEventAction action = new PlayEventAction(self);
|
||||
action.appendCost(
|
||||
new ChooseAndExertCharactersCost(action, playerId, 1, 1, Filters.race(Race.URUK_HAI)));
|
||||
int companions = Filters.countActive(game.getGameState(), game.getModifiersQuerying(), Filters.type(CardType.COMPANION));
|
||||
int companions = Filters.countSpottable(game.getGameState(), game.getModifiersQuerying(), Filters.type(CardType.COMPANION));
|
||||
if (companions >= 6)
|
||||
action.appendEffect(
|
||||
new DiscardCardsFromPlayEffect(self,
|
||||
|
||||
@@ -26,7 +26,7 @@ public class Card2_099 extends AbstractEvent {
|
||||
@Override
|
||||
public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) {
|
||||
return super.checkPlayRequirements(playerId, game, self, twilightModifier)
|
||||
&& Filters.countActive(game.getGameState(), game.getModifiersQuerying(), Filters.race(Race.HOBBIT)) >= 2;
|
||||
&& Filters.countSpottable(game.getGameState(), game.getModifiersQuerying(), Filters.race(Race.HOBBIT)) >= 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -31,7 +31,7 @@ public class Card2_107 extends AbstractPermanent {
|
||||
@Override
|
||||
public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) {
|
||||
return super.checkPlayRequirements(playerId, game, self, twilightModifier)
|
||||
&& Filters.countActive(game.getGameState(), game.getModifiersQuerying(), Filters.race(Race.HOBBIT)) >= 2;
|
||||
&& Filters.countSpottable(game.getGameState(), game.getModifiersQuerying(), Filters.race(Race.HOBBIT)) >= 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.gempukku.lotro.cards.set3.dwarven;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractAttachable;
|
||||
import com.gempukku.lotro.cards.PlayConditions;
|
||||
import com.gempukku.lotro.cards.costs.ExertCharactersCost;
|
||||
import com.gempukku.lotro.cards.effects.AddUntilEndOfPhaseModifierEffect;
|
||||
import com.gempukku.lotro.cards.modifiers.KeywordSpotModifier;
|
||||
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.LotroGame;
|
||||
import com.gempukku.lotro.logic.actions.ActivateCardAction;
|
||||
import com.gempukku.lotro.logic.timing.Action;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Set: Realms of Elf-lords
|
||||
* Side: Free
|
||||
* Culture: Dwarven
|
||||
* Twilight Cost: 1
|
||||
* Type: Possession • Pipe
|
||||
* Game Text: Bearer must be Gimli. Fellowship: Exert Gimli to add 1 to the number of pipes you can spot.
|
||||
*/
|
||||
public class Card3_002 extends AbstractAttachable {
|
||||
public Card3_002() {
|
||||
super(Side.FREE_PEOPLE, CardType.POSSESSION, 1, Culture.DWARVEN, Keyword.PIPE, "Gimli's Pipe", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Filter getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self) {
|
||||
return Filters.name("Gimli");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<? extends Action> getExtraPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
|
||||
if (PlayConditions.canUseFPCardDuringPhase(game.getGameState(), Phase.FELLOWSHIP, self)
|
||||
&& PlayConditions.canExert(self, game.getGameState(), game.getModifiersQuerying(), self.getAttachedTo())) {
|
||||
ActivateCardAction action = new ActivateCardAction(self, Keyword.FELLOWSHIP);
|
||||
action.appendCost(
|
||||
new ExertCharactersCost(self, self.getAttachedTo()));
|
||||
action.appendEffect(
|
||||
new AddUntilEndOfPhaseModifierEffect(
|
||||
new KeywordSpotModifier(self, Keyword.PIPE), Phase.FELLOWSHIP));
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -20,11 +20,18 @@ public class Filters {
|
||||
return visitor.isSpotted();
|
||||
}
|
||||
|
||||
public static int countSpottable(GameState gameState, ModifiersQuerying modifiersQuerying, Filter... filters) {
|
||||
Filter filter = Filters.and(filters);
|
||||
GetCardsMatchingFilterVisitor visitor = new GetCardsMatchingFilterVisitor(gameState, modifiersQuerying, filter);
|
||||
gameState.iterateActiveCards(visitor);
|
||||
return modifiersQuerying.getSpotCount(gameState, filter, visitor.getCounter());
|
||||
}
|
||||
|
||||
public static Collection<PhysicalCard> filterActive(GameState gameState, ModifiersQuerying modifiersQuerying, Filter... filters) {
|
||||
Filter filter = Filters.and(filters);
|
||||
GetCardsVisitor getCards = new GetCardsVisitor(gameState, modifiersQuerying, filter);
|
||||
gameState.iterateActiveCards(getCards);
|
||||
return getCards.getPhysicalCards();
|
||||
GetCardsMatchingFilterVisitor getCardsMatchingFilter = new GetCardsMatchingFilterVisitor(gameState, modifiersQuerying, filter);
|
||||
gameState.iterateActiveCards(getCardsMatchingFilter);
|
||||
return getCardsMatchingFilter.getPhysicalCards();
|
||||
}
|
||||
|
||||
public static Collection<PhysicalCard> filter(Collection<? extends PhysicalCard> cards, GameState gameState, ModifiersQuerying modifiersQuerying, Filter... filters) {
|
||||
@@ -43,9 +50,9 @@ public class Filters {
|
||||
}
|
||||
|
||||
public static int countActive(GameState gameState, ModifiersQuerying modifiersQuerying, Filter... filters) {
|
||||
GetCardsVisitor visitor = new GetCardsVisitor(gameState, modifiersQuerying, Filters.and(filters));
|
||||
gameState.iterateActiveCards(visitor);
|
||||
return visitor.getCounter();
|
||||
GetCardsMatchingFilterVisitor matchingFilterVisitor = new GetCardsMatchingFilterVisitor(gameState, modifiersQuerying, Filters.and(filters));
|
||||
gameState.iterateActiveCards(matchingFilterVisitor);
|
||||
return matchingFilterVisitor.getCounter();
|
||||
}
|
||||
|
||||
// Filters available
|
||||
@@ -190,7 +197,7 @@ public class Filters {
|
||||
return new Filter() {
|
||||
@Override
|
||||
public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) {
|
||||
return physicalCard.getOwner().equals(playerId);
|
||||
return physicalCard.getOwner() != null && physicalCard.getOwner().equals(playerId);
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -272,7 +279,7 @@ public class Filters {
|
||||
return new Filter() {
|
||||
@Override
|
||||
public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) {
|
||||
return (physicalCard.getBlueprint().getName().equals(name));
|
||||
return physicalCard.getBlueprint().getName() != null && physicalCard.getBlueprint().getName().equals(name);
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -395,14 +402,14 @@ public class Filters {
|
||||
}
|
||||
}
|
||||
|
||||
private static class GetCardsVisitor extends CompletePhysicalCardVisitor {
|
||||
private static class GetCardsMatchingFilterVisitor extends CompletePhysicalCardVisitor {
|
||||
private GameState _gameState;
|
||||
private ModifiersQuerying _modifiersQuerying;
|
||||
private Filter _filter;
|
||||
|
||||
private Set<PhysicalCard> _physicalCards = new HashSet<PhysicalCard>();
|
||||
|
||||
private GetCardsVisitor(GameState gameState, ModifiersQuerying modifiersQuerying, Filter filter) {
|
||||
private GetCardsMatchingFilterVisitor(GameState gameState, ModifiersQuerying modifiersQuerying, Filter filter) {
|
||||
_gameState = gameState;
|
||||
_modifiersQuerying = modifiersQuerying;
|
||||
_filter = filter;
|
||||
|
||||
@@ -164,4 +164,9 @@ public abstract class AbstractModifier implements Modifier {
|
||||
public boolean canLookOrRevealCardsInHand(GameState gameState, ModifiersQuerying modifiersQuerying, String playerId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSpotCount(GameState gameState, ModifiersQuerying modifiersQuerying, Filter filter, int result) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.gempukku.lotro.logic.modifiers;
|
||||
import com.gempukku.lotro.common.Keyword;
|
||||
import com.gempukku.lotro.common.Phase;
|
||||
import com.gempukku.lotro.common.Side;
|
||||
import com.gempukku.lotro.filters.Filter;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.GameState;
|
||||
import com.gempukku.lotro.logic.timing.Action;
|
||||
@@ -64,4 +65,6 @@ public interface Modifier {
|
||||
public boolean canBeHealed(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard card, boolean result);
|
||||
|
||||
public boolean canLookOrRevealCardsInHand(GameState gameState, ModifiersQuerying modifiersQuerying, String playerId);
|
||||
|
||||
public int getSpotCount(GameState gameState, ModifiersQuerying modifiersQuerying, Filter filter, int result);
|
||||
}
|
||||
|
||||
@@ -3,5 +3,5 @@ package com.gempukku.lotro.logic.modifiers;
|
||||
public enum ModifierEffect {
|
||||
KEYWORD_MODIFIER, STRENGTH_MODIFIER, VITALITY_MODIFIER, TWILIGHT_COST_MODIFIER, OVERWHELM_MODIFIER, WOUND_MODIFIER,
|
||||
PRESENCE_MODIFIER, ARCHERY_MODIFIER, MOVE_LIMIT_MODIFIER, ACTION_MODIFIER, ASSIGNMENT_MODIFIER, DISCARD_FROM_PLAY_MODIFIER,
|
||||
LOOK_OR_REVEAL_MODIFIER
|
||||
LOOK_OR_REVEAL_MODIFIER, SPOT_MODIFIER
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.gempukku.lotro.common.CardType;
|
||||
import com.gempukku.lotro.common.Keyword;
|
||||
import com.gempukku.lotro.common.Phase;
|
||||
import com.gempukku.lotro.common.Side;
|
||||
import com.gempukku.lotro.filters.Filter;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.GameState;
|
||||
import com.gempukku.lotro.logic.timing.Action;
|
||||
@@ -392,6 +393,14 @@ public class ModifiersLogic implements ModifiersEnvironment, ModifiersQuerying {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSpotCount(GameState gameState, Filter filter, int inPlayCount) {
|
||||
int result = inPlayCount;
|
||||
for (Modifier modifier : getModifiers(ModifierEffect.SPOT_MODIFIER))
|
||||
result = modifier.getSpotCount(gameState, this, filter, result);
|
||||
return Math.max(0, result);
|
||||
}
|
||||
|
||||
private class ModifierHookImpl implements ModifierHook {
|
||||
private Modifier _modifier;
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.gempukku.lotro.logic.modifiers;
|
||||
import com.gempukku.lotro.common.Keyword;
|
||||
import com.gempukku.lotro.common.Phase;
|
||||
import com.gempukku.lotro.common.Side;
|
||||
import com.gempukku.lotro.filters.Filter;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.GameState;
|
||||
import com.gempukku.lotro.logic.timing.Action;
|
||||
@@ -55,4 +56,6 @@ public interface ModifiersQuerying {
|
||||
public boolean canDrawCardAndIncrement(GameState gameState, String playerId);
|
||||
|
||||
public boolean canLookOrRevealCardsInHand(GameState gameState, String playerId);
|
||||
|
||||
public int getSpotCount(GameState gameState, Filter filter, int inPlayCount);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user