Advertisement
zyzzyzus

Extra stats menu

May 30th, 2014
6,183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var newmenu = document.createElement('div')
  2. newmenu.id = 'newButton';
  3. newmenu.className = 'button';
  4. newmenu.innerHTML = 'E. Stats'
  5. if(!statsloaded) document.getElementById('comments').appendChild(newmenu);
  6.  
  7. with(newmenu)
  8. {
  9. style.top = '0px';
  10. style.right = '-16px';
  11. style.padding = '14px 16px 10px 0px';
  12. onmouseenter = function(){style.right = '-8px'}
  13. onmouseleave = function(){style.right = '-16px'}
  14. }
  15.  
  16. var addnewstats = function(clicked)
  17. {
  18. with(Game)
  19. {
  20. if(onMenu=='estats' && (drawT%(fps*3)==0 || clicked==1))
  21. {
  22. var TcookiesSucked = wrinklers.reduce(function(p,c){return p + 1.1*c.sucked * (1 + 0.05*Has('Wrinklerspawn'))},0);
  23.  
  24. var hcsthsg = Beautify(HowMuchPrestige(cookiesEarned+cookiesReset) - prestige['Heavenly chips'])
  25.  
  26. var selling = Game.ObjectsById.reduce(function(p,c){
  27. if(c.amount > 50)
  28. {
  29. var sellback = 3.83*c.getPrice()
  30. }
  31. else sellback = 0;
  32. return p + sellback},0);
  33. selling+=(Game.cookies + TcookiesSucked);
  34. selling*=0.05*(1 - Game.Has('Chocolate egg'))*Game.HasUnlocked('Chocolate egg');
  35.  
  36. var currfrenzy = 1;
  37. if (Game.frenzy > 0)
  38. {
  39. currfrenzy = Game.frenzyPower;
  40. }
  41. var frenzyluckbank = Game.cookiesPs*60*20*7*10/currfrenzy
  42. var maxchain = '7';
  43. while(parseInt(maxchain + '7') < Math.min(10800*7*Game.cookiesPs/currfrenzy,0.25*Game.cookies))
  44. {
  45. maxchain += '7'
  46. }
  47. var Basereindeer = 60*(cookiesPs/currfrenzy)*(1 + Game.Has('Ho ho ho-flavored frosting'));
  48.  
  49. var newstats=''
  50. //start stats page
  51. newstats+='<div style="position:absolute;top:8px;right:8px;cursor:pointer;font-size:16px;" '+Game.clickStr+'="Game.ShowMenu();">X</div><div class="section">Extra stats</div>';
  52.  
  53. //start first subsection
  54. newstats+='<div class="subsection"><div class="title">General stats</div>'
  55. newstats+='<div class="listing"><b>Total cookies in wrinklers :</b> <div class="price plain">' + Beautify(TcookiesSucked) + '</div></div>'
  56. newstats+='<div class="listing"><b>Total cookies(inc wrinklers) :</b> <div class="price plain">' + Beautify(TcookiesSucked + Game.cookies) + '</div></div>'
  57. newstats+='<div class="listing"><b>Average cookies/c :</b> <div class="price plain">' + Beautify(Game.handmadeCookies/Game.cookieClicks) + '</div></div>'
  58. newstats+='<div class="listing"><b>Choc egg value(inc. wrink.) :</b> <div class="price plain">' +
  59. Beautify(0.05*(Game.cookies + TcookiesSucked)) + '</div></div>'
  60. newstats+='</div>'
  61. //end first subsection
  62.  
  63. //start second subsection
  64. newstats+='<div class="subsection"><div class="title">HC stats</div>'
  65. newstats+='<div class="listing"><b>HCs earned :</b> <div class="price plain">' + hcsthsg + '</div></div>'
  66. newstats+='<div class="listing"><b>HCs earned(inc wrink and choc egg) :</b> <div class="price plain">' +
  67. Beautify(Game.HowMuchPrestige(Game.cookiesEarned+Game.cookiesReset+TcookiesSucked+0.05*(Game.cookies + TcookiesSucked)*(1 - Game.Has('Chocolate egg'))*Game.HasUnlocked('Chocolate egg'))-prestige['Heavenly chips']) + '</div></div>'
  68. newstats+='<div class="listing"><b>HCs selling buildings first(approx.) :</b> <div class="price plain">' +
  69. Beautify(Game.HowMuchPrestige(Game.cookiesEarned+Game.cookiesReset+TcookiesSucked+selling)-prestige['Heavenly chips']) + '</div></div>'
  70. newstats+='<div class="listing"><b>HCs after reset(approx.) :</b> <div class="price plain">' +
  71. Beautify(Game.HowMuchPrestige(Game.cookiesEarned+Game.cookiesReset+TcookiesSucked+selling)) + '</div></div>'
  72. newstats+='<div class="listing"><b>Current HCs :</b> <div class="price plain">' +
  73. Beautify(Game.prestige['Heavenly chips']) + '</div></div>'
  74. newstats+='</div>'
  75. //end second subsection
  76.  
  77. //start third subsection
  78. newstats+='<div class="subsection"><div class="title">GC stats</div>'
  79. newstats+='<div class="listing"><b>Frenzy-Lucky Bank :</b> <div class="price plain">' +
  80. Beautify(frenzyluckbank) + '</div></div>'
  81. newstats+='<div class="listing"><b>Max chain size(frenzied) :</b> <div class="price plain">' +
  82. Beautify(parseInt(maxchain)) + '</div></div>'
  83. /*
  84. newstats+='<div class="listing"><b>Frenzy-Chain bank :</b> <div class="price plain">' +
  85. Beautify(4*parseInt(maxchain)) + '</div></div>'
  86. */
  87. newstats+='</div>'
  88. //end third subsection
  89. //start fourth subsection
  90. newstats+='<div class="subsection"><div class="title">Reindeer stats</div>'
  91. newstats+='<div class="listing"><b>Reindeer value :</b> <div class="price plain">' +
  92. Beautify(Basereindeer) + '</div></div>'
  93. newstats+='<div class="listing"><b>Clotdeer value :</b> <div class="price plain">' +
  94. Beautify(0.5*Basereindeer) + '</div></div>'
  95. newstats+='<div class="listing"><b>Goldeer value :</b> <div class="price plain">' +
  96. Beautify(7*Basereindeer) + '</div></div>'
  97. newstats+='<div class="listing"><b>Eldeer value :</b> <div class="price plain">' +
  98. Beautify(666*Basereindeer) + '</div></div>'
  99. newstats+='</div>'
  100. //end fourth subsection
  101.  
  102.  
  103. newstats+='</div></div>'
  104. //end stats page
  105.  
  106. return document.getElementById('menu').innerHTML = newstats;
  107.  
  108. }
  109. else return;
  110. }
  111. }
  112.  
  113. if(!statsloaded)
  114. {
  115. Game.customDraw.push(addnewstats); /*uses Orteil's support for custom code. Game.customDraw.push(function) allows you to run functions whenever Game.Draw is called.*/
  116. var statsloaded = true;
  117. }
  118.  
  119. var clickstats = function()
  120. {
  121. if(Game.onMenu!='estats' && Game.onMenu!='stats')
  122. {
  123. Game.ShowMenu('stats');
  124. Game.onMenu = 'estats';
  125. addnewstats(1);
  126. }
  127. else if(Game.onMenu=='stats')
  128. {
  129. Game.onMenu = 'estats';
  130. addnewstats(1);
  131. }
  132. else
  133. {
  134. Game.ShowMenu();
  135. }
  136. }
  137.  
  138. document.getElementById('newButton').onclick = clickstats;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement