diff --git a/ohbem.go b/ohbem.go index 6a5bbec..747763e 100644 --- a/ohbem.go +++ b/ohbem.go @@ -541,27 +541,14 @@ func (o *Ohbem) QueryPvPRank(pokemonId int, form int, costume int, gender int, a if evolution.GenderRequirement != 0 && gender != evolution.GenderRequirement { continue } - pushRecursively := func(form int) { - evolvedRanks, _ := o.QueryPvPRank(evolution.Pokemon, form, costume, gender, attack, defense, stamina, level) - for leagueName, results := range evolvedRanks { - if result[leagueName] == nil { - result[leagueName] = results - } else { - result[leagueName] = append(result[leagueName], results...) - } + evolvedRanks, _ := o.QueryPvPRank(evolution.Pokemon, evolution.Form, costume, gender, attack, defense, stamina, level) + for leagueName, results := range evolvedRanks { + if result[leagueName] == nil { + result[leagueName] = results + } else { + result[leagueName] = append(result[leagueName], results...) } } - pushRecursively(evolution.Form) - switch evolution.Pokemon { - case 26: - pushRecursively(50) // RAICHU_ALOLA - case 103: - pushRecursively(78) // EXEGGUTOR_ALOLA - case 105: - pushRecursively(80) // MAROWAK_ALOLA - case 110: - pushRecursively(944) // WEEZING_GALARIAN - } } } diff --git a/test/master-test.json b/test/master-test.json index ea470b0..cc7f883 100644 --- a/test/master-test.json +++ b/test/master-test.json @@ -501,6 +501,10 @@ "evolutions": [ { "pokemon": 26 + }, + { + "pokemon": 26, + "form": 50 } ] }, @@ -530,6 +534,10 @@ "evolutions": [ { "pokemon": 26 + }, + { + "pokemon": 26, + "form": 50 } ] }, @@ -1160,7 +1168,12 @@ }, "attack": 207, "defense": 138, - "stamina": 163 + "stamina": 163, + "evolutions": [ + { + "pokemon": 979 + } + ] }, "58": { "forms": { @@ -2093,6 +2106,10 @@ { "pokemon": 103, "form": 77 + }, + { + "pokemon": 103, + "form": 78 } ] }, @@ -2106,6 +2123,10 @@ { "pokemon": 103, "form": 77 + }, + { + "pokemon": 103, + "form": 78 } ], "little": true @@ -2132,6 +2153,10 @@ { "pokemon": 105, "form": 79 + }, + { + "pokemon": 105, + "form": 80 } ] }, @@ -2145,6 +2170,10 @@ { "pokemon": 105, "form": 79 + }, + { + "pokemon": 105, + "form": 80 } ], "little": true @@ -2203,6 +2232,10 @@ { "pokemon": 110, "form": 706 + }, + { + "pokemon": 110, + "form": 944 } ] }, @@ -2216,6 +2249,10 @@ { "pokemon": 110, "form": 706 + }, + { + "pokemon": 110, + "form": 944 } ], "little": true @@ -3074,6 +3111,10 @@ "evolutions": [ { "pokemon": 157 + }, + { + "pokemon": 157, + "form": 2786 } ] }, @@ -3086,6 +3127,10 @@ "evolutions": [ { "pokemon": 157 + }, + { + "pokemon": 157, + "form": 2786 } ] }, @@ -3094,7 +3139,11 @@ "1133": {}, "1134": {}, "1135": {}, - "2786": {} + "2786": { + "attack": 238, + "defense": 172, + "stamina": 177 + } }, "attack": 223, "defense": 173, @@ -3673,6 +3722,9 @@ { "pokemon": 195, "form": 1229 + }, + { + "pokemon": 980 } ], "little": true @@ -3824,7 +3876,13 @@ }, "attack": 182, "defense": 133, - "stamina": 172 + "stamina": 172, + "evolutions": [ + { + "pokemon": 981 + } + ], + "little": true }, "204": { "forms": { @@ -3868,7 +3926,13 @@ }, "attack": 131, "defense": 128, - "stamina": 225 + "stamina": 225, + "evolutions": [ + { + "pokemon": 982 + } + ], + "little": true }, "207": { "forms": { @@ -4091,13 +4155,24 @@ }, "217": { "forms": { - "1268": {}, + "1268": { + "evolutions": [ + { + "pokemon": 901 + } + ] + }, "1269": {}, "1270": {} }, "attack": 236, "defense": 144, - "stamina": 207 + "stamina": 207, + "evolutions": [ + { + "pokemon": 901 + } + ] }, "218": { "forms": { @@ -5190,8 +5265,7 @@ "1": { "attack": 326, "defense": 229, - "stamina": 169, - "unreleased": true + "stamina": 169 } } }, @@ -5639,8 +5713,7 @@ "1": { "attack": 205, "defense": 179, - "stamina": 155, - "unreleased": true + "stamina": 155 } } }, @@ -6706,8 +6779,7 @@ "1": { "attack": 310, "defense": 251, - "stamina": 216, - "unreleased": true + "stamina": 216 } } }, @@ -6826,6 +6898,11 @@ "temp_evolutions": { "1": {} } + }, + "2821": { + "temp_evolutions": { + "1": {} + } } }, "attack": 228, @@ -6851,6 +6928,11 @@ "temp_evolutions": { "1": {} } + }, + "2822": { + "temp_evolutions": { + "1": {} + } } }, "attack": 268, @@ -6872,7 +6954,14 @@ }, "attack": 270, "defense": 228, - "stamina": 205 + "stamina": 205, + "temp_evolutions": { + "4": { + "attack": 353, + "defense": 268, + "stamina": 218 + } + } }, "383": { "forms": { @@ -6882,7 +6971,14 @@ }, "attack": 270, "defense": 228, - "stamina": 205 + "stamina": 205, + "temp_evolutions": { + "4": { + "attack": 353, + "defense": 268, + "stamina": 218 + } + } }, "384": { "forms": { @@ -7785,6 +7881,10 @@ "evolutions": [ { "pokemon": 122 + }, + { + "pokemon": 122, + "form": 2339 } ], "little": true @@ -8666,6 +8766,10 @@ "evolutions": [ { "pokemon": 503 + }, + { + "pokemon": 503, + "form": 2787 } ] }, @@ -8674,7 +8778,11 @@ "1913": {}, "1914": {}, "1915": {}, - "2787": {} + "2787": { + "attack": 218, + "defense": 152, + "stamina": 207 + } }, "attack": 212, "defense": 157, @@ -9285,6 +9393,10 @@ "evolutions": [ { "pokemon": 549 + }, + { + "pokemon": 549, + "form": 2789 } ], "little": true @@ -9294,7 +9406,11 @@ "2051": {}, "2052": {}, "2053": {}, - "2789": {} + "2789": { + "attack": 208, + "defense": 159, + "stamina": 172 + } }, "attack": 214, "defense": 155, @@ -9311,7 +9427,8 @@ "stamina": 172, "evolutions": [ { - "pokemon": 902 + "pokemon": 902, + "form": 2807 } ], "little": true @@ -10385,7 +10502,12 @@ }, "attack": 232, "defense": 176, - "stamina": 163 + "stamina": 163, + "evolutions": [ + { + "pokemon": 983 + } + ] }, "626": { "forms": { @@ -10410,6 +10532,10 @@ { "pokemon": 628, "form": 2276 + }, + { + "pokemon": 628, + "form": 2798 } ], "little": true @@ -11733,13 +11859,27 @@ "evolutions": [ { "pokemon": 705 + }, + { + "pokemon": 705, + "form": 2790 } ], "little": true }, "705": { "forms": { - "2790": {}, + "2790": { + "attack": 153, + "defense": 201, + "stamina": 151, + "evolutions": [ + { + "pokemon": 706, + "form": 2791 + } + ] + }, "2810": {} }, "attack": 159, @@ -11749,11 +11889,16 @@ { "pokemon": 706 } - ] + ], + "little": true }, "706": { "forms": { - "2791": {}, + "2791": { + "attack": 211, + "defense": 255, + "stamina": 190 + }, "2811": {} }, "attack": 220, @@ -11878,6 +12023,10 @@ "evolutions": [ { "pokemon": 713 + }, + { + "pokemon": 713, + "form": 2795 } ], "little": true @@ -12005,13 +12154,21 @@ "evolutions": [ { "pokemon": 724 + }, + { + "pokemon": 724, + "form": 2785 } ] }, "724": { "forms": { "0": {}, - "2785": {}, + "2785": { + "attack": 213, + "defense": 174, + "stamina": 204 + }, "2809": {} }, "attack": 210, @@ -14030,6 +14187,863 @@ "attack": 281, "defense": 162, "stamina": 179 + }, + "906": { + "forms": {}, + "attack": 116, + "defense": 99, + "stamina": 120, + "evolutions": [ + { + "pokemon": 907 + } + ], + "little": true + }, + "907": { + "forms": {}, + "attack": 157, + "defense": 128, + "stamina": 156, + "evolutions": [ + { + "pokemon": 908 + } + ], + "little": true + }, + "908": { + "forms": {}, + "attack": 233, + "defense": 153, + "stamina": 183 + }, + "909": { + "forms": {}, + "attack": 112, + "defense": 96, + "stamina": 167, + "evolutions": [ + { + "pokemon": 910 + } + ], + "little": true + }, + "910": { + "forms": {}, + "attack": 162, + "defense": 134, + "stamina": 191, + "evolutions": [ + { + "pokemon": 911 + } + ], + "little": true + }, + "911": { + "forms": {}, + "attack": 207, + "defense": 178, + "stamina": 232 + }, + "912": { + "forms": {}, + "attack": 120, + "defense": 86, + "stamina": 146, + "evolutions": [ + { + "pokemon": 913 + } + ], + "little": true + }, + "913": { + "forms": {}, + "attack": 162, + "defense": 123, + "stamina": 172, + "evolutions": [ + { + "pokemon": 914 + } + ], + "little": true + }, + "914": { + "forms": {}, + "attack": 236, + "defense": 159, + "stamina": 198 + }, + "915": { + "forms": {}, + "attack": 81, + "defense": 79, + "stamina": 144, + "evolutions": [ + { + "pokemon": 916 + } + ], + "little": true + }, + "916": { + "forms": {}, + "attack": 186, + "defense": 153, + "stamina": 242 + }, + "917": { + "forms": {}, + "attack": 70, + "defense": 77, + "stamina": 111, + "evolutions": [ + { + "pokemon": 918 + } + ], + "little": true + }, + "918": { + "forms": {}, + "attack": 139, + "defense": 166, + "stamina": 155 + }, + "919": { + "forms": {}, + "attack": 81, + "defense": 65, + "stamina": 107, + "evolutions": [ + { + "pokemon": 920 + } + ], + "little": true + }, + "920": { + "forms": {}, + "attack": 199, + "defense": 144, + "stamina": 174 + }, + "921": { + "forms": {}, + "attack": 95, + "defense": 45, + "stamina": 128, + "evolutions": [ + { + "pokemon": 922 + } + ], + "little": true + }, + "922": { + "forms": {}, + "attack": 147, + "defense": 82, + "stamina": 155, + "evolutions": [ + { + "pokemon": 923 + } + ], + "little": true + }, + "923": { + "forms": {}, + "attack": 232, + "defense": 141, + "stamina": 172 + }, + "924": { + "forms": {}, + "attack": 98, + "defense": 90, + "stamina": 137, + "evolutions": [ + { + "pokemon": 925 + } + ], + "little": true + }, + "925": { + "forms": {}, + "attack": 159, + "defense": 157, + "stamina": 179 + }, + "926": { + "forms": {}, + "attack": 102, + "defense": 126, + "stamina": 114, + "evolutions": [ + { + "pokemon": 927 + } + ], + "little": true + }, + "927": { + "forms": {}, + "attack": 159, + "defense": 212, + "stamina": 149 + }, + "928": { + "forms": {}, + "attack": 100, + "defense": 89, + "stamina": 121, + "evolutions": [ + { + "pokemon": 929 + } + ], + "little": true + }, + "929": { + "forms": {}, + "attack": 137, + "defense": 131, + "stamina": 141, + "evolutions": [ + { + "pokemon": 930 + } + ], + "little": true + }, + "930": { + "forms": {}, + "attack": 219, + "defense": 189, + "stamina": 186 + }, + "931": { + "forms": {}, + "attack": 185, + "defense": 105, + "stamina": 193 + }, + "932": { + "forms": {}, + "attack": 95, + "defense": 108, + "stamina": 146, + "evolutions": [ + { + "pokemon": 933 + } + ], + "little": true + }, + "933": { + "forms": {}, + "attack": 105, + "defense": 160, + "stamina": 155, + "evolutions": [ + { + "pokemon": 934 + } + ], + "little": true + }, + "934": { + "forms": {}, + "attack": 171, + "defense": 212, + "stamina": 225 + }, + "935": { + "forms": {}, + "attack": 92, + "defense": 74, + "stamina": 120, + "evolutions": [ + { + "pokemon": 936 + }, + { + "pokemon": 937 + } + ], + "little": true + }, + "936": { + "forms": {}, + "attack": 234, + "defense": 185, + "stamina": 198 + }, + "937": { + "forms": {}, + "attack": 239, + "defense": 189, + "stamina": 181 + }, + "938": { + "forms": {}, + "attack": 104, + "defense": 73, + "stamina": 156, + "evolutions": [ + { + "pokemon": 939 + } + ], + "little": true + }, + "939": { + "forms": {}, + "attack": 184, + "defense": 165, + "stamina": 240 + }, + "940": { + "forms": {}, + "attack": 105, + "defense": 75, + "stamina": 120, + "evolutions": [ + { + "pokemon": 941 + } + ], + "little": true + }, + "941": { + "forms": {}, + "attack": 221, + "defense": 132, + "stamina": 172 + }, + "942": { + "forms": {}, + "attack": 140, + "defense": 108, + "stamina": 155, + "evolutions": [ + { + "pokemon": 943 + } + ], + "little": true + }, + "943": { + "forms": {}, + "attack": 230, + "defense": 168, + "stamina": 190 + }, + "944": { + "forms": {}, + "attack": 124, + "defense": 70, + "stamina": 120, + "evolutions": [ + { + "pokemon": 945 + } + ], + "little": true + }, + "945": { + "forms": {}, + "attack": 199, + "defense": 149, + "stamina": 160 + }, + "946": { + "forms": {}, + "attack": 121, + "defense": 64, + "stamina": 120, + "evolutions": [ + { + "pokemon": 947 + } + ], + "little": true + }, + "947": { + "forms": {}, + "attack": 228, + "defense": 144, + "stamina": 146 + }, + "948": { + "forms": {}, + "attack": 97, + "defense": 149, + "stamina": 120, + "evolutions": [ + { + "pokemon": 949 + } + ], + "little": true + }, + "949": { + "forms": {}, + "attack": 166, + "defense": 209, + "stamina": 190 + }, + "950": { + "forms": {}, + "attack": 184, + "defense": 185, + "stamina": 172 + }, + "951": { + "forms": {}, + "attack": 118, + "defense": 76, + "stamina": 137, + "evolutions": [ + { + "pokemon": 952 + } + ], + "little": true + }, + "952": { + "forms": {}, + "attack": 216, + "defense": 130, + "stamina": 163 + }, + "953": { + "forms": {}, + "attack": 86, + "defense": 108, + "stamina": 121, + "evolutions": [ + { + "pokemon": 954 + } + ], + "little": true + }, + "954": { + "forms": {}, + "attack": 201, + "defense": 178, + "stamina": 181 + }, + "955": { + "forms": {}, + "attack": 105, + "defense": 60, + "stamina": 102, + "evolutions": [ + { + "pokemon": 956 + } + ], + "little": true + }, + "956": { + "forms": {}, + "attack": 204, + "defense": 127, + "stamina": 216 + }, + "957": { + "forms": {}, + "attack": 85, + "defense": 110, + "stamina": 137, + "evolutions": [ + { + "pokemon": 958 + } + ], + "little": true + }, + "958": { + "forms": {}, + "attack": 109, + "defense": 145, + "stamina": 163, + "evolutions": [ + { + "pokemon": 959 + } + ], + "little": true + }, + "959": { + "forms": {}, + "attack": 155, + "defense": 196, + "stamina": 198 + }, + "960": { + "forms": {}, + "attack": 109, + "defense": 52, + "stamina": 67, + "evolutions": [ + { + "pokemon": 961 + } + ], + "little": true + }, + "961": { + "forms": {}, + "attack": 205, + "defense": 136, + "stamina": 111 + }, + "962": { + "forms": {}, + "attack": 198, + "defense": 172, + "stamina": 172 + }, + "963": { + "forms": {}, + "attack": 90, + "defense": 80, + "stamina": 172, + "evolutions": [ + { + "pokemon": 964 + } + ], + "little": true + }, + "964": { + "forms": {}, + "attack": 143, + "defense": 144, + "stamina": 225 + }, + "965": { + "forms": {}, + "attack": 123, + "defense": 107, + "stamina": 128, + "evolutions": [ + { + "pokemon": 966 + } + ], + "little": true + }, + "966": { + "forms": {}, + "attack": 229, + "defense": 168, + "stamina": 190 + }, + "967": { + "forms": {}, + "attack": 205, + "defense": 142, + "stamina": 172 + }, + "968": { + "forms": {}, + "attack": 161, + "defense": 219, + "stamina": 172 + }, + "969": { + "forms": {}, + "attack": 187, + "defense": 104, + "stamina": 134, + "evolutions": [ + { + "pokemon": 970 + } + ], + "little": true + }, + "970": { + "forms": {}, + "attack": 246, + "defense": 177, + "stamina": 195 + }, + "971": { + "forms": {}, + "attack": 105, + "defense": 106, + "stamina": 137, + "evolutions": [ + { + "pokemon": 972 + } + ], + "little": true + }, + "972": { + "forms": {}, + "attack": 186, + "defense": 195, + "stamina": 176 + }, + "973": { + "forms": {}, + "attack": 227, + "defense": 145, + "stamina": 193 + }, + "974": { + "forms": {}, + "attack": 119, + "defense": 80, + "stamina": 239, + "evolutions": [ + { + "pokemon": 975 + } + ], + "little": true + }, + "975": { + "forms": {}, + "attack": 208, + "defense": 123, + "stamina": 347 + }, + "976": { + "forms": {}, + "attack": 196, + "defense": 139, + "stamina": 207 + }, + "977": { + "forms": {}, + "attack": 176, + "defense": 178, + "stamina": 312 + }, + "978": { + "forms": {}, + "attack": 226, + "defense": 166, + "stamina": 169 + }, + "979": { + "forms": {}, + "attack": 220, + "defense": 178, + "stamina": 242 + }, + "980": { + "forms": {}, + "attack": 127, + "defense": 151, + "stamina": 277 + }, + "981": { + "forms": {}, + "attack": 209, + "defense": 136, + "stamina": 260 + }, + "982": { + "forms": {}, + "attack": 188, + "defense": 150, + "stamina": 268 + }, + "983": { + "forms": {}, + "attack": 238, + "defense": 203, + "stamina": 225 + }, + "984": { + "forms": {}, + "attack": 226, + "defense": 190, + "stamina": 229 + }, + "985": { + "forms": {}, + "attack": 139, + "defense": 234, + "stamina": 251 + }, + "986": { + "forms": {}, + "attack": 232, + "defense": 190, + "stamina": 244 + }, + "987": { + "forms": {}, + "attack": 280, + "defense": 235, + "stamina": 146 + }, + "988": { + "forms": {}, + "attack": 261, + "defense": 193, + "stamina": 198 + }, + "989": { + "forms": {}, + "attack": 244, + "defense": 195, + "stamina": 198 + }, + "990": { + "forms": {}, + "attack": 227, + "defense": 216, + "stamina": 207 + }, + "991": { + "forms": {}, + "attack": 266, + "defense": 211, + "stamina": 148 + }, + "992": { + "forms": {}, + "attack": 223, + "defense": 161, + "stamina": 291 + }, + "993": { + "forms": {}, + "attack": 249, + "defense": 179, + "stamina": 214 + }, + "994": { + "forms": {}, + "attack": 281, + "defense": 196, + "stamina": 190 + }, + "995": { + "forms": {}, + "attack": 250, + "defense": 200, + "stamina": 225 + }, + "996": { + "forms": {}, + "attack": 134, + "defense": 86, + "stamina": 163, + "evolutions": [ + { + "pokemon": 997 + } + ], + "little": true + }, + "997": { + "forms": {}, + "attack": 173, + "defense": 128, + "stamina": 207, + "evolutions": [ + { + "pokemon": 998 + } + ], + "little": true + }, + "998": { + "forms": {}, + "attack": 254, + "defense": 168, + "stamina": 229 + }, + "999": { + "forms": { + "2998": {} + }, + "attack": 121, + "defense": 122, + "stamina": 128, + "evolutions": [ + { + "pokemon": 1000 + }, + { + "pokemon": 1000, + "form": 3000 + } + ], + "little": true + }, + "1000": { + "forms": { + "3000": {} + }, + "attack": 252, + "defense": 190, + "stamina": 202 + }, + "1001": { + "forms": {}, + "attack": 186, + "defense": 242, + "stamina": 198 + }, + "1002": { + "forms": {}, + "attack": 261, + "defense": 167, + "stamina": 190 + }, + "1003": { + "forms": {}, + "attack": 194, + "defense": 203, + "stamina": 321 + }, + "1004": { + "forms": {}, + "attack": 269, + "defense": 221, + "stamina": 146 + }, + "1005": { + "forms": {}, + "attack": 254, + "defense": 178, + "stamina": 213 + }, + "1006": { + "forms": {}, + "attack": 279, + "defense": 171, + "stamina": 179 + }, + "1007": { + "forms": {}, + "attack": 263, + "defense": 223, + "stamina": 205 + }, + "1008": { + "forms": {}, + "attack": 263, + "defense": 223, + "stamina": 205 } }, "costumes": { @@ -14093,6 +15107,12 @@ "57": false, "58": true, "59": false, - "60": true + "60": true, + "61": true, + "62": true, + "63": false, + "64": false, + "65": false, + "66": false } } \ No newline at end of file