Simplified playing event action.

This commit is contained in:
marcins78@gmail.com
2011-10-29 13:59:05 +00:00
parent ff0936e1c4
commit 7e7e52b283
2 changed files with 5 additions and 25 deletions

View File

@@ -8,8 +8,6 @@ import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.GameUtils;
import com.gempukku.lotro.logic.actions.AbstractCostToEffectAction;
import com.gempukku.lotro.logic.effects.PlayEventEffect;
import com.gempukku.lotro.logic.effects.SendMessageEffect;
import com.gempukku.lotro.logic.effects.SendPlayEventMessageEffect;
import com.gempukku.lotro.logic.timing.Effect;
import java.util.Collections;
@@ -41,8 +39,6 @@ public class PlayEventAction extends AbstractCostToEffectAction {
_requiresRanger = requiresRanger;
List<Effect> preCostEffects = new LinkedList<Effect>();
preCostEffects.add(new SendMessageEffect(card.getOwner() + " plays " + GameUtils.getCardLink(card) + " from " + card.getZone().getHumanReadable()));
preCostEffects.add(new SendPlayEventMessageEffect(card));
appendCost(new PayTwilightCostEffect(card));
if (card.getZone() == Zone.DECK)
preCostEffects.add(new ShuffleDeckEffect(card.getOwner()));
@@ -77,15 +73,17 @@ public class PlayEventAction extends AbstractCostToEffectAction {
@Override
public Effect nextEffect(LotroGame game) {
if (_preCostIterator.hasNext())
return _preCostIterator.next();
if (!_cardRemoved) {
_cardRemoved = true;
game.getGameState().sendMessage(_eventPlayed.getOwner() + " plays " + GameUtils.getCardLink(_eventPlayed) + " from " + _eventPlayed.getZone().getHumanReadable());
game.getGameState().removeCardsFromZone(_eventPlayed.getOwner(), Collections.singleton(_eventPlayed));
game.getGameState().addCardToZone(game, _eventPlayed, Zone.VOID);
game.getGameState().eventPlayed(_eventPlayed);
}
if (_preCostIterator.hasNext())
return _preCostIterator.next();
if (!isCostFailed()) {
Effect cost = getNextCost();
if (cost != null)

View File

@@ -1,18 +0,0 @@
package com.gempukku.lotro.logic.effects;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.timing.UnrespondableEffect;
public class SendPlayEventMessageEffect extends UnrespondableEffect {
private PhysicalCard _card;
public SendPlayEventMessageEffect(PhysicalCard card) {
_card = card;
}
@Override
protected void doPlayEffect(LotroGame game) {
game.getGameState().eventPlayed(_card);
}
}