From c240bb9003043a5e87922c014a167ff1154b1757 Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Sun, 4 Dec 2011 19:18:09 +0000 Subject: [PATCH] "One Good Turn Deserves Another" --- .../effects/PutPlayedEventIntoHandEffect.java | 41 +++++++++++++ .../lotro/cards/set11/gollum/Card11_049.java | 60 +++++++++++++++++++ 2 files changed, 101 insertions(+) create mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/effects/PutPlayedEventIntoHandEffect.java create mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set11/gollum/Card11_049.java diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/effects/PutPlayedEventIntoHandEffect.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/effects/PutPlayedEventIntoHandEffect.java new file mode 100644 index 000000000..f4ba4b85d --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/effects/PutPlayedEventIntoHandEffect.java @@ -0,0 +1,41 @@ +package com.gempukku.lotro.cards.effects; + +import com.gempukku.lotro.cards.actions.PlayEventAction; +import com.gempukku.lotro.common.Zone; +import com.gempukku.lotro.game.state.LotroGame; +import com.gempukku.lotro.logic.GameUtils; +import com.gempukku.lotro.logic.timing.AbstractEffect; + +public class PutPlayedEventIntoHandEffect extends AbstractEffect { + private PlayEventAction _action; + + public PutPlayedEventIntoHandEffect(PlayEventAction action) { + _action = action; + } + + @Override + public String getText(LotroGame game) { + return "Put " + GameUtils.getCardLink(_action.getEventPlayed()) + " into hand"; + } + + @Override + public Type getType() { + return null; + } + + @Override + public boolean isPlayableInFull(LotroGame game) { + return true; + } + + @Override + protected FullEffectResult playEffectReturningResult(LotroGame game) { + if (isPlayableInFull(game)) { + game.getGameState().sendMessage(_action.getPerformingPlayer() + " puts " + GameUtils.getCardLink(_action.getEventPlayed()) + " into hand"); + _action.skipDiscardPart(); + game.getGameState().addCardToZone(game, _action.getEventPlayed(), Zone.HAND); + return new FullEffectResult(true, true); + } + return new FullEffectResult(false, false); + } +} \ No newline at end of file diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set11/gollum/Card11_049.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set11/gollum/Card11_049.java new file mode 100644 index 000000000..19d13e57d --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set11/gollum/Card11_049.java @@ -0,0 +1,60 @@ +package com.gempukku.lotro.cards.set11.gollum; + +import com.gempukku.lotro.cards.AbstractEvent; +import com.gempukku.lotro.cards.PlayConditions; +import com.gempukku.lotro.cards.actions.PlayEventAction; +import com.gempukku.lotro.cards.actions.SubCostToEffectAction; +import com.gempukku.lotro.cards.effects.AddBurdenEffect; +import com.gempukku.lotro.cards.effects.PutPlayedEventIntoHandEffect; +import com.gempukku.lotro.common.Culture; +import com.gempukku.lotro.common.Phase; +import com.gempukku.lotro.common.Side; +import com.gempukku.lotro.filters.Filters; +import com.gempukku.lotro.game.PhysicalCard; +import com.gempukku.lotro.game.state.LotroGame; +import com.gempukku.lotro.logic.GameUtils; +import com.gempukku.lotro.logic.decisions.YesNoDecision; +import com.gempukku.lotro.logic.effects.PlaySiteEffect; +import com.gempukku.lotro.logic.effects.PlayoutDecisionEffect; + +/** + * Set: Shadows + * Side: Free + * Culture: Gollum + * Twilight Cost: 0 + * Type: Event • Fellowship or Regroup + * Game Text: Spot Smeagol to play the fellowship's next site. Then you may add a burden to take this card back + * into hand. + */ +public class Card11_049 extends AbstractEvent { + public Card11_049() { + super(Side.FREE_PEOPLE, 0, Culture.GOLLUM, "One Good Turn Deserves Another", Phase.FELLOWSHIP, Phase.REGROUP); + } + + @Override + public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int withTwilightRemoved, int twilightModifier, boolean ignoreRoamingPenalty, boolean ignoreCheckingDeadPile) { + return super.checkPlayRequirements(playerId, game, self, withTwilightRemoved, twilightModifier, ignoreRoamingPenalty, ignoreCheckingDeadPile) + && PlayConditions.canSpot(game, Filters.smeagol); + } + + @Override + public PlayEventAction getPlayCardAction(String playerId, final LotroGame game, final PhysicalCard self, int twilightModifier, boolean ignoreRoamingPenalty) { + final PlayEventAction action = new PlayEventAction(self); + action.appendEffect( + new PlaySiteEffect(action, playerId, null, game.getGameState().getCurrentSiteNumber())); + action.appendEffect( + new PlayoutDecisionEffect(playerId, + new YesNoDecision("Do you wanto return " + GameUtils.getCardLink(self) + " back into hand?") { + @Override + protected void yes() { + SubCostToEffectAction subAction = new SubCostToEffectAction(action); + subAction.appendCost( + new AddBurdenEffect(self, 1)); + subAction.appendEffect( + new PutPlayedEventIntoHandEffect(action)); + game.getActionsEnvironment().addActionToStack(subAction); + } + })); + return action; + } +}