Advertisement
Guest User

Clickerheroes primal calc

a guest
Oct 16th, 2014
323
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.74 KB | None | 0 0
  1. <html>
  2. <body>
  3. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
  4. <script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/md5.js"></script>
  5.  
  6. <script language="javascript">
  7. function Random(a, b) {
  8.   Seed = (Seed * 16807) % 2147483647;
  9.   return (Seed % (b - a)) + a;
  10. }
  11. function Rand() {
  12.   Seed = (Seed * 16807) % 2147483647;
  13.   return Seed;
  14. }
  15.  
  16. function RandRoll(cnt) {
  17.   for (var i = 0; i < cnt; i++) {
  18.    Random(0, 1);
  19.  }
  20. }
  21.  
  22. function isPrimal(lvl)
  23. {
  24. Seed=game_Seed;
  25.            if(lvl % 100 == 0) {return true;};
  26.            if(lvl % 5 == 0)
  27.            {
  28.               var _loc3_ = lvl - 100/ 5;
  29.               var _loc4_ = 0;
  30.               while(_loc4_ < _loc3_)
  31.               {
  32.                  Rand();
  33.                  _loc4_++;
  34.               }
  35.               if(Rand() % 100 < (25+Math.floor($("#bonusPrimal").val())))
  36.               {
  37.                   return true;
  38.               }
  39.                
  40.            }
  41.             return false;
  42. }
  43. function primalreward(param1)
  44. {
  45. if (param1==100)
  46. {
  47.     return 1;
  48. }
  49. return Math.floor(Math.pow(((param1 - 100) / 5 + 4) / 5,1.3)*(1+$("#bonusHS").val()*0.01));
  50. }
  51.  
  52. var game_Seed;
  53.  
  54. var UserData;
  55.  
  56.  
  57.  
  58. function CheckPrimal()
  59. {
  60. var outLog = "";
  61. var sum=0;
  62. $("#primaltbl > tbody").empty();
  63. for (var i=100;i<= $("#maxlevel").val();i++ )
  64. {
  65. if (isPrimal(i))
  66. {
  67. var tr = $("<tr></tr>");
  68.  tr.append($("<td></td>").append(i));
  69.  tr.append($("<td></td>").append(primalreward(i)));
  70.  sum+=primalreward(i)
  71.  tr.append($("<td></td>").append(sum));
  72.  $("#primaltbl").append(tr);
  73.  }
  74.    
  75. }
  76.  
  77. }
  78.  
  79.  
  80.    
  81. function Import()
  82. {
  83.  var data_inp = $("#savedata").val();
  84.    
  85.     UserData=JSON.parse(atob(data_inp.split("Fe12NAfA3R6z4k0z")[0].replace(/(.)./g,"$1")));
  86.     game_Seed=UserData.primalNumberGenerator.seed;
  87.     CheckPrimal();
  88. }
  89.  
  90. </script>
  91.  
  92. Primal Kurkulator<br>
  93.  
  94. Paste save data (click wrench, click Save, close the save prompt because its already copied to clipboard):
  95. <textarea id="savedata" style="width: 100%; height: 50px" onfocus="this.select()" onmouseup="return false">
  96. </textarea>
  97. <input type="button" value="Import save" onclick="Import()" style="margin-bottom: 12px"></input>
  98. <table id="params" border="0" cellspacing="0">
  99.  <tbody>
  100. <tr><td>Maxlevel</td><td><input type="text" id="maxlevel" value="400"></input></td></tr>
  101. <tr><td>Bonus to HS(%)</td><td><input type="text" id="bonusHS" value="0"></input></td></tr>
  102. <tr><td>Bonus to primal(%)</td><td><input type="text" id="bonusPrimal" value="0"></input></td></tr>
  103.  </tbody>
  104. </table>
  105. <table id="primaltbl" border="1" cellspacing="0">
  106.  <thead><tr><th>Level</th><th>Reward</th><th>Sum</th></tr></thead>
  107.  <tbody>
  108.  </tbody>
  109. </table>
  110.  
  111. <div id="output">
  112. </div>
  113. <div id="output2">
  114. </div>
  115. </body>
  116. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement