Mitsunee

spreadsheet function for Medium Slow EXP Group

Mar 4th, 2018
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var mediumSlowEXPTable = [NaN,
  2.        0,     9,    57,    96,   135,   179,   236,   314,    419,    560,
  3.      742,   973,  1261,  1612,  2035,  2535,  3120,  3798,   4575,   5460,
  4.     6458,  7577,  8825, 10208, 11735, 13411, 15244, 17242,  19411,  21760,
  5.    24294, 27021, 29949, 33084, 36435, 40007, 43808, 47846,  52127,  56660,
  6.    61450, 66505, 71833, 77440, 83335, 89523, 96012,102810, 109923, 117360,
  7.   125126,133229,141677,150476,159635,169159,179056,189334, 199999, 211060,
  8.   222522,234393,246681,259392,272535,286115,300140,314618, 329555, 344960,
  9.   360838,377197,394045,411388,429235,447591,466464,485862, 505791, 526260,
  10.   547274,568841,590969,613664,636935,660787,685228,710266, 735907, 762160,
  11.   789030,816525,844653,873420,902835,932903,963632,995030,1027103,1059860];
  12. /**
  13.  * Gives the total EXP for a Level for a Pokemon in the Medium Slow experience group.
  14.  *
  15.  * @param {number} input The Level of the Pokemon.
  16.  * @return The total EXP of the Pokemon at that Level.
  17.  * @customfunction
  18.  */
  19. function mediumSlow(Level) {
  20.   //EXP = ((1.2*Math.pow(Level,3)|0) - (15*Math.pow(Level,2)) + (100*Level) - 140)|0;
  21.   //if (EXP<0) EXP = 0;
  22.   EXP = mediumSlowEXPTable[Level];
  23.   return EXP;
  24. }
  25. /**
  26.  * Calculates the experience gain that a Rare Candy replaces.
  27.  *
  28.  * @param {number} EXPTotal The current experience total.
  29.  * @param {number} NewLevel The goal level.
  30.  * @return The experience gain replaced by the Rare Candy.
  31.  * @customfunction
  32.  */
  33. function EXPGAINCANDY(EXPTotal,NewLevel) {
  34.   EXPGain = mediumSlow(NewLevel) - EXPTotal;
  35.   return EXPGain;
  36. }
  37. /**
  38.  * Gives the Level for a Pokemon in the Medium Slow experience group at any given experience total.
  39.  *
  40.  * @param {number} input The current experience total of the Pokemon.
  41.  * @return The level of the Pokemon at that experience total.
  42.  * @customfunction
  43.  */
  44. function mediumSlowLevel(EXPTotal) {
  45.   for(i=1;mediumSlowEXPTable[i]<EXPTotal;i++);
  46.   if(mediumSlowEXPTable[i]==EXPTotal) return i;
  47.   if(mediumSlowEXPTable[i]>EXPTotal) return i-1;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment