- Cards stacked on sites do not count as their type, while their owner is not of correct side.
This commit is contained in:
@@ -41,7 +41,7 @@ public class Card4_167 extends AbstractAttachable {
|
||||
new Condition() {
|
||||
@Override
|
||||
public boolean isFullfilled(GameState gameState, ModifiersQuerying modifiersQuerying) {
|
||||
return Filters.filter(gameState.getStackedCards(self.getAttachedTo()), gameState, modifiersQuerying, Race.URUK_HAI).size() > 0;
|
||||
return Filters.filter(gameState.getStackedCards(self.getAttachedTo()), gameState, modifiersQuerying, Filters.activeSide, Race.URUK_HAI).size() > 0;
|
||||
}
|
||||
}, Side.FREE_PEOPLE, Phase.SKIRMISH));
|
||||
}
|
||||
|
||||
@@ -49,12 +49,8 @@ public class Card7_316 extends AbstractPermanent {
|
||||
@Override
|
||||
public int evaluateExpression(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard cardAffected) {
|
||||
int counter = 0;
|
||||
for (PhysicalCard site : Filters.filterActive(gameState, modifiersQuerying, CardType.SITE)) {
|
||||
for (PhysicalCard physicalCard : gameState.getStackedCards(site)) {
|
||||
if (modifiersQuerying.hasKeyword(gameState, physicalCard, Keyword.BESIEGER))
|
||||
counter++;
|
||||
}
|
||||
}
|
||||
for (PhysicalCard site : Filters.filterActive(gameState, modifiersQuerying, CardType.SITE))
|
||||
counter += Filters.filter(gameState.getStackedCards(site), gameState, modifiersQuerying, Filters.activeSide, Keyword.BESIEGER).size();
|
||||
|
||||
return counter;
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public class Card8_105 extends AbstractMinion {
|
||||
int count = 0;
|
||||
final Collection<PhysicalCard> sites = Filters.filterActive(gameState, modifiersQuerying, CardType.SITE);
|
||||
for (PhysicalCard site : sites)
|
||||
count += Filters.filter(gameState.getStackedCards(site), gameState, modifiersQuerying, Culture.SAURON, CardType.MINION).size();
|
||||
count += Filters.filter(gameState.getStackedCards(site), gameState, modifiersQuerying, Filters.activeSide, Culture.SAURON, CardType.MINION).size();
|
||||
|
||||
return -2 * count;
|
||||
}
|
||||
|
||||
@@ -637,7 +637,7 @@ public class Filters {
|
||||
@Override
|
||||
public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) {
|
||||
List<PhysicalCard> physicalCardList = gameState.getStackedCards(physicalCard);
|
||||
return (Filters.filter(physicalCardList, gameState, modifiersQuerying, filter).size() > 0);
|
||||
return (Filters.filter(physicalCardList, gameState, modifiersQuerying, Filters.and(filter, activeSide)).size() > 0);
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -830,6 +830,17 @@ public class Filters {
|
||||
throw new IllegalArgumentException("Unknown type of filterable: " + filter);
|
||||
}
|
||||
|
||||
public static Filter activeSide = new Filter() {
|
||||
@Override
|
||||
public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) {
|
||||
boolean shadow = physicalCard.getBlueprint().getSide() == Side.SHADOW;
|
||||
if (shadow)
|
||||
return !physicalCard.getOwner().equals(gameState.getCurrentPlayerId());
|
||||
else
|
||||
return physicalCard.getOwner().equals(gameState.getCurrentPlayerId());
|
||||
}
|
||||
};
|
||||
|
||||
private static Filter andInternal(final Filter... filters) {
|
||||
return new Filter() {
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user