Advertisement
wartab

Untitled

Mar 18th, 2020
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. let initialRoutes = {
  3.     "15": [{type: "init", level: 15, curve: "Medium Slow", name: "Lucario"}, {type: "exp-candy", experience: 2300}, {type: "rare-candy"}, {type: "rare-candy"}],
  4.     "16": [{type: "init", level: 16, curve: "Medium Slow", name: "Lucario"}, {type: "exp-candy", experience: 2300}, {type: "rare-candy"}, {type: "rare-candy"}],
  5.     "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}],
  6.     "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}],
  7.     "19": [{type: "init", level: 19, curve: "Medium Slow", name: "Lucario"}, {type: "exp-candy", experience: 2300}, {type: "rare-candy"}, {type: "rare-candy"}],
  8.     "20": [{type: "init", level: 20, curve: "Medium Slow", name: "Lucario"}, {type: "exp-candy", experience: 2300}, {type: "rare-candy"}, {type: "rare-candy"}],
  9.     "16C": [{type: "init", level: 16, curve: "Medium Slow", name: "Lucario"}, {type: "exp-candy", experience: 2300}, {type: "rare-candy"}, {type: "rare-candy"}, {type: "rare-candy"}],
  10.     "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}],
  11.     "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}],
  12.     "20C": [{type: "init", level: 20, curve: "Medium Slow", name: "Lucario"}, {type: "exp-candy", experience: 2300}, {type: "rare-candy"}, {type: "rare-candy"}, {type: "rare-candy"}],
  13. };
  14.  
  15. // let selectedRoute = "16";
  16. let selectedRoute = "17";
  17. // let selectedRoute = "20";
  18. // let selectedRoute = "20C";
  19.  
  20. let route = [
  21.     // {type: "init", level: 15, curve: "Medium Slow", name: "Lucario"}, {type: "exp-candy", experience: 2300}, {type: "rare-candy"}, {type: "rare-candy"},
  22.     // {type: "init", level: 16, curve: "Medium Slow", name: "Lucario"}, {type: "exp-candy", experience: 2300}, {type: "rare-candy"}, {type: "rare-candy"},
  23.     // {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},
  24.     // {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},
  25.     // {type: "init", level: 19, curve: "Medium Slow", name: "Lucario"}, {type: "exp-candy", experience: 2300}, {type: "rare-candy"}, {type: "rare-candy"},
  26.     // {type: "init", level: 20, curve: "Medium Slow", name: "Lucario"}, {type: "exp-candy", experience: 2300}, {type: "rare-candy"}, {type: "rare-candy"},
  27.  
  28.     // {type: "init", level: 15, curve: "Medium Slow", name: "Lucario"}, {type: "exp-candy", experience: 2300}, {type: "rare-candy"}, {type: "rare-candy"}, {type: "rare-candy"},
  29.     // {type: "init", level: 16, curve: "Medium Slow", name: "Lucario"}, {type: "exp-candy", experience: 2300}, {type: "rare-candy"}, {type: "rare-candy"}, {type: "rare-candy"},
  30.     // {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},
  31.     // {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},
  32.     // {type: "init", level: 19, curve: "Medium Slow", name: "Lucario"}, {type: "exp-candy", experience: 2300}, {type: "rare-candy"}, {type: "rare-candy"}, {type: "rare-candy"},
  33.     // {type: "init", level: 20, curve: "Medium Slow", name: "Lucario"}, {type: "exp-candy", experience: 2300}, {type: "rare-candy"}, {type: "rare-candy"}, {type: "rare-candy"},
  34.  
  35.         ...initialRoutes[selectedRoute],
  36.  
  37.     {type: "kill", pokemon: "Gossifleur", level: 16, expShare: false},
  38.     {type: "kill", pokemon: "Gossifleur", level: 19, expShare: false},
  39.     {type: "kill", pokemon: "Eldegoss", level: 20, expShare: false},
  40.     {type: "kill", pokemon: "Zigzagoon", level: 17},
  41.     {type: "kill", pokemon: "Thievul", level: 18},
  42.     {type: "kill", pokemon: "Sableye", level: 18},
  43.     {type: "kill", pokemon: "Wooloo", level: 18},
  44.     {type: "kill", pokemon: "Corvisquire", level: 19},
  45.     {type: "kill", pokemon: "Raboot", level: 21},
  46.     {type: "kill", pokemon: "Tympole", level: 21},
  47.     {type: "kill", pokemon: "Krabby", level: 20},
  48.     {type: "kill", pokemon: "Corphish", level: 20},
  49.     {type: "kill", pokemon: "Goldeen", level: 22},
  50.     {type: "kill", pokemon: "Arrokuda", level: 23},
  51.     {type: "kill", pokemon: "Drednaw", level: 24},
  52.     {type: "kill", pokemon: "Solosis", level: 21},
  53.     {type: "kill", pokemon: "Gothita", level: 22},
  54.     {type: "kill", pokemon: "Hatenna", level: 23},
  55.     {type: "kill", pokemon: "Ponyta", level: 22},
  56.     {type: "kill", pokemon: "Carkol", level: 21},
  57.     {type: "kill", pokemon: "Thievul", level: 21},
  58.     {type: "kill", pokemon: "Linoone", level: 22},
  59.     {type: "kill", pokemon: "Pancham", level: 21},
  60.     {type: "kill", pokemon: "Liepard", level: 22},
  61.     {type: "kill", pokemon: "Croagunk", level: 24},
  62.     {type: "kill", pokemon: "Scraggy", level: 24},
  63.     {type: "kill", pokemon: "Morpeko", level: 26},
  64.     {type: "catch", pokemon: "Litwick", level: 25},
  65.     {type: "kill", pokemon: "Vulpix", level: 24},
  66.     {type: "catch", pokemon: "Litwick", level: 25},
  67.     {type: "kill", pokemon: "Ninetales", level: 25},
  68.     {type: "kill", pokemon: "Arcanine", level: 25},
  69.     {type: "kill", pokemon: "Centiskorch", level: 27},
  70.     // {type: "rare-candy"},
  71.     // {type: "rare-candy"},
  72.     {type: "kill", pokemon: "Stunky", level: 29},
  73.     {type: "kill", pokemon: "Linoone", level: 30},
  74.     {type: "kill", pokemon: "Liepard", level: 30},
  75.     {type: "kill", pokemon: "Clefairy", level: 29},
  76.     {type: "kill", pokemon: "Clefable", level: 30},
  77.     {type: "kill", pokemon: "Koffing", level: 29},
  78.     {type: "kill", pokemon: "Sudowoodo", level: 31},
  79.     // {type: "rare-candy"},
  80.     // {type: "rare-candy"},
  81.     {type: "kill", pokemon: "Cramorant", level: 29},
  82.     {type: "kill", pokemon: "Silicobra", level: 30},
  83.     {type: "kill", pokemon: "Raboot", level: 33},
  84.     {type: "kill", pokemon: "Toxel", level: 29},
  85.     {type: "kill", pokemon: "Stufful", level: 31},
  86.     {type: "kill", pokemon: "Bewear", level: 32},
  87.     // {type: "evolve"},
  88.     {type: "kill", pokemon: "Farfetch’d", level: 32},
  89.     {type: "kill", pokemon: "Hitmonlee", level: 33},
  90.     {type: "kill", pokemon: "Hitmonchan", level: 33},
  91.     {type: "kill", pokemon: "Hitmontop", level: 34},
  92.     {type: "kill", pokemon: "Pangoro", level: 34},
  93.     {type: "kill", pokemon: "Sirfetch’d", level: 35},
  94.     {type: "kill", pokemon: "Machamp", level: 35},
  95.     {type: "kill", pokemon: "Duosion", level: 32},
  96.     {type: "kill", pokemon: "Hattrem", level: 35},
  97.     {type: "kill", pokemon: "Gothorita", level: 32},
  98.     {type: "kill", pokemon: "Ponyta", level: 33},
  99.     {type: "kill", pokemon: "Spritzee", level: 34},
  100.     {type: "kill", pokemon: "Slurpuff", level: 34},
  101.     {type: "kill", pokemon: "Swirlix", level: 34},
  102.     {type: "kill", pokemon: "Aromatisse", level: 34},
  103.     {type: "kill", pokemon: "Morgrem", level: 35},
  104.     {type: "kill", pokemon: "Gardevoir", level: 35},
  105.     {type: "kill", pokemon: "Weezing", level: 36},
  106.     {type: "kill", pokemon: "Togekiss", level: 37},
  107.     {type: "kill", pokemon: "Mawile", level: 36},
  108.     {type: "kill", pokemon: "Alcremie", level: 38},
  109.  
  110.     ["17", "18", "17C", "19", "18C"].indexOf(selectedRoute) !== -1 ? {type: "rare-candy"} : null,
  111.  
  112.     {type: "kill", pokemon: "Trevenant", level: 34},
  113.     {type: "kill", pokemon: "Cinderace", level: 37},
  114.     {type: "kill", pokemon: "Heatmor", level: 34},
  115.     {type: "kill", pokemon: "Boltund", level: 35},
  116.     {type: "kill", pokemon: "Snorlax", level: 35},
  117.     {type: "kill", pokemon: "Roselia", level: 36},
  118.     {type: "kill", pokemon: "Hattrem", level: 36},
  119.     // {type: "kill", pokemon: "Boldore", level: 38},
  120.     {type: "kill", pokemon: "Barbaracle", level: 40},
  121.     {type: "kill", pokemon: "Stonjourner", level: 41},
  122.     {type: "kill", pokemon: "Shuckle", level: 40},
  123.     {type: "kill", pokemon: "Coalossal", level: 42},
  124.     {type: "kill", pokemon: "Dubwool", level: 40},
  125.     {type: "kill", pokemon: "Cinderace", level: 41},
  126.     {type: "kill", pokemon: "Corviknight", level: 40},
  127.     {type: "kill", pokemon: "Pincurchin", level: 39},
  128.     {type: "kill", pokemon: "Snorlax", level: 39},
  129.     {type: "kill", pokemon: "Linoone", level: 39},
  130.     {type: "kill", pokemon: "Pangoro", level: 40},
  131.     {type: "kill", pokemon: "Liepard", level: 42},
  132.     {type: "kill", pokemon: "Scrafty", level: 43},
  133.     {type: "kill", pokemon: "Morpeko", level: 44},
  134.     {type: "kill", pokemon: "Toxicroak", level: 43},
  135.     {type: "kill", pokemon: "Linoone", level: 42},
  136.     {type: "kill", pokemon: "Thievul", level: 42},
  137.     {type: "kill", pokemon: "Scrafty", level: 42},
  138.     {type: "kill", pokemon: "Weavile", level: 43},
  139.     {type: "kill", pokemon: "Liepard", level: 43},
  140.     {type: "kill", pokemon: "Drapion", level: 43},
  141.     {type: "kill", pokemon: "Scrafty", level: 44},
  142.     {type: "kill", pokemon: "Obstagoon", level: 46},
  143.     {type: "kill", pokemon: "Malamar", level: 45},
  144.     {type: "kill", pokemon: "Skuntank", level: 46},
  145.     {type: "kill", pokemon: "Pelipper", level: 45},
  146.     {type: "kill", pokemon: "Sliggoo", level: 45},
  147.     {type: "kill", pokemon: "Ninetales", level: 45},
  148.     {type: "kill", pokemon: "Turtonator", level: 45},
  149.     {type: "kill", pokemon: "Hakamo-o", level: 45},
  150.     {type: "kill", pokemon: "Abomasnow", level: 45},
  151.     {type: "kill", pokemon: "Gigalith", level: 46},
  152.     {type: "kill", pokemon: "Sandaconda", level: 46},
  153.     {type: "kill", pokemon: "Duraludon", level: 48},
  154.     {type: "kill", pokemon: "Flygon", level: 47, skipLevel: false},
  155.  
  156.     ["15"].indexOf(selectedRoute) !== -1 ? {type: "rare-candy"} : null,
  157.  
  158.     // // {type: "item-equip", item: "Choice Specs"},
  159.     {type: "kill", pokemon: "Gardevoir", level: 45},
  160.     {type: "kill", pokemon: "Pelipper", level: 46},
  161.     {type: "kill", pokemon: "Noctowl", level: 46},
  162.     {type: "kill", pokemon: "Gigalith", level: 46},
  163.     {type: "kill", pokemon: "Rhydon", level: 46},
  164.     {type: "kill", pokemon: "Darmanitan", level: 46},
  165.     {type: "kill", pokemon: "Falinks", level: 46},
  166.     {type: "kill", pokemon: "Grapploct", level: 46},
  167.  
  168.     ["16"].indexOf(selectedRoute) !== -1 ? {type: "rare-candy"} : null,
  169.  
  170.     {type: "kill", pokemon: "Liepard", level: 47},
  171.     {type: "kill", pokemon: "Scrafty", level: 47},
  172.     {type: "kill", pokemon: "Morpeko", level: 48},
  173.     {type: "kill", pokemon: "Toxicroak", level: 47},
  174.     {type: "kill", pokemon: "Grimmsnarl", level: 49},
  175.     {type: "kill", pokemon: "Dubwool", level: 48},
  176.     {type: "kill", pokemon: "Snorlax", level: 47},
  177.     {type: "kill", pokemon: "Pincurchin", level: 47},
  178.     {type: "kill", pokemon: "Corviknight", level: 48},
  179.     {type: "kill", pokemon: "Cinderace", level: 49},
  180.     {type: "kill", pokemon: "Meowth", level: 47},
  181.     {type: "kill", pokemon: "Durant", level: 47},
  182.     {type: "kill", pokemon: "Mawile", level: 47},
  183.     {type: "kill", pokemon: "Excadrill", level: 47},
  184.     {type: "kill", pokemon: "Ferroseed", level: 47},
  185.     {type: "kill", pokemon: "Steelix", level: 47},
  186.     ["20C"].indexOf(selectedRoute) !== -1 ? {type: "rare-candy"} : null,
  187.     ["20C"].indexOf(selectedRoute) !== -1 ? {type: "rare-candy"} : null,
  188.  
  189.     {type: "kill", pokemon: "Durant", level: 48},
  190.  
  191.     ["20"].indexOf(selectedRoute) !== -1 ? {type: "rare-candy"} : null,
  192.     ["20"].indexOf(selectedRoute) !== -1 ? {type: "rare-candy"} : null,
  193.  
  194.     {type: "kill", pokemon: "Cufant", level: 48},
  195.     {type: "kill", pokemon: "Bronzong", level: 48},
  196.     {type: "kill", pokemon: "Mawile", level: 48},
  197.     {type: "kill", pokemon: "Klang", level: 48},
  198.     {type: "kill", pokemon: "Stunfisk", level: 49},
  199.     {type: "kill", pokemon: "Steelix", level: 49},
  200.     {type: "kill", pokemon: "Froslass", level: 50},
  201.     {type: "kill", pokemon: "Salazzle", level: 50},
  202.     {type: "kill", pokemon: "Milotic", level: 51},
  203.     {type: "kill", pokemon: "Tsareena", level: 50},
  204.     {type: "kill", pokemon: "Garbador", level: 52},
  205.  
  206.     ["15", "17", "18", "17C", "19", "18C"].indexOf(selectedRoute) !== -1 ? {type: "rare-candy"} : null,
  207.  
  208.     {type: "kill", pokemon: "Mawile", level: 51},
  209.     {type: "kill", pokemon: "Gardevoir", level: 51},
  210.     {type: "kill", pokemon: "Rapidash", level: 52},
  211.     {type: "kill", pokemon: "Hatterene", level: 53},
  212.  
  213.     ["16"].indexOf(selectedRoute) !== -1 ? {type: "rare-candy"} : null,
  214.  
  215.     {type: "kill", pokemon: "Barraskewda", level: 52},
  216.     {type: "kill", pokemon: "Golisopod", level: 51},
  217.     {type: "kill", pokemon: "Seaking", level: 52},
  218.     {type: "kill", pokemon: "Pelipper", level: 51},
  219.     {type: "kill", pokemon: "Drednaw", level: 53},
  220.     {type: "kill", pokemon: "Hawlucha", level: 52},
  221.     {type: "kill", pokemon: "Falinks", level: 53},
  222.     {type: "kill", pokemon: "Grapploct", level: 52},
  223.     {type: "kill", pokemon: "Sirfetch’d", level: 53},
  224.     {type: "kill", pokemon: "Machamp", level: 54},
  225.     {type: "kill", pokemon: "Torkoal", level: 53},
  226.     {type: "kill", pokemon: "Turtonator", level: 54},
  227.     {type: "kill", pokemon: "Flygon", level: 54},
  228.     {type: "kill", pokemon: "Goodra", level: 54},
  229.     {type: "kill", pokemon: "Duraludon", level: 55},
  230.     {type: "kill", pokemon: "Escavalier", level: 55},
  231.     {type: "kill", pokemon: "Ferrothorn", level: 55},
  232.     {type: "kill", pokemon: "Klinklang", level: 56},
  233.     {type: "kill", pokemon: "Perrserker", level: 55},
  234.     {type: "kill", pokemon: "Copperajah", level: 57},
  235. ];
  236.  
  237. let requiredExperience = {
  238.     "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],
  239.     "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],
  240.     "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],
  241.     "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],
  242.     "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],
  243.     "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],
  244. };
  245.  
  246. let experienceYields = {
  247.     "Rattata": 51,
  248.     "Raticate": 145,
  249.     "Pikachu": 112,
  250.     "Zubat": 49,
  251.     "Machop": 61,
  252.     "Drowzee": 66,
  253.     "Eevee": 65,
  254.     "Makuhita": 47,
  255.     "Zorua": 66,
  256.     "Furfrou": 165,
  257.     "Noibat": 49,
  258.     "Litten": 64,
  259.     "Torracat": 147,
  260.     "Crabrawler": 68,
  261.     "Wishiwashi": 61,
  262.     "Wishiwashi-School": 217,
  263.     "Dewpider": 54,
  264.     "Araquanid": 159,
  265.     "Type: Null": 107,
  266.     "Poipole": 189,
  267.     "Spearow": 52,
  268.     "Mawile": 133,
  269.     "Roggenrola": 56,
  270.     "Carbink": 100,
  271.     "Sableye": 133,
  272.     "Spinda": 126,
  273.     "Abra": 62,
  274.     "Meowth": 58,
  275.     "Mime Jr.": 62,
  276.     "Ekans": 58,
  277.     "Murkrow": 81,
  278.     "Mareep": 56,
  279.     "Lycanroc": 170,
  280.     "Granbull": 158,
  281.     "Ribombee": 162,
  282.     "Gumshoos": 146,
  283.     "Smeargle": 88,
  284.     "Komala": 168,
  285.     "Lanturn": 161,
  286.     "Cloyster": 184,
  287.     "Arcanine": 194,
  288.     "Talonflame": 175,
  289.     "Marowak": 149,
  290.     "Magmar": 173,
  291.     "Kecleon": 154,
  292.     "Goldeen": 64,
  293.     "Tropius": 161,
  294.     "Exeggcute": 65,
  295.     "Golurk": 169,
  296.     "Gastrodon": 166,
  297.     "Flygon": 260,
  298.     "Mudsdale": 175,
  299.     "Crobat": 241,
  300.     "Silvally": 257,
  301.     "Lucario": 184,
  302.     "Zoroark": 179,
  303.     "Pikipek": 53,
  304.     "Caterpie": 39,
  305.     "Yungoos": 51,
  306.     "Pichu": 41,
  307.     "Metapod": 72,
  308.     "Bonsly": 58,
  309.     "Grimer": 58,
  310.     "Magnemite": 65,
  311.     "Grubbin": 60,
  312.     "Gastly": 62,
  313.     "Psyduck": 64,
  314.     "Petilil": 56,
  315.     "Growlithe": 70,
  316.     "Mankey": 61,
  317.     "Diglett": 53,
  318.     "Delibird": 116,
  319.     "Glaceon": 184,
  320.     "Drifloon": 70,
  321.     "Munchlax": 78,
  322.     "Bagon": 60,
  323.     "Cutiefly": 61,
  324.     "Tauros": 172,
  325.     "Mudbray": 77,
  326.     "Lillipup": 55,
  327.     "Magby": 73,
  328.     "Sudowoodo": 144,
  329.     "Cubone": 64,
  330.     "Oricorio": 167,
  331.     "Salazzle": 168,
  332.     "Kadabra": 140,
  333.     "Bounsweet": 42,
  334.     "Trumbeak": 124,
  335.     "Miltank": 172,
  336.     "Archen": 71,
  337.     "Shieldon": 70,
  338.     "Rockruff": 56,
  339.     "Shiinotic": 142,
  340.     "Fomantis": 50,
  341.     "Lurantis": 168,
  342.     "Charjabug": 140,
  343.     "Goomy": 60,
  344.     "Sylveon": 184,
  345.     "Salandit": 64,
  346.     "Umbreon": 184,
  347.     "Jigglypuff": 95,
  348.     "Ledian": 137,
  349.     "Comfey": 170,
  350.     "Ariados": 140,
  351.     "Staryu": 68,
  352.     "Gyarados": 189,
  353.     "Hariyama": 166,
  354.     "Golbat": 159,
  355.     "Nosepass": 75,
  356.     "Boldore": 137,
  357.     "Raichu": 218,
  358.     "Leafeon": 184,
  359.     "Persian": 154,
  360.     "Cleffa": 44,
  361.     "Trubbish": 66,
  362.     "Muk": 175,
  363.     "Poliwhirl": 135,
  364.     "Steenee": 102,
  365.     "Skarmory": 163,
  366.     "Dugtrio": 149,
  367.     "Metang": 147,
  368.     "Vikavolt": 225,
  369.     "Clefairy": 113,
  370.     "Geodude": 60,
  371.     "Oranguru": 172,
  372.     "Passimian": 172,
  373.     "Absol": 163,
  374.     "Golisopod": 186,
  375.     "Weedle": 39,
  376.     "Pidgey": 50,
  377.     "NidoranF": 55,
  378.     "Herdier": 130,
  379.     "Fletchinder": 134,
  380.     "Stufful": 68,
  381.     "Pancham": 70,
  382.     "Krokorok": 123,
  383.     "Tirtouga": 71,
  384.     "Cranidos": 70,
  385.     "Porygon": 79,
  386.     "Magneton": 163,
  387.     "Alomomola": 165,
  388.     "Whiscash": 164,
  389.     "Sandygast": 64,
  390.     "Elekid": 72,
  391.     "Feebas": 40,
  392.     "Haunter": 142,
  393.     "Gengar": 225,
  394.     "Mimikyu": 167,
  395.     "Togedemaru": 152,
  396.     "Gabite": 144,
  397.     "Pyukumuku": 144,
  398.     "Sandshrew": 60,
  399.     "Vulpix": 60,
  400.     "Wigglytuff": 196,
  401.     "Tentacruel": 180,
  402.     "Slowbro": 172,
  403.     "Golduck": 175,
  404.     "Luvdisc": 116,
  405.     "Corsola": 144,
  406.     "Torkoal": 165,
  407.     "Seaking": 158,
  408.     "Sneasel": 86,
  409.     "Alakazam": 225,
  410.     "Mareanie": 61,
  411.     "Spinarak": 50,
  412.     "Wimpod": 46,
  413.     "Wooloo": 122,
  414.     "Scorbunny": 62,
  415.     "Raboot": 147,
  416.     "Cinderace": 265,
  417.     "Skwovet": 55,
  418.     "Rookidee": 49,
  419.     "Blipbug": 36,
  420.     "Nickit": 49,
  421.     "Zigzagoon": 56,
  422.     "Sizzlipede": 61,
  423.     "Dottler": 117,
  424.     "Drilbur": 66,
  425.     "Rolycoly": 49,
  426.     "Solosis": 58,
  427.     "Hatenna": 53,
  428.     "Gothita": 58,
  429.     "Gossifleur": 50,
  430.     "Eldegoss": 161,
  431.     "Thievul": 159,
  432.     "Corvisquire": 128,
  433.     "Corviknight": 248,
  434.     "Tympole": 59,
  435.     "Krabby": 65,
  436.     "Corphish": 62,
  437.     "Arrokuda": 56,
  438.     "Drednaw": 170,
  439.     "Ponyta": 82,
  440.     "Carkol": 144,
  441.     "Linoone": 147,
  442.     "Liepard": 156,
  443.     "Croagunk": 60,
  444.     "Scraggy": 70,
  445.     "Morpeko": 153,
  446.     "Litwick": 55,
  447.     "Ninetales": 177,
  448.     "Centiskorch": 184,
  449.     "Stunky": 66,
  450.     "Clefable": 242,
  451.     // "Clefable": 217,
  452.     "Koffing": 68,
  453.     "Cramorant": 166,
  454.     "Silicobra": 63,
  455.     "Toxel": 48,
  456.     "Bewear": 175,
  457.     "Farfetch’d": 132,
  458.     "Hitmonlee": 159,
  459.     "Hitmonchan": 159,
  460.     "Hitmontop": 159,
  461.     "Pangoro": 173,
  462.     "Sirfetch’d": 177,
  463.     "Machamp": 253,
  464.     "Duosion": 130,
  465.     "Hattrem": 130,
  466.     "Gothorita": 137,
  467.     "Spritzee": 68,
  468.     "Slurpuff": 168,
  469.     "Swirlix": 68,
  470.     "Aromatisse": 162,
  471.     "Morgrem": 130,
  472.     "Gardevoir": 259,
  473.     "Weezing": 172,
  474.     "Togekiss": 273,
  475.     "Alcremie": 173,
  476.     "Trevenant": 166,
  477.     "Boltund": 172,
  478.     "Heatmor": 169,
  479.     "Snorlax": 189,
  480.     "Roselia": 140,
  481.     "Barbaracle": 175,
  482.     "Shuckle": 177,
  483.     "Stonjourner": 165,
  484.     "Coalossal": 255,
  485.     "Dubwool": 172,
  486.     "Pincurchin": 152,
  487.     "Toxicroak": 172,
  488.     "Scrafty": 171,
  489.     "Weavile": 179,
  490.     "Drapion": 175,
  491.     "Malamar": 169,
  492.     "Obstagoon": 260,
  493.     "Pelipper": 154,
  494.     "Sliggoo": 158,
  495.     "Skuntank": 168,
  496.     "Turtonator": 170,
  497.     "Hakamo-o": 147,
  498.     "Abomasnow": 173,
  499.     "Sandaconda": 179,
  500.     "Gigalith": 258,
  501.     "Duraludon": 187,
  502.     "Rhydon": 170,
  503.     "Darmanitan": 168,
  504.     "Falinks": 165,
  505.     "Grapploct": 168,
  506.     "Grimmsnarl": 255,
  507.     "Durant": 169,
  508.     "Excadrill": 178,
  509.     "Ferroseed": 61,
  510.     "Steelix": 179,
  511.     "Cufant": 66,
  512.     "Bronzong": 175,
  513.     "Stunfisk": 165,
  514.     "Klang": 154,
  515.     "Froslass": 168,
  516.     "Tsareena": 255,
  517.     "Milotic": 189,
  518.     "Garbador": 166,
  519.     "Hatterene": 255,
  520.     "Rapidash": 175,
  521.     "Barraskewda": 172,
  522.     "Onix": 77,
  523.     "Hawlucha": 175,
  524.     "Noctowl": 158,
  525.     "Goodra": 300,
  526.     "Escavalier": 173,
  527.     "Ferrothorn": 171,
  528.     "Klinklang": 260,
  529.     "Perrserker": 154,
  530.     "Copperajah": 175,
  531. };
  532.  
  533. let evYields = {
  534.     "Torkoal": {def: 2},
  535.     "Copperajah": {atk: 2},
  536.     "Perrserker": {atk: 2},
  537.     "Klinklang": {def: 3},
  538.     "Ferrothorn": {def: 2},
  539.     "Escavalier": {atk: 2},
  540.     "Goodra": {spDef: 3},
  541.     "Seaking": {atk: 2},
  542.     "Salazzle": {spd: 2},
  543.     "Golisopod": {def: 2},
  544.     "Flygon": {atk: 1, spd: 2},
  545.     "Meowth": {spd: 1},
  546.     "Wooloo": {def: 1},
  547.     "Scorbunny": {spd: 1},
  548.     "Skwovet": {hp: 1},
  549.     "Rookidee": {spd: 1},
  550.     "Blipbug": {spDef: 1},
  551.     "Nickit": {spDef: 1},
  552.     "Zigzagoon": {spd: 1},
  553.     "Sizzlipede": {atk: 1},
  554.     "Dottler": {spDef: 2},
  555.     "Diglett": {spd: 1},
  556.     "Drilbur": {atk: 1},
  557.     "Rolycoly": {def: 1},
  558.     "Solosis": {spAtk: 1},
  559.     "Gothita": {spDef: 1},
  560.     "Hatenna": {spAtk: 1},
  561.     "Gossifleur": {spDef: 1},
  562.     "Eldegoss": {spDef: 2},
  563.     "Thievul": {spDef: 2},
  564.     "Sableye": {atk: 1, def: 1},
  565.     "Corvisquire": {spd: 2},
  566.     "Corviknight": {def: 3},
  567.     "Raboot": {spd: 2},
  568.     "Tympole": {spd: 1},
  569.     "Krabby": {atk: 1},
  570.     "Corphish": {atk: 1},
  571.     "Goldeen": {atk: 1},
  572.     "Arrokuda": {spd: 1},
  573.     "Drednaw": {atk: 2},
  574.     "Ponyta": {spd: 1},
  575.     "Carkol": {def: 2},
  576.     "Linoone": {spd: 2},
  577.     "Pancham": {atk: 1},
  578.     "Liepard": {spd: 2},
  579.     "Croagunk": {atk: 1},
  580.     "Scraggy": {atk: 1},
  581.     "Morpeko": {spd: 2},
  582.     "Vulpix": {spd: 1},
  583.     "Litwick": {spAtk: 1},
  584.     "Ninetales": {spDef: 1, spd: 1},
  585.     "Arcanine": {atk: 2},
  586.     "Centiskorch": {atk: 2},
  587.     "Stunky": {spd: 1},
  588.     "Clefairy": {hp: 2},
  589.     "Clefable": {hp: 3},
  590.     "Koffing": {def: 1},
  591.     "Sudowoodo": {def: 2},
  592.     "Cramorant": {spDef: 2},
  593.     "Silicobra": {def: 1},
  594.     "Toxel": {spAtk: 1},
  595.     "Stufful": {atk: 1},
  596.     "Bewear": {atk: 2},
  597.     "Farfetch’d": {atk: 1},
  598.     "Hitmonlee": {atk: 2},
  599.     "Hitmonchan": {spDef: 2},
  600.     "Hitmontop": {spDef: 2},
  601.     "Pangoro": {atk: 2},
  602.     "Sirfetch’d": {atk: 2},
  603.     "Machamp": {atk: 3},
  604.     "Duosion": {spAtk: 2},
  605.     "Hattrem": {spAtk: 2},
  606.     "Gothorita": {spDef: 2},
  607.     "Spritzee": {hp: 1},
  608.     "Slurpuff": {def: 2},
  609.     "Swirlix": {def: 1},
  610.     "Aromatisse": {hp: 2},
  611.     "Morgrem": {spAtk: 2},
  612.     "Gardevoir": {spAtk: 3},
  613.     "Weezing": {def: 2},
  614.     "Mawile": {atk: 1, def: 1},
  615.     "Togekiss": {spAtk: 2, spDef: 1},
  616.     "Alcremie": {spDef: 2},
  617.     "Trevenant": {atk: 2},
  618.     "Boltund": {spd: 2},
  619.     "Heatmor": {spAtk: 2},
  620.     "Snorlax": {hp: 2},
  621.     "Cinderace": {spd: 3},
  622.     "Roselia": {spAtk: 2},
  623.     "Boldore": {atk: 1, def: 1},
  624.     "Barbaracle": {atk: 2},
  625.     "Shuckle": {def: 1, spDef: 1},
  626.     "Stonjourner": {def: 2},
  627.     "Coalossal": {def: 3},
  628.     "Dubwool": {def: 2},
  629.     "Pincurchin": {atk: 2},
  630.     "Toxicroak": {atk: 2},
  631.     "Scrafty": {def: 1, spDef: 1},
  632.     "Weavile": {atk: 1, spd: 1},
  633.     "Drapion": {def: 2},
  634.     "Malamar": {atk: 2},
  635.     "Obstagoon": {def: 3},
  636.     "Pelipper": {def: 2},
  637.     "Sliggoo": {spDef: 2},
  638.     "Skuntank": {hp: 2},
  639.     "Turtonator": {def: 2},
  640.     "Hakamo-o": {def: 2},
  641.     "Abomasnow": {atk: 1, spAtk: 1},
  642.     "Sandaconda": {def: 2},
  643.     "Gigalith": {atk: 3},
  644.     "Duraludon": {spAtk: 2},
  645.     "Rhydon": {atk: 2},
  646.     "Darmanitan": {atk: 2},
  647.     "Grapploct": {atk: 2},
  648.     "Falinks": {atk: 2, spDef: 1},
  649.     "Grimmsnarl": {atk: 3},
  650.     "Durant": {def: 2},
  651.     "Excadrill": {atk: 2},
  652.     "Ferroseed": {def: 1},
  653.     "Steelix": {def: 2},
  654.     "Cufant": {atk: 1},
  655.     "Bronzong": {def: 1, spDef: 1},
  656.     "Stunfisk": {hp: 2},
  657.     "Klang": {def: 2},
  658.     "Froslass": {spd: 2},
  659.     "Tsareena": {atk: 3},
  660.     "Milotic": {spDef: 2},
  661.     "Garbador": {atk: 2},
  662.     "Hatterene": {spAtk: 3},
  663.     "Rapidash": {spd: 2},
  664.     "Barraskewda": {spd: 2},
  665.     "Onix": {def: 1},
  666.     "Hawlucha": {atk: 2},
  667.     "Noctowl": {hp: 2},
  668. };
  669.  
  670.  
  671. processActions(route);
  672.  
  673. function computeExperienceForLevel(level, curve) {
  674.     return requiredExperience[curve][level - 1];
  675. }
  676.  
  677. function gamefreakSqrt(n) {
  678.     let actualSqrt = Math.sqrt(n);
  679.     let lowerBound = Math.floor(actualSqrt);
  680.     if(lowerBound * lowerBound === n) {
  681.         return lowerBound * 4096;
  682.     }
  683.  
  684.     let bestCoeff = 0;
  685.     let bestDistance = actualSqrt - lowerBound;
  686.     for (let i = 1; i <= 4096; i++) {
  687.         let check = lowerBound + i / 4096;
  688.         let distance = Math.abs(actualSqrt - check);
  689.         if (distance < bestDistance) {
  690.             bestCoeff = i;
  691.             bestDistance = distance;
  692.         }
  693.     }
  694.     return lowerBound * 4096 + bestCoeff;
  695. }
  696.  
  697. function getExperienceForKill(foeName, foeLevel, level, luckyEgg, affection, rotoExp, expShare, tradeExp, evolutionDue) {
  698.     let expYield = experienceYields[foeName];
  699.  
  700.     if (typeof expYield === "undefined") {
  701.         throw new Error("Unknown Pokémon: " + foeName);
  702.     }
  703.  
  704.     let x = foeLevel + foeLevel + 10;
  705.     let y = foeLevel + level + 10;
  706.  
  707.     let x2 = x * x;
  708.     let y2 = y * y;
  709.  
  710.     let z = Math.floor(expYield * foeLevel / 5);
  711.     if (expShare) {
  712.         z = Math.floor(z / 2);
  713.     }
  714.  
  715.     let exp = Math.floor(((gamefreakSqrt(x) * x2) * z) / ((gamefreakSqrt(y) * y2))) + 1;
  716.  
  717.     // console.log(exp);
  718.  
  719.     if (tradeExp) {
  720.         exp = Math.floor(exp * 1.5);
  721.     }
  722.  
  723.     // if (luckyEgg) {
  724.     //     exp = Math.floor(exp * 1.5);
  725.     // }
  726.  
  727.     if (affection) {
  728.         exp = exp * 4915;
  729.         exp = Math.round(exp / 4096)
  730.     }
  731.  
  732.     if (evolutionDue) {
  733.         exp = exp * 4915;
  734.         exp = Math.round(exp / 4096)
  735.     }
  736.  
  737.     if (rotoExp) {
  738.         exp = exp * 150;
  739.         exp = Math.floor(exp / 100);
  740.     }
  741.  
  742.     return Math.floor(exp);
  743. }
  744.  
  745. function processActions(actions) {
  746.  
  747.     if (!actions || !actions[0] || actions[0].type !== "init") {
  748.         throw new Error("First action must be init");
  749.     }
  750.  
  751.     let affectionBoost = false;
  752.     let luckyEgg = false;
  753.     let rotoExp = false;
  754.     let tradeExp = !!actions[0].tradeExp;
  755.  
  756.     let pokemonName = actions[0].name;
  757.     let currentLevel = actions[0].level;
  758.     let curve = actions[0].curve;
  759.     let stage = 1;
  760.     let evolution1 = actions[0].evolution1;
  761.     let evolution2 = actions[0].evolution2;
  762.     let evolution1Name = actions[0].evolution1Name;
  763.     let evolution2Name = actions[0].evolution2Name;
  764.     let currentExp = computeExperienceForLevel(currentLevel, curve);
  765.     let currentHpEvs = 0;
  766.     let currentAtkEvs = 0;
  767.     let currentDefEvs = 0;
  768.     let currentSpAtkEvs = 0;
  769.     let currentSpDefEvs = 0;
  770.     let currentSpdEvs = 0;
  771.     let currentItem = "";
  772.  
  773.     function printDumpFormat() {
  774.         if (currentItem) {
  775.             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}`);
  776.         } else {
  777.             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}`);
  778.         }
  779.     }
  780.  
  781.     function printIvCalcFormat() {
  782.         console.log(`${currentLevel}\t${currentHpEvs}\t${currentAtkEvs}\t${currentDefEvs}\t${currentSpAtkEvs}\t${currentSpDefEvs}\t${currentSpdEvs}`);
  783.     }
  784.  
  785.     for (let i = 1; i < actions.length; ++i) {
  786.         let action = actions[i];
  787.         if (!action) {
  788.             continue;
  789.         }
  790.         switch (action.type) {
  791.             case "kill":
  792.             case "catch":
  793.                 let evolutionDue = false;
  794.                 if ((stage === 1 && evolution1 && evolution1 <= currentLevel) || (stage <= 2 && evolution2 && evolution2 <= currentLevel)) {
  795.                     evolutionDue = true;
  796.                     console.log("[LEVEL BONUS]");
  797.                 }
  798.  
  799.                 let receivedExp = action.overrideExperience;
  800.                 if (typeof receivedExp === "undefined") {
  801.                     receivedExp = getExperienceForKill(action.pokemon, action.level, currentLevel, luckyEgg, affectionBoost, rotoExp, !!action.expShare, tradeExp, evolutionDue);
  802.                 }
  803.                 if (action.type === "kill") {
  804.                     console.log(`[KILL]: Got ${receivedExp} Exp for killing Lv. ${action.level} ${action.pokemon}`);
  805.                 } else {
  806.                     console.log(`[CATCH]: Got ${receivedExp} Exp for catching Lv. ${action.level} ${action.pokemon}`);
  807.                 }
  808.  
  809.                 if (evYields[action.pokemon]) {
  810.                     for (let stat in evYields[action.pokemon]) {
  811.                         if (evYields[action.pokemon].hasOwnProperty(stat)) {
  812.                             switch (stat) {
  813.                                 case "hp": currentHpEvs+= evYields[action.pokemon][stat]; break;
  814.                                 case "atk": currentAtkEvs+= evYields[action.pokemon][stat]; break;
  815.                                 case "def": currentDefEvs+= evYields[action.pokemon][stat]; break;
  816.                                 case "spAtk": currentSpAtkEvs+= evYields[action.pokemon][stat]; break;
  817.                                 case "spDef": currentSpDefEvs+= evYields[action.pokemon][stat]; break;
  818.                                 case "spd": currentSpdEvs+= evYields[action.pokemon][stat]; break;
  819.                             }
  820.                         }
  821.                     }
  822.                     console.log("EV yield: " + JSON.stringify(evYields[action.pokemon]));
  823.                 } else {
  824.                     console.warn("Could not find EV Yield for: " + action.pokemon);
  825.                 }
  826.  
  827.                 currentExp+= receivedExp;
  828.  
  829.                 if (!action.skipLevel) {
  830.                     while (currentLevel < 100 && computeExperienceForLevel(currentLevel + 1, curve) <= currentExp) {
  831.                         ++currentLevel;
  832.                         console.log(`[LEVELUP] Now level ${currentLevel}`);
  833.                         printIvCalcFormat();
  834.                     }
  835.                 }
  836.  
  837.                 printDumpFormat();
  838.  
  839.                 break;
  840.             case "evolve":
  841.                 ++stage;
  842.                 if (stage === 2) {
  843.                     pokemonName = evolution1Name;
  844.                 } else if (stage === 3) {
  845.                     pokemonName = evolution2Name;
  846.                 }
  847.                 console.log(`[EVOLUTION]`);
  848.                 printDumpFormat();
  849.                 break;
  850.  
  851.             case "affection-boost":
  852.                 affectionBoost = !!action.value;
  853.                 console.log(`[AFFECTION BOOST] ${affectionBoost}`);
  854.                 break;
  855.  
  856.             case "roto-exp":
  857.                 rotoExp = !!action.value;
  858.                 console.log(`[ROTO EXP] ${rotoExp}`);
  859.                 break;
  860.  
  861.             case "rare-candy":
  862.                 currentExp = computeExperienceForLevel(currentLevel + 1, curve);
  863.                 ++currentLevel;
  864.                 console.log(`[RARE CANDY] Now level ${currentLevel}`);
  865.                 printIvCalcFormat();
  866.                 printDumpFormat();
  867.                 break;
  868.  
  869.             case "exp-candy":
  870.                 currentExp+= action.experience;
  871.  
  872.                 console.log(`[EXP CANDY] Added ${action.experience} Exp`);
  873.  
  874.                 while (currentLevel < 100 && computeExperienceForLevel(currentLevel + 1, curve) <= currentExp) {
  875.                     ++currentLevel;
  876.                     console.log(`[LEVELUP] Now level ${currentLevel}`);
  877.                     printIvCalcFormat();
  878.                 }
  879.                 printDumpFormat();
  880.                 break;
  881.  
  882.             case "item-equip":
  883.                 if (currentItem === "Lucky Egg" && action.item !== "Lucky Egg") {
  884.                     luckyEgg = false;
  885.                 }
  886.  
  887.                 currentItem = action.item || "";
  888.                 console.log("[ITEM EQUIP] " + (currentItem || "(none)"));
  889.  
  890.                 if (currentItem === "Lucky Egg") {
  891.                     luckyEgg = true;
  892.                 }
  893.                 break;
  894.  
  895.         }
  896.         console.log();
  897.     }
  898.  
  899.     let addendum = "";
  900.     if (currentLevel < 100) {
  901.         let currentLevelExp =  computeExperienceForLevel(currentLevel, curve);
  902.         let nextLevelExp = computeExperienceForLevel(currentLevel + 1, curve);
  903.  
  904.         let percentage = (currentExp - currentLevelExp) / (nextLevelExp - currentLevelExp);
  905.         addendum = " (" + (percentage * 100).toFixed(2) + "%)";
  906.     }
  907.  
  908.  
  909.     console.log("Final Exp: " + currentExp + addendum);
  910.     console.log();
  911.  
  912.     return currentExp;
  913. }
  914.  
  915. let possibleActions = [
  916.     {type: "rare-candy"},
  917.     {type: "rare-candy"},
  918.     {type: "rare-candy"},
  919.     {type: "exp-candy", experience: 700},
  920.     {type: "exp-candy", experience: 800},
  921.     {type: "exp-candy", experience: 800},
  922. ];
  923. //
  924. // console.log = () => {};
  925. //
  926. // let highestExp = 0;
  927. //
  928. // for (let a = 0; a < 6; ++a) {
  929. //     for (let b = 0; b < 6; ++b) {
  930. //         if (a === b) {
  931. //             continue;
  932. //         }
  933. //
  934. //         for (let c = 0; c < 6; ++c) {
  935. //             if (a === c || b === c) {
  936. //                 continue;
  937. //             }
  938. //
  939. //             for (let d = 0; d < 6; ++d) {
  940. //                 if (a === d || b === d || c === d) {
  941. //                     continue;
  942. //                 }
  943. //
  944. //                 for (let e = 0; e < 6; ++e) {
  945. //                     if (a === e || b === e || c === e || d === e) {
  946. //                         continue;
  947. //                     }
  948. //
  949. //                     for (let f = 0; f < 6; ++f) {
  950. //                         if (a === f || b === f || c === f || d === f || e === f) {
  951. //                             continue;
  952. //                         }
  953. //
  954. //                         let r = [
  955. //                             {type: "init", level: 3, curve: "Medium Slow", name: "Lucario"},
  956. //                             possibleActions[a],
  957. //                             possibleActions[b],
  958. //                             possibleActions[c],
  959. //                             possibleActions[d],
  960. //                             possibleActions[e],
  961. //                             possibleActions[f],
  962. //                         ];
  963. //
  964. //                         let exp = processActions(r);
  965. //                         if (exp >= highestExp) {
  966. //                             // if (exp === 7958) {
  967. //                             highestExp = exp;
  968. //                             console.warn("Found newest best combo: " + exp + ": " + a + b + c + d + e + f);
  969. //                         }
  970. //                     }
  971. //                 }
  972. //             }
  973. //         }
  974. //     }
  975. // }
  976. //
  977. //
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement