diff --git a/CardData.xml b/CardData.xml index 7fda8cf..1d44ce2 100644 --- a/CardData.xml +++ b/CardData.xml @@ -4,7 +4,7 @@ - + @@ -12,7 +12,7 @@ - + @@ -40,9 +40,9 @@ - - - + + + @@ -50,7 +50,7 @@ - + @@ -63,11 +63,11 @@ - + - + @@ -77,7 +77,7 @@ - + @@ -88,7 +88,7 @@ - + @@ -143,7 +143,7 @@ - + @@ -430,7 +430,7 @@ - + @@ -438,7 +438,7 @@ - + @@ -475,7 +475,7 @@ - + @@ -511,7 +511,7 @@ - + @@ -1159,4 +1159,173 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CardPool.xml b/CardPool.xml index 84aa1b8..479f65d 100644 --- a/CardPool.xml +++ b/CardPool.xml @@ -1158,4 +1158,173 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/README.md b/README.md index 22c0c52..238803e 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ A tool to allow importing/exporting decks between Magic Duels and Magic Assistan 1. Download and install [Magic Assistant](https://sourceforge.net/projects/mtgbrowser/). Run it and let it update. Keep track of where you save the workspace. 2. In Magic Assistant, open the card filter dialog _(looks like three arrows point right)_. Click _'Set filter'_, then make sure the following sets all have icons: * _Aether Revolt_ + * _Amonkhet_ * _Battle for Zendikar_ * _Eldritch Moon_ * _Kaladesh_ diff --git a/src/com/blueraja/magicduelsimporter/carddata/CardDataGenerator.java b/src/com/blueraja/magicduelsimporter/carddata/CardDataGenerator.java index be5b83f..9d2c45c 100644 --- a/src/com/blueraja/magicduelsimporter/carddata/CardDataGenerator.java +++ b/src/com/blueraja/magicduelsimporter/carddata/CardDataGenerator.java @@ -76,7 +76,7 @@ private static void LoadMagicDuelsCardPool(String cardpoolPath) int id = Integer.parseInt(idStr); if(!_nameToMagicAssistEntry.containsKey(normalizedName)) { - throw new Exception("Card is missing: " + name + " (" + normalizedName + ")"); + throw new Exception("Card is missing: " + name + " (" + normalizedName + ") - Did you update Magic Assistant?"); } MagicAssistEntry magicAssistEntry = _nameToMagicAssistEntry.get(normalizedName); _cardDataManager.addEntry(magicAssistEntry.originalName, id, magicAssistEntry.id); @@ -85,7 +85,15 @@ private static void LoadMagicDuelsCardPool(String cardpoolPath) private static String cleanupName(String name) { //There is a card named "Anchor to the Æther" - return name.replace("Æ", "Ae"); + name = name.replace("Æ", "Ae"); + + // The new "Aftermath" cards have different names in Magic: Duels + if(name.contains("//")) { + int index = name.indexOf("//"); + name = name.substring(0, index-1); + } + + return name; } private static String normalizeName(String name) { diff --git a/src/com/blueraja/magicduelsimporter/magicduels/Profile.java b/src/com/blueraja/magicduelsimporter/magicduels/Profile.java index 6c06102..1c896cd 100644 --- a/src/com/blueraja/magicduelsimporter/magicduels/Profile.java +++ b/src/com/blueraja/magicduelsimporter/magicduels/Profile.java @@ -32,7 +32,7 @@ public Profile(File profileFile) throws FileNotFoundException, IOException { public byte[] readCards(int numCards) { byte[] cards = new byte[numCards]; int offset = content.length - 1026; - for (int i=0; i<=numCards/2; i++) { + for (int i=0; i*2 < cards.length; i++) { cards[2*i] = (byte)(content[offset+i] & 0x0F); if(2*i+1 < cards.length) { cards[2*i+1] = (byte) ((content[offset + i]>>4) & 0x0F);