"One Good Turn Deserves Another"

This commit is contained in:
marcins78@gmail.com
2011-12-04 19:18:09 +00:00
parent c914758958
commit c240bb9003
2 changed files with 101 additions and 0 deletions

View File

@@ -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);
}
}

View File

@@ -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;
}
}