- 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).

This commit is contained in:
Agetian
2017-08-21 10:04:36 +00:00
parent 5263edc3e2
commit b24f31f98c

View File

@@ -28,17 +28,26 @@ public class QuestSpellShop {
private static ItemPool<InventoryItem> decksUsingMyCards; private static ItemPool<InventoryItem> decksUsingMyCards;
public static Integer getCardValue(final InventoryItem card) { public static Integer getCardValue(final InventoryItem card) {
String ns; String ns, nsArt;
int value = 1337; // previously this was the returned default int value = 1337; // previously this was the returned default
boolean foil = false; boolean foil = false;
int foilMultiplier; int foilMultiplier;
PaperCard pc = null;
int artIndex = 0;
if (card instanceof PaperCard) { 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(); foil = ((PaperCard) card).isFoil();
} }
else { else {
ns = card.getName(); ns = card.getName();
nsArt = ns;
} }
if (mapPrices == null) { //initialize price map if not already done if (mapPrices == null) { //initialize price map if not already done
@@ -46,8 +55,10 @@ public class QuestSpellShop {
} }
if (mapPrices.containsKey(ns)) { if (mapPrices.containsKey(ns)) {
value = mapPrices.get(ns); value = mapPrices.get(ns);
} } else if (mapPrices.containsKey(nsArt)) {
else if (card instanceof PaperCard) { // 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()) { switch (((IPaperCard) card).getRarity()) {
case BasicLand: case BasicLand:
value = 4; value = 4;