- Foil cards will now correctly display in deck editors (with foil).

- Fixed the foil card display during the match.
This commit is contained in:
Agetian
2013-07-31 05:28:03 +00:00
parent 49beec26c5
commit 04a0d0c04c
2 changed files with 14 additions and 2 deletions

View File

@@ -134,7 +134,7 @@ public class GameNew {
// Assign card-specific foiling or random foiling on approximately 1:20 cards if enabled
CardEdition.FoilType foilType = CardEdition.FoilType.NOT_SUPPORTED;
if (card.getCurSetCode() != null && Singletons.getModel().getEditions().get(card.getCurSetCode()) != null) {
Singletons.getModel().getEditions().get(card.getCurSetCode()).getFoilType();
foilType = Singletons.getModel().getEditions().get(card.getCurSetCode()).getFoilType();
}
if (foilType != CardEdition.FoilType.NOT_SUPPORTED && (cp.isFoil() || (canRandomFoil && MyRandom.percentTrue(5)))) {
int iFoil = 0;

View File

@@ -25,11 +25,13 @@ import forge.Card;
import forge.CardCharacteristicName;
import forge.Command;
import forge.Singletons;
import forge.card.CardEdition;
import forge.gui.framework.ICDoc;
import forge.gui.match.views.VPicture;
import forge.gui.toolbox.special.CardZoomer;
import forge.item.IPaperCard;
import forge.item.InventoryItem;
import forge.util.MyRandom;
/**
* Controls the card picture panel in the match UI.
@@ -66,7 +68,17 @@ public enum CPicture implements ICDoc {
public void showCard(final InventoryItem item) {
if (item instanceof IPaperCard) {
showCard(((IPaperCard)item).getMatchingForgeCard(), false);
Card c = ((IPaperCard)item).getMatchingForgeCard();
if (((IPaperCard)item).isFoil() && c.getFoil() == 0) {
CardEdition.FoilType foilType = CardEdition.FoilType.NOT_SUPPORTED;
if (c.getCurSetCode() != null && Singletons.getModel().getEditions().get(c.getCurSetCode()) != null) {
foilType = Singletons.getModel().getEditions().get(c.getCurSetCode()).getFoilType();
}
if (foilType != CardEdition.FoilType.NOT_SUPPORTED) {
c.setFoil(foilType == CardEdition.FoilType.MODERN ? MyRandom.getRandom().nextInt(9) + 1 : MyRandom.getRandom().nextInt(9) + 11);
}
}
showCard(c, false);
return;
}