diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/PlayConditions.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/PlayConditions.java index 9cbedbfa3..2d47156e5 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/PlayConditions.java +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/PlayConditions.java @@ -527,6 +527,14 @@ public class PlayConditions { return false; } + public static boolean movesFrom(LotroGame game, EffectResult effectResult, Filterable... filters) { + if (effectResult.getType() == EffectResult.Type.WHEN_MOVE_FROM + && Filters.and(filters).accepts(game.getGameState(), game.getModifiersQuerying(), game.getGameState().getCurrentSite())) { + return true; + } + return false; + } + public static boolean canRemoveTokens(LotroGame game, Token token, int count, Filterable... fromFilters) { return Filters.filterActive(game.getGameState(), game.getModifiersQuerying(), Filters.and(fromFilters, Filters.hasToken(token, count))).size() > 0; } diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/site/Card7_333.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/site/Card7_333.java new file mode 100644 index 000000000..cbc634361 --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set7/site/Card7_333.java @@ -0,0 +1,39 @@ +package com.gempukku.lotro.cards.set7.site; + +import com.gempukku.lotro.cards.AbstractSite; +import com.gempukku.lotro.cards.PlayConditions; +import com.gempukku.lotro.cards.effects.RemoveTwilightEffect; +import com.gempukku.lotro.common.Block; +import com.gempukku.lotro.common.Race; +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.timing.EffectResult; + +import java.util.Collections; +import java.util.List; + +/** + * Set: The Return of the King + * Type: Site + * Site: 1K + * Game Text: When the fellowship moves from this site, the Free Peoples player may spot 3 Hobbits to remove (2). + */ +public class Card7_333 extends AbstractSite { + public Card7_333() { + super("Sleeping Quarters", Block.KING, 1, 0, Direction.LEFT); + } + + @Override + public List getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) { + if (PlayConditions.movesFrom(game, effectResult, self) + && PlayConditions.canSpot(game, 3, Race.HOBBIT) + && playerId.equals(game.getGameState().getCurrentPlayerId())) { + OptionalTriggerAction action = new OptionalTriggerAction(self); + action.appendEffect( + new RemoveTwilightEffect(2)); + return Collections.singletonList(action); + } + return null; + } +}