diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/effects/ReplaceOpponentSiteEffect.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/effects/PlaySiteEffect.java similarity index 73% rename from gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/effects/ReplaceOpponentSiteEffect.java rename to gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/effects/PlaySiteEffect.java index 76665a43b..16aa11c10 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/effects/ReplaceOpponentSiteEffect.java +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/effects/PlaySiteEffect.java @@ -7,11 +7,11 @@ import com.gempukku.lotro.game.state.GameState; import com.gempukku.lotro.game.state.LotroGame; import com.gempukku.lotro.logic.timing.UnrespondableEffect; -public class ReplaceOpponentSiteEffect extends UnrespondableEffect { +public class PlaySiteEffect extends UnrespondableEffect { private String _playerId; private int _siteNumber; - public ReplaceOpponentSiteEffect(String playerId, int siteNumber) { + public PlaySiteEffect(String playerId, int siteNumber) { _playerId = playerId; _siteNumber = siteNumber; } @@ -20,9 +20,11 @@ public class ReplaceOpponentSiteEffect extends UnrespondableEffect { public void playEffect(LotroGame game) { GameState gameState = game.getGameState(); PhysicalCard card = gameState.getSite(_siteNumber); - gameState.stopAffecting(card); - gameState.removeCardFromZone(card); - gameState.addCardToZone(card, Zone.DECK); + if (card != null) { + gameState.stopAffecting(card); + gameState.removeCardFromZone(card); + gameState.addCardToZone(card, Zone.DECK); + } PhysicalCard newSite = Filters.filter(gameState.getAdventureDeck(_playerId), game.getGameState(), game.getModifiersQuerying(), Filters.siteNumber(_siteNumber)).get(0); gameState.addCardToZone(newSite, Zone.ADVENTURE_PATH); gameState.startAffecting(newSite, game.getModifiersEnvironment()); diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/shire/Card1_295.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/shire/Card1_295.java index dac4cb884..da7a29cdb 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/shire/Card1_295.java +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/shire/Card1_295.java @@ -3,7 +3,7 @@ package com.gempukku.lotro.cards.set1.shire; import com.gempukku.lotro.cards.AbstractAlly; import com.gempukku.lotro.cards.PlayConditions; import com.gempukku.lotro.cards.effects.ExertCharacterEffect; -import com.gempukku.lotro.cards.effects.ReplaceOpponentSiteEffect; +import com.gempukku.lotro.cards.effects.PlaySiteEffect; import com.gempukku.lotro.cards.modifiers.ProxyingModifier; import com.gempukku.lotro.common.CardType; import com.gempukku.lotro.common.Culture; @@ -97,7 +97,7 @@ public class Card1_295 extends AbstractAlly { && PlayConditions.canExert(game.getGameState(), game.getModifiersQuerying(), self)) { DefaultCostToEffectAction action = new DefaultCostToEffectAction(self, Keyword.FELLOWSHIP, "Exert this ally and to replace opponent's site 1 with your site 1."); action.addCost(new ExertCharacterEffect(self)); - action.addEffect(new ReplaceOpponentSiteEffect(playerId, 1)); + action.addEffect(new PlaySiteEffect(playerId, 1)); actions.add(action); } LotroCardBlueprint copied = getCopied(game, self); diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/shire/Card1_316.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/shire/Card1_316.java index 8ba594e4b..0a5d0f5bf 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/shire/Card1_316.java +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/shire/Card1_316.java @@ -16,6 +16,9 @@ import com.gempukku.lotro.logic.modifiers.ModifierEffect; import com.gempukku.lotro.logic.modifiers.ModifiersQuerying; import com.gempukku.lotro.logic.timing.Action; +import java.util.Collections; +import java.util.List; + /** * Set: The Fellowship of the Ring * Side: Free @@ -49,6 +52,15 @@ public class Card1_316 extends AbstractLotroCardBlueprint { return action; } + @Override + public List getPhaseActions(String playerId, LotroGame game, PhysicalCard self) { + if (PlayConditions.canPlayFPCardDuringPhase(game, Phase.FELLOWSHIP, self) + && checkPlayRequirements(playerId, game, self)) { + return Collections.singletonList(getPlayCardAction(playerId, game, self, 0)); + } + return null; + } + @Override public Modifier getAlwaysOnEffect(PhysicalCard self) { return new AbstractModifier(self, "Spot 2 Hobbit companions to make the shadow number -1 (or spot 4 to make it -2)", diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/shire/Card1_318.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/shire/Card1_318.java new file mode 100644 index 000000000..42cafe182 --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set1/shire/Card1_318.java @@ -0,0 +1,75 @@ +package com.gempukku.lotro.cards.set1.shire; + +import com.gempukku.lotro.cards.AbstractLotroCardBlueprint; +import com.gempukku.lotro.cards.PlayConditions; +import com.gempukku.lotro.cards.actions.PlayPermanentAction; +import com.gempukku.lotro.cards.effects.ExertCharacterEffect; +import com.gempukku.lotro.cards.effects.PlaySiteEffect; +import com.gempukku.lotro.common.*; +import com.gempukku.lotro.filters.Filters; +import com.gempukku.lotro.game.PhysicalCard; +import com.gempukku.lotro.game.state.LotroGame; +import com.gempukku.lotro.logic.actions.DefaultCostToEffectAction; +import com.gempukku.lotro.logic.effects.ChooseActiveCardsEffect; +import com.gempukku.lotro.logic.effects.DiscardCardFromPlayEffect; +import com.gempukku.lotro.logic.timing.Action; + +import java.util.Collections; +import java.util.List; + +/** + * Set: The Fellowship of the Ring + * Side: Free + * Culture: Shire + * Twilight Cost: 0 + * Type: Possession + * Game Text: Plays to your support area. Fellowship or Regroup: Exert 2 Hobbits and discard Thror's Map to play the + * fellowship's next site (replacing opponent's site if necessary). + */ +public class Card1_318 extends AbstractLotroCardBlueprint { + public Card1_318() { + super(Side.FREE_PEOPLE, CardType.POSSESSION, Culture.SHIRE, "Thror's Map", true); + } + + @Override + public int getTwilightCost() { + return 0; + } + + @Override + public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self) { + return PlayConditions.checkUniqueness(game.getGameState(), game.getModifiersQuerying(), self); + } + + @Override + public Action getPlayCardAction(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) { + return new PlayPermanentAction(self, Zone.FREE_SUPPORT); + } + + @Override + public List getPhaseActions(String playerId, LotroGame game, PhysicalCard self) { + if (PlayConditions.canPlayFPCardDuringPhase(game, Phase.FELLOWSHIP, self) + && checkPlayRequirements(playerId, game, self)) { + return Collections.singletonList(getPlayCardAction(playerId, game, self, 0)); + } + + if ((PlayConditions.canUseFPCardDuringPhase(game.getGameState(), Phase.FELLOWSHIP, self) + || PlayConditions.canUseFPCardDuringPhase(game.getGameState(), Phase.REGROUP, self)) + && Filters.countActive(game.getGameState(), game.getModifiersQuerying(), Filters.keyword(Keyword.HOBBIT), Filters.canExert()) >= 2) { + Keyword phaseKeyword = (game.getGameState().getCurrentPhase() == Phase.FELLOWSHIP) ? Keyword.FELLOWSHIP : Keyword.REGROUP; + final DefaultCostToEffectAction action = new DefaultCostToEffectAction(self, phaseKeyword, "Exert 2 Hobbits and discard Thror's Map to play the fellowship's next site (replacing opponent's site if necessary)"); + action.addCost( + new ChooseActiveCardsEffect(playerId, "Choose Hobbit", 2, 2, Filters.keyword(Keyword.HOBBIT), Filters.canExert()) { + @Override + protected void cardsSelected(List cards) { + action.addCost(new ExertCharacterEffect(cards.get(0))); + action.addCost(new ExertCharacterEffect(cards.get(1))); + } + }); + action.addCost(new DiscardCardFromPlayEffect(self, self)); + action.addEffect(new PlaySiteEffect(playerId, game.getGameState().getCurrentSiteNumber() + 1)); + return Collections.singletonList(action); + } + return null; + } +}