"Swear By the Precious"

This commit is contained in:
marcins78@gmail.com
2012-01-26 13:07:10 +00:00
parent cdd774f65a
commit 968ec4bed7
2 changed files with 78 additions and 0 deletions

View File

@@ -0,0 +1,69 @@
package com.gempukku.lotro.cards.set15.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.effects.AddUntilEndOfTurnModifierEffect;
import com.gempukku.lotro.cards.effects.PreventableEffect;
import com.gempukku.lotro.common.CardType;
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.actions.SubAction;
import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect;
import com.gempukku.lotro.logic.effects.DiscardCardsFromPlayEffect;
import com.gempukku.lotro.logic.modifiers.StrengthModifier;
import com.gempukku.lotro.logic.timing.Effect;
/**
* Set: The Hunters
* Side: Free
* Culture: Gollum
* Twilight Cost: 2
* Type: Event • Maneuver
* Game Text: Spot Frodo and Smeagol to discard a minion. That minions owner may make each minion strength -2 until
* the end of the turn to prevent that.
*/
public class Card15_052 extends AbstractEvent {
public Card15_052() {
super(Side.FREE_PEOPLE, 2, Culture.GOLLUM, "Swear By the Precious", Phase.MANEUVER);
}
@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.frodo)
&& PlayConditions.canSpot(game, Filters.smeagol);
}
@Override
public PlayEventAction getPlayCardAction(String playerId, LotroGame game, final PhysicalCard self, int twilightModifier, boolean ignoreRoamingPenalty) {
final PlayEventAction action = new PlayEventAction(self);
action.appendEffect(
new ChooseActiveCardEffect(self, playerId, "Choose a minion to discard", CardType.MINION, Filters.canBeDiscarded(self)) {
@Override
protected void cardSelected(LotroGame game, final PhysicalCard card) {
action.appendEffect(
new PreventableEffect(action,
new DiscardCardsFromPlayEffect(self, card), card.getOwner(),
new PreventableEffect.PreventionCost() {
@Override
public Effect createPreventionCostForPlayer(SubAction subAction, String playerId) {
return new AddUntilEndOfTurnModifierEffect(
new StrengthModifier(self, CardType.MINION, -2)) {
@Override
public String getText(LotroGame game) {
return "Make each minion strength -2";
}
};
}
}));
}
});
return action;
}
}

View File

@@ -357,6 +357,15 @@ public class Filters {
};
}
public static final Filter canBeDiscarded(final PhysicalCard source) {
return new Filter() {
@Override
public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) {
return modifiersQuerying.canBeDiscardedFromPlay(gameState, physicalCard, source);
}
};
}
public static final Filter canTakeWound = canTakeWounds(1);
public static final Filter exhausted = new Filter() {