A few fixes and tweaks in what message is sent to user.
This commit is contained in:
@@ -12,7 +12,7 @@ import java.util.List;
|
|||||||
|
|
||||||
public class TransferPermanentAction extends DefaultCostToEffectAction {
|
public class TransferPermanentAction extends DefaultCostToEffectAction {
|
||||||
public TransferPermanentAction(final PhysicalCard card, LotroGame game, Filter filter) {
|
public TransferPermanentAction(final PhysicalCard card, LotroGame game, Filter filter) {
|
||||||
super(null, null, "Transfer " + card.getBlueprint().getName());
|
super(card, null, "Transfer " + card.getBlueprint().getName());
|
||||||
|
|
||||||
addCost(new ChooseActiveCardsEffect(card.getOwner(), "Choose target to attach to", 1, 1, filter) {
|
addCost(new ChooseActiveCardsEffect(card.getOwner(), "Choose target to attach to", 1, 1, filter) {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -42,11 +42,12 @@ public class DiscardCardFromPlayEffect extends AbstractEffect {
|
|||||||
public EffectResult playEffect(LotroGame game) {
|
public EffectResult playEffect(LotroGame game) {
|
||||||
_discardedCards = new LinkedList<PhysicalCard>();
|
_discardedCards = new LinkedList<PhysicalCard>();
|
||||||
|
|
||||||
if (game.getModifiersQuerying().canBeDiscardedFromPlay(game.getGameState(), _card, _source)) {
|
if (_source == null || game.getModifiersQuerying().canBeDiscardedFromPlay(game.getGameState(), _card, _source)) {
|
||||||
_discardedCards.add(_card);
|
_discardedCards.add(_card);
|
||||||
|
|
||||||
GameState gameState = game.getGameState();
|
GameState gameState = game.getGameState();
|
||||||
gameState.sendMessage(_source.getOwner() + " discards " + _card.getBlueprint().getName() + " from play using " + _source.getBlueprint().getName());
|
if (_source != null)
|
||||||
|
gameState.sendMessage(_source.getOwner() + " discards " + _card.getBlueprint().getName() + " from play using " + _source.getBlueprint().getName());
|
||||||
gameState.stopAffecting(_card);
|
gameState.stopAffecting(_card);
|
||||||
gameState.removeCardFromZone(_card);
|
gameState.removeCardFromZone(_card);
|
||||||
gameState.addCardToZone(_card, Zone.DISCARD);
|
gameState.addCardToZone(_card, Zone.DISCARD);
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ public class DiscardCardsFromPlayEffect extends AbstractEffect {
|
|||||||
List<PhysicalCard> cardsToDiscard = Filters.filterActive(game.getGameState(), game.getModifiersQuerying(), _filter);
|
List<PhysicalCard> cardsToDiscard = Filters.filterActive(game.getGameState(), game.getModifiersQuerying(), _filter);
|
||||||
_discardedCards = new LinkedList<PhysicalCard>();
|
_discardedCards = new LinkedList<PhysicalCard>();
|
||||||
for (PhysicalCard card : cardsToDiscard) {
|
for (PhysicalCard card : cardsToDiscard) {
|
||||||
if (game.getModifiersQuerying().canBeDiscardedFromPlay(game.getGameState(), card, _source)) {
|
if (_source == null || game.getModifiersQuerying().canBeDiscardedFromPlay(game.getGameState(), card, _source)) {
|
||||||
_discardedCards.add(card);
|
_discardedCards.add(card);
|
||||||
|
|
||||||
GameState gameState = game.getGameState();
|
GameState gameState = game.getGameState();
|
||||||
@@ -68,7 +68,7 @@ public class DiscardCardsFromPlayEffect extends AbstractEffect {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_discardedCards.size() > 0)
|
if (_source != null && _discardedCards.size() > 0)
|
||||||
game.getGameState().sendMessage(_source.getOwner() + " discards multiple cards from play using " + _source.getBlueprint().getName());
|
game.getGameState().sendMessage(_source.getOwner() + " discards multiple cards from play using " + _source.getBlueprint().getName());
|
||||||
return new DiscardCardsFromPlayResult(_discardedCards);
|
return new DiscardCardsFromPlayResult(_discardedCards);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ public class WoundCharacterEffect extends AbstractEffect {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getText() {
|
public String getText() {
|
||||||
return "Wound target";
|
return "Wound " + _woundTarget.getBlueprint().getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -2,17 +2,14 @@ package com.gempukku.lotro.logic.timing.processes.turn.regroup;
|
|||||||
|
|
||||||
import com.gempukku.lotro.common.CardType;
|
import com.gempukku.lotro.common.CardType;
|
||||||
import com.gempukku.lotro.common.Phase;
|
import com.gempukku.lotro.common.Phase;
|
||||||
import com.gempukku.lotro.common.Zone;
|
|
||||||
import com.gempukku.lotro.filters.Filters;
|
import com.gempukku.lotro.filters.Filters;
|
||||||
import com.gempukku.lotro.game.PhysicalCard;
|
|
||||||
import com.gempukku.lotro.game.state.GameState;
|
import com.gempukku.lotro.game.state.GameState;
|
||||||
import com.gempukku.lotro.game.state.LotroGame;
|
import com.gempukku.lotro.game.state.LotroGame;
|
||||||
|
import com.gempukku.lotro.logic.effects.DiscardCardsFromPlayEffect;
|
||||||
import com.gempukku.lotro.logic.timing.processes.GameProcess;
|
import com.gempukku.lotro.logic.timing.processes.GameProcess;
|
||||||
import com.gempukku.lotro.logic.timing.processes.turn.EndOfTurnGameProcess;
|
import com.gempukku.lotro.logic.timing.processes.turn.EndOfTurnGameProcess;
|
||||||
import com.gempukku.lotro.logic.timing.processes.turn.general.EndOfPhaseGameProcess;
|
import com.gempukku.lotro.logic.timing.processes.turn.general.EndOfPhaseGameProcess;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class DiscardAllMinionsGameProcess implements GameProcess {
|
public class DiscardAllMinionsGameProcess implements GameProcess {
|
||||||
private LotroGame _game;
|
private LotroGame _game;
|
||||||
|
|
||||||
@@ -23,11 +20,8 @@ public class DiscardAllMinionsGameProcess implements GameProcess {
|
|||||||
@Override
|
@Override
|
||||||
public void process() {
|
public void process() {
|
||||||
GameState gameState = _game.getGameState();
|
GameState gameState = _game.getGameState();
|
||||||
List<PhysicalCard> minions = Filters.filterActive(gameState, _game.getModifiersQuerying(), Filters.type(CardType.MINION));
|
DiscardCardsFromPlayEffect cards = new DiscardCardsFromPlayEffect(null, Filters.type(CardType.MINION));
|
||||||
for (PhysicalCard minion : minions) {
|
cards.playEffect(_game);
|
||||||
gameState.removeCardFromZone(minion);
|
|
||||||
gameState.addCardToZone(minion, Zone.DISCARD);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user