diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/effects/PlaySiteEffect.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/effects/PlaySiteEffect.java index 561ed7191..254537378 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/effects/PlaySiteEffect.java +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/effects/PlaySiteEffect.java @@ -19,17 +19,19 @@ public class PlaySiteEffect extends UnrespondableEffect { @Override public void doPlayEffect(LotroGame game) { GameState gameState = game.getGameState(); - PhysicalCard card = gameState.getSite(_siteNumber); - if (card != null) { - if (gameState.getCurrentSiteNumber() == _siteNumber) - 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)).iterator().next(); - gameState.sendMessage(newSite.getOwner() + " plays " + newSite.getBlueprint().getName()); - gameState.addCardToZone(newSite, Zone.ADVENTURE_PATH); - if (gameState.getCurrentSiteNumber() == _siteNumber) - gameState.startAffecting(newSite, game.getModifiersEnvironment()); + if (newSite != null) { + PhysicalCard card = gameState.getSite(_siteNumber); + if (card != null) { + if (gameState.getCurrentSiteNumber() == _siteNumber) + gameState.stopAffecting(card); + gameState.removeCardFromZone(card); + gameState.addCardToZone(card, Zone.DECK); + } + gameState.sendMessage(newSite.getOwner() + " plays " + newSite.getBlueprint().getName()); + gameState.addCardToZone(newSite, Zone.ADVENTURE_PATH); + if (gameState.getCurrentSiteNumber() == _siteNumber) + gameState.startAffecting(newSite, game.getModifiersEnvironment()); + } } } diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set2/site/Card2_116.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set2/site/Card2_116.java new file mode 100644 index 000000000..d2b7a9ff5 --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set2/site/Card2_116.java @@ -0,0 +1,44 @@ +package com.gempukku.lotro.cards.set2.site; + +import com.gempukku.lotro.cards.AbstractSite; +import com.gempukku.lotro.cards.PlayConditions; +import com.gempukku.lotro.cards.costs.ChooseAndExertCharactersCost; +import com.gempukku.lotro.cards.effects.PlaySiteEffect; +import com.gempukku.lotro.common.Keyword; +import com.gempukku.lotro.common.Phase; +import com.gempukku.lotro.common.Race; +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.ActivateCardAction; +import com.gempukku.lotro.logic.timing.Action; + +import java.util.Collections; +import java.util.List; + +/** + * Set: Mines of Moria + * Type: Site + * Site: 1 + * Game Text: Forest. Fellowship: Exert a Hobbit to play your site 2 (replacing opponent's site if necessary). + */ +public class Card2_116 extends AbstractSite { + public Card2_116() { + super("Hobbiton Woods", 1, 0, Direction.LEFT); + addKeyword(Keyword.FOREST); + } + + @Override + public List getPhaseActions(String playerId, LotroGame game, PhysicalCard self) { + if (PlayConditions.canUseSiteDuringPhase(game.getGameState(), Phase.FELLOWSHIP, self) + && PlayConditions.canExert(self, game.getGameState(), game.getModifiersQuerying(), Filters.race(Race.HOBBIT))) { + ActivateCardAction action = new ActivateCardAction(self, Keyword.FELLOWSHIP); + action.appendCost( + new ChooseAndExertCharactersCost(action, playerId, 1, 1, Filters.race(Race.HOBBIT))); + action.appendEffect( + new PlaySiteEffect(playerId, 2)); + return Collections.singletonList(action); + } + return null; + } +}