If a card just looks if there is anything stacked (with Filters.any) it will find cards that do not belong to active side.
This commit is contained in:
@@ -6,11 +6,9 @@ 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.Condition;
|
||||
import com.gempukku.lotro.logic.modifiers.Modifier;
|
||||
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
|
||||
import com.gempukku.lotro.logic.modifiers.SpotCondition;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@@ -38,11 +36,6 @@ public class Card4_167 extends AbstractAttachable {
|
||||
public List<? extends Modifier> getAlwaysOnModifiers(LotroGame game, final PhysicalCard self) {
|
||||
return Collections.singletonList(
|
||||
new SidePlayerCantPlayPhaseEventsOrSpecialAbilitiesModifier(self,
|
||||
new Condition() {
|
||||
@Override
|
||||
public boolean isFullfilled(GameState gameState, ModifiersQuerying modifiersQuerying) {
|
||||
return Filters.filter(gameState.getStackedCards(self.getAttachedTo()), gameState, modifiersQuerying, Filters.activeSide, Race.URUK_HAI).size() > 0;
|
||||
}
|
||||
}, Side.FREE_PEOPLE, Phase.SKIRMISH));
|
||||
new SpotCondition(self, Filters.hasStacked(Race.URUK_HAI)), Side.FREE_PEOPLE, Phase.SKIRMISH));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -637,6 +637,8 @@ public class Filters {
|
||||
@Override
|
||||
public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) {
|
||||
List<PhysicalCard> physicalCardList = gameState.getStackedCards(physicalCard);
|
||||
if (filter.length == 1 && filter[0] == Filters.any)
|
||||
return physicalCardList.size() > 0;
|
||||
return (Filters.filter(physicalCardList, gameState, modifiersQuerying, Filters.and(filter, activeSide)).size() > 0);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -8,7 +8,6 @@ import com.gempukku.lotro.logic.decisions.AwaitingDecision;
|
||||
import com.gempukku.lotro.logic.decisions.AwaitingDecisionType;
|
||||
import com.gempukku.lotro.logic.decisions.DecisionResultInvalidException;
|
||||
import com.gempukku.lotro.logic.vo.LotroDeck;
|
||||
import static junit.framework.Assert.assertEquals;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.Arrays;
|
||||
@@ -16,6 +15,8 @@ import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static junit.framework.Assert.assertEquals;
|
||||
|
||||
public class IndividualCardAtTest extends AbstractAtTest {
|
||||
@Test
|
||||
public void dwarvenAxeDoesNotFreeze() throws DecisionResultInvalidException {
|
||||
@@ -484,4 +485,34 @@ public class IndividualCardAtTest extends AbstractAtTest {
|
||||
|
||||
assertEquals(8, _game.getModifiersQuerying().getTwilightCost(_game.getGameState(), attea, false));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void sentBackAllowsPlayingCardInDeadPile() throws DecisionResultInvalidException {
|
||||
initializeSimplestGame();
|
||||
|
||||
PhysicalCardImpl sentBack = new PhysicalCardImpl(100, "9_27", P1, _library.getLotroCardBlueprint("9_27"));
|
||||
_game.getGameState().addCardToZone(_game, sentBack, Zone.SUPPORT);
|
||||
|
||||
PhysicalCardImpl radagast1 = new PhysicalCardImpl(101, "9_26", P1, _library.getLotroCardBlueprint("9_26"));
|
||||
_game.getGameState().addCardToZone(_game, radagast1, Zone.DEAD);
|
||||
|
||||
PhysicalCardImpl radagast2 = new PhysicalCardImpl(101, "9_26", P1, _library.getLotroCardBlueprint("9_26"));
|
||||
_game.getGameState().addCardToZone(_game, radagast2, Zone.HAND);
|
||||
|
||||
skipMulligans();
|
||||
|
||||
// End fellowship
|
||||
AwaitingDecision playFellowshipAction = _userFeedback.getAwaitingDecision(P1);
|
||||
assertEquals(AwaitingDecisionType.CARD_ACTION_CHOICE, playFellowshipAction.getDecisionType());
|
||||
validateContents(new String[]{"" + sentBack.getCardId()}, ((String[]) playFellowshipAction.getDecisionParameters().get("cardId")));
|
||||
playerDecided(P1, "0");
|
||||
|
||||
AwaitingDecision chooseRadagast = _userFeedback.getAwaitingDecision(P1);
|
||||
assertEquals(AwaitingDecisionType.CARD_SELECTION, chooseRadagast.getDecisionType());
|
||||
validateContents(new String[]{"" + radagast2.getCardId()}, ((String[]) chooseRadagast.getDecisionParameters().get("cardId")));
|
||||
playerDecided(P1, String.valueOf(radagast2.getCardId()));
|
||||
|
||||
assertEquals(Zone.FREE_CHARACTERS, radagast2.getZone());
|
||||
assertEquals(4, _game.getGameState().getTwilightPool());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user