diff --git a/src/Calculate.ts b/src/Calculate.ts index 58181a0b8..b73605855 100644 --- a/src/Calculate.ts +++ b/src/Calculate.ts @@ -257,7 +257,7 @@ let lookupTableRuneExp: number[] | null = null // Returns the amount of exp required to level a rune export const calculateRuneExpToLevel = (runeIndex: number, runeLevel = player.runelevels[runeIndex]) => { - lookupTableRuneExp ??= Array.from({ length: 40000 }, (_, i) => lookupTableGen(i)) + lookupTableRuneExp ??= Array.from({ length: 40000 + 1 }, (_, i) => lookupTableGen(i)) // For runes 6 and 7 we will apply a special multiplier let multiplier = lookupTableRuneExp[runeLevel] @@ -1816,9 +1816,14 @@ export const calculateAscensionSpeedMultiplier = () => { // Singularity Penalty arr.push(1 / calculateSingularityDebuff('Ascension Speed')) + let multiplier = productContents(arr) + if (!isFinite(multiplier)) { + multiplier = 0 + } + return { list: arr, - mult: productContents(arr) + mult: multiplier } } @@ -2293,11 +2298,11 @@ export const CalcCorruptionStuff = () => { Math.floor(baseScore), corruptionMultiplier, Math.floor(effectiveScore), - Math.floor(cubeGain), - Math.max(player.singularityCount, Math.floor(tesseractGain)), - Math.floor(hypercubeGain), - Math.floor(platonicGain), - Math.floor(hepteractGain), + Math.min(1e300, Math.floor(cubeGain)), + Math.min(1e300, Math.max(player.singularityCount, Math.floor(tesseractGain))), + Math.min(1e300, Math.floor(hypercubeGain)), + Math.min(1e300, Math.floor(platonicGain)), + Math.min(1e300, Math.floor(hepteractGain)), bonusMultiplier ] } diff --git a/src/CheckVariables.ts b/src/CheckVariables.ts index f2fd477a8..4ae694eb7 100644 --- a/src/CheckVariables.ts +++ b/src/CheckVariables.ts @@ -622,12 +622,12 @@ export const checkVariablesOnLoad = (data: PlayerSave) => { ) player.worlds.add( 150 * shop.offeringAutoLevel + 25 / 2 * (shop.offeringAutoLevel - 1) * shop.offeringAutoLevel - - 150 * Math.min(1, shop.offeringAutoLevel), + - 150 * Math.min(1, shop.offeringAutoLevel), false ) player.worlds.add( 150 * shop.obtainiumAutoLevel + 25 / 2 * (shop.obtainiumAutoLevel - 1) * shop.obtainiumAutoLevel - - 150 * Math.min(1, shop.obtainiumAutoLevel), + - 150 * Math.min(1, shop.obtainiumAutoLevel), false ) player.worlds.add(100 * shop.cashGrabLevel + 100 / 2 * (shop.cashGrabLevel - 1) * shop.cashGrabLevel, false) @@ -720,17 +720,17 @@ export const checkVariablesOnLoad = (data: PlayerSave) => { player.loadedV253 = true player.worlds.add( 10000 * player.shopUpgrades.calculator - + 10000 / 2 * (player.shopUpgrades.calculator - 1) * (player.shopUpgrades.calculator), + + 10000 / 2 * (player.shopUpgrades.calculator - 1) * (player.shopUpgrades.calculator), false ) player.worlds.add( 10000 * player.shopUpgrades.calculator2 - + 5000 / 2 * (player.shopUpgrades.calculator2 - 1) * (player.shopUpgrades.calculator2), + + 5000 / 2 * (player.shopUpgrades.calculator2 - 1) * (player.shopUpgrades.calculator2), false ) player.worlds.add( 25000 * player.shopUpgrades.calculator3 - + 25000 / 2 * (player.shopUpgrades.calculator3 - 1) * (player.shopUpgrades.calculator3), + + 25000 / 2 * (player.shopUpgrades.calculator3 - 1) * (player.shopUpgrades.calculator3), false ) player.shopUpgrades.calculator = 0 @@ -744,7 +744,7 @@ export const checkVariablesOnLoad = (data: PlayerSave) => { player.loadedV255 = true player.worlds.add( 1000 * player.shopUpgrades.powderEX - + 1000 / 2 * (player.shopUpgrades.powderEX - 1) * (player.shopUpgrades.powderEX), + + 1000 / 2 * (player.shopUpgrades.powderEX - 1) * (player.shopUpgrades.powderEX), false ) player.shopUpgrades.powderEX = 0 @@ -824,7 +824,7 @@ export const checkVariablesOnLoad = (data: PlayerSave) => { if ( player.singularityUpgrades[k].maxLevel !== -1 && player.singularityUpgrades[k].level <= player.singularityUpgrades[k].maxLevel - && player.singularityUpgrades[k].goldenQuarksInvested !== cost + && player.singularityUpgrades[k].goldenQuarksInvested.toExponential(10) !== cost.toExponential(10) && player.singularityUpgrades[k].specialCostForm === 'Default' ) { player.singularityUpgrades[k].refund() diff --git a/src/Reset.ts b/src/Reset.ts index d235af0df..72fe98427 100644 --- a/src/Reset.ts +++ b/src/Reset.ts @@ -82,7 +82,7 @@ export const resetdetails = (input: resetNames) => { resetObtainiumText.textContent = '' } - ;(input === 'ascensionChallenge' || input === 'ascension' || input === 'singularity') + ; (input === 'ascensionChallenge' || input === 'ascension' || input === 'singularity') ? offeringImage.style.display = offeringText.style.display = 'none' : offeringImage.style.display = offeringText.style.display = 'block' @@ -590,6 +590,16 @@ export const reset = (input: resetNames, fast = false, from = 'unknown') => { player.antSacrificePoints = 0 player.antSacrificeTimer = 0 player.antSacrificeTimerReal = 0 + player.sacrificeTimer = 0 + // Ascension early automation timer + if (player.autoSacrificeToggle) { + player.sacrificeTimer = 0.9 + } + if (player.autoAntSacrifice && player.autoAntSacrificeMode === 2) { + player.antSacrificeTimer = Math.max(0, player.autoAntSacTimer - 0.1) + player.antSacrificeTimerReal = player.antSacrificeTimer + } + player.antUpgrades[12 - 1] = 0 for (let j = 61; j <= 80; j++) { player.upgrades[j] = 0 @@ -733,7 +743,7 @@ export const reset = (input: resetNames, fast = false, from = 'unknown') => { if (index >= 2 && index <= 9) { return Math.min( maxLevel * (player.challengecompletions[corrChallengeMinimum(index)] > 0 - || player.singularityUpgrades.platonicTau.getEffect().bonus + || player.singularityUpgrades.platonicTau.getEffect().bonus ? 1 : 0), curr diff --git a/src/Runes.ts b/src/Runes.ts index 7cea41280..96276c6b9 100644 --- a/src/Runes.ts +++ b/src/Runes.ts @@ -148,7 +148,7 @@ export const redeemShards = (runeIndexPlusOne: number, auto = false, cubeUpgrade const mult = fact.slice(1, fact.length).reduce((x, y) => x * y, 1) while (toSpendTotal > 0 && levelsAdded < levelsToAdd && player.runelevels[runeIndex] < maxLevel) { const exp = calculateRuneExpToLevel(runeIndex, player.runelevels[runeIndex]) - player.runeexp[runeIndex] - const expPerOff = (add + a * player.runelevels[runeIndex]) * mult + const expPerOff = Math.min(1e300, (add + a * player.runelevels[runeIndex]) * mult) let toSpend = Math.min(toSpendTotal, Math.ceil(exp / expPerOff)) if (isNaN(toSpend)) { toSpend = toSpendTotal @@ -177,7 +177,9 @@ export const redeemShards = (runeIndexPlusOne: number, auto = false, cubeUpgrade } } } - displayRuneInformation(runeIndexPlusOne) + if (!auto) { + displayRuneInformation(runeIndexPlusOne) + } } calculateRuneLevels() if (player.runeshards < 0 || !player.runeshards) { diff --git a/src/UpdateHTML.ts b/src/UpdateHTML.ts index a36c591f2..6f0b70d92 100644 --- a/src/UpdateHTML.ts +++ b/src/UpdateHTML.ts @@ -1098,7 +1098,11 @@ export const showCorruptionStatsLoadouts = () => { } const updateAscensionStats = () => { - const t = player.ascensionCounter + let t = player.ascensionCounter + // Division by 0 is not defined + if (t === 0) { + t = 1 + } const [cubes, tess, hyper, platonic, hepteract] = CalcCorruptionStuff().slice(4) const addedAsterisk = player.singularityUpgrades.oneMind.getEffect().bonus const fillers: Record = { diff --git a/src/singularity.ts b/src/singularity.ts index 6f87c3e23..cbb2dd1df 100644 --- a/src/singularity.ts +++ b/src/singularity.ts @@ -2203,6 +2203,9 @@ export const calculateSingularityDebuff = ( let constitutiveSingularityCount = singularityCount constitutiveSingularityCount -= player.shopUpgrades.shopSingularityPenaltyDebuff + if (constitutiveSingularityCount < 1) { + return 1 + } const effectiveSingularities = calculateEffectiveSingularities(constitutiveSingularityCount)