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 4ca27ebbb..d97ef467f 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 @@ -102,11 +102,11 @@ public class PlayConditions { return canExert(self, game, Filters.sameCard(self)); } - public static boolean canExert(PhysicalCard source, LotroGame game, Filter... filters) { + public static boolean canExert(PhysicalCard source, LotroGame game, Filterable... filters) { return canExert(source, game.getGameState(), game.getModifiersQuerying(), filters); } - public static boolean canExert(PhysicalCard source, LotroGame game, int times, Filter... filters) { + public static boolean canExert(PhysicalCard source, LotroGame game, int times, Filterable... filters) { return canExert(source, game.getGameState(), game.getModifiersQuerying(), times, filters); } @@ -118,7 +118,7 @@ public class PlayConditions { return Filters.countSpottable(game.getGameState(), game.getModifiersQuerying(), filters) >= count; } - public static boolean canExertMultiple(final PhysicalCard source, final GameState gameState, final ModifiersQuerying modifiersQuerying, final int times, final int count, Filter... filters) { + public static boolean canExertMultiple(final PhysicalCard source, final GameState gameState, final ModifiersQuerying modifiersQuerying, final int times, final int count, Filterable... filters) { final Filter filter = Filters.and(filters); return gameState.iterateActiveCards( new PhysicalCardVisitor() { @@ -143,15 +143,15 @@ public class PlayConditions { return Filters.filter(game.getGameState().getHand(playerId), game.getGameState(), game.getModifiersQuerying(), Filters.and(filters, Filters.playable(game, twilightModifier))).size() > 0; } - public static boolean canPlayFromDiscard(String playerId, LotroGame game, Filter... filters) { + public static boolean canPlayFromDiscard(String playerId, LotroGame game, Filterable... filters) { return Filters.filter(game.getGameState().getDiscard(playerId), game.getGameState(), game.getModifiersQuerying(), Filters.and(filters, Filters.playable(game))).size() > 0; } - public static boolean canExert(final PhysicalCard source, final GameState gameState, final ModifiersQuerying modifiersQuerying, Filter... filters) { + public static boolean canExert(final PhysicalCard source, final GameState gameState, final ModifiersQuerying modifiersQuerying, Filterable... filters) { return canExert(source, gameState, modifiersQuerying, 1, filters); } - public static boolean canExert(final PhysicalCard source, final GameState gameState, final ModifiersQuerying modifiersQuerying, final int times, Filter... filters) { + public static boolean canExert(final PhysicalCard source, final GameState gameState, final ModifiersQuerying modifiersQuerying, final int times, Filterable... filters) { final Filter filter = Filters.and(filters); return gameState.iterateActiveCards( new PhysicalCardVisitor() { diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/effects/choose/ChooseAndPlayCardFromDiscardEffect.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/effects/choose/ChooseAndPlayCardFromDiscardEffect.java index ee2c5ca1f..c47c8ca8b 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/effects/choose/ChooseAndPlayCardFromDiscardEffect.java +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/effects/choose/ChooseAndPlayCardFromDiscardEffect.java @@ -1,5 +1,6 @@ package com.gempukku.lotro.cards.effects.choose; +import com.gempukku.lotro.common.Filterable; import com.gempukku.lotro.filters.Filter; import com.gempukku.lotro.filters.Filters; import com.gempukku.lotro.game.PhysicalCard; @@ -18,11 +19,11 @@ public class ChooseAndPlayCardFromDiscardEffect extends AbstractEffect { private Filter _filter; private int _twilightModifier; - public ChooseAndPlayCardFromDiscardEffect(String playerId, List cardsInDiscardAtStart, Filter filter) { - this(playerId, cardsInDiscardAtStart, filter, 0); + public ChooseAndPlayCardFromDiscardEffect(String playerId, List cardsInDiscardAtStart, Filterable... filter) { + this(playerId, cardsInDiscardAtStart, 0, filter); } - public ChooseAndPlayCardFromDiscardEffect(String playerId, List cardsInDiscardAtStart, Filter filter, int twilightModifier) { + public ChooseAndPlayCardFromDiscardEffect(String playerId, List cardsInDiscardAtStart, int twilightModifier, Filterable... filter) { _playerId = playerId; // Card has to be in discard when you start playing the card (we need to copy the collection) _filter = Filters.and(filter, Filters.in(new LinkedList(cardsInDiscardAtStart))); diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/moria/Card1_193.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/moria/Card1_193.java index d2414cf62..e9ff36e96 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/moria/Card1_193.java +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/moria/Card1_193.java @@ -41,10 +41,10 @@ public class Card1_193 extends AbstractPermanent { action.appendEffect( new ChooseAndPlayCardFromDiscardEffect(playerId, game.getGameState().getDiscard(playerId), - Filters.and( + -1, Filters.and( Filters.culture(Culture.MORIA), Filters.weapon, - Filters.in(discardedCards)), -1)); + Filters.in(discardedCards)))); return Collections.singletonList(action); } } diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set3/isengard/Card3_052.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set3/isengard/Card3_052.java index 6e860a094..2aa77c58e 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set3/isengard/Card3_052.java +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set3/isengard/Card3_052.java @@ -38,7 +38,7 @@ public class Card3_052 extends AbstractPermanent { new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Filters.name("Saruman"))); List discard = game.getGameState().getDiscard(playerId); action.appendEffect( - new ChooseAndPlayCardFromDiscardEffect(playerId, discard, Filters.and(Filters.culture(Culture.ISENGARD), Filters.keyword(Keyword.WEATHER), Filters.type(CardType.CONDITION)), -2)); + new ChooseAndPlayCardFromDiscardEffect(playerId, discard, -2, Filters.and(Filters.culture(Culture.ISENGARD), Filters.keyword(Keyword.WEATHER), Filters.type(CardType.CONDITION)))); return Collections.singletonList(action); } return null; diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set4/isengard/Card4_170.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set4/isengard/Card4_170.java index 75a115ba0..e640bc5d6 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set4/isengard/Card4_170.java +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set4/isengard/Card4_170.java @@ -41,7 +41,7 @@ public class Card4_170 extends AbstractPermanent { for (int i = 0; i < count; i++) { OptionalTriggerAction action = new OptionalTriggerAction(self); action.appendEffect( - new ChooseAndPlayCardFromDiscardEffect(playerId, game.getGameState().getDiscard(playerId), Filters.and(Filters.type(CardType.MINION), Filters.culture(Culture.ISENGARD)), -2)); + new ChooseAndPlayCardFromDiscardEffect(playerId, game.getGameState().getDiscard(playerId), -2, Filters.and(Filters.type(CardType.MINION), Filters.culture(Culture.ISENGARD)))); optionalTriggers.add(action); } diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set4/rohan/Card4_294.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set4/rohan/Card4_294.java new file mode 100644 index 000000000..36dd613a1 --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set4/rohan/Card4_294.java @@ -0,0 +1,43 @@ +package com.gempukku.lotro.cards.set4.rohan; + +import com.gempukku.lotro.cards.AbstractPermanent; +import com.gempukku.lotro.cards.PlayConditions; +import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect; +import com.gempukku.lotro.cards.effects.choose.ChooseAndPlayCardFromDiscardEffect; +import com.gempukku.lotro.common.*; +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: The Two Towers + * Side: Free + * Culture: Rohan + * Twilight Cost: 1 + * Type: Condition + * Game Text: Plays to your support area. Fellowship: Exert a [ROHAN] Man to play a hand weapon from your discard pile. + */ +public class Card4_294 extends AbstractPermanent { + public Card4_294() { + super(Side.FREE_PEOPLE, 1, CardType.CONDITION, Culture.ROHAN, Zone.SUPPORT, "Weapon Store"); + } + + @Override + protected List getExtraPhaseActions(String playerId, LotroGame game, PhysicalCard self) { + if (PlayConditions.canUseFPCardDuringPhase(game.getGameState(), Phase.FELLOWSHIP, self) + && PlayConditions.canExert(self, game, Culture.ROHAN, Race.MAN) + && PlayConditions.canPlayFromDiscard(playerId, game, PossessionClass.HAND_WEAPON)) { + ActivateCardAction action = new ActivateCardAction(self); + action.appendCost( + new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Culture.ROHAN, Race.MAN)); + action.appendEffect( + new ChooseAndPlayCardFromDiscardEffect(playerId, game.getGameState().getDiscard(playerId), PossessionClass.HAND_WEAPON)); + return Collections.singletonList(action); + } + return null; + } +}