From 07b509684a180273813bcde2cbd9578cd6fd5ee0 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Fri, 28 Nov 2014 17:38:53 +0100 Subject: [PATCH] * Fixed some handling problems with face down creatures (Ixidron). --- .../java/org/mage/card/arcane/CardPanel.java | 10 ++++- Mage.Common/src/mage/view/CardView.java | 16 +++++-- Mage.Common/src/mage/view/PermanentView.java | 42 +++++++++++-------- 3 files changed, 44 insertions(+), 24 deletions(-) diff --git a/Mage.Client/src/main/java/org/mage/card/arcane/CardPanel.java b/Mage.Client/src/main/java/org/mage/card/arcane/CardPanel.java index 10d6111754..2daa784760 100644 --- a/Mage.Client/src/main/java/org/mage/card/arcane/CardPanel.java +++ b/Mage.Client/src/main/java/org/mage/card/arcane/CardPanel.java @@ -703,10 +703,16 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti try { tappedAngle = isTapped() ? CardPanel.TAPPED_ANGLE : 0; flippedAngle = isFlipped() ? CardPanel.FLIPPED_ANGLE : 0; + BufferedImage srcImage; if (gameCard.isFaceDown()) { - return; + if (gameCard.isMorphCard()) { + srcImage = ImageCache.getMorphImage(); + } else { + srcImage = ImageCache.loadImage(new TFile(DirectLinksForDownload.outDir + File.separator + DirectLinksForDownload.cardbackFilename)); + } + } else { + srcImage = ImageCache.getThumbnail(gameCard); } - BufferedImage srcImage = ImageCache.getThumbnail(gameCard); if (srcImage != null) { hasImage = true; setText(gameCard); diff --git a/Mage.Common/src/mage/view/CardView.java b/Mage.Common/src/mage/view/CardView.java index 350d4d2266..d836267d43 100644 --- a/Mage.Common/src/mage/view/CardView.java +++ b/Mage.Common/src/mage/view/CardView.java @@ -128,7 +128,7 @@ public class CardView extends SimpleCardView { * * @param card * @param cardId - * @param controlled is the card view created for the card controller - used for morph cards to know which player may see information for the card + * @param controlled is the card view created for the card controller - used for morph / face down cards to know which player may see information for the card */ public CardView(Card card, UUID cardId, boolean controlled) { super(card.getId(), card.getExpansionSetCode(), card.getCardNumber(), card.isFaceDown(), card.getUsesVariousArt(), card.getTokenSetCode()); @@ -151,9 +151,17 @@ public class CardView extends SimpleCardView { return; } } else { - this.fillEmpty(card, false); - this.hideInfo = true; - return; + + if (card instanceof Permanent) { + this.fillEmpty(card, controlled); + this.power = Integer.toString(card.getPower().getValue()); + this.toughness = Integer.toString(card.getToughness().getValue()); + this.cardTypes = card.getCardType(); + } else { + this.fillEmpty(card, false); + this.hideInfo = true; + return; + } } } diff --git a/Mage.Common/src/mage/view/PermanentView.java b/Mage.Common/src/mage/view/PermanentView.java index b58852ac5e..5b7476a1f8 100644 --- a/Mage.Common/src/mage/view/PermanentView.java +++ b/Mage.Common/src/mage/view/PermanentView.java @@ -111,27 +111,33 @@ public class PermanentView extends CardView { this.nameOwner = ""; } - if (permanent.isFaceDown() && permanent.isMorphCard()) { - // add morph rule text - if (card != null) { - if (controlled) { - for (Ability permanentAbility : permanent.getAbilities()) { - if (permanentAbility instanceof TurnFaceUpAbility && !permanentAbility.getRuleVisible()) { - this.rules.add(permanentAbility.getRule(true)); - } - if (permanentAbility.getWorksFaceDown()) { - this.rules.add(permanentAbility.getRule()); + if (permanent.isFaceDown()) { + if (permanent.isMorphCard()){ + // add morph rule text + if (card != null) { + if (controlled) { + for (Ability permanentAbility : permanent.getAbilities()) { + if (permanentAbility instanceof TurnFaceUpAbility && !permanentAbility.getRuleVisible()) { + this.rules.add(permanentAbility.getRule(true)); + } + if (permanentAbility.getWorksFaceDown()) { + this.rules.add(permanentAbility.getRule()); + } } + this.name = card.getName(); + this.expansionSetCode = card.getExpansionSetCode(); + this.cardNumber = card.getCardNumber(); + } else { + this.rules.add("If the controller has priority, he or she may turn this permanent face up." + + " This is a special action; it doesn’t use the stack. To do this he or she pays the morph costs," + + " then turns this permanent face up."); } + } + } else{ + if (controlled && card != null) { this.name = card.getName(); - this.expansionSetCode = card.getExpansionSetCode(); - this.cardNumber = card.getCardNumber(); - } else { - this.rules.add("If the controller has priority, he or she may turn this permanent face up." + - " This is a special action; it doesn’t use the stack. To do this he or she pays the morph costs," + - " then turns this permanent face up."); - } - + this.displayName = card.getName(); + } } }