"Hosts Still Unfought"

This commit is contained in:
marcins78@gmail.com
2011-11-03 15:41:53 +00:00
parent f2fd60ebce
commit 0397c5fc25
5 changed files with 70 additions and 8 deletions

View File

@@ -67,13 +67,11 @@ public class ChooseAndDiscardCardsFromHandEffect extends AbstractSubActionEffect
Collection<PhysicalCard> hand = Filters.filter(game.getGameState().getHand(_playerId), game.getGameState(), game.getModifiersQuerying(), _filter);
final boolean success = hand.size() >= _minimum;
if (hand.size() <= _minimum) {
SubAction subAction = new SubAction(_action);
subAction.appendEffect(new DiscardCardsFromHandEffect(_action.getActionSource(), _playerId, hand, _forced));
processSubAction(game, subAction);
cardsBeingDiscarded(hand, success);
cardsBeingDiscardedCallback(hand);
} else {
game.getUserFeedback().sendAwaitingDecision(_playerId,
new CardsSelectionDecision(1, "Choose cards to discard", hand, _minimum, _maximum) {
@@ -83,7 +81,7 @@ public class ChooseAndDiscardCardsFromHandEffect extends AbstractSubActionEffect
SubAction subAction = new SubAction(_action);
subAction.appendEffect(new DiscardCardsFromHandEffect(_action.getActionSource(), _playerId, cards, _forced));
processSubAction(game, subAction);
cardsBeingDiscarded(cards, success);
cardsBeingDiscardedCallback(cards);
}
});
}
@@ -91,6 +89,6 @@ public class ChooseAndDiscardCardsFromHandEffect extends AbstractSubActionEffect
return null;
}
protected void cardsBeingDiscarded(Collection<PhysicalCard> cardsBeingDiscarded, boolean success) {
protected void cardsBeingDiscardedCallback(Collection<PhysicalCard> cardsBeingDiscarded) {
}
}

View File

@@ -51,7 +51,7 @@ public class Card3_011 extends AbstractOldEvent {
action.appendEffect(
new ChooseAndDiscardCardsFromHandEffect(action, opponent, true, 1) {
@Override
protected void cardsBeingDiscarded(Collection<PhysicalCard> cardsBeingDiscarded, boolean success) {
protected void cardsBeingDiscardedCallback(Collection<PhysicalCard> cardsBeingDiscarded) {
integer.addAndGet(cardsBeingDiscarded.size());
}
});

View File

@@ -46,7 +46,7 @@ public class Card3_023 extends AbstractAttachableFPPossession {
action.appendCost(
new ChooseAndDiscardCardsFromHandEffect(action, playerId, false, 0, 2, Filters.any) {
@Override
protected void cardsBeingDiscarded(Collection<PhysicalCard> cardsBeingDiscarded, boolean success) {
protected void cardsBeingDiscardedCallback(Collection<PhysicalCard> cardsBeingDiscarded) {
int count = cardsBeingDiscarded.size();
if (count > 0)
action.appendEffect(

View File

@@ -44,7 +44,7 @@ public class Card3_049 extends AbstractOldEvent {
action.appendEffect(
new ChooseAndDiscardCardsFromHandEffect(action, playerId, false, 0, 3, Filters.any) {
@Override
protected void cardsBeingDiscarded(Collection<PhysicalCard> cardsBeingDiscarded, boolean success) {
protected void cardsBeingDiscardedCallback(Collection<PhysicalCard> cardsBeingDiscarded) {
int cardsCount = cardsBeingDiscarded.size();
action.appendEffect(
new DrawCardEffect(playerId, cardsCount));

View File

@@ -0,0 +1,64 @@
package com.gempukku.lotro.cards.set7.raider;
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.choose.ChooseAndDiscardCardsFromHandEffect;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.Race;
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.effects.AddTwilightEffect;
import java.util.Collection;
/**
* Set: The Return of the King
* Side: Shadow
* Culture: Raider
* Twilight Cost: 0
* Type: Event • Maneuver
* Game Text: To play, spot 2 [RAIDER] Men. Discard any number of cards from hand. The Free Peoples player then discards
* any number of cards from hand. For each card you discarded more than the Free Peoples player, add (1).
*/
public class Card7_151 extends AbstractEvent {
public Card7_151() {
super(Side.SHADOW, 0, Culture.RAIDER, "Hosts Still Unfought", Phase.MANEUVER);
}
@Override
public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) {
return super.checkPlayRequirements(playerId, game, self, twilightModifier)
&& PlayConditions.canSpot(game, 2, Culture.RAIDER, Race.MAN);
}
@Override
public PlayEventAction getPlayCardAction(String playerId, final LotroGame game, final PhysicalCard self, int twilightModifier) {
final PlayEventAction action = new PlayEventAction(self);
action.appendEffect(
new ChooseAndDiscardCardsFromHandEffect(action, playerId, false, 0, Integer.MAX_VALUE, Filters.any) {
@Override
protected void cardsBeingDiscardedCallback(Collection<PhysicalCard> cardsBeingDiscarded) {
final int shadowDiscardCount = cardsBeingDiscarded.size();
action.appendEffect(
new ChooseAndDiscardCardsFromHandEffect(action, game.getGameState().getCurrentPlayerId(), false, 0, Integer.MAX_VALUE, Filters.any) {
@Override
protected void cardsBeingDiscardedCallback(Collection<PhysicalCard> cardsBeingDiscarded) {
int fpDiscardCount = cardsBeingDiscarded.size();
int diff = shadowDiscardCount - fpDiscardCount;
if (diff > 0) {
action.appendEffect(
new AddTwilightEffect(self, diff));
}
}
});
}
});
return action;
}
}