"Stampeding Savage"

This commit is contained in:
marcins78@gmail.com
2012-02-16 01:37:43 +00:00
parent 08c58b7f21
commit aaf4b4ad0c
2 changed files with 65 additions and 0 deletions

View File

@@ -12,6 +12,7 @@ import com.gempukku.lotro.logic.timing.AbstractSubActionEffect;
import com.gempukku.lotro.logic.timing.Action;
import com.gempukku.lotro.logic.timing.Effect;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
@@ -58,6 +59,7 @@ public class ChooseAndDiscardStackedCardsEffect extends AbstractSubActionEffect
if (discardableCards.size() <= _minimum) {
SubAction subAction = new SubAction(_action);
subAction.appendEffect(new DiscardStackedCardsEffect(_action.getActionSource(), discardableCards));
discardingCardsCallback(discardableCards);
processSubAction(game, subAction);
} else {
game.getUserFeedback().sendAwaitingDecision(_playerId,
@@ -67,9 +69,14 @@ public class ChooseAndDiscardStackedCardsEffect extends AbstractSubActionEffect
Set<PhysicalCard> selectedCards = getSelectedCardsByResponse(result);
SubAction subAction = new SubAction(_action);
subAction.appendEffect(new DiscardStackedCardsEffect(_action.getActionSource(), selectedCards));
discardingCardsCallback(selectedCards);
processSubAction(game, subAction);
}
});
}
}
protected void discardingCardsCallback(Collection<PhysicalCard> cards) {
}
}

View File

@@ -0,0 +1,58 @@
package com.gempukku.lotro.cards.set17.men;
import com.gempukku.lotro.cards.AbstractMinion;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.SelfDiscardEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndDiscardStackedCardsEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndPlayCardFromDiscardEffect;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
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.Collection;
import java.util.Collections;
import java.util.List;
/**
* Set: Rise of Saruman
* Side: Shadow
* Culture: Men
* Twilight Cost: 3
* Type: Minion • Man
* Strength: 8
* Vitality: 2
* Site: 4
* Game Text: Maneuver: Discard this minion and X minions stacked on a [MEN] possession to play a [MEN] minion from your
* discard pile. That minion is twilight cost -X.
*/
public class Card17_053 extends AbstractMinion {
public Card17_053() {
super(3, 8, 2, 4, Race.MAN, Culture.MEN, "Stampeding Savage");
}
@Override
protected List<? extends Action> getExtraPhaseActions(final String playerId, final LotroGame game, PhysicalCard self) {
if (PlayConditions.canUseShadowCardDuringPhase(game, Phase.MANEUVER, self, 0)) {
final ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(
new SelfDiscardEffect(self));
action.appendCost(
new ChooseAndDiscardStackedCardsEffect(action, playerId, 0, Integer.MAX_VALUE, Filters.and(Culture.MEN, CardType.POSSESSION), CardType.MINION) {
@Override
protected void discardingCardsCallback(Collection<PhysicalCard> cards) {
int count = cards.size();
action.appendEffect(
new ChooseAndPlayCardFromDiscardEffect(playerId, game, -count, Culture.MEN, CardType.MINION));
}
});
return Collections.singletonList(action);
}
return null;
}
}