Merge pull request #2144 from fwannmacher/master

- Fixed issue #2075
This commit is contained in:
LevelX2 2016-08-04 17:51:24 +02:00 committed by GitHub
commit 1c5d4a0f48
3 changed files with 45 additions and 37 deletions

View file

@ -17,6 +17,7 @@ import mage.client.util.GUISizeHelper;
import mage.constants.CardType;
import mage.constants.MageObjectType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.utils.CardUtil;
import mage.view.CardView;
import mage.view.CounterView;
@ -344,6 +345,11 @@ public class GuiDisplayUtil {
buffer.append(ManaSymbols.replaceSymbolsWithHTML(legal, ManaSymbols.Type.TOOLTIP));
}
Zone zone = card.getZone();
if (zone != null) {
buffer.append("<p style='margin: 2px'><b>Card Zone:</b> ").append(zone).append("</p>");
}
buffer.append("<br></body></html>");
return buffer;
}

View file

@ -111,6 +111,8 @@ public class CardView extends SimpleCardView {
protected boolean controlledByOwner = true;
protected Zone zone;
protected boolean rotate;
protected boolean hideInfo; // controls if the tooltip window is shown (eg. controlled face down morph card)
@ -161,9 +163,10 @@ public class CardView extends SimpleCardView {
// 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());
if (card.isFaceDown(game)) {
showFaceUp = false;
if (!Zone.BATTLEFIELD.equals(game.getState().getZone(card.getId()))) {
if (!Zone.BATTLEFIELD.equals(zone)) {
if (showFaceDownCard) {
showFaceUp = true;
}
@ -708,6 +711,10 @@ public class CardView extends SimpleCardView {
return controlledByOwner;
}
public Zone getZone() {
return zone;
}
public boolean isFlipCard() {
return flipCard;
}

View file

@ -27,6 +27,7 @@
*/
package mage.sets.eldritchmoon;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import mage.MageObject;
@ -72,7 +73,7 @@ public class CoaxFromTheBlindEternities extends CardImpl {
class CoaxFromTheBlindEternitiesEffect extends OneShotEffect {
private static final String choiceText = "Choose a Eldrazi card you own from outside the game (sideboard), and put it into your hand?";
private static final String choiceText = "Choose a Eldrazi card you own from outside the game (sideboard) or in exile, and put it into your hand?";
private static final FilterCard filter = new FilterCard("Eldrazi card");
@ -99,46 +100,40 @@ class CoaxFromTheBlindEternitiesEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = source.getSourceObject(game);
if (controller != null && sourceObject != null) {
Cards cards = controller.getSideboard();
Card card = null;
if (!cards.isEmpty()) {
if (controller.chooseUse(Outcome.Benefit, choiceText, source, game)) {
Set<Card> filtered = cards.getCards(filter, game);
if (filtered.isEmpty()) {
game.informPlayer(controller, "You have no " + filter.getMessage() + " outside the game (your sideboard).");
} else {
Cards filteredCards = new CardsImpl();
for (Card sideboardCard : filtered) {
filteredCards.add(sideboardCard.getId());
}
TargetCard target = new TargetCard(Zone.OUTSIDE, filter);
target.setNotTarget(true);
if (controller.choose(outcome, filteredCards, target, game)) {
card = controller.getSideboard().get(target.getFirstTarget(), game);
if (controller.chooseUse(Outcome.Benefit, choiceText, source, game)) {
Set<Card> sideboard = controller.getSideboard().getCards(filter, game);
List<Card> exile = game.getExile().getAllCards(game);
Cards filteredCards = new CardsImpl();
Card card = null;
for (Card sideboardCard : sideboard) {
filteredCards.add(sideboardCard.getId());
}
for (Card exileCard : exile) {
if (exileCard.getOwnerId().equals(source.getControllerId()) && exileCard.hasSubtype("Eldrazi")) {
filteredCards.add(exileCard);
}
}
if (filteredCards.isEmpty()) {
game.informPlayer(controller, "You have no " + filter.getMessage() + " outside the game (your sideboard) or in exile.");
}
else {
TargetCard target = new TargetCard(Zone.OUTSIDE, filter);
target.setNotTarget(true);
if (controller.choose(outcome, filteredCards, target, game)) {
card = controller.getSideboard().get(target.getFirstTarget(), game);
if (card == null) {
card = game.getCard(target.getFirstTarget());
}
}
}
}
// Choose a card from exile
Cards filteredCards = new CardsImpl();
for (Card exileCard : game.getExile().getAllCards(game)) {
if (exileCard.getOwnerId().equals(source.getControllerId()) && exileCard.hasSubtype("Eldrazi")) {
filteredCards.add(exileCard);
if (card != null) {
card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
controller.revealCards(sourceObject.getIdName(), new CardsImpl(card), game);
}
}
if (filteredCards.isEmpty()) {
game.informPlayer(controller, "You have no Eldrazi cards in the exile zone.");
} else {
TargetCard target = new TargetCard(Zone.EXILED, filter);
target.setNotTarget(true);
if (controller.choose(Outcome.Benefit, filteredCards, target, game)) {
card = game.getCard(target.getFirstTarget());
}
}
if (card != null) {
card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
controller.revealCards(sourceObject.getIdName(), new CardsImpl(card), game);
}
return true;
}
return false;