1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-11 09:11:12 -09:00

* Fixed some handling problems with face down creatures (Ixidron).

This commit is contained in:
LevelX2 2014-11-28 17:38:53 +01:00
parent b06637df53
commit 07b509684a
3 changed files with 44 additions and 24 deletions
Mage.Client/src/main/java/org/mage/card/arcane
Mage.Common/src/mage/view

View file

@ -703,10 +703,16 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
try { try {
tappedAngle = isTapped() ? CardPanel.TAPPED_ANGLE : 0; tappedAngle = isTapped() ? CardPanel.TAPPED_ANGLE : 0;
flippedAngle = isFlipped() ? CardPanel.FLIPPED_ANGLE : 0; flippedAngle = isFlipped() ? CardPanel.FLIPPED_ANGLE : 0;
BufferedImage srcImage;
if (gameCard.isFaceDown()) { 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) { if (srcImage != null) {
hasImage = true; hasImage = true;
setText(gameCard); setText(gameCard);

View file

@ -128,7 +128,7 @@ public class CardView extends SimpleCardView {
* *
* @param card * @param card
* @param cardId * @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) { public CardView(Card card, UUID cardId, boolean controlled) {
super(card.getId(), card.getExpansionSetCode(), card.getCardNumber(), card.isFaceDown(), card.getUsesVariousArt(), card.getTokenSetCode()); super(card.getId(), card.getExpansionSetCode(), card.getCardNumber(), card.isFaceDown(), card.getUsesVariousArt(), card.getTokenSetCode());
@ -151,9 +151,17 @@ public class CardView extends SimpleCardView {
return; return;
} }
} else { } else {
this.fillEmpty(card, false);
this.hideInfo = true; if (card instanceof Permanent) {
return; 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;
}
} }
} }

View file

@ -111,27 +111,33 @@ public class PermanentView extends CardView {
this.nameOwner = ""; this.nameOwner = "";
} }
if (permanent.isFaceDown() && permanent.isMorphCard()) { if (permanent.isFaceDown()) {
// add morph rule text if (permanent.isMorphCard()){
if (card != null) { // add morph rule text
if (controlled) { if (card != null) {
for (Ability permanentAbility : permanent.getAbilities()) { if (controlled) {
if (permanentAbility instanceof TurnFaceUpAbility && !permanentAbility.getRuleVisible()) { for (Ability permanentAbility : permanent.getAbilities()) {
this.rules.add(permanentAbility.getRule(true)); if (permanentAbility instanceof TurnFaceUpAbility && !permanentAbility.getRuleVisible()) {
} this.rules.add(permanentAbility.getRule(true));
if (permanentAbility.getWorksFaceDown()) { }
this.rules.add(permanentAbility.getRule()); 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.");
} }
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.displayName = card.getName();
}
} }
} }