let initialRoutes = { "15": [{type: "init", level: 15, curve: "Medium Slow", name: "Lucario"}, {type: "exp-candy", experience: 2300}, {type: "rare-candy"}, {type: "rare-candy"}], "16": [{type: "init", level: 16, curve: "Medium Slow", name: "Lucario"}, {type: "exp-candy", experience: 2300}, {type: "rare-candy"}, {type: "rare-candy"}], "17": [{type: "init", level: 17, curve: "Medium Slow", name: "Lucario"}, {type: "exp-candy", experience: 1500}, {type: "rare-candy"}, {type: "rare-candy"}, {type: "exp-candy", experience: 800}], "18": [{type: "init", level: 18, curve: "Medium Slow", name: "Lucario"}, {type: "exp-candy", experience: 800}, {type: "rare-candy"}, {type: "rare-candy"}, {type: "exp-candy", experience: 1500}], "19": [{type: "init", level: 19, curve: "Medium Slow", name: "Lucario"}, {type: "exp-candy", experience: 2300}, {type: "rare-candy"}, {type: "rare-candy"}], "20": [{type: "init", level: 20, curve: "Medium Slow", name: "Lucario"}, {type: "exp-candy", experience: 2300}, {type: "rare-candy"}, {type: "rare-candy"}], "16C": [{type: "init", level: 16, curve: "Medium Slow", name: "Lucario"}, {type: "exp-candy", experience: 2300}, {type: "rare-candy"}, {type: "rare-candy"}, {type: "rare-candy"}], "17C": [{type: "init", level: 17, curve: "Medium Slow", name: "Lucario"}, {type: "exp-candy", experience: 1500}, {type: "rare-candy"}, {type: "rare-candy"}, {type: "rare-candy"}, {type: "exp-candy", experience: 800}], "18C": [{type: "init", level: 18, curve: "Medium Slow", name: "Lucario"}, {type: "exp-candy", experience: 800}, {type: "rare-candy"}, {type: "rare-candy"}, {type: "rare-candy"}, {type: "exp-candy", experience: 1500}], "20C": [{type: "init", level: 20, curve: "Medium Slow", name: "Lucario"}, {type: "exp-candy", experience: 2300}, {type: "rare-candy"}, {type: "rare-candy"}, {type: "rare-candy"}], }; // let selectedRoute = "16"; let selectedRoute = "17"; // let selectedRoute = "20"; // let selectedRoute = "20C"; let route = [ // {type: "init", level: 15, curve: "Medium Slow", name: "Lucario"}, {type: "exp-candy", experience: 2300}, {type: "rare-candy"}, {type: "rare-candy"}, // {type: "init", level: 16, curve: "Medium Slow", name: "Lucario"}, {type: "exp-candy", experience: 2300}, {type: "rare-candy"}, {type: "rare-candy"}, // {type: "init", level: 17, curve: "Medium Slow", name: "Lucario"}, {type: "exp-candy", experience: 1500}, {type: "rare-candy"}, {type: "rare-candy"}, {type: "exp-candy", experience: 800}, // {type: "init", level: 18, curve: "Medium Slow", name: "Lucario"}, {type: "exp-candy", experience: 800}, {type: "rare-candy"}, {type: "rare-candy"}, {type: "exp-candy", experience: 1500}, // {type: "init", level: 19, curve: "Medium Slow", name: "Lucario"}, {type: "exp-candy", experience: 2300}, {type: "rare-candy"}, {type: "rare-candy"}, // {type: "init", level: 20, curve: "Medium Slow", name: "Lucario"}, {type: "exp-candy", experience: 2300}, {type: "rare-candy"}, {type: "rare-candy"}, // {type: "init", level: 15, curve: "Medium Slow", name: "Lucario"}, {type: "exp-candy", experience: 2300}, {type: "rare-candy"}, {type: "rare-candy"}, {type: "rare-candy"}, // {type: "init", level: 16, curve: "Medium Slow", name: "Lucario"}, {type: "exp-candy", experience: 2300}, {type: "rare-candy"}, {type: "rare-candy"}, {type: "rare-candy"}, // {type: "init", level: 17, curve: "Medium Slow", name: "Lucario"}, {type: "exp-candy", experience: 1500}, {type: "rare-candy"}, {type: "rare-candy"}, {type: "rare-candy"}, {type: "exp-candy", experience: 800}, // {type: "init", level: 18, curve: "Medium Slow", name: "Lucario"}, {type: "exp-candy", experience: 800}, {type: "rare-candy"}, {type: "rare-candy"}, {type: "rare-candy"}, {type: "exp-candy", experience: 1500}, // {type: "init", level: 19, curve: "Medium Slow", name: "Lucario"}, {type: "exp-candy", experience: 2300}, {type: "rare-candy"}, {type: "rare-candy"}, {type: "rare-candy"}, // {type: "init", level: 20, curve: "Medium Slow", name: "Lucario"}, {type: "exp-candy", experience: 2300}, {type: "rare-candy"}, {type: "rare-candy"}, {type: "rare-candy"}, ...initialRoutes[selectedRoute], {type: "kill", pokemon: "Gossifleur", level: 16, expShare: false}, {type: "kill", pokemon: "Gossifleur", level: 19, expShare: false}, {type: "kill", pokemon: "Eldegoss", level: 20, expShare: false}, {type: "kill", pokemon: "Zigzagoon", level: 17}, {type: "kill", pokemon: "Thievul", level: 18}, {type: "kill", pokemon: "Sableye", level: 18}, {type: "kill", pokemon: "Wooloo", level: 18}, {type: "kill", pokemon: "Corvisquire", level: 19}, {type: "kill", pokemon: "Raboot", level: 21}, {type: "kill", pokemon: "Tympole", level: 21}, {type: "kill", pokemon: "Krabby", level: 20}, {type: "kill", pokemon: "Corphish", level: 20}, {type: "kill", pokemon: "Goldeen", level: 22}, {type: "kill", pokemon: "Arrokuda", level: 23}, {type: "kill", pokemon: "Drednaw", level: 24}, {type: "kill", pokemon: "Solosis", level: 21}, {type: "kill", pokemon: "Gothita", level: 22}, {type: "kill", pokemon: "Hatenna", level: 23}, {type: "kill", pokemon: "Ponyta", level: 22}, {type: "kill", pokemon: "Carkol", level: 21}, {type: "kill", pokemon: "Thievul", level: 21}, {type: "kill", pokemon: "Linoone", level: 22}, {type: "kill", pokemon: "Pancham", level: 21}, {type: "kill", pokemon: "Liepard", level: 22}, {type: "kill", pokemon: "Croagunk", level: 24}, {type: "kill", pokemon: "Scraggy", level: 24}, {type: "kill", pokemon: "Morpeko", level: 26}, {type: "catch", pokemon: "Litwick", level: 25}, {type: "kill", pokemon: "Vulpix", level: 24}, {type: "catch", pokemon: "Litwick", level: 25}, {type: "kill", pokemon: "Ninetales", level: 25}, {type: "kill", pokemon: "Arcanine", level: 25}, {type: "kill", pokemon: "Centiskorch", level: 27}, // {type: "rare-candy"}, // {type: "rare-candy"}, {type: "kill", pokemon: "Stunky", level: 29}, {type: "kill", pokemon: "Linoone", level: 30}, {type: "kill", pokemon: "Liepard", level: 30}, {type: "kill", pokemon: "Clefairy", level: 29}, {type: "kill", pokemon: "Clefable", level: 30}, {type: "kill", pokemon: "Koffing", level: 29}, {type: "kill", pokemon: "Sudowoodo", level: 31}, // {type: "rare-candy"}, // {type: "rare-candy"}, {type: "kill", pokemon: "Cramorant", level: 29}, {type: "kill", pokemon: "Silicobra", level: 30}, {type: "kill", pokemon: "Raboot", level: 33}, {type: "kill", pokemon: "Toxel", level: 29}, {type: "kill", pokemon: "Stufful", level: 31}, {type: "kill", pokemon: "Bewear", level: 32}, // {type: "evolve"}, {type: "kill", pokemon: "Farfetch’d", level: 32}, {type: "kill", pokemon: "Hitmonlee", level: 33}, {type: "kill", pokemon: "Hitmonchan", level: 33}, {type: "kill", pokemon: "Hitmontop", level: 34}, {type: "kill", pokemon: "Pangoro", level: 34}, {type: "kill", pokemon: "Sirfetch’d", level: 35}, {type: "kill", pokemon: "Machamp", level: 35}, {type: "kill", pokemon: "Duosion", level: 32}, {type: "kill", pokemon: "Hattrem", level: 35}, {type: "kill", pokemon: "Gothorita", level: 32}, {type: "kill", pokemon: "Ponyta", level: 33}, {type: "kill", pokemon: "Spritzee", level: 34}, {type: "kill", pokemon: "Slurpuff", level: 34}, {type: "kill", pokemon: "Swirlix", level: 34}, {type: "kill", pokemon: "Aromatisse", level: 34}, {type: "kill", pokemon: "Morgrem", level: 35}, {type: "kill", pokemon: "Gardevoir", level: 35}, {type: "kill", pokemon: "Weezing", level: 36}, {type: "kill", pokemon: "Togekiss", level: 37}, {type: "kill", pokemon: "Mawile", level: 36}, {type: "kill", pokemon: "Alcremie", level: 38}, ["17", "18", "17C", "19", "18C"].indexOf(selectedRoute) !== -1 ? {type: "rare-candy"} : null, {type: "kill", pokemon: "Trevenant", level: 34}, {type: "kill", pokemon: "Cinderace", level: 37}, {type: "kill", pokemon: "Heatmor", level: 34}, {type: "kill", pokemon: "Boltund", level: 35}, {type: "kill", pokemon: "Snorlax", level: 35}, {type: "kill", pokemon: "Roselia", level: 36}, {type: "kill", pokemon: "Hattrem", level: 36}, // {type: "kill", pokemon: "Boldore", level: 38}, {type: "kill", pokemon: "Barbaracle", level: 40}, {type: "kill", pokemon: "Stonjourner", level: 41}, {type: "kill", pokemon: "Shuckle", level: 40}, {type: "kill", pokemon: "Coalossal", level: 42}, {type: "kill", pokemon: "Dubwool", level: 40}, {type: "kill", pokemon: "Cinderace", level: 41}, {type: "kill", pokemon: "Corviknight", level: 40}, {type: "kill", pokemon: "Pincurchin", level: 39}, {type: "kill", pokemon: "Snorlax", level: 39}, {type: "kill", pokemon: "Linoone", level: 39}, {type: "kill", pokemon: "Pangoro", level: 40}, {type: "kill", pokemon: "Liepard", level: 42}, {type: "kill", pokemon: "Scrafty", level: 43}, {type: "kill", pokemon: "Morpeko", level: 44}, {type: "kill", pokemon: "Toxicroak", level: 43}, {type: "kill", pokemon: "Linoone", level: 42}, {type: "kill", pokemon: "Thievul", level: 42}, {type: "kill", pokemon: "Scrafty", level: 42}, {type: "kill", pokemon: "Weavile", level: 43}, {type: "kill", pokemon: "Liepard", level: 43}, {type: "kill", pokemon: "Drapion", level: 43}, {type: "kill", pokemon: "Scrafty", level: 44}, {type: "kill", pokemon: "Obstagoon", level: 46}, {type: "kill", pokemon: "Malamar", level: 45}, {type: "kill", pokemon: "Skuntank", level: 46}, {type: "kill", pokemon: "Pelipper", level: 45}, {type: "kill", pokemon: "Sliggoo", level: 45}, {type: "kill", pokemon: "Ninetales", level: 45}, {type: "kill", pokemon: "Turtonator", level: 45}, {type: "kill", pokemon: "Hakamo-o", level: 45}, {type: "kill", pokemon: "Abomasnow", level: 45}, {type: "kill", pokemon: "Gigalith", level: 46}, {type: "kill", pokemon: "Sandaconda", level: 46}, {type: "kill", pokemon: "Duraludon", level: 48}, {type: "kill", pokemon: "Flygon", level: 47, skipLevel: false}, ["15"].indexOf(selectedRoute) !== -1 ? {type: "rare-candy"} : null, // // {type: "item-equip", item: "Choice Specs"}, {type: "kill", pokemon: "Gardevoir", level: 45}, {type: "kill", pokemon: "Pelipper", level: 46}, {type: "kill", pokemon: "Noctowl", level: 46}, {type: "kill", pokemon: "Gigalith", level: 46}, {type: "kill", pokemon: "Rhydon", level: 46}, {type: "kill", pokemon: "Darmanitan", level: 46}, {type: "kill", pokemon: "Falinks", level: 46}, {type: "kill", pokemon: "Grapploct", level: 46}, ["16"].indexOf(selectedRoute) !== -1 ? {type: "rare-candy"} : null, {type: "kill", pokemon: "Liepard", level: 47}, {type: "kill", pokemon: "Scrafty", level: 47}, {type: "kill", pokemon: "Morpeko", level: 48}, {type: "kill", pokemon: "Toxicroak", level: 47}, {type: "kill", pokemon: "Grimmsnarl", level: 49}, {type: "kill", pokemon: "Dubwool", level: 48}, {type: "kill", pokemon: "Snorlax", level: 47}, {type: "kill", pokemon: "Pincurchin", level: 47}, {type: "kill", pokemon: "Corviknight", level: 48}, {type: "kill", pokemon: "Cinderace", level: 49}, {type: "kill", pokemon: "Meowth", level: 47}, {type: "kill", pokemon: "Durant", level: 47}, {type: "kill", pokemon: "Mawile", level: 47}, {type: "kill", pokemon: "Excadrill", level: 47}, {type: "kill", pokemon: "Ferroseed", level: 47}, {type: "kill", pokemon: "Steelix", level: 47}, ["20C"].indexOf(selectedRoute) !== -1 ? {type: "rare-candy"} : null, ["20C"].indexOf(selectedRoute) !== -1 ? {type: "rare-candy"} : null, {type: "kill", pokemon: "Durant", level: 48}, ["20"].indexOf(selectedRoute) !== -1 ? {type: "rare-candy"} : null, ["20"].indexOf(selectedRoute) !== -1 ? {type: "rare-candy"} : null, {type: "kill", pokemon: "Cufant", level: 48}, {type: "kill", pokemon: "Bronzong", level: 48}, {type: "kill", pokemon: "Mawile", level: 48}, {type: "kill", pokemon: "Klang", level: 48}, {type: "kill", pokemon: "Stunfisk", level: 49}, {type: "kill", pokemon: "Steelix", level: 49}, {type: "kill", pokemon: "Froslass", level: 50}, {type: "kill", pokemon: "Salazzle", level: 50}, {type: "kill", pokemon: "Milotic", level: 51}, {type: "kill", pokemon: "Tsareena", level: 50}, {type: "kill", pokemon: "Garbador", level: 52}, ["15", "17", "18", "17C", "19", "18C"].indexOf(selectedRoute) !== -1 ? {type: "rare-candy"} : null, {type: "kill", pokemon: "Mawile", level: 51}, {type: "kill", pokemon: "Gardevoir", level: 51}, {type: "kill", pokemon: "Rapidash", level: 52}, {type: "kill", pokemon: "Hatterene", level: 53}, ["16"].indexOf(selectedRoute) !== -1 ? {type: "rare-candy"} : null, {type: "kill", pokemon: "Barraskewda", level: 52}, {type: "kill", pokemon: "Golisopod", level: 51}, {type: "kill", pokemon: "Seaking", level: 52}, {type: "kill", pokemon: "Pelipper", level: 51}, {type: "kill", pokemon: "Drednaw", level: 53}, {type: "kill", pokemon: "Hawlucha", level: 52}, {type: "kill", pokemon: "Falinks", level: 53}, {type: "kill", pokemon: "Grapploct", level: 52}, {type: "kill", pokemon: "Sirfetch’d", level: 53}, {type: "kill", pokemon: "Machamp", level: 54}, {type: "kill", pokemon: "Torkoal", level: 53}, {type: "kill", pokemon: "Turtonator", level: 54}, {type: "kill", pokemon: "Flygon", level: 54}, {type: "kill", pokemon: "Goodra", level: 54}, {type: "kill", pokemon: "Duraludon", level: 55}, {type: "kill", pokemon: "Escavalier", level: 55}, {type: "kill", pokemon: "Ferrothorn", level: 55}, {type: "kill", pokemon: "Klinklang", level: 56}, {type: "kill", pokemon: "Perrserker", level: 55}, {type: "kill", pokemon: "Copperajah", level: 57}, ]; let requiredExperience = { "Erratic": [0, 15, 52, 122, 237, 406, 637, 942, 1326, 1800, 2369, 3041, 3822, 4719, 5737, 6881, 8155, 9564, 11111, 12800, 14632, 16610, 18737, 21012, 23437, 26012, 28737, 31610, 34632, 37800, 41111, 44564, 48155, 51881, 55737, 59719, 63822, 68041, 72369, 76800, 81326, 85942, 90637, 95406, 100237, 105122, 110052, 115015, 120001, 125000, 131324, 137795, 144410, 151165, 158056, 165079, 172229, 179503, 186894, 194400, 202013, 209728, 217540, 225443, 233431, 241496, 249633, 257834, 267406, 276458, 286328, 296358, 305767, 316074, 326531, 336255, 346965, 357812, 367807, 378880, 390077, 400293, 411686, 423190, 433572, 445239, 457001, 467489, 479378, 491346, 501878, 513934, 526049, 536557, 548720, 560922, 571333, 583539, 591882, 60000], "Fast": [0, 6, 21, 51, 100, 172, 274, 409, 583, 800, 1064, 1382, 1757, 2195, 2700, 3276, 3930, 4665, 5487, 6400, 7408, 8518, 9733, 11059, 12500, 14060, 15746, 17561, 19511, 21600, 23832, 26214, 28749, 31443, 34300, 37324, 40522, 43897, 47455, 51200, 55136, 59270, 63605, 68147, 72900, 77868, 83058, 88473, 94119, 100000, 106120, 112486, 119101, 125971, 133100, 140492, 148154, 156089, 164303, 172800, 181584, 190662, 200037, 209715, 219700, 229996, 240610, 251545, 262807, 274400, 286328, 298598, 311213, 324179, 337500, 351180, 365226, 379641, 394431, 409600, 425152, 441094, 457429, 474163, 491300, 508844, 526802, 545177, 563975, 583200, 602856, 622950, 643485, 664467, 685900, 707788, 730138, 752953, 776239, 800000], "Medium Fast": [0, 8, 27, 64, 125, 216, 343, 512, 729, 1000, 1331, 1728, 2197, 2744, 3375, 4096, 4913, 5832, 6859, 8000, 9261, 10648, 12167, 13824, 15625, 17576, 19683, 21952, 24389, 27000, 29791, 32768, 35937, 39304, 42875, 46656, 50653, 54872, 59319, 64000, 68921, 74088, 79507, 85184, 91125, 97336, 103823, 110592, 117649, 125000, 132651, 140608, 148877, 157464, 166375, 175616, 185193, 195112, 205379, 216000, 226981, 238328, 250047, 262144, 274625, 287496, 300763, 314432, 328509, 343000, 357911, 373248, 389017, 405224, 421875, 438976, 456533, 474552, 493039, 512000, 531441, 551368, 571787, 592704, 614125, 636056, 658503, 681472, 704969, 729000, 753571, 778688, 804357, 830584, 857375, 884736, 912673, 941192, 970299, 1000000], "Medium Slow": [0, 9, 57, 96, 135, 179, 236, 314, 419, 560, 742, 973, 1261, 1612, 2035, 2535, 3120, 3798, 4575, 5460, 6458, 7577, 8825, 10208, 11735, 13411, 15244, 17242, 19411, 21760, 24294, 27021, 29949, 33084, 36435, 40007, 43808, 47846, 52127, 56660, 61450, 66505, 71833, 77440, 83335, 89523, 96012, 102810, 109923, 117360, 125126, 133229, 141677, 150476, 159635, 169159, 179056, 189334, 199999, 211060, 222522, 234393, 246681, 259392, 272535, 286115, 300140, 314618, 329555, 344960, 360838, 377197, 394045, 411388, 429235, 447591, 466464, 485862, 505791, 526260, 547274, 568841, 590969, 613664, 636935, 660787, 685228, 710266, 735907, 762160, 789030, 816525, 844653, 873420, 902835, 932903, 963632, 995030, 1027103, 1059860], "Slow": [0, 10, 33, 80, 156, 270, 428, 640, 911, 1250, 1663, 2160, 2746, 3430, 4218, 5120, 6141, 7290, 8573, 10000, 11576, 13310, 15208, 17280, 19531, 21970, 24603, 27440, 30486, 33750, 37238, 40960, 44921, 49130, 53593, 58320, 63316, 68590, 74148, 80000, 86151, 92610, 99383, 106480, 113906, 121670, 129778, 138240, 147061, 156250, 165813, 175760, 186096, 196830, 207968, 219520, 231491, 243890, 256723, 270000, 283726, 297910, 312558, 327680, 343281, 359370, 375953, 393040, 410636, 428750, 447388, 466560, 486271, 506530, 527343, 548720, 570666, 593190, 616298, 640000, 664301, 689210, 714733, 740880, 767656, 795070, 823128, 851840, 881211, 911250, 941963, 973360, 1005446, 1038230, 1071718, 1105920, 1140841, 1176490, 1212873, 1250000], "Fluctuating": [0, 4, 13, 32, 65, 112, 178, 276, 393, 540, 745, 967, 1230, 1591, 1957, 2457, 3046, 3732, 4526, 5440, 6482, 7666, 9003, 10506, 12187, 14060, 16140, 18439, 20974, 23760, 26811, 30146, 33780, 37731, 42017, 46656, 50653, 55969, 60505, 66560, 71677, 78533, 84277, 91998, 98415, 107069, 114205, 123863, 131766, 142500, 151222, 163105, 172697, 185807, 196322, 210739, 222231, 238036, 250562, 267840, 281456, 300293, 315059, 335544, 351520, 373744, 390991, 415050, 433631, 459620, 479600, 507617, 529063, 559209, 582187, 614566, 639146, 673863, 700115, 737280, 765275, 804997, 834809, 877201, 908905, 954084, 987754, 1035837, 1071552, 1122660, 1160499, 1214753, 1254796, 1312322, 1354652, 1415577, 1460276, 1524731, 1571884, 1640000], }; let experienceYields = { "Rattata": 51, "Raticate": 145, "Pikachu": 112, "Zubat": 49, "Machop": 61, "Drowzee": 66, "Eevee": 65, "Makuhita": 47, "Zorua": 66, "Furfrou": 165, "Noibat": 49, "Litten": 64, "Torracat": 147, "Crabrawler": 68, "Wishiwashi": 61, "Wishiwashi-School": 217, "Dewpider": 54, "Araquanid": 159, "Type: Null": 107, "Poipole": 189, "Spearow": 52, "Mawile": 133, "Roggenrola": 56, "Carbink": 100, "Sableye": 133, "Spinda": 126, "Abra": 62, "Meowth": 58, "Mime Jr.": 62, "Ekans": 58, "Murkrow": 81, "Mareep": 56, "Lycanroc": 170, "Granbull": 158, "Ribombee": 162, "Gumshoos": 146, "Smeargle": 88, "Komala": 168, "Lanturn": 161, "Cloyster": 184, "Arcanine": 194, "Talonflame": 175, "Marowak": 149, "Magmar": 173, "Kecleon": 154, "Goldeen": 64, "Tropius": 161, "Exeggcute": 65, "Golurk": 169, "Gastrodon": 166, "Flygon": 260, "Mudsdale": 175, "Crobat": 241, "Silvally": 257, "Lucario": 184, "Zoroark": 179, "Pikipek": 53, "Caterpie": 39, "Yungoos": 51, "Pichu": 41, "Metapod": 72, "Bonsly": 58, "Grimer": 58, "Magnemite": 65, "Grubbin": 60, "Gastly": 62, "Psyduck": 64, "Petilil": 56, "Growlithe": 70, "Mankey": 61, "Diglett": 53, "Delibird": 116, "Glaceon": 184, "Drifloon": 70, "Munchlax": 78, "Bagon": 60, "Cutiefly": 61, "Tauros": 172, "Mudbray": 77, "Lillipup": 55, "Magby": 73, "Sudowoodo": 144, "Cubone": 64, "Oricorio": 167, "Salazzle": 168, "Kadabra": 140, "Bounsweet": 42, "Trumbeak": 124, "Miltank": 172, "Archen": 71, "Shieldon": 70, "Rockruff": 56, "Shiinotic": 142, "Fomantis": 50, "Lurantis": 168, "Charjabug": 140, "Goomy": 60, "Sylveon": 184, "Salandit": 64, "Umbreon": 184, "Jigglypuff": 95, "Ledian": 137, "Comfey": 170, "Ariados": 140, "Staryu": 68, "Gyarados": 189, "Hariyama": 166, "Golbat": 159, "Nosepass": 75, "Boldore": 137, "Raichu": 218, "Leafeon": 184, "Persian": 154, "Cleffa": 44, "Trubbish": 66, "Muk": 175, "Poliwhirl": 135, "Steenee": 102, "Skarmory": 163, "Dugtrio": 149, "Metang": 147, "Vikavolt": 225, "Clefairy": 113, "Geodude": 60, "Oranguru": 172, "Passimian": 172, "Absol": 163, "Golisopod": 186, "Weedle": 39, "Pidgey": 50, "NidoranF": 55, "Herdier": 130, "Fletchinder": 134, "Stufful": 68, "Pancham": 70, "Krokorok": 123, "Tirtouga": 71, "Cranidos": 70, "Porygon": 79, "Magneton": 163, "Alomomola": 165, "Whiscash": 164, "Sandygast": 64, "Elekid": 72, "Feebas": 40, "Haunter": 142, "Gengar": 225, "Mimikyu": 167, "Togedemaru": 152, "Gabite": 144, "Pyukumuku": 144, "Sandshrew": 60, "Vulpix": 60, "Wigglytuff": 196, "Tentacruel": 180, "Slowbro": 172, "Golduck": 175, "Luvdisc": 116, "Corsola": 144, "Torkoal": 165, "Seaking": 158, "Sneasel": 86, "Alakazam": 225, "Mareanie": 61, "Spinarak": 50, "Wimpod": 46, "Wooloo": 122, "Scorbunny": 62, "Raboot": 147, "Cinderace": 265, "Skwovet": 55, "Rookidee": 49, "Blipbug": 36, "Nickit": 49, "Zigzagoon": 56, "Sizzlipede": 61, "Dottler": 117, "Drilbur": 66, "Rolycoly": 49, "Solosis": 58, "Hatenna": 53, "Gothita": 58, "Gossifleur": 50, "Eldegoss": 161, "Thievul": 159, "Corvisquire": 128, "Corviknight": 248, "Tympole": 59, "Krabby": 65, "Corphish": 62, "Arrokuda": 56, "Drednaw": 170, "Ponyta": 82, "Carkol": 144, "Linoone": 147, "Liepard": 156, "Croagunk": 60, "Scraggy": 70, "Morpeko": 153, "Litwick": 55, "Ninetales": 177, "Centiskorch": 184, "Stunky": 66, "Clefable": 242, // "Clefable": 217, "Koffing": 68, "Cramorant": 166, "Silicobra": 63, "Toxel": 48, "Bewear": 175, "Farfetch’d": 132, "Hitmonlee": 159, "Hitmonchan": 159, "Hitmontop": 159, "Pangoro": 173, "Sirfetch’d": 177, "Machamp": 253, "Duosion": 130, "Hattrem": 130, "Gothorita": 137, "Spritzee": 68, "Slurpuff": 168, "Swirlix": 68, "Aromatisse": 162, "Morgrem": 130, "Gardevoir": 259, "Weezing": 172, "Togekiss": 273, "Alcremie": 173, "Trevenant": 166, "Boltund": 172, "Heatmor": 169, "Snorlax": 189, "Roselia": 140, "Barbaracle": 175, "Shuckle": 177, "Stonjourner": 165, "Coalossal": 255, "Dubwool": 172, "Pincurchin": 152, "Toxicroak": 172, "Scrafty": 171, "Weavile": 179, "Drapion": 175, "Malamar": 169, "Obstagoon": 260, "Pelipper": 154, "Sliggoo": 158, "Skuntank": 168, "Turtonator": 170, "Hakamo-o": 147, "Abomasnow": 173, "Sandaconda": 179, "Gigalith": 258, "Duraludon": 187, "Rhydon": 170, "Darmanitan": 168, "Falinks": 165, "Grapploct": 168, "Grimmsnarl": 255, "Durant": 169, "Excadrill": 178, "Ferroseed": 61, "Steelix": 179, "Cufant": 66, "Bronzong": 175, "Stunfisk": 165, "Klang": 154, "Froslass": 168, "Tsareena": 255, "Milotic": 189, "Garbador": 166, "Hatterene": 255, "Rapidash": 175, "Barraskewda": 172, "Onix": 77, "Hawlucha": 175, "Noctowl": 158, "Goodra": 300, "Escavalier": 173, "Ferrothorn": 171, "Klinklang": 260, "Perrserker": 154, "Copperajah": 175, }; let evYields = { "Torkoal": {def: 2}, "Copperajah": {atk: 2}, "Perrserker": {atk: 2}, "Klinklang": {def: 3}, "Ferrothorn": {def: 2}, "Escavalier": {atk: 2}, "Goodra": {spDef: 3}, "Seaking": {atk: 2}, "Salazzle": {spd: 2}, "Golisopod": {def: 2}, "Flygon": {atk: 1, spd: 2}, "Meowth": {spd: 1}, "Wooloo": {def: 1}, "Scorbunny": {spd: 1}, "Skwovet": {hp: 1}, "Rookidee": {spd: 1}, "Blipbug": {spDef: 1}, "Nickit": {spDef: 1}, "Zigzagoon": {spd: 1}, "Sizzlipede": {atk: 1}, "Dottler": {spDef: 2}, "Diglett": {spd: 1}, "Drilbur": {atk: 1}, "Rolycoly": {def: 1}, "Solosis": {spAtk: 1}, "Gothita": {spDef: 1}, "Hatenna": {spAtk: 1}, "Gossifleur": {spDef: 1}, "Eldegoss": {spDef: 2}, "Thievul": {spDef: 2}, "Sableye": {atk: 1, def: 1}, "Corvisquire": {spd: 2}, "Corviknight": {def: 3}, "Raboot": {spd: 2}, "Tympole": {spd: 1}, "Krabby": {atk: 1}, "Corphish": {atk: 1}, "Goldeen": {atk: 1}, "Arrokuda": {spd: 1}, "Drednaw": {atk: 2}, "Ponyta": {spd: 1}, "Carkol": {def: 2}, "Linoone": {spd: 2}, "Pancham": {atk: 1}, "Liepard": {spd: 2}, "Croagunk": {atk: 1}, "Scraggy": {atk: 1}, "Morpeko": {spd: 2}, "Vulpix": {spd: 1}, "Litwick": {spAtk: 1}, "Ninetales": {spDef: 1, spd: 1}, "Arcanine": {atk: 2}, "Centiskorch": {atk: 2}, "Stunky": {spd: 1}, "Clefairy": {hp: 2}, "Clefable": {hp: 3}, "Koffing": {def: 1}, "Sudowoodo": {def: 2}, "Cramorant": {spDef: 2}, "Silicobra": {def: 1}, "Toxel": {spAtk: 1}, "Stufful": {atk: 1}, "Bewear": {atk: 2}, "Farfetch’d": {atk: 1}, "Hitmonlee": {atk: 2}, "Hitmonchan": {spDef: 2}, "Hitmontop": {spDef: 2}, "Pangoro": {atk: 2}, "Sirfetch’d": {atk: 2}, "Machamp": {atk: 3}, "Duosion": {spAtk: 2}, "Hattrem": {spAtk: 2}, "Gothorita": {spDef: 2}, "Spritzee": {hp: 1}, "Slurpuff": {def: 2}, "Swirlix": {def: 1}, "Aromatisse": {hp: 2}, "Morgrem": {spAtk: 2}, "Gardevoir": {spAtk: 3}, "Weezing": {def: 2}, "Mawile": {atk: 1, def: 1}, "Togekiss": {spAtk: 2, spDef: 1}, "Alcremie": {spDef: 2}, "Trevenant": {atk: 2}, "Boltund": {spd: 2}, "Heatmor": {spAtk: 2}, "Snorlax": {hp: 2}, "Cinderace": {spd: 3}, "Roselia": {spAtk: 2}, "Boldore": {atk: 1, def: 1}, "Barbaracle": {atk: 2}, "Shuckle": {def: 1, spDef: 1}, "Stonjourner": {def: 2}, "Coalossal": {def: 3}, "Dubwool": {def: 2}, "Pincurchin": {atk: 2}, "Toxicroak": {atk: 2}, "Scrafty": {def: 1, spDef: 1}, "Weavile": {atk: 1, spd: 1}, "Drapion": {def: 2}, "Malamar": {atk: 2}, "Obstagoon": {def: 3}, "Pelipper": {def: 2}, "Sliggoo": {spDef: 2}, "Skuntank": {hp: 2}, "Turtonator": {def: 2}, "Hakamo-o": {def: 2}, "Abomasnow": {atk: 1, spAtk: 1}, "Sandaconda": {def: 2}, "Gigalith": {atk: 3}, "Duraludon": {spAtk: 2}, "Rhydon": {atk: 2}, "Darmanitan": {atk: 2}, "Grapploct": {atk: 2}, "Falinks": {atk: 2, spDef: 1}, "Grimmsnarl": {atk: 3}, "Durant": {def: 2}, "Excadrill": {atk: 2}, "Ferroseed": {def: 1}, "Steelix": {def: 2}, "Cufant": {atk: 1}, "Bronzong": {def: 1, spDef: 1}, "Stunfisk": {hp: 2}, "Klang": {def: 2}, "Froslass": {spd: 2}, "Tsareena": {atk: 3}, "Milotic": {spDef: 2}, "Garbador": {atk: 2}, "Hatterene": {spAtk: 3}, "Rapidash": {spd: 2}, "Barraskewda": {spd: 2}, "Onix": {def: 1}, "Hawlucha": {atk: 2}, "Noctowl": {hp: 2}, }; processActions(route); function computeExperienceForLevel(level, curve) { return requiredExperience[curve][level - 1]; } function gamefreakSqrt(n) { let actualSqrt = Math.sqrt(n); let lowerBound = Math.floor(actualSqrt); if(lowerBound * lowerBound === n) { return lowerBound * 4096; } let bestCoeff = 0; let bestDistance = actualSqrt - lowerBound; for (let i = 1; i <= 4096; i++) { let check = lowerBound + i / 4096; let distance = Math.abs(actualSqrt - check); if (distance < bestDistance) { bestCoeff = i; bestDistance = distance; } } return lowerBound * 4096 + bestCoeff; } function getExperienceForKill(foeName, foeLevel, level, luckyEgg, affection, rotoExp, expShare, tradeExp, evolutionDue) { let expYield = experienceYields[foeName]; if (typeof expYield === "undefined") { throw new Error("Unknown Pokémon: " + foeName); } let x = foeLevel + foeLevel + 10; let y = foeLevel + level + 10; let x2 = x * x; let y2 = y * y; let z = Math.floor(expYield * foeLevel / 5); if (expShare) { z = Math.floor(z / 2); } let exp = Math.floor(((gamefreakSqrt(x) * x2) * z) / ((gamefreakSqrt(y) * y2))) + 1; // console.log(exp); if (tradeExp) { exp = Math.floor(exp * 1.5); } // if (luckyEgg) { // exp = Math.floor(exp * 1.5); // } if (affection) { exp = exp * 4915; exp = Math.round(exp / 4096) } if (evolutionDue) { exp = exp * 4915; exp = Math.round(exp / 4096) } if (rotoExp) { exp = exp * 150; exp = Math.floor(exp / 100); } return Math.floor(exp); } function processActions(actions) { if (!actions || !actions[0] || actions[0].type !== "init") { throw new Error("First action must be init"); } let affectionBoost = false; let luckyEgg = false; let rotoExp = false; let tradeExp = !!actions[0].tradeExp; let pokemonName = actions[0].name; let currentLevel = actions[0].level; let curve = actions[0].curve; let stage = 1; let evolution1 = actions[0].evolution1; let evolution2 = actions[0].evolution2; let evolution1Name = actions[0].evolution1Name; let evolution2Name = actions[0].evolution2Name; let currentExp = computeExperienceForLevel(currentLevel, curve); let currentHpEvs = 0; let currentAtkEvs = 0; let currentDefEvs = 0; let currentSpAtkEvs = 0; let currentSpDefEvs = 0; let currentSpdEvs = 0; let currentItem = ""; function printDumpFormat() { if (currentItem) { console.log(`${pokemonName} (Lv. ${currentLevel}) @${currentItem} (Nature: Current) (Moves: (None)/(None)/(None)/(None)) IVs: 0/0/0/0/0/0 EVs: ${currentHpEvs}/${currentAtkEvs}/${currentDefEvs}/${currentSpAtkEvs}/${currentSpDefEvs}/${currentSpdEvs}`); } else { console.log(`${pokemonName} (Lv. ${currentLevel}) (Nature: Current) (Moves: (None)/(None)/(None)/(None)) IVs: 0/0/0/0/0/0 EVs: ${currentHpEvs}/${currentAtkEvs}/${currentDefEvs}/${currentSpAtkEvs}/${currentSpDefEvs}/${currentSpdEvs}`); } } function printIvCalcFormat() { console.log(`${currentLevel}\t${currentHpEvs}\t${currentAtkEvs}\t${currentDefEvs}\t${currentSpAtkEvs}\t${currentSpDefEvs}\t${currentSpdEvs}`); } for (let i = 1; i < actions.length; ++i) { let action = actions[i]; if (!action) { continue; } switch (action.type) { case "kill": case "catch": let evolutionDue = false; if ((stage === 1 && evolution1 && evolution1 <= currentLevel) || (stage <= 2 && evolution2 && evolution2 <= currentLevel)) { evolutionDue = true; console.log("[LEVEL BONUS]"); } let receivedExp = action.overrideExperience; if (typeof receivedExp === "undefined") { receivedExp = getExperienceForKill(action.pokemon, action.level, currentLevel, luckyEgg, affectionBoost, rotoExp, !!action.expShare, tradeExp, evolutionDue); } if (action.type === "kill") { console.log(`[KILL]: Got ${receivedExp} Exp for killing Lv. ${action.level} ${action.pokemon}`); } else { console.log(`[CATCH]: Got ${receivedExp} Exp for catching Lv. ${action.level} ${action.pokemon}`); } if (evYields[action.pokemon]) { for (let stat in evYields[action.pokemon]) { if (evYields[action.pokemon].hasOwnProperty(stat)) { switch (stat) { case "hp": currentHpEvs+= evYields[action.pokemon][stat]; break; case "atk": currentAtkEvs+= evYields[action.pokemon][stat]; break; case "def": currentDefEvs+= evYields[action.pokemon][stat]; break; case "spAtk": currentSpAtkEvs+= evYields[action.pokemon][stat]; break; case "spDef": currentSpDefEvs+= evYields[action.pokemon][stat]; break; case "spd": currentSpdEvs+= evYields[action.pokemon][stat]; break; } } } console.log("EV yield: " + JSON.stringify(evYields[action.pokemon])); } else { console.warn("Could not find EV Yield for: " + action.pokemon); } currentExp+= receivedExp; if (!action.skipLevel) { while (currentLevel < 100 && computeExperienceForLevel(currentLevel + 1, curve) <= currentExp) { ++currentLevel; console.log(`[LEVELUP] Now level ${currentLevel}`); printIvCalcFormat(); } } printDumpFormat(); break; case "evolve": ++stage; if (stage === 2) { pokemonName = evolution1Name; } else if (stage === 3) { pokemonName = evolution2Name; } console.log(`[EVOLUTION]`); printDumpFormat(); break; case "affection-boost": affectionBoost = !!action.value; console.log(`[AFFECTION BOOST] ${affectionBoost}`); break; case "roto-exp": rotoExp = !!action.value; console.log(`[ROTO EXP] ${rotoExp}`); break; case "rare-candy": currentExp = computeExperienceForLevel(currentLevel + 1, curve); ++currentLevel; console.log(`[RARE CANDY] Now level ${currentLevel}`); printIvCalcFormat(); printDumpFormat(); break; case "exp-candy": currentExp+= action.experience; console.log(`[EXP CANDY] Added ${action.experience} Exp`); while (currentLevel < 100 && computeExperienceForLevel(currentLevel + 1, curve) <= currentExp) { ++currentLevel; console.log(`[LEVELUP] Now level ${currentLevel}`); printIvCalcFormat(); } printDumpFormat(); break; case "item-equip": if (currentItem === "Lucky Egg" && action.item !== "Lucky Egg") { luckyEgg = false; } currentItem = action.item || ""; console.log("[ITEM EQUIP] " + (currentItem || "(none)")); if (currentItem === "Lucky Egg") { luckyEgg = true; } break; } console.log(); } let addendum = ""; if (currentLevel < 100) { let currentLevelExp = computeExperienceForLevel(currentLevel, curve); let nextLevelExp = computeExperienceForLevel(currentLevel + 1, curve); let percentage = (currentExp - currentLevelExp) / (nextLevelExp - currentLevelExp); addendum = " (" + (percentage * 100).toFixed(2) + "%)"; } console.log("Final Exp: " + currentExp + addendum); console.log(); return currentExp; } let possibleActions = [ {type: "rare-candy"}, {type: "rare-candy"}, {type: "rare-candy"}, {type: "exp-candy", experience: 700}, {type: "exp-candy", experience: 800}, {type: "exp-candy", experience: 800}, ]; // // console.log = () => {}; // // let highestExp = 0; // // for (let a = 0; a < 6; ++a) { // for (let b = 0; b < 6; ++b) { // if (a === b) { // continue; // } // // for (let c = 0; c < 6; ++c) { // if (a === c || b === c) { // continue; // } // // for (let d = 0; d < 6; ++d) { // if (a === d || b === d || c === d) { // continue; // } // // for (let e = 0; e < 6; ++e) { // if (a === e || b === e || c === e || d === e) { // continue; // } // // for (let f = 0; f < 6; ++f) { // if (a === f || b === f || c === f || d === f || e === f) { // continue; // } // // let r = [ // {type: "init", level: 3, curve: "Medium Slow", name: "Lucario"}, // possibleActions[a], // possibleActions[b], // possibleActions[c], // possibleActions[d], // possibleActions[e], // possibleActions[f], // ]; // // let exp = processActions(r); // if (exp >= highestExp) { // // if (exp === 7958) { // highestExp = exp; // console.warn("Found newest best combo: " + exp + ": " + a + b + c + d + e + f); // } // } // } // } // } // } // } // //