Adding use card message.

This commit is contained in:
marcins78@gmail.com
2011-09-14 11:41:14 +00:00
parent 1447585137
commit a2e0caca88
10 changed files with 28 additions and 11 deletions

View File

@@ -9,6 +9,7 @@ import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.actions.CostToEffectAction;
import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect;
import com.gempukku.lotro.logic.effects.PlayCardEffect;
import com.gempukku.lotro.logic.effects.SendMessageEffect;
import com.gempukku.lotro.logic.timing.Effect;
import java.util.*;

View File

@@ -1,11 +1,15 @@
package com.gempukku.lotro.cards.actions;
import com.gempukku.lotro.cards.effects.*;
import com.gempukku.lotro.cards.effects.PayTwilightCostEffect;
import com.gempukku.lotro.cards.effects.PutCardIntoDiscardEffect;
import com.gempukku.lotro.cards.effects.RemoveCardFromZoneEffect;
import com.gempukku.lotro.cards.effects.ShuffleDeckEffect;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.common.Zone;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.logic.actions.CostToEffectAction;
import com.gempukku.lotro.logic.effects.PlayCardEffect;
import com.gempukku.lotro.logic.effects.SendMessageEffect;
import com.gempukku.lotro.logic.timing.Effect;
import java.util.ArrayList;

View File

@@ -6,6 +6,7 @@ import com.gempukku.lotro.common.Zone;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.logic.actions.CostToEffectAction;
import com.gempukku.lotro.logic.effects.PlayCardEffect;
import com.gempukku.lotro.logic.effects.SendMessageEffect;
import com.gempukku.lotro.logic.timing.Effect;
import java.util.ArrayList;

View File

@@ -12,7 +12,7 @@ import java.util.List;
public class TransferPermanentAction extends DefaultCostToEffectAction {
public TransferPermanentAction(final PhysicalCard card, LotroGame game, Filter filter) {
super(card, null, "Transfer " + card.getBlueprint().getName());
super(null, null, "Transfer " + card.getBlueprint().getName());
addCost(new ChooseActiveCardsEffect(card.getOwner(), "Choose target to attach to", 1, 1, filter) {
@Override

View File

@@ -2,6 +2,7 @@ package com.gempukku.lotro.logic.actions;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.logic.effects.SendMessageEffect;
import com.gempukku.lotro.logic.timing.Effect;
import java.util.ArrayList;
@@ -18,6 +19,8 @@ public class DefaultCostToEffectAction implements CostToEffectAction {
private int _costsNextIndex = 0;
private int _effectsNextIndex = 0;
private boolean _sentMessage;
public DefaultCostToEffectAction(PhysicalCard physicalCard, Keyword type, String text) {
_physicalCard = physicalCard;
_type = type;
@@ -49,6 +52,11 @@ public class DefaultCostToEffectAction implements CostToEffectAction {
@Override
public Effect nextEffect() {
if (!_sentMessage && _physicalCard != null) {
_sentMessage = true;
return new SendMessageEffect(_physicalCard.getBlueprint().getName() + " is used");
}
if (_costsNextIndex < _costs.size()) {
_costsNextIndex++;
return _costs.get(_costsNextIndex - 1);

View File

@@ -1,4 +1,4 @@
package com.gempukku.lotro.cards.effects;
package com.gempukku.lotro.logic.effects;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.timing.UnrespondableEffect;

View File

@@ -78,6 +78,6 @@ public class ChooseSeatingOrderGameProcess implements GameProcess {
@Override
public GameProcess getNextProcess() {
return new FirstPlayerPlaysSiteGameProcess(_game, _bids);
return new FirstPlayerPlaysSiteGameProcess(_game, _bids, _orderedPlayers[0]);
}
}

View File

@@ -12,16 +12,18 @@ import java.util.Map;
public class FirstPlayerPlaysSiteGameProcess implements GameProcess {
private LotroGame _game;
private Map<String, Integer> _bids;
private String _firstPlayer;
public FirstPlayerPlaysSiteGameProcess(LotroGame game, Map<String, Integer> bids) {
public FirstPlayerPlaysSiteGameProcess(LotroGame game, Map<String, Integer> bids, String firstPlayer) {
_game = game;
_bids = bids;
_firstPlayer = firstPlayer;
}
@Override
public void process() {
GameState gameState = _game.getGameState();
PhysicalCard firstSite = Filters.filter(gameState.getAdventureDeck(gameState.getCurrentPlayerId()), gameState, _game.getModifiersQuerying(), Filters.siteNumber(1)).get(0);
PhysicalCard firstSite = Filters.filter(gameState.getAdventureDeck(_firstPlayer), gameState, _game.getModifiersQuerying(), Filters.siteNumber(1)).get(0);
gameState.removeCardFromZone(firstSite);
gameState.addCardToZone(firstSite, Zone.ADVENTURE_PATH);
@@ -31,6 +33,6 @@ public class FirstPlayerPlaysSiteGameProcess implements GameProcess {
@Override
public GameProcess getNextProcess() {
return new PlayRingBearerRingAndAddBurdersGameProcess(_game, _bids);
return new PlayRingBearerRingAndAddBurdersGameProcess(_game, _bids, _firstPlayer);
}
}

View File

@@ -14,10 +14,12 @@ import java.util.Map;
public class PlayRingBearerRingAndAddBurdersGameProcess implements GameProcess {
private LotroGame _game;
private Map<String, Integer> _bids;
private String _firstPlayer;
public PlayRingBearerRingAndAddBurdersGameProcess(LotroGame game, Map<String, Integer> bids) {
public PlayRingBearerRingAndAddBurdersGameProcess(LotroGame game, Map<String, Integer> bids, String firstPlayer) {
_game = game;
_bids = bids;
_firstPlayer = firstPlayer;
}
@Override
@@ -41,6 +43,6 @@ public class PlayRingBearerRingAndAddBurdersGameProcess implements GameProcess {
@Override
public GameProcess getNextProcess() {
GameState gameState = _game.getGameState();
return new PlayStartingFellowshipGameProcess(_game, gameState.getPlayerOrder().getClockwisePlayOrder(gameState.getCurrentPlayerId(), false));
return new PlayStartingFellowshipGameProcess(_game, gameState.getPlayerOrder().getClockwisePlayOrder(_firstPlayer, false));
}
}

View File

@@ -22,8 +22,7 @@ public class PlayStartingFellowshipGameProcess implements GameProcess {
public void process() {
String nextPlayer = _playOrder.getNextPlayer();
if (_game.getGameState().getCurrentPlayerId() != null)
_game.getGameState().stopAffectingCardsForCurrentPlayer();
_game.getGameState().stopAffectingCardsForCurrentPlayer();
if (nextPlayer != null) {
_game.getGameState().startPlayerTurn(nextPlayer);