Simplified playing event action.
This commit is contained in:
@@ -8,8 +8,6 @@ import com.gempukku.lotro.game.state.LotroGame;
|
|||||||
import com.gempukku.lotro.logic.GameUtils;
|
import com.gempukku.lotro.logic.GameUtils;
|
||||||
import com.gempukku.lotro.logic.actions.AbstractCostToEffectAction;
|
import com.gempukku.lotro.logic.actions.AbstractCostToEffectAction;
|
||||||
import com.gempukku.lotro.logic.effects.PlayEventEffect;
|
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 com.gempukku.lotro.logic.timing.Effect;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@@ -41,8 +39,6 @@ public class PlayEventAction extends AbstractCostToEffectAction {
|
|||||||
_requiresRanger = requiresRanger;
|
_requiresRanger = requiresRanger;
|
||||||
|
|
||||||
List<Effect> preCostEffects = new LinkedList<Effect>();
|
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));
|
appendCost(new PayTwilightCostEffect(card));
|
||||||
if (card.getZone() == Zone.DECK)
|
if (card.getZone() == Zone.DECK)
|
||||||
preCostEffects.add(new ShuffleDeckEffect(card.getOwner()));
|
preCostEffects.add(new ShuffleDeckEffect(card.getOwner()));
|
||||||
@@ -77,15 +73,17 @@ public class PlayEventAction extends AbstractCostToEffectAction {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Effect nextEffect(LotroGame game) {
|
public Effect nextEffect(LotroGame game) {
|
||||||
if (_preCostIterator.hasNext())
|
|
||||||
return _preCostIterator.next();
|
|
||||||
|
|
||||||
if (!_cardRemoved) {
|
if (!_cardRemoved) {
|
||||||
_cardRemoved = true;
|
_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().removeCardsFromZone(_eventPlayed.getOwner(), Collections.singleton(_eventPlayed));
|
||||||
game.getGameState().addCardToZone(game, _eventPlayed, Zone.VOID);
|
game.getGameState().addCardToZone(game, _eventPlayed, Zone.VOID);
|
||||||
|
game.getGameState().eventPlayed(_eventPlayed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_preCostIterator.hasNext())
|
||||||
|
return _preCostIterator.next();
|
||||||
|
|
||||||
if (!isCostFailed()) {
|
if (!isCostFailed()) {
|
||||||
Effect cost = getNextCost();
|
Effect cost = getNextCost();
|
||||||
if (cost != null)
|
if (cost != null)
|
||||||
|
|||||||
@@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user