Jacorb90

Untitled

Apr 29th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 53.42 KB | None | 0 0
  1. allAchievements.a11 = "Instant Multiplier"
  2. allAchievements.a12 = "Better Replicanti Multiplier"
  3. allAchievements.a13 = "Eighth Generation"
  4. allAchievementNums["Instant Multiplier"] = "a11"
  5. allAchievementNums["Better Replicanti Multiplier"] = "a12"
  6. allAchievementNums["Eighth Generation"] = "a13"
  7.  
  8. function gameLoop(diff) {
  9. var thisUpdate = new Date().getTime();
  10. if (thisUpdate - player.lastUpdate >= 21600000) giveAchievement("Don't you dare to sleep")
  11. if (typeof diff === 'undefined') var diff = Math.min(thisUpdate - player.lastUpdate, 21600000);
  12. diff = diff / 100;
  13. if (diff < 0) diff = 1;
  14. if (player.currentEternityChall === "eterc12") diff = diff / 1000;
  15. if (player.thisInfinityTime < -10) player.thisInfinityTime = Infinity
  16. if (player.bestInfinityTime < -10) player.bestInfinityTime = Infinity
  17. if (diff > player.autoTime && !player.break) player.infinityPoints = player.infinityPoints.plus(player.autoIP.times(diff/player.autoTime))
  18. /*if (player.currentChallenge == "postc6" && player.matter.gte(1)) player.matter = player.matter.plus(diff/10)
  19. else */
  20. player.matter = player.matter.times(Decimal.pow((1.03 + player.resets/200 + player.galaxies/100), diff));
  21. if (player.matter.gt(player.money) && (player.currentChallenge == "challenge12" || player.currentChallenge == "postc1")) {
  22. if (player.resets > 0) player.resets--;
  23. softReset(0);
  24. }
  25.  
  26. if (player.currentChallenge == "postc8") postc8Mult = postc8Mult.times(Math.pow(0.000000046416, diff))
  27.  
  28. if (player.currentChallenge == "challenge3" || player.matter.gte(1)) player.chall3Pow = player.chall3Pow.times(Decimal.pow(1.00038, diff));
  29. player.chall2Pow = Math.min(player.chall2Pow + diff/1800, 1);
  30. if (player.currentChallenge == "postc2") {
  31. postC2Count++;
  32. if (postC2Count >= 8 || diff > 80) {
  33. sacrifice();
  34. postC2Count = 0;
  35. }
  36. }
  37. if (player.infinityUpgrades.includes("passiveGen")) player.partInfinityPoint += diff / player.bestInfinityTime;
  38. if (player.partInfinityPoint >= 100) {
  39. player.infinityPoints = player.infinityPoints.plus(player.infMult.times(kongIPMult * (player.partInfinityPoint/10)));
  40. player.partInfinityPoint = 0;
  41. }
  42.  
  43. if (player.partInfinityPoint >= 10) {
  44. player.partInfinityPoint -= 10;
  45. player.infinityPoints = player.infinityPoints.plus(player.infMult.times(kongIPMult));
  46. }
  47.  
  48.  
  49.  
  50. if (player.infinityUpgrades.includes("infinitiedGeneration") && player.currentEternityChall !== "eterc4") player.partInfinitied += diff / player.bestInfinityTime;
  51. if (player.partInfinitied >= 50) {
  52. player.infinitied += Math.floor(player.partInfinitied/5)
  53. player.partInfinitied = 0;
  54. }
  55.  
  56. if (player.partInfinitied >= 5) {
  57. player.partInfinitied -= 5;
  58. player.infinitied ++;
  59. }
  60.  
  61. player.infinityPoints = player.infinityPoints.plus(bestRunIppm.times(player.offlineProd/100).times(diff/600))
  62.  
  63. if (player.money.lte(Number.MAX_VALUE) || (player.break && player.currentChallenge == "") || (player.currentChallenge != "" && player.money.lte(player.challengeTarget))) {
  64.  
  65. if (player.currentChallenge != "challenge7" && player.currentEternityChall != "eterc3") {
  66. for (let tier = 8; tier >= 1; --tier) {
  67. var name = TIER_NAMES[tier];
  68.  
  69. player[name + 'Amount'] = player[name + 'Amount'].plus(getDimensionProductionPerSecond(tier + 1).times(diff / 100));
  70. }
  71. } else if (player.currentEternityChall != "eterc3") {
  72. for (let tier = 6; tier >= 1; --tier) {
  73. var name = TIER_NAMES[tier];
  74.  
  75. player[name + 'Amount'] = player[name + 'Amount'].plus(getDimensionProductionPerSecond(tier + 2).times(diff / 100));
  76. }
  77. } else {
  78. for (let tier = 3; tier >= 1; --tier) {
  79. var name = TIER_NAMES[tier];
  80.  
  81. player[name + 'Amount'] = player[name + 'Amount'].plus(getDimensionProductionPerSecond(tier + 1).times(diff / 100));
  82. }
  83. }
  84.  
  85. if (player.currentChallenge == "challenge3" || player.currentChallenge == "postc1") {
  86. player.money = player.money.plus(getDimensionProductionPerSecond(1).times(diff/10).times(player.chall3Pow));
  87. player.totalmoney = player.totalmoney.plus(getDimensionProductionPerSecond(1).times(diff/10).times(player.chall3Pow));
  88. } else {
  89. player.money = player.money.plus(getDimensionProductionPerSecond(1).times(diff/10));
  90. player.totalmoney = player.totalmoney.plus(getDimensionProductionPerSecond(1).times(diff/10));
  91. }
  92. if (player.currentChallenge == "challenge7") {
  93. player.money = player.money.plus(getDimensionProductionPerSecond(2).times(diff/10));
  94. player.totalmoney = player.totalmoney.plus(getDimensionProductionPerSecond(2).times(diff/10))
  95. }
  96. }
  97.  
  98. document.getElementById("dimTabButtons").style.display = "none"
  99.  
  100. if (player.currentEternityChall === "eterc12") player.totalTimePlayed += diff*1000
  101. else player.totalTimePlayed += diff
  102. player.thisInfinityTime += diff
  103. player.thisEternity += diff
  104.  
  105. if (player.eternities > 0) document.getElementById("tdtabbtn").style.display = "inline-block"
  106.  
  107. for (let tier=1;tier<9;tier++) {
  108. if (tier != 8 && (player.infDimensionsUnlocked[tier-1] || ECTimesCompleted("eterc7") > 0)) player["infinityDimension"+tier].amount = player["infinityDimension"+tier].amount.plus(DimensionProduction(tier+1).times(diff/100))
  109. if (player.infDimensionsUnlocked[tier-1]) {
  110. document.getElementById("infRow"+tier).style.display = "inline-block"
  111. document.getElementById("dimTabButtons").style.display = "inline-block"
  112. var idtabshown = true;
  113. } else {
  114. document.getElementById("infRow"+tier).style.display = "none"
  115. document.getElementById("idtabbtn").style.display = "none"
  116. }
  117. if (idtabshown === true || player.eternities >= 1) {
  118. document.getElementById("idtabbtn").style.display = "inline-block"
  119. }
  120.  
  121. if (tier <8) player["timeDimension"+tier].amount = player["timeDimension"+tier].amount.plus(getTimeDimensionProduction(tier+1).times(diff/100))
  122. }
  123.  
  124. if (player.infinitied > 0 && player.eternities < 1) {
  125. document.getElementById("dimTabButtons").style.display = "inline-block"
  126. document.getElementById("dtabbtn").style.display = "inline-block"
  127. document.getElementById("prodtabbtn").style.display = "inline-block"
  128. }
  129. if (player.eternities > 0) document.getElementById("dimTabButtons").style.display = "inline-block"
  130.  
  131. if (player.currentEternityChall !== "eterc7") player.infinityPower = player.infinityPower.plus(DimensionProduction(1).times(diff/10))
  132. else if (player.currentChallenge !== "challenge4" && player.currentChallenge !== "postc1") player.seventhAmount = player.seventhAmount.plus(DimensionProduction(1).times(diff/10))
  133.  
  134.  
  135.  
  136.  
  137. if (player.currentEternityChall == "eterc7") player.infinityDimension8.amount = player.infinityDimension8.amount.plus(getTimeDimensionProduction(1).times(diff/10))
  138. else player.timeShards = player.timeShards.plus(getTimeDimensionProduction(1).times(diff/10))
  139.  
  140. if (getTimeDimensionProduction(1).gt(0) && ECTimesCompleted("eterc7") > 0) player.infinityDimension8.amount = player.infinityDimension8.amount.plus(getTimeDimensionProduction(1).pow(ECTimesCompleted("eterc7")*0.2).minus(1).times(diff/10))
  141.  
  142. let gain;
  143. if (player.timeShards.gt(0)) {
  144. if (player.timestudy.studies.includes(171)) gain = Math.ceil(new Decimal(player.timeShards).dividedBy(player.tickThreshold).log10() / Math.log10(1.25))
  145. else gain = Math.ceil(new Decimal(player.timeShards).dividedBy(player.tickThreshold).log10() / Math.log10(1.33))
  146. player.totalTickGained += gain
  147. player.tickspeed = player.tickspeed.times(Decimal.pow(getTickSpeedMultiplier(), gain))
  148. if (player.timestudy.studies.includes(171)) player.tickThreshold = new Decimal(1).times(1.25).pow(player.totalTickGained)
  149. else player.tickThreshold = new Decimal(1).times(1.33).pow(player.totalTickGained)
  150. document.getElementById("totaltickgained").textContent = "You've gained "+player.totalTickGained.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")+" tickspeed upgrades."
  151. updateTickSpeed();
  152. }
  153.  
  154. if (player.eternities == 0) {
  155. document.getElementById("eternityPoints2").style.display = "none"
  156. document.getElementById("eternitystorebtn").style.display = "none"
  157. }
  158. else {
  159. document.getElementById("eternityPoints2").style.display = "inline-block"
  160. }
  161.  
  162.  
  163. if (player.money.gte(Number.MAX_VALUE) && (!player.break || (player.currentChallenge != "" && player.money.gte(player.challengeTarget)))) {
  164. document.getElementById("bigcrunch").style.display = 'inline-block';
  165. if ((player.currentChallenge == "" || player.options.retryChallenge) && (player.bestInfinityTime <= 600 || player.break)) {}
  166. else showTab('emptiness');
  167. } else document.getElementById("bigcrunch").style.display = 'none';
  168.  
  169. if (player.break && player.money.gte(Number.MAX_VALUE) && player.currentChallenge == "") {
  170. document.getElementById("postInfinityButton").style.display = "inline-block"
  171. } else {
  172. document.getElementById("postInfinityButton").style.display = "none"
  173. }
  174.  
  175.  
  176. if (player.break) document.getElementById("iplimit").style.display = "inline"
  177. else document.getElementById("iplimit").style.display = "none"
  178.  
  179. var currentIPmin = gainedInfinityPoints().dividedBy(player.thisInfinityTime/600)
  180. if (currentIPmin.gt(IPminpeak)) IPminpeak = currentIPmin
  181. if (IPminpeak.lte("1e100000")) document.getElementById("postInfinityButton").innerHTML = "<b>Big Crunch for "+shortenDimensions(gainedInfinityPoints())+" Infinity Points.</b><br>"+shortenDimensions(currentIPmin) + " IP/min"+"<br>Peaked at "+shortenDimensions(IPminpeak)+" IP/min"
  182. else document.getElementById("postInfinityButton").innerHTML = "<b>Big Crunch for "+shortenDimensions(gainedInfinityPoints())+" Infinity Points.</b>"
  183.  
  184. if (nextAt[player.postChallUnlocked] === undefined) document.getElementById("nextchall").textContent = " "
  185. else if (!player.achievements.includes("r133")) {
  186. document.getElementById("nextchall").textContent = "Next challenge unlocks at "+ shortenCosts(nextAt[player.postChallUnlocked]) + " antimatter."
  187. while (player.money.gte(nextAt[player.postChallUnlocked]) && player.challenges.includes("postc8") === false && player.postChallUnlocked != 8) {
  188. if (player.postChallUnlocked != 8) player.postChallUnlocked += 1
  189. if (player.eternities > 6) player.challenges.push("postc"+player.postChallUnlocked)
  190. updateChallenges()
  191. }
  192. }
  193. let interval = player.replicanti.interval
  194. if (player.timestudy.studies.includes(62)) interval = interval/3
  195. if (player.timestudy.studies.includes(133) || player.replicanti.amount.gt(Number.MAX_VALUE)) interval *= 10
  196. if (player.timestudy.studies.includes(213)) interval /= 20
  197. if (player.replicanti.amount.lt(Number.MAX_VALUE) && player.achievements.includes("r134")) interval /= 2
  198. if (player.replicanti.amount.gt(Number.MAX_VALUE)) interval = Math.max(interval * Math.pow(1.2, (player.replicanti.amount.log10() - 308)/308), interval)
  199. var est = Math.log(player.replicanti.chance+1) * 1000 / interval
  200.  
  201. var current = player.replicanti.amount.ln()
  202.  
  203. if (player.replicanti.unl && (diff > 5 || interval < 50 || player.timestudy.studies.includes(192))) {
  204. var gained = Decimal.pow(Math.E, current +(diff*est/10))
  205. if (player.timestudy.studies.includes(192)) gained = Decimal.pow(Math.E, current +Math.log((diff*est/10) * (Math.log10(1.2)/308)+1) / (Math.log10(1.2)/308))
  206. player.replicanti.amount = Decimal.min(Number.MAX_VALUE, gained)
  207. if (player.timestudy.studies.includes(192)) player.replicanti.amount = gained
  208. replicantiTicks = 0
  209. } else {
  210. if (interval <= replicantiTicks && player.replicanti.unl) {
  211. if (player.replicanti.amount.lte(100)) {
  212. var temp = player.replicanti.amount
  213. for (var i=0; temp.gt(i); i++) {
  214. if (player.replicanti.chance > Math.random()) player.replicanti.amount = player.replicanti.amount.plus(1)
  215. }
  216. } else {
  217. var temp = Decimal.round(player.replicanti.amount.dividedBy(100))
  218. if (Math.round(player.replicanti.chance) !== 1) {
  219. let counter = 0
  220. for (var i=0; i<100; i++) {
  221. if (player.replicanti.chance > Math.random()) {
  222. counter++;
  223. }
  224. }
  225. player.replicanti.amount = Decimal.min(Number.MAX_VALUE, temp.times(counter).plus(player.replicanti.amount))
  226. if (player.timestudy.studies.includes(192)) player.replicanti.amount = temp.times(counter).plus(player.replicanti.amount)
  227. counter = 0
  228. } else {
  229. if (player.timestudy.studies.includes(192)) player.replicanti.amount = player.replicanti.amount.times(2)
  230. else player.replicanti.amount = Decimal.min(Number.MAX_VALUE, player.replicanti.amount.times(2))
  231.  
  232. }
  233. }
  234. replicantiTicks -= interval
  235. }
  236.  
  237. }
  238. if (player.replicanti.amount.gt(0)) replicantiTicks += player.options.updateRate
  239.  
  240.  
  241. if (current == Decimal.ln(Number.MAX_VALUE) && player.thisInfinityTime < 600*30) giveAchievement("Is this safe?");
  242. if (player.replicanti.galaxies >= 10 && player.thisInfinityTime < 150) giveAchievement("The swarm");
  243. if (player.money.gte(new Decimal(1e5))) giveAchievement("Instant Multiplier");
  244. if (player.replicanti.amount.gte(new Decimal("1e999"))) giveAchievement("Better Replicanti Multiplier");
  245. if (player.eightAmount.gte(1000)) giveAchievement("Eighth Generation")
  246.  
  247. if (player.replicanti.galaxybuyer && player.replicanti.amount.gte(Number.MAX_VALUE) && !player.timestudy.studies.includes(131)) {
  248. document.getElementById("replicantireset").click()
  249. }
  250. if (player.timestudy.studies.includes(22) ? player.replicanti.interval !== 1 : (player.replicanti.interval !== 50)) document.getElementById("replicantiinterval").innerHTML = "Interval: "+(interval).toFixed(3)+"ms<br>-> "+Math.max(interval*0.9).toFixed(3)+" Costs: "+shortenCosts(player.replicanti.intervalCost)+" IP"
  251. else document.getElementById("replicantiinterval").textContent = "Interval: "+(interval).toFixed(3)+"ms"
  252.  
  253.  
  254. if (player.infMultBuyer) {
  255. var dif = player.infinityPoints.e - player.infMultCost.e +1
  256. if (dif > 0) {
  257. player.infMult = player.infMult.times(Decimal.pow(2, dif))
  258. player.infMultCost = player.infMultCost.times(Decimal.pow(10, dif))
  259. document.getElementById("infiMult").innerHTML = "Multiply infinity points from all sources by 2 <br>currently: "+shorten(player.infMult.times(kongIPMult)) +"x<br>Cost: "+shortenCosts(player.infMultCost)+" IP"
  260. player.infinityPoints = player.infinityPoints.minus(player.infMultCost.dividedBy(10))
  261. if (player.autobuyers[11].priority !== undefined && player.autobuyers[11].priority !== null && player.autoCrunchMode == "amount") player.autobuyers[11].priority = player.autobuyers[11].priority.times(Decimal.pow(2, dif));
  262. if (player.autoCrunchMode == "amount") document.getElementById("priority12").value = player.autobuyers[11].priority
  263. }
  264. }
  265.  
  266.  
  267. var estimate = Math.max((Math.log(Number.MAX_VALUE) - current) / est, 0)
  268. document.getElementById("replicantiapprox").textContent ="Approximately "+ timeDisplay(estimate*10) + " Until Infinite Replicanti"
  269.  
  270. document.getElementById("replicantiamount").textContent = shortenDimensions(player.replicanti.amount)
  271. var replmult = Decimal.pow(Decimal.log2(Decimal.max(player.replicanti.amount, 1)), 2)
  272. if (player.timestudy.studies.includes(21)) replmult = replmult.plus(Decimal.pow(player.replicanti.amount, 0.032))
  273. if (player.timestudy.studies.includes(102))replmult = replmult.times(Decimal.pow(5, player.replicanti.galaxies, 150))
  274. document.getElementById("replicantimult").textContent = shorten(replmult.max(1))
  275.  
  276. var currentEPmin = gainedEternityPoints().dividedBy(player.thisEternity/600)
  277. if (currentEPmin.gt(EPminpeak) && player.infinityPoints.gte(Number.MAX_VALUE)) EPminpeak = currentEPmin
  278. document.getElementById("eternitybtn").innerHTML = (player.eternities == 0) ? "Other times await.. I need to become Eternal" : "<b>I need to become Eternal.</b><br>"+"Gain <b>"+shortenDimensions(gainedEternityPoints())+"</b> Eternity points.<br>"+shortenDimensions(currentEPmin)+ " EP/min<br>Peaked at "+shortenDimensions(EPminpeak)+" EP/min"
  279. if (gainedEternityPoints().gte(1e6)) document.getElementById("eternitybtn").innerHTML = "Gain <b>"+shortenDimensions(gainedEternityPoints())+"</b> Eternity points.<br>"+shortenDimensions(currentEPmin)+ " EP/min<br>Peaked at "+shortenDimensions(EPminpeak)+" EP/min"
  280. if (player.dilation.active) document.getElementById("eternitybtn").innerHTML = "Gain <b>"+shortenDimensions(gainedEternityPoints())+"</b> Eternity points.<br>"+"+"+shortenMoney(Math.round(Math.max(Math.pow(Decimal.log10(player.money) / 400, 1.5) * (Math.pow(3, player.dilation.rebuyables[3])) - player.dilation.totalTachyonParticles, 0) * 10)/10) +" Tachyon particles."
  281. if (player.currentEternityChall !== "") document.getElementById("eternitybtn").textContent = "Other challenges await.. I need to become Eternal"
  282. updateMoney();
  283. updateCoinPerSec();
  284. updateDimensions()
  285. updateInfCosts()
  286. updateInfinityDimensions();
  287. updateInfPower();
  288. updateTimeDimensions()
  289. updateTimeShards()
  290. updateDilation()
  291. if (getDimensionProductionPerSecond(1).gt(player.money) && !player.achievements.includes("r44")) {
  292. Marathon+=player.options.updateRate/1000;
  293. if (Marathon >= 30) giveAchievement("Over in 30 seconds");
  294. } else {
  295. Marathon = 0;
  296. }
  297. if (DimensionProduction(1).gt(player.infinityPower) && player.currentEternityChall != "eterc7" && !player.achievements.includes("r113")) {
  298. Marathon2+=player.options.updateRate/1000;
  299. if (Marathon2 >= 60) giveAchievement("Long lasting relationship");
  300. } else {
  301. Marathon2 = 0;
  302. }
  303. if (player.eternities >= 1 && (player.options.notation == "Standard" || player.options.notation == "Emojis" || player.options.notation == "Brackets")) {
  304. painTimer += player.options.updateRate/1000;
  305. if (painTimer >= 600) giveAchievement("Do you enjoy pain?");
  306. }
  307.  
  308. if(player.money.gt(Math.pow(10,63))) giveAchievement("Supersanic");
  309.  
  310. for (let tier = 1; tier <= 8; ++tier) {
  311. var name = TIER_NAMES[tier];
  312. if (player.currentChallenge != "challenge10" && player.currentChallenge != "postc1") {
  313. document.getElementById(name).className = canAfford(player[name + 'Cost']) ? 'storebtn' : 'unavailablebtn';
  314. document.getElementById(name + 'Max').className = canAfford(player[name + 'Cost'].times(10 - dimBought(tier))) ? 'storebtn' : 'unavailablebtn';
  315. } else {
  316. if (tier >= 3) {
  317. document.getElementById(name).className = player[TIER_NAMES[tier-2] + 'Amount'].gte(player[name + 'Cost']) ? 'storebtn' : 'unavailablebtn';
  318. document.getElementById(name + 'Max').className = player[TIER_NAMES[tier-2] + 'Amount'].gte(player[name + 'Cost'].times(10 - dimBought(tier))) ? 'storebtn' : 'unavailablebtn';
  319. } else {
  320. document.getElementById(name).className = canAfford(player[name + 'Cost']) ? 'storebtn' : 'unavailablebtn';
  321. document.getElementById(name + 'Max').className = canAfford(player[name + 'Cost'].times(10 - dimBought(tier))) ? 'storebtn' : 'unavailablebtn';
  322. }
  323. }
  324. }
  325. if (player.firstAmount.lt(1)) document.getElementById("first").className = 'storebtn';
  326.  
  327. for (var tier = 1; tier < 9; tier++) {
  328. if (player.infinityPoints.gte(player["infinityDimension"+tier].cost)) document.getElementById("infMax"+tier).className = "storebtn"
  329. else document.getElementById("infMax"+tier).className = "unavailablebtn"
  330. }
  331.  
  332. for (var tier = 1; tier < 9; tier++) {
  333. if (player.eternityPoints.gte(player["timeDimension"+tier].cost)) document.getElementById("timeMax"+tier).className = "storebtn"
  334. else document.getElementById("timeMax"+tier).className = "unavailablebtn"
  335. }
  336.  
  337. if (player.dilation.studies.includes(1)) player.dilation.dilatedTime = player.dilation.dilatedTime.plus(player.dilation.tachyonParticles*Math.pow(2, player.dilation.rebuyables[1])*diff/10)
  338.  
  339. if (player.dilation.nextThreshold.lte(player.dilation.dilatedTime)) {
  340. let thresholdMult = 1.35 + 3.65 * Math.pow(0.8, player.dilation.rebuyables[2])
  341. // for (var i = 0; i < player.dilation.rebuyables[2]; i++) {
  342. // thresholdMult *= Math.min( 1 - (Math.pow(0.8, i) / 10), 0.999)
  343. // }
  344. player.dilation.nextThreshold = player.dilation.nextThreshold.times(thresholdMult)
  345. player.dilation.freeGalaxies += 1
  346. if (player.dilation.upgrades.includes(4)) player.dilation.freeGalaxies += 1
  347. }
  348.  
  349.  
  350.  
  351.  
  352. if (canAfford(player.tickSpeedCost)) {
  353. document.getElementById("tickSpeed").className = 'storebtn';
  354. document.getElementById("tickSpeedMax").className = 'storebtn';
  355. } else {
  356. document.getElementById("tickSpeed").className = 'unavailablebtn';
  357. document.getElementById("tickSpeedMax").className = 'unavailablebtn';
  358. }
  359.  
  360. if (player.infinityPoints.gt(0) || player.eternities !== 0) {
  361. document.getElementById("infinitybtn").style.display = "block";
  362. document.getElementById("infi11").className = "infinistorebtn1"
  363. document.getElementById("infi21").className = "infinistorebtn2"
  364. if (player.infinityUpgrades.includes("timeMult")) document.getElementById("infi12").className = "infinistorebtn1"
  365. else document.getElementById("infi12").className = "infinistorebtnlocked"
  366. if (player.infinityUpgrades.includes("dimMult")) document.getElementById("infi22").className = "infinistorebtn2"
  367. else document.getElementById("infi22").className = "infinistorebtnlocked"
  368. if (player.infinityUpgrades.includes("18Mult")) document.getElementById("infi13").className = "infinistorebtn1"
  369. else document.getElementById("infi13").className = "infinistorebtnlocked"
  370. if (player.infinityUpgrades.includes("27Mult")) document.getElementById("infi23").className = "infinistorebtn2"
  371. else document.getElementById("infi23").className = "infinistorebtnlocked"
  372. if (player.infinityUpgrades.includes("36Mult")) document.getElementById("infi14").className = "infinistorebtn1"
  373. else document.getElementById("infi14").className = "infinistorebtnlocked"
  374. if (player.infinityUpgrades.includes("45Mult") && player.infinityPoints.gte(2)) document.getElementById("infi24").className = "infinistorebtn2"
  375. else document.getElementById("infi24").className = "infinistorebtnlocked"
  376. if (player.infinityPoints.gte(3)) document.getElementById("infi31").className = "infinistorebtn3"
  377. else document.getElementById("infi31").className = "infinistorebtnlocked"
  378. if (player.infinityUpgrades.includes("timeMult2") && player.infinityPoints.gte(5)) document.getElementById("infi32").className = "infinistorebtn3"
  379. else document.getElementById("infi32").className = "infinistorebtnlocked"
  380. if (player.infinityUpgrades.includes("unspentBonus") && player.infinityPoints.gte(7)) document.getElementById("infi33").className = "infinistorebtn3"
  381. else document.getElementById("infi33").className = "infinistorebtnlocked"
  382. if (player.infinityUpgrades.includes("resetMult") && player.infinityPoints.gte(10)) document.getElementById("infi34").className = "infinistorebtn3"
  383. else document.getElementById("infi34").className = "infinistorebtnlocked"
  384. if (player.infinityPoints.gte(20)) document.getElementById("infi41").className = "infinistorebtn4"
  385. else document.getElementById("infi41").className = "infinistorebtnlocked"
  386. if (player.infinityUpgrades.includes("skipReset1") && player.infinityPoints.gte(40)) document.getElementById("infi42").className = "infinistorebtn4"
  387. else document.getElementById("infi42").className = "infinistorebtnlocked"
  388. if (player.infinityUpgrades.includes("skipReset2") && player.infinityPoints.gte(80)) document.getElementById("infi43").className = "infinistorebtn4"
  389. else document.getElementById("infi43").className = "infinistorebtnlocked"
  390. if (player.infinityUpgrades.includes("skipReset3") && player.infinityPoints.gte(500)) document.getElementById("infi44").className = "infinistorebtn4"
  391. else document.getElementById("infi44").className = "infinistorebtnlocked"
  392. if (player.infinityUpgrades.includes("skipResetGalaxy") && player.infinityUpgrades.includes("passiveGen") && player.infinityUpgrades.includes("galaxyBoost") && player.infinityUpgrades.includes("resetBoost") && player.infinityPoints.gte(player.infMultCost)) {
  393. document.getElementById("infiMult").className = "infinimultbtn"
  394. } else document.getElementById("infiMult").className = "infinistorebtnlocked"
  395.  
  396. if (player.infinityPoints.gte(1e4)) document.getElementById("postinfi11").className = "infinistorebtn1"
  397. else document.getElementById("postinfi11").className = "infinistorebtnlocked"
  398.  
  399. if (player.infinityPoints.gte(5e4)) document.getElementById("postinfi21").className = "infinistorebtn1"
  400. else document.getElementById("postinfi21").className = "infinistorebtnlocked"
  401.  
  402. if (player.infinityPoints.gte(player.tickSpeedMultDecreaseCost)) document.getElementById("postinfi31").className = "infinimultbtn"
  403. else document.getElementById("postinfi31").className = "infinistorebtnlocked"
  404.  
  405. if (player.infinityPoints.gte(5e11)) document.getElementById("postinfi41").className = "infinistorebtn1"
  406. else document.getElementById("postinfi41").className = "infinistorebtnlocked"
  407.  
  408. if (player.infinityPoints.gte(1e5)) document.getElementById("postinfi12").className = "infinistorebtn1"
  409. else document.getElementById("postinfi12").className = "infinistorebtnlocked"
  410.  
  411. if (player.infinityPoints.gte(1e6)) document.getElementById("postinfi22").className = "infinistorebtn1"
  412. else document.getElementById("postinfi22").className = "infinistorebtnlocked"
  413.  
  414. if (player.infinityPoints.gte(1e7)) document.getElementById("postinfi32").className = "infinistorebtn1"
  415. else document.getElementById("postinfi32").className = "infinistorebtnlocked"
  416.  
  417. if (player.infinityPoints.gte(player.dimensionMultDecreaseCost)) document.getElementById("postinfi42").className = "infinimultbtn"
  418. else document.getElementById("postinfi42").className = "infinistorebtnlocked"
  419.  
  420. if (player.infinityPoints.gte(20e6)) document.getElementById("postinfi13").className = "infinistorebtn1"
  421. else document.getElementById("postinfi13").className = "infinistorebtnlocked"
  422.  
  423. if (player.infinityPoints.gte(5e9)) document.getElementById("postinfi23").className = "infinistorebtn1"
  424. else document.getElementById("postinfi23").className = "infinistorebtnlocked"
  425.  
  426. if (player.infinityPoints.gte(1e15)) document.getElementById("postinfi33").className = "infinistorebtn1"
  427. else document.getElementById("postinfi33").className = "infinistorebtnlocked"
  428.  
  429. if (player.infinityPoints.gte(player.offlineProdCost)) document.getElementById("offlineProd").className = "infinimultbtn"
  430. else document.getElementById("offlineProd").className = "infinistorebtnlocked"
  431.  
  432. }
  433. if (player.infinityPoints.equals(0)){
  434. document.getElementById("infi11").className = "infinistorebtnlocked"
  435. document.getElementById("infi12").className = "infinistorebtnlocked"
  436. document.getElementById("infi13").className = "infinistorebtnlocked"
  437. document.getElementById("infi14").className = "infinistorebtnlocked"
  438. document.getElementById("infi21").className = "infinistorebtnlocked"
  439. document.getElementById("infi22").className = "infinistorebtnlocked"
  440. document.getElementById("infi23").className = "infinistorebtnlocked"
  441. document.getElementById("infi24").className = "infinistorebtnlocked"
  442. document.getElementById("infi31").className = "infinistorebtnlocked"
  443. document.getElementById("infi32").className = "infinistorebtnlocked"
  444. document.getElementById("infi33").className = "infinistorebtnlocked"
  445. document.getElementById("infi34").className = "infinistorebtnlocked"
  446. document.getElementById("infi41").className = "infinistorebtnlocked"
  447. document.getElementById("infi42").className = "infinistorebtnlocked"
  448. document.getElementById("infi43").className = "infinistorebtnlocked"
  449. document.getElementById("infi44").className = "infinistorebtnlocked"
  450. document.getElementById("infiMult").className = "infinistorebtnlocked"
  451.  
  452. }
  453.  
  454. if (player.autobuyers[11]%1 === 0 || player.autobuyers[11].interval>100) document.getElementById("break").className = "infinistorebtnlocked"
  455. else document.getElementById("break").className = "infinistorebtn2"
  456.  
  457.  
  458. if (player.resets > 4) {
  459. document.getElementById("confirmation").style.display = "inline-block";
  460. document.getElementById("sacrifice").style.display = "inline-block";
  461. } else {
  462. document.getElementById("confirmation").style.display = "none";
  463. document.getElementById("sacrifice").style.display = "none";
  464. }
  465.  
  466. if (player.infinitied > 0) document.getElementById("sacrifice").style.display = "inline-block";
  467.  
  468. if (player.eightAmount > 0 && player.resets > 4 && player.currentEternityChall !== "eterc3") document.getElementById("sacrifice").className = "storebtn"
  469. else document.getElementById("sacrifice").className = "unavailablebtn"
  470.  
  471. if (player.autobuyers[11]%1 !== 0 && player.autobuyers[11].interval == 100) {
  472. document.getElementById("postinftable").style.display = "inline-block"
  473. } else {
  474. document.getElementById("postinftable").style.display = "none"
  475. }
  476.  
  477. if (player.autobuyers[11].interval == 100) document.getElementById("abletobreak").style.display = "none"
  478.  
  479.  
  480. document.getElementById("infinitybtn").style.display = "none";
  481. document.getElementById("challengesbtn").style.display = "none";
  482.  
  483. if (player.money.gte(Number.MAX_VALUE) && (((player.currentChallenge != "" && player.money.gte(player.challengeTarget)) && !player.options.retryChallenge) || (player.bestInfinityTime > 600 && !player.break))) {
  484. document.getElementById("dimensionsbtn").style.display = "none";
  485. document.getElementById("optionsbtn").style.display = "none";
  486. document.getElementById("statisticsbtn").style.display = "none";
  487. document.getElementById("achievementsbtn").style.display = "none";
  488. document.getElementById("challengesbtn").style.display = "none";
  489. document.getElementById("infinitybtn").style.display = "none";
  490. document.getElementById("tickSpeed").style.visibility = "hidden";
  491. document.getElementById("tickSpeedMax").style.visibility = "hidden";
  492. document.getElementById("tickLabel").style.visibility = "hidden";
  493. document.getElementById("tickSpeedAmount").style.visibility = "hidden";
  494. } else {
  495. document.getElementById("dimensionsbtn").style.display = "inline-block";
  496. document.getElementById("optionsbtn").style.display = "inline-block";
  497. document.getElementById("statisticsbtn").style.display = "inline-block";
  498. document.getElementById("achievementsbtn").style.display = "inline-block";
  499. if (player.infinitied > 0) {
  500. document.getElementById("infinitybtn").style.display = "inline-block";
  501. document.getElementById("challengesbtn").style.display = "inline-block";
  502. }
  503. }
  504.  
  505. document.getElementById("epmult").className = player.eternityPoints.gte(player.epmultCost) ? "eternityupbtn" : "eternityupbtnlocked"
  506.  
  507. if (player.infinityUpgrades.includes("bulkBoost")) document.getElementById("bulkdimboost").style.display = "inline"
  508. else document.getElementById("bulkdimboost").style.display = "none"
  509.  
  510. if (player.infinityUpgrades.includes("timeMult")) document.getElementById("infi11").className = "infinistorebtnbought"
  511. if (player.infinityUpgrades.includes("dimMult")) document.getElementById("infi21").className = "infinistorebtnbought"
  512. if (player.infinityUpgrades.includes("18Mult")) document.getElementById("infi12").className = "infinistorebtnbought"
  513. if (player.infinityUpgrades.includes("27Mult")) document.getElementById("infi22").className = "infinistorebtnbought"
  514. if (player.infinityUpgrades.includes("36Mult")) document.getElementById("infi13").className = "infinistorebtnbought"
  515. if (player.infinityUpgrades.includes("45Mult")) document.getElementById("infi23").className = "infinistorebtnbought"
  516. if (player.infinityUpgrades.includes("resetBoost")) document.getElementById("infi14").className = "infinistorebtnbought"
  517. if (player.infinityUpgrades.includes("galaxyBoost")) document.getElementById("infi24").className = "infinistorebtnbought"
  518. if (player.infinityUpgrades.includes("timeMult2")) document.getElementById("infi31").className = "infinistorebtnbought"
  519. if (player.infinityUpgrades.includes("unspentBonus")) document.getElementById("infi32").className = "infinistorebtnbought"
  520. if (player.infinityUpgrades.includes("resetMult")) document.getElementById("infi33").className = "infinistorebtnbought"
  521. if (player.infinityUpgrades.includes("passiveGen")) document.getElementById("infi34").className = "infinistorebtnbought"
  522. if (player.infinityUpgrades.includes("skipReset1")) document.getElementById("infi41").className = "infinistorebtnbought"
  523. if (player.infinityUpgrades.includes("skipReset2")) document.getElementById("infi42").className = "infinistorebtnbought"
  524. if (player.infinityUpgrades.includes("skipReset3")) document.getElementById("infi43").className = "infinistorebtnbought"
  525. if (player.infinityUpgrades.includes("skipResetGalaxy")) document.getElementById("infi44").className = "infinistorebtnbought"
  526.  
  527. if (player.infinityUpgrades.includes("totalMult")) document.getElementById("postinfi11").className = "infinistorebtnbought"
  528. if (player.infinityUpgrades.includes("currentMult")) document.getElementById("postinfi21").className = "infinistorebtnbought"
  529. if (player.tickSpeedMultDecrease <= 2) document.getElementById("postinfi31").className = "infinistorebtnbought"
  530. if (player.infinityUpgrades.includes("achievementMult")) document.getElementById("postinfi22").className = "infinistorebtnbought"
  531. if (player.infinityUpgrades.includes("infinitiedMult")) document.getElementById("postinfi12").className = "infinistorebtnbought"
  532. if (player.infinityUpgrades.includes("postGalaxy")) document.getElementById("postinfi41").className = "infinistorebtnbought"
  533. if (player.infinityUpgrades.includes("challengeMult")) document.getElementById("postinfi32").className = "infinistorebtnbought"
  534. if (player.dimensionMultDecrease <= 3) document.getElementById("postinfi42").className = "infinistorebtnbought"
  535. if (player.offlineProd == 50) document.getElementById("offlineProd").className = "infinistorebtnbought"
  536.  
  537.  
  538. if (player.infinityUpgrades.includes("infinitiedGeneration")) document.getElementById("postinfi13").className = "infinistorebtnbought"
  539. if (player.infinityUpgrades.includes("bulkBoost")) document.getElementById("postinfi23").className = "infinistorebtnbought"
  540. if (player.infinityUpgrades.includes("autoBuyerUpgrade")) document.getElementById("postinfi33").className = "infinistorebtnbought"
  541.  
  542. if (player.currentChallenge !== "") {
  543. document.getElementById("progressbar").style.width = Decimal.min((Decimal.log10(player.money.plus(1)) / Decimal.log10(player.challengeTarget) * 100), 100).toFixed(2) + "%"
  544. document.getElementById("progresspercent").textContent = Decimal.min((Decimal.log10(player.money.plus(1)) / Decimal.log10(player.challengeTarget) * 100), 100).toFixed(2) + "%"
  545. document.getElementById("progresspercent").setAttribute('ach-tooltip',"Percentage to challenge goal")
  546. } else if (!player.break) {
  547. document.getElementById("progressbar").style.width = Decimal.min((Decimal.log10(player.money.plus(1)) / Decimal.log10(Number.MAX_VALUE) * 100), 100).toFixed(2) + "%"
  548. document.getElementById("progresspercent").textContent = Decimal.min((Decimal.log10(player.money.plus(1)) / Decimal.log10(Number.MAX_VALUE) * 100), 100).toFixed(2) + "%"
  549. document.getElementById("progresspercent").setAttribute('ach-tooltip',"Percentage to Infinity")
  550. } else if (player.infDimensionsUnlocked.includes(false)) {
  551. document.getElementById("progressbar").style.width = Decimal.min(player.money.e / getNewInfReq().e * 100, 100).toFixed(2) + "%"
  552. document.getElementById("progresspercent").textContent = Decimal.min(player.money.e / getNewInfReq().e * 100, 100).toFixed(2) + "%"
  553. document.getElementById("progresspercent").setAttribute('ach-tooltip',"Percentage to next dimension unlock")
  554. } else {
  555. document.getElementById("progressbar").style.width = Decimal.min(Decimal.log10(player.infinityPoints.plus(1)) / Decimal.log10(Number.MAX_VALUE) * 100, 100).toFixed(2) + "%"
  556. document.getElementById("progresspercent").textContent = Decimal.min(Decimal.log10(player.infinityPoints.plus(1)) / Decimal.log10(Number.MAX_VALUE) * 100, 100).toFixed(2) + "%"
  557. document.getElementById("progresspercent").setAttribute('ach-tooltip',"Percentage to Eternity")
  558. }
  559.  
  560. if (player.eternities > 0) {
  561. document.getElementById("infinitybtn").style.display = "inline-block";
  562. document.getElementById("challengesbtn").style.display = "inline-block";
  563. }
  564.  
  565. document.getElementById("ec1reward").textContent = "Reward: "+shortenMoney(Math.pow(Math.max(player.thisEternity*10, 1), 0.3+(ECTimesCompleted("eterc1")*0.05)))+"x on all Time Dimensions (based on time spent this Eternity)"
  566. document.getElementById("ec2reward").textContent = "Reward: Infinity power affects 1st Infinity Dimension with reduced effect, Currently: "+shortenMoney(player.infinityPower.pow(1.5/(700 - ECTimesCompleted("eterc2")*100)).min(new Decimal("1e100")).max(1))+"x"
  567. document.getElementById("ec3reward").textContent = "Reward: Increase the multiplier for buying 10 dimensions, Currently: "+getDimensionPowerMultiplier().toFixed(2)+"x"
  568. document.getElementById("ec4reward").textContent = "Reward: Infinity Dimension multiplier from unspent IP, Currently: "+shortenMoney(player.infinityPoints.pow(0.003 + ECTimesCompleted("eterc4")*0.002).min(new Decimal("1e200")))+"x"
  569. document.getElementById("ec5reward").textContent = "Reward: Galaxy cost scaling starts "+((ECTimesCompleted("eterc5")*5))+" galaxies later."
  570. document.getElementById("ec6reward").textContent = "Reward: Further reduce the dimension cost multiplier increase, Currently: "+player.dimensionMultDecrease.toFixed(1)+"x "
  571. document.getElementById("ec7reward").textContent = "Reward: First Time dimension produces Eighth Infinity Dimensions, Currently: "+shortenMoney(getTimeDimensionProduction(1).pow(ECTimesCompleted("eterc7")*0.2).minus(1).max(0))+" per second. "
  572. document.getElementById("ec8reward").textContent = "Reward: Infinity power powers up replicanti galaxies, Currently: " + (Math.max(Math.pow(Math.log10(player.infinityPower.plus(1).log10()+1), 0.03 * ECTimesCompleted("eterc8"))-1, 0) * 100).toFixed(2) + "%"
  573. document.getElementById("ec9reward").textContent = "Reward: Infinity Dimension multiplier based on time shards, Currently: "+shortenMoney(player.timeShards.pow(ECTimesCompleted("eterc9")*0.1).min(new Decimal("1e400")))+"x "
  574. document.getElementById("ec10reward").textContent = "Reward: Time dimensions gain a multiplier from infinitied stat, Currently: "+shortenMoney(new Decimal(Math.max(Math.pow(getInfinitied(), 0.9) * ECTimesCompleted("eterc10") * 0.000002+1, 1)).pow((player.timestudy.studies.includes(31)) ? 4 : 1))+"x "
  575. document.getElementById("ec11reward").textContent = "Reward: Further reduce the tickspeed cost multiplier increase, Currently: "+player.tickSpeedMultDecrease.toFixed(2)+"x "
  576. document.getElementById("ec12reward").textContent = "Reward: Infinity Dimension cost multipliers are reduced. (x^"+(1-ECTimesCompleted("eterc12")*0.008)+")"
  577.  
  578. // let extraGals = 0
  579. // if (player.timestudy.studies.includes(225)) extraGals += Math.floor(player.replicanti.amount.e / 2500)
  580. // if (player.timestudy.studies.includes(226)) extraGals += Math.floor(player.replicanti.gal / 40)
  581. // if (extraGals !== 0) document.getElementById("replicantireset").innerHTML = "Reset replicanti amount, but get a free galaxy<br>"+player.replicanti.galaxies + "+"+extraGals+ " replicated galaxies created."
  582. // else document.getElementById("replicantireset").innerHTML = "Reset replicanti amount, but get a free galaxy<br>"+player.replicanti.galaxies + " replicated galaxies created."
  583.  
  584. document.getElementById("ec10span").textContent = shortenMoney(ec10bonus) + "x"
  585. var scale1 = [2.82e-45,1e-42,7.23e-30,5e-21,9e-17,6.2e-11,5e-8,3.555e-6,7.5e-4,1,2.5e3,2.6006e6,3.3e8,5e12,4.5e17,1.08e21,1.53e24,1.41e27,5e32,8e36,1.7e45,1.7e48,3.3e55,3.3e61,5e68,1e73,3.4e80,1e113,Number.MAX_VALUE,new Decimal("1e65000")];
  586. var scale2 = [" protons."," nucleui."," Hydrogen atoms."," viruses."," red blood cells."," grains of sand."," grains of rice."," teaspoons."," wine bottles."," fridge-freezers."," Olympic-sized swimming pools."," Great Pyramids of Giza."," Great Walls of China."," large asteroids.",
  587. " dwarf planets."," Earths."," Jupiters."," Suns."," red giants."," hypergiant stars."," nebulas."," Oort clouds."," Local Bubbles."," galaxies."," Local Groups."," Sculptor Voids."," observable universes."," Dimensions.", " Infinity Dimensions.", " Time Dimensions."];
  588. var id = 0;
  589. if (player.money.times(4.22419e-105).gt(2.82e-45)) {
  590. if (player.money.times(4.22419e-105).gt(scale1[scale1.length - 1])) id = scale1.length - 1;
  591. else {
  592. while (player.money.times(4.22419e-105).gt(scale1[id])) id++;
  593. if (id > 0) id--;
  594. }
  595. if (id >= 7 && id < 11) document.getElementById("infoScale").textContent = "If every antimatter were a planck volume, you would have enough to fill " + formatValue(player.options.notation, player.money * 4.22419e-105 / scale1[id], 2, 1) + scale2[id];
  596. else document.getElementById("infoScale").textContent = "If every antimatter were a planck volume, you would have enough to make " + formatValue(player.options.notation, player.money.times(4.22419e-105).dividedBy(scale1[id]), 2, 1) + scale2[id];
  597. } else { //does this part work correctly? i doubt it does
  598. if (player.money.times(1e-54) < 2.82e-45) document.getElementById("infoScale").textContent = "If every antimatter were " + formatValue(player.options.notation,2.82e-45 / 1e-54 / player.money, 2, 1) + " attometers cubed, you would have enough to make a proton."
  599. else if (player.money * 1e-63 < 2.82e-45) document.getElementById("infoScale").textContent = "If every antimatter were " + formatValue(player.options.notation,2.82e-45 / 1e-63 / player.money, 2, 1) + " zeptometers cubed, you would have enough to make a proton."
  600. else if (player.money * 1e-72 < 2.82e-45) document.getElementById("infoScale").textContent = "If every antimatter were " + formatValue(player.options.notation,2.82e-45 / 1e-72 / player.money, 2, 1) + " yoctometers cubed, you would have enough to make a proton."
  601. else document.getElementById("infoScale").textContent = "If every antimatter were " + formatValue(player.options.notation,2.82e-45 / 4.22419e-105 / player.money, 2, 1) + " planck volumes, you would have enough to make a proton."
  602. }
  603. if (player.money.gt(new Decimal("1e100000"))) {
  604. document.getElementById("infoScale").innerHTML = "<br>If you wrote 3 numbers a second, it would take you <br>" + timeDisplay(player.money.log10()*10/3) + "<br> to write down your antimatter amount.";
  605. }
  606.  
  607. var shiftRequirement = getShiftRequirement(0);
  608.  
  609. if (player[TIER_NAMES[shiftRequirement.tier] + 'Amount'] >= shiftRequirement.amount) {
  610. document.getElementById("softReset").className = 'storebtn';
  611. } else {
  612. document.getElementById("softReset").className = 'unavailablebtn';
  613. }
  614.  
  615. if (player.eightAmount >= getGalaxyRequirement()) {
  616. document.getElementById("secondSoftReset").className = 'storebtn';
  617. } else {
  618. document.getElementById("secondSoftReset").className = 'unavailablebtn';
  619. }
  620.  
  621. if (player.currentChallenge == "challenge4" && player.sixthAmount >= getGalaxyRequirement()) {
  622. document.getElementById("secondSoftReset").className = 'storebtn';
  623. }
  624.  
  625. if (player.currentChallenge == "challenge2" || player.currentChallenge == "postc1") document.getElementById("chall2Pow").style.display = "inline-block"
  626. else document.getElementById("chall2Pow").style.display = "none"
  627. if (player.currentChallenge == "challenge3" || player.currentChallenge == "postc1") document.getElementById("chall3Pow").style.display = "inline-block"
  628. else document.getElementById("chall3Pow").style.display = "none"
  629.  
  630. document.getElementById("chall2Pow").textContent = (player.chall2Pow*100).toFixed(2) + "%"
  631. document.getElementById("chall3Pow").textContent = shorten(player.chall3Pow*100) + "%"
  632.  
  633.  
  634. if (player.infDimensionsUnlocked[7] == false && player.break && player.eternities <= 24) {
  635. document.getElementById("newDimensionButton").style.display = "inline-block"
  636. } else document.getElementById("newDimensionButton").style.display = "none"
  637.  
  638. if (player.money.gte(getNewInfReq())) document.getElementById("newDimensionButton").className = "newdim"
  639. else document.getElementById("newDimensionButton").className = "newdimlocked"
  640.  
  641. var infdimpurchasewhileloop = 1;
  642. while (player.eternities > 24 && getNewInfReq().lt(player.money) && player.infDimensionsUnlocked[7] === false) {
  643. for (i=0; i<8; i++) {
  644. if (player.infDimensionsUnlocked[i]) infdimpurchasewhileloop++
  645. }
  646. newDimension()
  647. if (player.infDimBuyers[i-1]) buyMaxInfDims(infdimpurchasewhileloop)
  648. infdimpurchasewhileloop = 1;
  649. }
  650.  
  651. document.getElementById("newDimensionButton").textContent = "Get " + shortenCosts(getNewInfReq()) + " antimatter to unlock a new Dimension."
  652.  
  653. document.getElementById("sacrifice").setAttribute('ach-tooltip', "Boosts 8th Dimension by " + formatValue(player.options.notation, calcSacrificeBoost(), 2, 2) + "x");
  654.  
  655. document.getElementById("sacrifice").textContent = "Dimensional Sacrifice ("+formatValue(player.options.notation, calcSacrificeBoost(), 2, 2)+"x)"
  656. if (isNaN(player.totalmoney)) player.totalmoney = new Decimal(10)
  657. if (player.timestudy.studies.includes(181)) player.infinityPoints = player.infinityPoints.plus(gainedInfinityPoints().times(diff/1000))
  658. if (player.dilation.upgrades.includes(10)) {
  659. player.timestudy.theorem += parseFloat(player.dilation.tachyonParticles.div(20000).times(diff/10).toString())
  660. if (document.getElementById("timestudies").style.display != "none" && document.getElementById("eternitystore").style.display != "none") {
  661. if (player.timestudy.theorem>99999) document.getElementById("timetheorems").innerHTML = "You have <span style='display:inline' class=\"TheoremAmount\">"+shortenMoney(player.timestudy.theorem)+"</span> Time "+"Theorems."
  662. else document.getElementById("timetheorems").innerHTML = "You have <span style='display:inline' class=\"TheoremAmount\">"+player.timestudy.theorem.toFixed(0)+"</span> Time "+ (player.timestudy.theorem == 1 ? "Theorem." : "Theorems.")
  663. updateTimeStudyButtons()
  664. }
  665. }
  666.  
  667. document.getElementById("infinityPoints1").innerHTML = "You have <span class=\"IPAmount1\">"+shortenDimensions(player.infinityPoints)+"</span> Infinity points."
  668. document.getElementById("infinityPoints2").innerHTML = "You have <span class=\"IPAmount2\">"+shortenDimensions(player.infinityPoints)+"</span> Infinity points."
  669.  
  670. player.lastUpdate = thisUpdate;
  671. }
  672.  
  673. function DimensionPower(tier) {
  674. var dim = player["infinityDimension"+tier]
  675. if (player.currentEternityChall == "eterc11") return new Decimal(1)
  676. var mult = dim.power
  677.  
  678. mult = mult.times(infDimPow)
  679. if (player.achievements.includes("a11")) mult = mult.times(7.77)
  680.  
  681. mult = mult.times(kongAllDimMult)
  682. if (player.achievements.includes("r94") && tier == 1) mult = mult.times(2);
  683. if (player.achievements.includes("r75")) mult = mult.times(player.achPow);
  684. if (player.replicanti.unl && player.replicanti.amount.gt(1)) {
  685. var replmult = Decimal.pow(Decimal.log2(player.replicanti.amount), 2)
  686. if (player.achievements.includes("a12")) replmult = replmult.pow((player.galaxies+1)/10)
  687.  
  688. if (player.timestudy.studies.includes(21)) replmult = replmult.plus(Decimal.pow(player.replicanti.amount, 0.032))
  689. if (player.timestudy.studies.includes(102)) replmult = replmult.times(Decimal.pow(5, player.replicanti.galaxies))
  690.  
  691. mult = mult.times(replmult)
  692. }
  693.  
  694. if (player.timestudy.studies.includes(72) && tier == 4) {
  695. mult = mult.times(calcTotalSacrificeBoost().pow(0.04).max(1).min("1e30000"))
  696. }
  697.  
  698. if (player.timestudy.studies.includes(82)) {
  699. mult = mult.times(Decimal.pow(1.0000109,Math.pow(player.resets,2)))
  700. }
  701.  
  702. if (player.eternityUpgrades.includes(1)) {
  703. mult = mult.times(player.eternityPoints.plus(1))
  704. }
  705.  
  706. if (player.eternityUpgrades.includes(2)) mult = mult.times(Decimal.pow(Math.min(player.eternities, 100000)/200 + 1, Math.log(Math.min(player.eternities, 100000)*2+1)/Math.log(4)).times(new Decimal((player.eternities-100000)/200 + 1).times(Math.log((player.eternities- 100000)*2+1)/Math.log(4)).max(1)))
  707.  
  708. if (player.eternityUpgrades.includes(3)) mult = mult.times(Decimal.pow(2,300/Math.max(infchallengeTimes, player.achievements.includes("r112") ? 6.1 : 7.5)))
  709.  
  710. if (player.timestudy.studies.includes(92)) mult = mult.times(Decimal.pow(2, 600/Math.max(player.bestEternity, 20)))
  711. if (player.timestudy.studies.includes(162)) mult = mult.times(1e11)
  712. if (ECTimesCompleted("eterc2") !== 0 && tier == 1) mult = mult.times(player.infinityPower.pow(1.5/(700-ECTimesCompleted("eterc2")*100)).min(new Decimal("1e100")).plus(1))
  713. if (player.currentEternityChall == "eterc2") mult = mult.times(0)
  714.  
  715. if (ECTimesCompleted("eterc4") !== 0) mult = mult.times(player.infinityPoints.pow(0.003 + ECTimesCompleted("eterc4")*0.002).min(new Decimal("1e200")))
  716.  
  717. if (ECTimesCompleted("eterc9") !== 0) mult = mult.times(player.timeShards.pow(ECTimesCompleted("eterc9")*0.1).plus(1).min(new Decimal("1e400")))
  718.  
  719. if (mult.lt(0)) mult = new Decimal(0)
  720.  
  721. if (player.dilation.active) {
  722. mult = Decimal.pow(10, Math.pow(mult.log10(), 0.75))
  723. if (player.dilation.upgrades.includes(9)) {
  724. mult = Decimal.pow(10, Math.pow(mult.log10(), 1.05))
  725. }
  726. }
  727.  
  728. return mult
  729. }
  730.  
  731. function getDimensionProductionPerSecond(tier) {
  732. if (tier > 8) {
  733. if (player.achievements.includes("a13")) {
  734. return Decimal.mul(new Decimal(Decimal.log2(player.timeDimension8.amount.plus(1))).plus(1).dividedBy(player.eightAmount.plus(1).dividedBy(10)),Decimal.pow(0.1,tier-9)).times(10)
  735. } else {
  736. return new Decimal(0)
  737. }
  738. } else {
  739. let ret = Decimal.floor(player[TIER_NAMES[tier] + 'Amount']).times(getDimensionFinalMultiplier(tier)).times(1000).dividedBy(player.tickspeed)
  740. if (player.currentChallenge == "challenge7") {
  741. if (tier == 4) ret = player[TIER_NAMES[tier] + 'Amount'].floor().pow(1.3).times(getDimensionFinalMultiplier(tier)).dividedBy(player.tickspeed.dividedBy(1000))
  742. else if (tier == 2) ret = player[TIER_NAMES[tier] + 'Amount'].floor().pow(1.5).times(getDimensionFinalMultiplier(tier)).dividedBy(player.tickspeed.dividedBy(1000))
  743. }
  744. if (player.currentChallenge == "challenge2" || player.currentChallenge == "postc1") ret = ret.times(player.chall2Pow)
  745. if (player.dilation.active) {
  746. let tick = new Decimal(player.tickspeed)
  747. tick = Decimal.pow(10, Math.pow(Math.abs(tick.log10()), 0.75))
  748. if (player.dilation.upgrades.includes(9)) {
  749. tick = Decimal.pow(10, Math.pow(Math.abs(tick.log10()), 1.05))
  750. }
  751. tick = new Decimal(1).dividedBy(tick)
  752. ret = Decimal.floor(player[TIER_NAMES[tier] + 'Amount']).times(getDimensionFinalMultiplier(tier)).times(1000).dividedBy(tick)
  753. }
  754. return ret;
  755. }
  756. }
  757.  
  758. function giveAchievement(name) {
  759.  
  760. if (player.achievements.includes(name)){ clearOldAchieves(); }
  761.  
  762. if (player.achievements.includes(allAchievementNums[name])) return false
  763.  
  764. $.notify(name, "success");
  765. player.achievements.push(allAchievementNums[name]);
  766. if (!name.includes("a")) {
  767. document.getElementById(name).className = "achievementunlocked"
  768. }
  769. kong.submitStats('Achievements', player.achievements.length);
  770. if (name == "All your IP are belong to us" || name == "MAXIMUM OVERDRIVE") {
  771. player.infMult = player.infMult.times(4);
  772. player.autoIP = player.autoIP.times(4);
  773. if (player.autoCrunchMode == "amount" && player.autobuyers[11].priority != undefined) player.autobuyers[11].priority = player.autobuyers[11].priority.times(4);
  774. }
  775. updateAchievements();
  776. }
Add Comment
Please, Sign In to add comment