diff --git a/Mage.Common/src/mage/view/CardView.java b/Mage.Common/src/mage/view/CardView.java index df89c3c8ce..e0f5ee9d84 100644 --- a/Mage.Common/src/mage/view/CardView.java +++ b/Mage.Common/src/mage/view/CardView.java @@ -144,7 +144,7 @@ public class CardView extends SimpleCardView { * the card */ public CardView(Card card, Game game, boolean controlled) { - this(card, game, controlled, false); + this(card, game, controlled, false, false); } /** @@ -156,22 +156,27 @@ public class CardView extends SimpleCardView { * the card * @param showFaceDownCard if true and the card is not on the battlefield, * also a face down card is shown in the view, face down cards will be shown + * @param storeZone if true the card zone will be set in the zone attribute. */ - public CardView(Card card, Game game, boolean controlled, boolean showFaceDownCard) { + public CardView(Card card, Game game, boolean controlled, boolean showFaceDownCard, boolean storeZone) { super(card.getId(), card.getExpansionSetCode(), card.getCardNumber(), card.getUsesVariousArt(), card.getTokenSetCode(), game != null); // no information available for face down cards as long it's not a controlled face down morph card // TODO: Better handle this in Framework (but currently I'm not sure how to do it there) LevelX2 boolean showFaceUp = true; if (game != null) { - zone = game.getState().getZone(card.getId()); + Zone cardZone = game.getState().getZone(card.getId()); if (card.isFaceDown(game)) { showFaceUp = false; - if (!Zone.BATTLEFIELD.equals(zone)) { + if (!Zone.BATTLEFIELD.equals(cardZone)) { if (showFaceDownCard) { showFaceUp = true; } } } + + if (storeZone) { + this.zone = cardZone; + } } // boolean showFaceUp = game == null || !card.isFaceDown(game) || (!game.getState().getZone(card.getId()).equals(Zone.BATTLEFIELD) && showFaceDownCard); diff --git a/Mage.Common/src/mage/view/CardsView.java b/Mage.Common/src/mage/view/CardsView.java index c27c1009f0..eb93fe3f1d 100644 --- a/Mage.Common/src/mage/view/CardsView.java +++ b/Mage.Common/src/mage/view/CardsView.java @@ -66,9 +66,9 @@ public class CardsView extends LinkedHashMap { } } - public CardsView(Game game, Collection cards, boolean showFaceDown) { + public CardsView(Game game, Collection cards, boolean showFaceDown, boolean storeZone) { for (Card card : cards) { - this.put(card.getId(), new CardView(card, game, false, showFaceDown)); + this.put(card.getId(), new CardView(card, game, false, showFaceDown, storeZone)); } } diff --git a/Mage.Common/src/mage/view/GameView.java b/Mage.Common/src/mage/view/GameView.java index 306f40b54c..648c3aa9eb 100644 --- a/Mage.Common/src/mage/view/GameView.java +++ b/Mage.Common/src/mage/view/GameView.java @@ -109,9 +109,9 @@ public class GameView implements Serializable { if (object != null) { if (object instanceof Permanent) { boolean controlled = ((Permanent) object).getControllerId().equals(createdForPlayerId); - stack.put(stackObject.getId(), new StackAbilityView(game, (StackAbility) stackObject, ((Permanent) object).getName(), new CardView(((Permanent) object), game, controlled, false))); + stack.put(stackObject.getId(), new StackAbilityView(game, (StackAbility) stackObject, ((Permanent) object).getName(), new CardView(((Permanent) object), game, controlled, false, false))); } else { - stack.put(stackObject.getId(), new StackAbilityView(game, (StackAbility) stackObject, card.getName(), new CardView(card, game, false, false))); + stack.put(stackObject.getId(), new StackAbilityView(game, (StackAbility) stackObject, card.getName(), new CardView(card, game, false, false, false))); } } else { stack.put(stackObject.getId(), new StackAbilityView(game, (StackAbility) stackObject, "", new CardView(card))); diff --git a/Mage.Server/src/main/java/mage/server/game/GameController.java b/Mage.Server/src/main/java/mage/server/game/GameController.java index 9fb6c6492d..009b959d0d 100644 --- a/Mage.Server/src/main/java/mage/server/game/GameController.java +++ b/Mage.Server/src/main/java/mage/server/game/GameController.java @@ -836,7 +836,7 @@ public class GameController implements GameCallback { // So always show face up for selection // boolean showFaceDown = targetZone != null && targetZone.equals(Zone.PICK); boolean showFaceDown = true; - getGameSession(playerId).target(question, new CardsView(game, cards.getCards(game), showFaceDown), targets, required, options); + getGameSession(playerId).target(question, new CardsView(game, cards.getCards(game), showFaceDown, true), targets, required, options); } else if (perms != null) { CardsView permsView = new CardsView(); for (Permanent perm : perms) {