diff --git a/Plugin.cs b/Plugin.cs index 245c417..2ce5902 100644 --- a/Plugin.cs +++ b/Plugin.cs @@ -214,7 +214,7 @@ public string Author public Version Version { - get { return new Version("0.9.0"); } + get { return new Version("0.9.1"); } } public MenuItem MenuItem @@ -1411,69 +1411,79 @@ private void PickHero(int heroindex) private async Task SearchCards() { Card[] cards = new Card[3]; - bool valid = false; Log.Info("GetArenaDraftChoices"); List choices = Reflection.GetArenaDraftChoices(); - if (choices != null) + + if (choices == null) + return; + + if (choices.Count != 3) + return; + + // Check if cards are valid and not hero cards + int validCards = 0; + for (int i = 0; i < 3; i++) { - if (choices.Count == 3) - { - for (int i = 0; i < 3; i++) - { - cards[i] = GetCard(choices[i].Id); - Log.Info("Choice: " + choices[i].Id); - } + cards[i] = GetCard(choices[i].Id); - // Check for same cards - bool samecardsdetected = false; - if (previouscards.Count == 3) - { - int samecards = 0; - for (int i = 0; i < 3; i++) - { - if (previouscards[i].Id == cards[i].Id) - { - samecards++; - } - } + if (cards[i].Type != "Hero") { + validCards++; + Log.Info("Choice: " + choices[i].Id); + } + } - if (samecards == 3) - { - // All the same cards, can be valid but unlikely - samecardsdetected = true; - } - } + if (validCards != 3) + return; - // Save card choices - previouscards.Clear(); - for (int i = 0; i < 3; i++) + // Check for same cards + bool samecardsdetected = false; + if (previouscards.Count == 3) + { + int samecards = 0; + for (int i = 0; i < 3; i++) + { + if (previouscards[i].Id == cards[i].Id) { - previouscards.Add(cards[i]); + samecards++; } + } - // Wait for confirmations when same cards detected - if (samecardsdetected) - { - if (!samecarddelay) - { - Log.Info("Same cards detected: delaying"); - samecardtime = DateTime.Now; - samecarddelay = true; - } - else if (DateTime.Now.Subtract(samecardtime).TotalMilliseconds >= samecardmaxtime) - { - samecarddelay = false; - valid = true; - } + if (samecards == 3) + { + // All the same cards, can be valid but unlikely + samecardsdetected = true; + } + } - } - else - { - samecarddelay = false; - valid = true; - } + // Save card choices + previouscards.Clear(); + for (int i = 0; i < 3; i++) + { + previouscards.Add(cards[i]); + } + + bool valid = false; + // Wait for confirmations when same cards detected + if (samecardsdetected) + { + if (!samecarddelay) + { + Log.Info("Same cards detected: delaying"); + samecardtime = DateTime.Now; + samecarddelay = true; } + else if (DateTime.Now.Subtract(samecardtime).TotalMilliseconds >= samecardmaxtime) + { + samecarddelay = false; + valid = true; + } + + } + else + { + samecarddelay = false; + valid = true; } if (valid) diff --git a/data/cardtier.json b/data/cardtier.json index 46e4d63..a7fc982 100644 --- a/data/cardtier.json +++ b/data/cardtier.json @@ -2105,7 +2105,7 @@ "value": [ "102", "103", - "112", + "111", "103", "100", "112", @@ -5118,7 +5118,7 @@ "id": "GIL_653", "name": "Woodcutter's Axe", "value": [ - "173", + "196", "", "", "", @@ -5238,7 +5238,7 @@ "id": "ICC_064", "name": "Blood Razor", "value": [ - "124", + "156", "", "", "", @@ -5373,15 +5373,15 @@ "id": "GIL_624", "name": "Night Prowler", "value": [ + "76", + "74", "77", - "75", + "68", "77", - "69", "77", - "78", - "70", + "68", "76", - "77" + "76" ] }, { @@ -5898,15 +5898,15 @@ "id": "UNG_072", "name": "Stonehill Defender", "value": [ - "122", - "130", - "149", - "120", - "124", - "135", - "110", - "132", - "126" + "134", + "142", + "163", + "145", + "137", + "148", + "129", + "145", + "138" ] }, { @@ -7626,7 +7626,7 @@ "", "", "", - "169*", + "201*", "", "", "", @@ -8999,21 +8999,6 @@ "" ] }, - { - "id": "EX1_295", - "name": "Ice Block", - "value": [ - "", - "", - "", - "", - "", - "", - "", - "48", - "" - ] - }, { "id": "NEW1_040", "name": "Hogger", @@ -10431,7 +10416,7 @@ "", "", "", - "158", + "178", "", "", "", @@ -11189,21 +11174,6 @@ "104" ] }, - { - "id": "EX1_050", - "name": "Coldlight Oracle", - "value": [ - "34", - "34", - "34", - "31", - "32", - "34", - "26", - "34", - "34" - ] - }, { "id": "LOOT_365", "name": "Gemstudded Golem", @@ -11384,21 +11354,6 @@ "" ] }, - { - "id": "EX1_620", - "name": "Molten Giant", - "value": [ - "30", - "29", - "30", - "27", - "28", - "30", - "26", - "30", - "31" - ] - }, { "id": "GIL_835", "name": "Squashling", diff --git a/data/version.json b/data/version.json index 2c39399..e00b3af 100644 --- a/data/version.json +++ b/data/version.json @@ -1,4 +1,4 @@ { "hashlist": "0.1.3", - "tierlist": "0.1.64" + "tierlist": "0.1.65" } \ No newline at end of file