mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
* Fixed handling of morphed cards in exile zone.
This commit is contained in:
parent
55e386a0e8
commit
8d6c25b3e8
4 changed files with 19 additions and 19 deletions
|
@ -721,13 +721,13 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
|
||||||
|
|
||||||
private BufferedImage getFaceDownImage() {
|
private BufferedImage getFaceDownImage() {
|
||||||
if (isPermanent) {
|
if (isPermanent) {
|
||||||
if (((PermanentView) gameCard).isMorphed()) {
|
if (gameCard.isMorphCard() && ((PermanentView) gameCard).isMorphed()) {
|
||||||
return ImageCache.getMorphImage();
|
return ImageCache.getMorphImage();
|
||||||
} else {
|
} else {
|
||||||
return ImageCache.getManifestImage();
|
return ImageCache.getManifestImage();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (gameCard.isMorphCard()) {
|
if (gameCard.isMorphCard() && this.gameCard instanceof StackAbilityView) {
|
||||||
return ImageCache.getMorphImage();
|
return ImageCache.getMorphImage();
|
||||||
} else {
|
} else {
|
||||||
return ImageCache.loadImage(new TFile(DirectLinksForDownload.outDir + File.separator + DirectLinksForDownload.cardbackFilename));
|
return ImageCache.loadImage(new TFile(DirectLinksForDownload.outDir + File.separator + DirectLinksForDownload.cardbackFilename));
|
||||||
|
|
|
@ -137,9 +137,8 @@ public class CardView extends SimpleCardView {
|
||||||
// TODO: Better handle this in Framework (but currently I'm not sure how to do it there) LevelX2
|
// TODO: Better handle this in Framework (but currently I'm not sure how to do it there) LevelX2
|
||||||
if (card.isFaceDown()) {
|
if (card.isFaceDown()) {
|
||||||
this.fillEmpty(card, controlled);
|
this.fillEmpty(card, controlled);
|
||||||
if (card.isMorphCard()) {
|
if (card.isMorphCard() && card instanceof Spell) {
|
||||||
// special handling for casting of Morph cards
|
// special handling for casting of Morph cards
|
||||||
if (card instanceof Spell /*|| card instanceof Card*/) {
|
|
||||||
if (controlled) {
|
if (controlled) {
|
||||||
this.name = card.getName();
|
this.name = card.getName();
|
||||||
this.displayName = card.getName();
|
this.displayName = card.getName();
|
||||||
|
@ -150,14 +149,13 @@ public class CardView extends SimpleCardView {
|
||||||
this.rules.add("You may cast this card as a 2/2 face-down creature, with no text," +
|
this.rules.add("You may cast this card as a 2/2 face-down creature, with no text," +
|
||||||
" no name, no subtypes, and no mana cost by paying {3} rather than paying its mana cost.");
|
" no name, no subtypes, and no mana cost by paying {3} rather than paying its mana cost.");
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (card instanceof Permanent) {
|
if (card instanceof Permanent) {
|
||||||
this.power = Integer.toString(card.getPower().getValue());
|
this.power = Integer.toString(card.getPower().getValue());
|
||||||
this.toughness = Integer.toString(card.getToughness().getValue());
|
this.toughness = Integer.toString(card.getToughness().getValue());
|
||||||
this.cardTypes = card.getCardType();
|
this.cardTypes = card.getCardType();
|
||||||
} else {
|
} else {
|
||||||
this.hideInfo = true;
|
// this.hideInfo = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,7 @@ package mage.sets.theros;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import mage.MageObject;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||||
|
@ -96,7 +97,8 @@ class PyxisOfPandemoniumExileEffect extends OneShotEffect {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
if (controller != null) {
|
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||||
|
if (sourceObject != null && controller != null) {
|
||||||
Map<String, UUID> exileIds;
|
Map<String, UUID> exileIds;
|
||||||
String valueKey = CardUtil.getCardZoneString("exileIds", source.getSourceId(), game);
|
String valueKey = CardUtil.getCardZoneString("exileIds", source.getSourceId(), game);
|
||||||
Object object = game.getState().getValue(valueKey);
|
Object object = game.getState().getValue(valueKey);
|
||||||
|
@ -122,7 +124,7 @@ class PyxisOfPandemoniumExileEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
card.setFaceDown(true);
|
card.setFaceDown(true);
|
||||||
player.moveCardToExileWithInfo(card, exileId,
|
player.moveCardToExileWithInfo(card, exileId,
|
||||||
new StringBuilder("Pyxis of Pandemonium (").append(player.getName()).append(")").toString(),
|
new StringBuilder(sourceObject.getLogName() +" (").append(player.getName()).append(")").toString(),
|
||||||
source.getSourceId(), game, Zone.LIBRARY);
|
source.getSourceId(), game, Zone.LIBRARY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -137,7 +139,7 @@ class PyxisOfPandemoniumPutOntoBattlefieldEffect extends OneShotEffect {
|
||||||
|
|
||||||
public PyxisOfPandemoniumPutOntoBattlefieldEffect() {
|
public PyxisOfPandemoniumPutOntoBattlefieldEffect() {
|
||||||
super(Outcome.PutCardInPlay);
|
super(Outcome.PutCardInPlay);
|
||||||
this.staticText = "Each player turns face up all cards he or she owns exiled with Pyxis of Pandemonium, then puts all permanent cards among them onto the battlefield";
|
this.staticText = "Each player turns face up all cards he or she owns exiled with {this}, then puts all permanent cards among them onto the battlefield";
|
||||||
}
|
}
|
||||||
|
|
||||||
public PyxisOfPandemoniumPutOntoBattlefieldEffect(final PyxisOfPandemoniumPutOntoBattlefieldEffect effect) {
|
public PyxisOfPandemoniumPutOntoBattlefieldEffect(final PyxisOfPandemoniumPutOntoBattlefieldEffect effect) {
|
||||||
|
|
|
@ -31,7 +31,6 @@ package mage.game.permanent;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.costs.mana.GenericManaCost;
|
|
||||||
import mage.abilities.costs.mana.ManaCost;
|
import mage.abilities.costs.mana.ManaCost;
|
||||||
import mage.abilities.costs.mana.ManaCosts;
|
import mage.abilities.costs.mana.ManaCosts;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
|
@ -120,6 +119,7 @@ public class PermanentCard extends PermanentImpl {
|
||||||
this.flipCard = card.isFlipCard();
|
this.flipCard = card.isFlipCard();
|
||||||
this.flipCardName = card.getFlipCardName();
|
this.flipCardName = card.getFlipCardName();
|
||||||
this.faceDown = card.isFaceDown();
|
this.faceDown = card.isFaceDown();
|
||||||
|
this.morphCard = card.isMorphCard();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Card getCard() {
|
public Card getCard() {
|
||||||
|
|
Loading…
Reference in a new issue