Removing abuse of "canSpot".
This commit is contained in:
@@ -116,7 +116,7 @@ public class PlayConditions {
|
||||
LotroCardBlueprint blueprint = self.getBlueprint();
|
||||
return (!blueprint.isUnique()
|
||||
|| (
|
||||
!Filters.canSpot(gameState, modifiersQuerying, Filters.name(blueprint.getName()))
|
||||
Filters.countActive(gameState, modifiersQuerying, Filters.name(blueprint.getName()))==0
|
||||
&& (ignoreCheckingDeadPile || (Filters.filter(gameState.getDeadPile(self.getOwner()), gameState, modifiersQuerying, Filters.name(blueprint.getName())).size() == 0))));
|
||||
}
|
||||
|
||||
@@ -351,7 +351,7 @@ public class PlayConditions {
|
||||
|
||||
public static boolean canRemoveAnyCultureTokens(LotroGame game, int count, Filterable... fromFilters) {
|
||||
return !game.getModifiersQuerying().hasFlagActive(game.getGameState(), ModifierFlag.CANT_TOUCH_CULTURE_TOKENS)
|
||||
&& Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.and(fromFilters, Filters.hasAnyCultureTokens(count)));
|
||||
&& Filters.countActive(game.getGameState(), game.getModifiersQuerying(), Filters.and(fromFilters, Filters.hasAnyCultureTokens(count)))>0;
|
||||
}
|
||||
|
||||
public static boolean canRemoveTokens(LotroGame game, PhysicalCard from, Token token) {
|
||||
|
||||
@@ -281,7 +281,7 @@ public class TriggerConditions {
|
||||
public static boolean forEachKilledInASkirmish(LotroGame game, EffectResult effectResult, Filterable killedBy, Filterable... killed) {
|
||||
if (effectResult.getType() == EffectResult.Type.FOR_EACH_KILLED
|
||||
&& game.getGameState().getCurrentPhase() == Phase.SKIRMISH
|
||||
&& Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.inSkirmish, killedBy)) {
|
||||
&& Filters.countActive(game.getGameState(), game.getModifiersQuerying(), Filters.inSkirmish, killedBy)>0) {
|
||||
ForEachKilledResult killResult = (ForEachKilledResult) effectResult;
|
||||
|
||||
return Filters.and(killed).accepts(game.getGameState(), game.getModifiersQuerying(), killResult.getKilledCard());
|
||||
|
||||
@@ -31,7 +31,7 @@ public class CancelSkirmishEffect extends AbstractEffect {
|
||||
return game.getGameState().getSkirmish() != null
|
||||
&& !game.getGameState().getSkirmish().isCancelled()
|
||||
&& (_involvementFilter == null || Filters.countActive(game.getGameState(), game.getModifiersQuerying(), Filters.and(_involvementFilter, Filters.inSkirmish)) > 0)
|
||||
&& (game.getFormat().canCancelRingBearerSkirmish() || !Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.ringBearer, Filters.inSkirmish));
|
||||
&& (game.getFormat().canCancelRingBearerSkirmish() || Filters.countActive(game.getGameState(), game.getModifiersQuerying(), Filters.ringBearer, Filters.inSkirmish)==0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -27,7 +27,7 @@ public class ReplaceInSkirmishEffect extends AbstractEffect {
|
||||
|
||||
@Override
|
||||
public boolean isPlayableInFull(LotroGame game) {
|
||||
return Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.and(_replacingFilter, Filters.inSkirmish));
|
||||
return Filters.countActive(game.getGameState(), game.getModifiersQuerying(), Filters.and(_replacingFilter, Filters.inSkirmish))>0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -43,7 +43,7 @@ public class ChooseAndExertCharactersEffect extends ChooseActiveCardsEffect {
|
||||
&& modifiersQuerying.getVitality(gameState, physicalCard) > exertTimes;
|
||||
}
|
||||
};
|
||||
if (Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.and(_filters, filter)))
|
||||
if (Filters.countActive(game.getGameState(), game.getModifiersQuerying(), Filters.and(_filters, filter))>0)
|
||||
return filter;
|
||||
times--;
|
||||
} while (times > 0);
|
||||
|
||||
@@ -88,7 +88,7 @@ public class ChooseAndTransferAttachableEffect extends AbstractEffect {
|
||||
return false;
|
||||
|
||||
AbstractAttachable attachable = (AbstractAttachable) transferredCard.getBlueprint();
|
||||
return Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), getValidTargetFilter(game, transferredCard, attachable));
|
||||
return Filters.countActive(game.getGameState(), game.getModifiersQuerying(), getValidTargetFilter(game, transferredCard, attachable))>0;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ public class ArcheryGameProcess implements GameProcess {
|
||||
|
||||
@Override
|
||||
public void process(LotroGame game) {
|
||||
if (!Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), CardType.MINION)
|
||||
if (Filters.countActive(game.getGameState(), game.getModifiersQuerying(), CardType.MINION)==0
|
||||
|| game.getModifiersQuerying().shouldSkipPhase(game.getGameState(), Phase.ARCHERY, null))
|
||||
_followingGameProcess = new AssignmentGameProcess();
|
||||
else
|
||||
|
||||
@@ -16,7 +16,7 @@ public class AssignmentGameProcess implements GameProcess {
|
||||
|
||||
@Override
|
||||
public void process(LotroGame game) {
|
||||
if (!Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), CardType.MINION)
|
||||
if (Filters.countActive(game.getGameState(), game.getModifiersQuerying(), CardType.MINION)==0
|
||||
|| game.getModifiersQuerying().shouldSkipPhase(game.getGameState(), Phase.ASSIGNMENT, null))
|
||||
_followingGameProcess = new RegroupGameProcess();
|
||||
else
|
||||
|
||||
@@ -14,7 +14,7 @@ public class ManeuverGameProcess implements GameProcess {
|
||||
|
||||
@Override
|
||||
public void process(LotroGame game) {
|
||||
if (!Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), CardType.MINION)
|
||||
if (Filters.countActive(game.getGameState(), game.getModifiersQuerying(), CardType.MINION)==0
|
||||
|| game.getModifiersQuerying().shouldSkipPhase(game.getGameState(), Phase.MANEUVER, null))
|
||||
_followingGameProcess = new ArcheryGameProcess();
|
||||
else
|
||||
|
||||
@@ -18,7 +18,7 @@ public class AfterSkirmishesGameProcess implements GameProcess {
|
||||
if (gameState.isExtraSkirmishes()) {
|
||||
gameState.setExtraSkirmishes(false);
|
||||
_followingGameProcess = new RegroupGameProcess();
|
||||
} else if (!gameState.isFierceSkirmishes() && Filters.canSpot(gameState, game.getModifiersQuerying(), CardType.MINION, Keyword.FIERCE)) {
|
||||
} else if (!gameState.isFierceSkirmishes() && Filters.countActive(gameState, game.getModifiersQuerying(), CardType.MINION, Keyword.FIERCE)>0) {
|
||||
gameState.setFierceSkirmishes(true);
|
||||
_followingGameProcess = new AssignmentGameProcess();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user