From b24f31f98c7e890a66ba74c4830ca4a78fc6376f Mon Sep 17 00:00:00 2001 From: Agetian Date: Mon, 21 Aug 2017 10:04:36 +0000 Subject: [PATCH] - Fixed an issue with the new quest card price format and cards with multiple art index (e.g. Arcane Denial from ALL or basic lands). --- .../main/java/forge/quest/QuestSpellShop.java | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/forge-gui/src/main/java/forge/quest/QuestSpellShop.java b/forge-gui/src/main/java/forge/quest/QuestSpellShop.java index 006edcdd769..8a7d77f4086 100644 --- a/forge-gui/src/main/java/forge/quest/QuestSpellShop.java +++ b/forge-gui/src/main/java/forge/quest/QuestSpellShop.java @@ -28,17 +28,26 @@ public class QuestSpellShop { private static ItemPool decksUsingMyCards; public static Integer getCardValue(final InventoryItem card) { - String ns; + String ns, nsArt; int value = 1337; // previously this was the returned default boolean foil = false; int foilMultiplier; + PaperCard pc = null; + int artIndex = 0; + if (card instanceof PaperCard) { - ns = card.getName() + "|" + ((PaperCard) card).getEdition(); + pc = (PaperCard) card; + artIndex = pc.getArtIndex(); + + ns = card.getName() + "|" + pc.getEdition(); + nsArt = card.getName() + " (" + artIndex + ")|" + pc.getEdition(); + foil = ((PaperCard) card).isFoil(); } else { ns = card.getName(); + nsArt = ns; } if (mapPrices == null) { //initialize price map if not already done @@ -46,8 +55,10 @@ public class QuestSpellShop { } if (mapPrices.containsKey(ns)) { value = mapPrices.get(ns); - } - else if (card instanceof PaperCard) { + } else if (mapPrices.containsKey(nsArt)) { + // Card with specific art index (for cards with multiple art variants, e.g. Arcane Denial from Alliances) + value = mapPrices.get(nsArt); + } else if (card instanceof PaperCard) { switch (((IPaperCard) card).getRarity()) { case BasicLand: value = 4;