"Smeagol"

This commit is contained in:
marcins78@gmail.com
2012-01-03 12:11:11 +00:00
parent 1e7b06648f
commit f8c18c1144
4 changed files with 120 additions and 3 deletions

View File

@@ -36,9 +36,9 @@ public class DiscardCardFromDeckEffect extends AbstractEffect {
protected FullEffectResult playEffectReturningResult(LotroGame game) {
if (isPlayableInFull(game)) {
GameState gameState = game.getGameState();
gameState.sendMessage(GameUtils.getCardLink(_card) + " gets discarded from deck");
gameState.removeCardsFromZone(_card.getOwner(), Collections.singleton(_card));
gameState.addCardToZone(game, _card, Zone.DISCARD);
gameState.sendMessage(GameUtils.getCardLink(_card) + " gets discarded from deck");
return new FullEffectResult(true, true);
}
return new FullEffectResult(false, false);

View File

@@ -0,0 +1,29 @@
package com.gempukku.lotro.cards.effects.choose;
import com.gempukku.lotro.cards.effects.DiscardCardFromDeckEffect;
import com.gempukku.lotro.common.Filterable;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.actions.SubAction;
import com.gempukku.lotro.logic.timing.Action;
import java.util.Collection;
public class ChooseAndPutCardFromDeckIntoDiscardEffect extends ChooseCardsFromDeckEffect {
private Action _action;
public ChooseAndPutCardFromDeckIntoDiscardEffect(Action action, String playerId, int minimum, int maximum, Filterable... filters) {
super(playerId, minimum, maximum, filters);
_action = action;
}
@Override
protected void cardsSelected(LotroGame game, Collection<PhysicalCard> cards) {
if (cards.size() > 0) {
SubAction subAction = new SubAction(_action);
for (PhysicalCard card : cards)
subAction.appendEffect(new DiscardCardFromDeckEffect(card));
game.getActionsEnvironment().addActionToStack(subAction);
}
}
}

View File

@@ -3,7 +3,7 @@ package com.gempukku.lotro.cards.set13.gandalf;
import com.gempukku.lotro.cards.AbstractCompanion;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.TriggerConditions;
import com.gempukku.lotro.cards.effects.choose.ChooseAndPutCardFromDeckIntoHandEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndPutCardFromDiscardIntoHandEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndRemoveCultureTokensFromCardEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.game.PhysicalCard;
@@ -39,7 +39,7 @@ public class Card13_029 extends AbstractCompanion {
action.appendCost(
new ChooseAndRemoveCultureTokensFromCardEffect(self, playerId, null, 2, Side.FREE_PEOPLE));
action.appendEffect(
new ChooseAndPutCardFromDeckIntoHandEffect(action, playerId, 1, 1, Culture.GANDALF, CardType.EVENT));
new ChooseAndPutCardFromDiscardIntoHandEffect(action, playerId, 1, 1, Culture.GANDALF, CardType.EVENT));
return Collections.singletonList(action);
}
return null;

View File

@@ -0,0 +1,88 @@
package com.gempukku.lotro.cards.set13.gollum;
import com.gempukku.lotro.cards.AbstractCompanion;
import com.gempukku.lotro.cards.TriggerConditions;
import com.gempukku.lotro.cards.actions.PlayPermanentAction;
import com.gempukku.lotro.cards.effects.AddBurdenEffect;
import com.gempukku.lotro.cards.effects.ShuffleDeckEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndPutCardFromDeckIntoDiscardEffect;
import com.gempukku.lotro.cards.modifiers.ResistanceModifier;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.GameState;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.actions.OptionalTriggerAction;
import com.gempukku.lotro.logic.modifiers.Modifier;
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
import com.gempukku.lotro.logic.modifiers.StrengthModifier;
import com.gempukku.lotro.logic.modifiers.evaluator.Evaluator;
import com.gempukku.lotro.logic.timing.EffectResult;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
/**
* Set: Bloodlines
* Side: Free
* Culture: Gollum
* Twilight Cost: 0
* Type: Companion
* Strength: 3
* Vitality: 4
* Resistance: 5
* Game Text: Ring-bound. To play, add a burden. For each card titled Deagol in your discard pile, Smeagol is
* strength +2 and resistance -1. Each time Smeagol wins a skirmish, you may take a [GOLLUM] card from your draw deck
* and place it in your discard pile.
*/
public class Card13_055 extends AbstractCompanion {
public Card13_055() {
super(0, 3, 4, 5, Culture.GOLLUM, null, null, "Smeagol", true);
addKeyword(Keyword.RING_BOUND);
}
@Override
public PlayPermanentAction getPlayCardAction(String playerId, LotroGame game, PhysicalCard self, int twilightModifier, boolean ignoreRoamingPenalty) {
final PlayPermanentAction playCardAction = super.getPlayCardAction(playerId, game, self, twilightModifier, ignoreRoamingPenalty);
playCardAction.appendCost(
new AddBurdenEffect(self, 1));
return playCardAction;
}
@Override
public List<? extends Modifier> getAlwaysOnModifiers(LotroGame game, final PhysicalCard self) {
List<Modifier> modifiers = new LinkedList<Modifier>();
modifiers.add(
new StrengthModifier(self, self, null,
new Evaluator() {
@Override
public int evaluateExpression(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard cardAffected) {
return Filters.filter(gameState.getDiscard(self.getOwner()), gameState, modifiersQuerying, Filters.name("Deagol")).size() * 2;
}
}));
modifiers.add(
new ResistanceModifier(self, self, null,
new Evaluator() {
@Override
public int evaluateExpression(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard cardAffected) {
return -Filters.filter(gameState.getDiscard(self.getOwner()), gameState, modifiersQuerying, Filters.name("Deagol")).size();
}
}));
return modifiers;
}
@Override
public List<OptionalTriggerAction> getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (TriggerConditions.winsSkirmish(game, effectResult, self)) {
OptionalTriggerAction action = new OptionalTriggerAction(self);
action.appendEffect(
new ChooseAndPutCardFromDeckIntoDiscardEffect(action, playerId, 1, 1, Culture.GOLLUM));
action.appendEffect(
new ShuffleDeckEffect(playerId));
return Collections.singletonList(action);
}
return null;
}
}