From 2757a6ba694cc1f97f4d10f463b19d870b8302e0 Mon Sep 17 00:00:00 2001 From: Pseudonian Date: Fri, 1 Mar 2024 07:07:03 -0500 Subject: [PATCH] Some additional Blueberry Upgrades --- Pictures/Default/BlueberryHyperflux.png | Bin 0 -> 395 bytes Pictures/Default/BlueberryObtainium.png | Bin 0 -> 502 bytes Pictures/Default/BlueberryOffering.png | Bin 0 -> 615 bytes Pictures/Legacy/BlueberryHyperflux.png | Bin 0 -> 395 bytes Pictures/Legacy/BlueberryObtainium.png | Bin 0 -> 502 bytes Pictures/Legacy/BlueberryOffering.png | Bin 0 -> 615 bytes Pictures/Monotonous/BlueberryHyperflux.png | Bin 0 -> 395 bytes Pictures/Monotonous/BlueberryObtainium.png | Bin 0 -> 502 bytes Pictures/Monotonous/BlueberryOffering.png | Bin 0 -> 615 bytes Pictures/Simplified/BlueberryHyperflux.png | Bin 0 -> 395 bytes Pictures/Simplified/BlueberryObtainium.png | Bin 0 -> 502 bytes Pictures/Simplified/BlueberryOffering.png | Bin 0 -> 615 bytes index.html | 13 +- src/BlueberryUpgrades.ts | 918 +-- src/Calculate.ts | 3470 ++++++----- src/CheckVariables.ts | 1546 +++-- src/Statistics.ts | 1935 +++--- src/Synergism.ts | 6382 ++++++++++++-------- src/singularity.ts | 2307 ++++--- translations/en.json | 15 + 20 files changed, 10228 insertions(+), 6358 deletions(-) create mode 100644 Pictures/Default/BlueberryHyperflux.png create mode 100644 Pictures/Default/BlueberryObtainium.png create mode 100644 Pictures/Default/BlueberryOffering.png create mode 100644 Pictures/Legacy/BlueberryHyperflux.png create mode 100644 Pictures/Legacy/BlueberryObtainium.png create mode 100644 Pictures/Legacy/BlueberryOffering.png create mode 100644 Pictures/Monotonous/BlueberryHyperflux.png create mode 100644 Pictures/Monotonous/BlueberryObtainium.png create mode 100644 Pictures/Monotonous/BlueberryOffering.png create mode 100644 Pictures/Simplified/BlueberryHyperflux.png create mode 100644 Pictures/Simplified/BlueberryObtainium.png create mode 100644 Pictures/Simplified/BlueberryOffering.png diff --git a/Pictures/Default/BlueberryHyperflux.png b/Pictures/Default/BlueberryHyperflux.png new file mode 100644 index 0000000000000000000000000000000000000000..56075f826c92e42106a1fd175b71e2cdfef27383 GIT binary patch literal 395 zcmV;60d)R}P)qJmekbUO%Mbu*yR_jM5M8Tqr;X$MUP{uA>GJ-(zDg8dFT8O$&qWWXDg zGv@lP+6Cw1;fz^_P|dw(!6t+zoDI>s=O#=+aszo)GMsC7^8xQu`>LKU_w(Xfj-v}X zp4|XF$5oXq-40|;0l*wW;EDw=sN@--Vp}E?7u!-Efx4F+7~GiV3>;^0V}{Itu`#os z)8GcIp!J5e_i_M?jahHZZD_;b#`G0J=QZgwpeFOtD%wBd;^ei}qF9Tz7-E>v#jzIM p446!)Z`UU|0K9$KMq%gOz%NO0Ut3sX;{pHx002ovPDHLkV1ho^tT6xp literal 0 HcmV?d00001 diff --git a/Pictures/Default/BlueberryObtainium.png b/Pictures/Default/BlueberryObtainium.png new file mode 100644 index 0000000000000000000000000000000000000000..3a0f9141f1a609f693a234f1106a7bc2fdf5bb07 GIT binary patch literal 502 zcmV(>Zl0f-Um=Y&_Pg#cIo0) zTH5BCG=pf)A^hVt&4t!n(ho`rwEVtY{&%IuYUx{Gg2@7adwnz!ob8@?1>}6#r$&r8lC}NxM-9IuZ0L*VeJKc zyjuZ!55W8uM5C-Mp|!ve4*b0blEDmsz%Gc3A72UVob3&u_0JyAdsKdp*_>;`U*Cal z6WF}uKAvA%fU(9Aw){5d@mC;-QwpW$NSqR@fC_I{Ygk+^MB>a1ISF;*Pd7&7om2j` z3&QYrwFUrV;Q+ualS4k6N5QxE1@10tv2n{Ba|j8q-+Rj(2hWHcfH7u3CoX5C0!iTj zz?_abG2H2x-U`sUoF-0DZbKQDVVyXjn1LWJCtuWqXMX0?1ysow3#gpyxpNA0TiidF z)5hHv51#=cgh7viq8q0uhmcCh*Shh@0!gBB{2^SQzD?~v;>J|Pw-}m^|HF_*2^mMz s8GZy&C1~&JOcnrMzD7L``q~Tp0uhTnVj1!KCjbBd07*qoM6N<$f~?8fSpWb4 literal 0 HcmV?d00001 diff --git a/Pictures/Default/BlueberryOffering.png b/Pictures/Default/BlueberryOffering.png new file mode 100644 index 0000000000000000000000000000000000000000..47263a0c5ab2c3063bfe8f3c1a81e30c94532c75 GIT binary patch literal 615 zcmV-t0+{`YP)KnjpRH_n$G&UgX;?&}x?2XI`+0|@jqb=km|9?zL>_qQ_az`_6J|;1o~RkZli@}O zUObnJh6bC$qk|Erp^Y$s>nL0TNR;94y(!$9KvF_qo34vXuw402`1eXFB_{A2GoNCX z!+sDS3^pY4z}XMdB^W26_pZ%w0ltK$o8j2Hz#p+WbwsE0>e&DQ002ovPDHLkV1iMH B8dU%Q literal 0 HcmV?d00001 diff --git a/Pictures/Legacy/BlueberryHyperflux.png b/Pictures/Legacy/BlueberryHyperflux.png new file mode 100644 index 0000000000000000000000000000000000000000..56075f826c92e42106a1fd175b71e2cdfef27383 GIT binary patch literal 395 zcmV;60d)R}P)qJmekbUO%Mbu*yR_jM5M8Tqr;X$MUP{uA>GJ-(zDg8dFT8O$&qWWXDg zGv@lP+6Cw1;fz^_P|dw(!6t+zoDI>s=O#=+aszo)GMsC7^8xQu`>LKU_w(Xfj-v}X zp4|XF$5oXq-40|;0l*wW;EDw=sN@--Vp}E?7u!-Efx4F+7~GiV3>;^0V}{Itu`#os z)8GcIp!J5e_i_M?jahHZZD_;b#`G0J=QZgwpeFOtD%wBd;^ei}qF9Tz7-E>v#jzIM p446!)Z`UU|0K9$KMq%gOz%NO0Ut3sX;{pHx002ovPDHLkV1ho^tT6xp literal 0 HcmV?d00001 diff --git a/Pictures/Legacy/BlueberryObtainium.png b/Pictures/Legacy/BlueberryObtainium.png new file mode 100644 index 0000000000000000000000000000000000000000..3a0f9141f1a609f693a234f1106a7bc2fdf5bb07 GIT binary patch literal 502 zcmV(>Zl0f-Um=Y&_Pg#cIo0) zTH5BCG=pf)A^hVt&4t!n(ho`rwEVtY{&%IuYUx{Gg2@7adwnz!ob8@?1>}6#r$&r8lC}NxM-9IuZ0L*VeJKc zyjuZ!55W8uM5C-Mp|!ve4*b0blEDmsz%Gc3A72UVob3&u_0JyAdsKdp*_>;`U*Cal z6WF}uKAvA%fU(9Aw){5d@mC;-QwpW$NSqR@fC_I{Ygk+^MB>a1ISF;*Pd7&7om2j` z3&QYrwFUrV;Q+ualS4k6N5QxE1@10tv2n{Ba|j8q-+Rj(2hWHcfH7u3CoX5C0!iTj zz?_abG2H2x-U`sUoF-0DZbKQDVVyXjn1LWJCtuWqXMX0?1ysow3#gpyxpNA0TiidF z)5hHv51#=cgh7viq8q0uhmcCh*Shh@0!gBB{2^SQzD?~v;>J|Pw-}m^|HF_*2^mMz s8GZy&C1~&JOcnrMzD7L``q~Tp0uhTnVj1!KCjbBd07*qoM6N<$f~?8fSpWb4 literal 0 HcmV?d00001 diff --git a/Pictures/Legacy/BlueberryOffering.png b/Pictures/Legacy/BlueberryOffering.png new file mode 100644 index 0000000000000000000000000000000000000000..47263a0c5ab2c3063bfe8f3c1a81e30c94532c75 GIT binary patch literal 615 zcmV-t0+{`YP)KnjpRH_n$G&UgX;?&}x?2XI`+0|@jqb=km|9?zL>_qQ_az`_6J|;1o~RkZli@}O zUObnJh6bC$qk|Erp^Y$s>nL0TNR;94y(!$9KvF_qo34vXuw402`1eXFB_{A2GoNCX z!+sDS3^pY4z}XMdB^W26_pZ%w0ltK$o8j2Hz#p+WbwsE0>e&DQ002ovPDHLkV1iMH B8dU%Q literal 0 HcmV?d00001 diff --git a/Pictures/Monotonous/BlueberryHyperflux.png b/Pictures/Monotonous/BlueberryHyperflux.png new file mode 100644 index 0000000000000000000000000000000000000000..56075f826c92e42106a1fd175b71e2cdfef27383 GIT binary patch literal 395 zcmV;60d)R}P)qJmekbUO%Mbu*yR_jM5M8Tqr;X$MUP{uA>GJ-(zDg8dFT8O$&qWWXDg zGv@lP+6Cw1;fz^_P|dw(!6t+zoDI>s=O#=+aszo)GMsC7^8xQu`>LKU_w(Xfj-v}X zp4|XF$5oXq-40|;0l*wW;EDw=sN@--Vp}E?7u!-Efx4F+7~GiV3>;^0V}{Itu`#os z)8GcIp!J5e_i_M?jahHZZD_;b#`G0J=QZgwpeFOtD%wBd;^ei}qF9Tz7-E>v#jzIM p446!)Z`UU|0K9$KMq%gOz%NO0Ut3sX;{pHx002ovPDHLkV1ho^tT6xp literal 0 HcmV?d00001 diff --git a/Pictures/Monotonous/BlueberryObtainium.png b/Pictures/Monotonous/BlueberryObtainium.png new file mode 100644 index 0000000000000000000000000000000000000000..3a0f9141f1a609f693a234f1106a7bc2fdf5bb07 GIT binary patch literal 502 zcmV(>Zl0f-Um=Y&_Pg#cIo0) zTH5BCG=pf)A^hVt&4t!n(ho`rwEVtY{&%IuYUx{Gg2@7adwnz!ob8@?1>}6#r$&r8lC}NxM-9IuZ0L*VeJKc zyjuZ!55W8uM5C-Mp|!ve4*b0blEDmsz%Gc3A72UVob3&u_0JyAdsKdp*_>;`U*Cal z6WF}uKAvA%fU(9Aw){5d@mC;-QwpW$NSqR@fC_I{Ygk+^MB>a1ISF;*Pd7&7om2j` z3&QYrwFUrV;Q+ualS4k6N5QxE1@10tv2n{Ba|j8q-+Rj(2hWHcfH7u3CoX5C0!iTj zz?_abG2H2x-U`sUoF-0DZbKQDVVyXjn1LWJCtuWqXMX0?1ysow3#gpyxpNA0TiidF z)5hHv51#=cgh7viq8q0uhmcCh*Shh@0!gBB{2^SQzD?~v;>J|Pw-}m^|HF_*2^mMz s8GZy&C1~&JOcnrMzD7L``q~Tp0uhTnVj1!KCjbBd07*qoM6N<$f~?8fSpWb4 literal 0 HcmV?d00001 diff --git a/Pictures/Monotonous/BlueberryOffering.png b/Pictures/Monotonous/BlueberryOffering.png new file mode 100644 index 0000000000000000000000000000000000000000..47263a0c5ab2c3063bfe8f3c1a81e30c94532c75 GIT binary patch literal 615 zcmV-t0+{`YP)KnjpRH_n$G&UgX;?&}x?2XI`+0|@jqb=km|9?zL>_qQ_az`_6J|;1o~RkZli@}O zUObnJh6bC$qk|Erp^Y$s>nL0TNR;94y(!$9KvF_qo34vXuw402`1eXFB_{A2GoNCX z!+sDS3^pY4z}XMdB^W26_pZ%w0ltK$o8j2Hz#p+WbwsE0>e&DQ002ovPDHLkV1iMH B8dU%Q literal 0 HcmV?d00001 diff --git a/Pictures/Simplified/BlueberryHyperflux.png b/Pictures/Simplified/BlueberryHyperflux.png new file mode 100644 index 0000000000000000000000000000000000000000..56075f826c92e42106a1fd175b71e2cdfef27383 GIT binary patch literal 395 zcmV;60d)R}P)qJmekbUO%Mbu*yR_jM5M8Tqr;X$MUP{uA>GJ-(zDg8dFT8O$&qWWXDg zGv@lP+6Cw1;fz^_P|dw(!6t+zoDI>s=O#=+aszo)GMsC7^8xQu`>LKU_w(Xfj-v}X zp4|XF$5oXq-40|;0l*wW;EDw=sN@--Vp}E?7u!-Efx4F+7~GiV3>;^0V}{Itu`#os z)8GcIp!J5e_i_M?jahHZZD_;b#`G0J=QZgwpeFOtD%wBd;^ei}qF9Tz7-E>v#jzIM p446!)Z`UU|0K9$KMq%gOz%NO0Ut3sX;{pHx002ovPDHLkV1ho^tT6xp literal 0 HcmV?d00001 diff --git a/Pictures/Simplified/BlueberryObtainium.png b/Pictures/Simplified/BlueberryObtainium.png new file mode 100644 index 0000000000000000000000000000000000000000..3a0f9141f1a609f693a234f1106a7bc2fdf5bb07 GIT binary patch literal 502 zcmV(>Zl0f-Um=Y&_Pg#cIo0) zTH5BCG=pf)A^hVt&4t!n(ho`rwEVtY{&%IuYUx{Gg2@7adwnz!ob8@?1>}6#r$&r8lC}NxM-9IuZ0L*VeJKc zyjuZ!55W8uM5C-Mp|!ve4*b0blEDmsz%Gc3A72UVob3&u_0JyAdsKdp*_>;`U*Cal z6WF}uKAvA%fU(9Aw){5d@mC;-QwpW$NSqR@fC_I{Ygk+^MB>a1ISF;*Pd7&7om2j` z3&QYrwFUrV;Q+ualS4k6N5QxE1@10tv2n{Ba|j8q-+Rj(2hWHcfH7u3CoX5C0!iTj zz?_abG2H2x-U`sUoF-0DZbKQDVVyXjn1LWJCtuWqXMX0?1ysow3#gpyxpNA0TiidF z)5hHv51#=cgh7viq8q0uhmcCh*Shh@0!gBB{2^SQzD?~v;>J|Pw-}m^|HF_*2^mMz s8GZy&C1~&JOcnrMzD7L``q~Tp0uhTnVj1!KCjbBd07*qoM6N<$f~?8fSpWb4 literal 0 HcmV?d00001 diff --git a/Pictures/Simplified/BlueberryOffering.png b/Pictures/Simplified/BlueberryOffering.png new file mode 100644 index 0000000000000000000000000000000000000000..47263a0c5ab2c3063bfe8f3c1a81e30c94532c75 GIT binary patch literal 615 zcmV-t0+{`YP)KnjpRH_n$G&UgX;?&}x?2XI`+0|@jqb=km|9?zL>_qQ_az`_6J|;1o~RkZli@}O zUObnJh6bC$qk|Erp^Y$s>nL0TNR;94y(!$9KvF_qo34vXuw402`1eXFB_{A2GoNCX z!+sDS3^pY4z}XMdB^W26_pZ%w0ltK$o8j2Hz#p+WbwsE0>e&DQ002ovPDHLkV1iMH B8dU%Q literal 0 HcmV?d00001 diff --git a/index.html b/index.html index 72ab391f6..c27c2e482 100644 --- a/index.html +++ b/index.html @@ -3114,7 +3114,8 @@

Artists

Citadel 2 [GQ]: 0

Cube Upgrade Cx4: 0

Offering Electrolosis [OC]: 0

-

Event: 0

+

RNG-Based Offering Multiplier: 0

+

Event: 0

TOTAL OFFERING MULTIPLIER: 0

@@ -4346,6 +4348,15 @@

Artists

+
+ +
+
+ +
+
+ +
diff --git a/src/BlueberryUpgrades.ts b/src/BlueberryUpgrades.ts index f06ea9ac3..4a1484b91 100644 --- a/src/BlueberryUpgrades.ts +++ b/src/BlueberryUpgrades.ts @@ -1,69 +1,72 @@ -import i18next from 'i18next' -import { DOMCacheGetOrSet } from './Cache/DOM' -import { DynamicUpgrade } from './DynamicUpgrade' -import type { IUpgradeData } from './DynamicUpgrade' -import { exportData, saveFilename } from './ImportExport' -import { format, player } from './Synergism' -import type { Player } from './types/Synergism' -import { Alert, Confirm, Prompt } from './UpdateHTML' -import { visualUpdateAmbrosia } from './UpdateVisuals' +import i18next from "i18next"; +import { DOMCacheGetOrSet } from "./Cache/DOM"; +import { DynamicUpgrade } from "./DynamicUpgrade"; +import type { IUpgradeData } from "./DynamicUpgrade"; +import { exportData, saveFilename } from "./ImportExport"; +import { format, player } from "./Synergism"; +import type { Player } from "./types/Synergism"; +import { Alert, Confirm, Prompt } from "./UpdateHTML"; +import { visualUpdateAmbrosia } from "./UpdateVisuals"; export type blueberryUpgradeNames = - | 'ambrosiaTutorial' - | 'ambrosiaQuarks1' - | 'ambrosiaCubes1' - | 'ambrosiaLuck1' - | 'ambrosiaCubeLuck1' - | 'ambrosiaQuarkLuck1' - | 'ambrosiaQuarkCube1' - | 'ambrosiaLuckCube1' - | 'ambrosiaCubeQuark1' - | 'ambrosiaLuckQuark1' - | 'ambrosiaQuarks2' - | 'ambrosiaCubes2' - | 'ambrosiaLuck2' - -export type BlueberryOpt = Partial> -export type BlueberryLoadoutMode = 'saveTree' | 'loadTree' - -export interface IBlueberryData extends Omit { - costFormula(this: void, level: number, baseCost: number): number - rewards(this: void, n: number): Record - blueberryCost: number - ambrosiaInvested?: number - blueberriesInvested?: number - prerequisites?: BlueberryOpt - cacheUpdates?: (() => void)[] // TODO: Improve this type signature -Plat + | "ambrosiaTutorial" + | "ambrosiaQuarks1" + | "ambrosiaCubes1" + | "ambrosiaLuck1" + | "ambrosiaCubeLuck1" + | "ambrosiaQuarkLuck1" + | "ambrosiaQuarkCube1" + | "ambrosiaLuckCube1" + | "ambrosiaCubeQuark1" + | "ambrosiaLuckQuark1" + | "ambrosiaQuarks2" + | "ambrosiaCubes2" + | "ambrosiaLuck2" + | "ambrosiaObtainium1" + | "ambrosiaOffering1"; + +export type BlueberryOpt = Partial>; +export type BlueberryLoadoutMode = "saveTree" | "loadTree"; + +export interface IBlueberryData + extends Omit { + costFormula(this: void, level: number, baseCost: number): number; + rewards(this: void, n: number): Record; + blueberryCost: number; + ambrosiaInvested?: number; + blueberriesInvested?: number; + prerequisites?: BlueberryOpt; + cacheUpdates?: (() => void)[]; // TODO: Improve this type signature -Plat } export class BlueberryUpgrade extends DynamicUpgrade { - readonly costFormula: (level: number, baseCost: number) => number - readonly rewards: (n: number) => Record - public ambrosiaInvested = 0 - public blueberriesInvested = 0 - public blueberryCost: number - readonly preRequisites: BlueberryOpt | undefined - readonly cacheUpdates: (() => void)[] | undefined - - constructor (data: IBlueberryData, key: string) { - const name = i18next.t(`ambrosia.data.${key}.name`) - const description = i18next.t(`ambrosia.data.${key}.description`) - - super({ ...data, name, description }) - this.blueberryCost = data.blueberryCost - this.costFormula = data.costFormula - this.rewards = data.rewards - this.ambrosiaInvested = data.ambrosiaInvested ?? 0 - this.blueberriesInvested = data.blueberriesInvested ?? 0 - this.preRequisites = data.prerequisites ?? undefined - this.cacheUpdates = data.cacheUpdates ?? undefined + readonly costFormula: (level: number, baseCost: number) => number; + readonly rewards: (n: number) => Record; + public ambrosiaInvested = 0; + public blueberriesInvested = 0; + public blueberryCost: number; + readonly preRequisites: BlueberryOpt | undefined; + readonly cacheUpdates: (() => void)[] | undefined; + + constructor(data: IBlueberryData, key: string) { + const name = i18next.t(`ambrosia.data.${key}.name`); + const description = i18next.t(`ambrosia.data.${key}.description`); + + super({ ...data, name, description }); + this.blueberryCost = data.blueberryCost; + this.costFormula = data.costFormula; + this.rewards = data.rewards; + this.ambrosiaInvested = data.ambrosiaInvested ?? 0; + this.blueberriesInvested = data.blueberriesInvested ?? 0; + this.preRequisites = data.prerequisites ?? undefined; + this.cacheUpdates = data.cacheUpdates ?? undefined; } - getCostTNL (): number { + getCostTNL(): number { if (this.level === this.maxLevel) { - return 0 + return 0; } - return this.costFormula(this.level, this.costPerLevel) + return this.costFormula(this.level, this.costPerLevel); } /** @@ -71,665 +74,868 @@ export class BlueberryUpgrade extends DynamicUpgrade { * @returns An alert indicating cannot afford, already maxed or purchased with how many * levels purchased */ - public async buyLevel (event: MouseEvent): Promise { - let purchased = 0 - let maxPurchasable = 1 - let ambrosiaBudget = player.ambrosia + public async buyLevel(event: MouseEvent): Promise { + let purchased = 0; + let maxPurchasable = 1; + let ambrosiaBudget = player.ambrosia; if (!this.checkPrerequisites()) { - return Alert(i18next.t('ambrosia.prereqNotMetAlert')) + return Alert(i18next.t("ambrosia.prereqNotMetAlert")); } if (event.shiftKey) { - maxPurchasable = 1000000 + maxPurchasable = 1000000; const buy = Number( - await Prompt(i18next.t('ambrosia.ambrosiaBuyPrompt', { amount: format(player.ambrosia, 0, true) })) - ) + await Prompt( + i18next.t("ambrosia.ambrosiaBuyPrompt", { + amount: format(player.ambrosia, 0, true), + }) + ) + ); - if (isNaN(buy) || !isFinite(buy) || !Number.isInteger(buy)) { // nan + Infinity checks - return Alert(i18next.t('general.validation.finite')) + if (isNaN(buy) || !isFinite(buy) || !Number.isInteger(buy)) { + // nan + Infinity checks + return Alert(i18next.t("general.validation.finite")); } if (buy === -1) { - ambrosiaBudget = player.ambrosia + ambrosiaBudget = player.ambrosia; } else if (buy <= 0) { - return Alert(i18next.t('octeract.buyLevel.cancelPurchase')) // For some reason this is in the Octeract section (???) + return Alert(i18next.t("octeract.buyLevel.cancelPurchase")); // For some reason this is in the Octeract section (???) } else { - ambrosiaBudget = buy + ambrosiaBudget = buy; } - ambrosiaBudget = Math.min(player.ambrosia, ambrosiaBudget) + ambrosiaBudget = Math.min(player.ambrosia, ambrosiaBudget); } if (this.maxLevel > 0) { - maxPurchasable = Math.min(maxPurchasable, this.maxLevel - this.level) + maxPurchasable = Math.min(maxPurchasable, this.maxLevel - this.level); } if (maxPurchasable === 0) { - return Alert(i18next.t('octeract.buyLevel.alreadyMax')) // Once again + return Alert(i18next.t("octeract.buyLevel.alreadyMax")); // Once again } while (maxPurchasable > 0) { - const cost = this.getCostTNL() + const cost = this.getCostTNL(); if (player.ambrosia < cost || ambrosiaBudget < cost) { - break + break; } else { if (this.level === 0) { - const availableBlueberries = player.caches.blueberryInventory.totalVal - player.spentBlueberries + const availableBlueberries = + player.caches.blueberryInventory.totalVal - player.spentBlueberries; if (availableBlueberries < this.blueberryCost) { - return Alert(i18next.t('ambrosia.notEnoughBlueberries')) + return Alert(i18next.t("ambrosia.notEnoughBlueberries")); } else { - player.spentBlueberries += this.blueberryCost - this.blueberriesInvested = this.blueberryCost + player.spentBlueberries += this.blueberryCost; + this.blueberriesInvested = this.blueberryCost; } } - player.ambrosia -= cost - ambrosiaBudget -= cost - this.ambrosiaInvested += cost - this.level += 1 - purchased += 1 - maxPurchasable -= 1 + player.ambrosia -= cost; + ambrosiaBudget -= cost; + this.ambrosiaInvested += cost; + this.level += 1; + purchased += 1; + maxPurchasable -= 1; } } if (purchased === 0) { - return Alert(i18next.t('octeract.buyLevel.cannotAfford')) + return Alert(i18next.t("octeract.buyLevel.cannotAfford")); } if (purchased > 1) { - return Alert(`${i18next.t('octeract.buyLevel.multiBuy', { n: format(purchased) })}`) + return Alert( + `${i18next.t("octeract.buyLevel.multiBuy", { n: format(purchased) })}` + ); } - this.updateUpgradeHTML() - this.updateCaches() + this.updateUpgradeHTML(); + this.updateCaches(); } - toString (): string { - const costNextLevel = this.getCostTNL() - const maxLevel = this.maxLevel === -1 - ? '' - : `/${format(this.maxLevel, 0, true)}` - const isMaxLevel = this.maxLevel === this.level - const color = isMaxLevel ? 'plum' : 'white' - - let freeLevelInfo = this.freeLevels > 0 - ? ` [+${format(this.freeLevels, 1, true)}]` - : '' + toString(): string { + const costNextLevel = this.getCostTNL(); + const maxLevel = + this.maxLevel === -1 ? "" : `/${format(this.maxLevel, 0, true)}`; + const isMaxLevel = this.maxLevel === this.level; + const color = isMaxLevel ? "plum" : "white"; + + let freeLevelInfo = + this.freeLevels > 0 + ? ` [+${format( + this.freeLevels, + 1, + true + )}]` + : ""; if (this.freeLevels > this.level) { - freeLevelInfo = `${freeLevelInfo}${ - i18next.t('general.softCapped') - }` + freeLevelInfo = `${freeLevelInfo}${i18next.t( + "general.softCapped" + )}`; } - const isAffordable = costNextLevel <= player.ambrosia + const isAffordable = costNextLevel <= player.ambrosia; const affordableInfo = isMaxLevel - ? ` ${i18next.t('general.maxed')}` + ? ` ${i18next.t("general.maxed")}` : isAffordable - ? ` ${i18next.t('general.affordable')}` - : ` ${i18next.t('octeract.buyLevel.cannotAfford')}` - - let preReqText = i18next.t('ambrosia.prerequisite') + ? ` ${i18next.t( + "general.affordable" + )}` + : ` ${i18next.t( + "octeract.buyLevel.cannotAfford" + )}`; + + let preReqText = i18next.t("ambrosia.prerequisite"); if (this.preRequisites !== undefined) { for (const [prereq, val] of Object.entries(this.preRequisites)) { - const k = prereq as keyof Player['blueberryUpgrades'] - const color = (player.blueberryUpgrades[k].level >= val) ? 'green' : 'red' - const met = (player.blueberryUpgrades[k].level >= val) ? '' : i18next.t('ambrosia.prereqNotMet') - preReqText = `${preReqText} ${ - player.blueberryUpgrades[k].name - } lv.${val} ${met} |` + const k = prereq as keyof Player["blueberryUpgrades"]; + const color = + player.blueberryUpgrades[k].level >= val ? "green" : "red"; + const met = + player.blueberryUpgrades[k].level >= val + ? "" + : i18next.t("ambrosia.prereqNotMet"); + preReqText = `${preReqText} ${player.blueberryUpgrades[k].name} lv.${val} ${met} |`; } - preReqText = preReqText.slice(0, -1) + preReqText = preReqText.slice(0, -1); } return `${this.name} ${preReqText} ${this.description} - ${i18next.t('general.level')} ${ - format(this.level, 0, true) - }${maxLevel}${freeLevelInfo} + ${i18next.t( + "general.level" + )} ${format(this.level, 0, true)}${maxLevel}${freeLevelInfo} ${this.rewardDesc} - ${i18next.t('octeract.toString.costNextLevel')}: ${ - format(costNextLevel, 2, true, true, true) - } ${i18next.t('ambrosia.ambrosia')} ${affordableInfo} - ${i18next.t('ambrosia.blueberryCost')} ${this.blueberryCost} - ${i18next.t('general.spent')} ${i18next.t('ambrosia.ambrosia')}: ${ - format(this.ambrosiaInvested, 2, true, true, true) - }` + ${i18next.t( + "octeract.toString.costNextLevel" + )}: ${format( + costNextLevel, + 2, + true, + true, + true + )} ${i18next.t("ambrosia.ambrosia")} ${affordableInfo} + ${i18next.t( + "ambrosia.blueberryCost" + )} ${this.blueberryCost} + ${i18next.t("general.spent")} ${i18next.t( + "ambrosia.ambrosia" + )}: ${format( + this.ambrosiaInvested, + 2, + true, + true, + true + )}`; } - updateUpgradeHTML (): void { - DOMCacheGetOrSet('singularityAmbrosiaMultiline').innerHTML = this.toString() - visualUpdateAmbrosia() + updateUpgradeHTML(): void { + DOMCacheGetOrSet("singularityAmbrosiaMultiline").innerHTML = + this.toString(); + visualUpdateAmbrosia(); } - checkPrerequisites (): boolean { + checkPrerequisites(): boolean { if (this.preRequisites !== undefined) { for (const [prereq, val] of Object.entries(this.preRequisites)) { - const k = prereq as keyof Player['blueberryUpgrades'] + const k = prereq as keyof Player["blueberryUpgrades"]; if (player.blueberryUpgrades[k].level < val) { - return false + return false; } } } - return true + return true; } - updateCaches (): void { + updateCaches(): void { if (this.cacheUpdates !== undefined) { for (const cache of this.cacheUpdates) { - cache() + cache(); } } } - refund (): void { - player.ambrosia += this.ambrosiaInvested - this.ambrosiaInvested = 0 - this.level = 0 + refund(): void { + player.ambrosia += this.ambrosiaInvested; + this.ambrosiaInvested = 0; + this.level = 0; - player.spentBlueberries -= this.blueberriesInvested - this.blueberriesInvested = 0 + player.spentBlueberries -= this.blueberriesInvested; + this.blueberriesInvested = 0; } - public get rewardDesc (): string { - if ('desc' in this.rewards(0)) { - return String(this.rewards(this.level).desc) + public get rewardDesc(): string { + if ("desc" in this.rewards(0)) { + return String(this.rewards(this.level).desc); } else { - return 'Contact Platonic or Khafra if you see this (should never occur!)' + return "Contact Platonic or Khafra if you see this (should never occur!)"; } } - public get bonus () { - return this.rewards(this.level) + public get bonus() { + return this.rewards(this.level); } } -export const blueberryUpgradeData: Record = { +export const blueberryUpgradeData: Record< + keyof Player["blueberryUpgrades"], + IBlueberryData +> = { ambrosiaTutorial: { maxLevel: 10, costPerLevel: 1, blueberryCost: 0, costFormula: (level: number, baseCost: number): number => { - return baseCost * (Math.pow(level + 1, 2) - Math.pow(level, 2)) + return baseCost * (Math.pow(level + 1, 2) - Math.pow(level, 2)); }, rewards: (n: number) => { - const cubeAmount = 1 + 0.05 * n - const quarkAmount = 1 + 0.01 * n + const cubeAmount = 1 + 0.05 * n; + const quarkAmount = 1 + 0.01 * n; return { quarks: quarkAmount, cubes: cubeAmount, desc: String( - i18next.t('ambrosia.data.ambrosiaTutorial.effect', { + i18next.t("ambrosia.data.ambrosiaTutorial.effect", { cubeAmount: format(100 * (cubeAmount - 1), 0, true), - quarkAmount: format(100 * (quarkAmount - 1), 0, true) + quarkAmount: format(100 * (quarkAmount - 1), 0, true), }) - ) - } - } + ), + }; + }, }, ambrosiaQuarks1: { maxLevel: 100, costPerLevel: 1, blueberryCost: 0, costFormula: (level: number, baseCost: number): number => { - return baseCost * (Math.pow(level + 1, 3) - Math.pow(level, 3)) + return baseCost * (Math.pow(level + 1, 3) - Math.pow(level, 3)); }, rewards: (n: number) => { - const quarkAmount = 1 + 0.01 * n + const quarkAmount = 1 + 0.01 * n; return { quarks: quarkAmount, desc: String( - i18next.t('ambrosia.data.ambrosiaQuarks1.effect', { amount: format(100 * (quarkAmount - 1), 0, true) }) - ) - } + i18next.t("ambrosia.data.ambrosiaQuarks1.effect", { + amount: format(100 * (quarkAmount - 1), 0, true), + }) + ), + }; }, prerequisites: { - ambrosiaTutorial: 10 - } + ambrosiaTutorial: 10, + }, }, ambrosiaCubes1: { maxLevel: 100, costPerLevel: 1, blueberryCost: 0, costFormula: (level: number, baseCost: number): number => { - return baseCost * (Math.pow(level + 1, 3) - Math.pow(level, 3)) + return baseCost * (Math.pow(level + 1, 3) - Math.pow(level, 3)); }, rewards: (n: number) => { - const cubeAmount = (1 + 0.05 * n) * Math.pow(1.1, Math.floor(n / 10)) + const cubeAmount = (1 + 0.05 * n) * Math.pow(1.1, Math.floor(n / 10)); return { cubes: cubeAmount, desc: String( - i18next.t('ambrosia.data.ambrosiaCubes1.effect', { amount: format(100 * (cubeAmount - 1), 2, true) }) - ) - } + i18next.t("ambrosia.data.ambrosiaCubes1.effect", { + amount: format(100 * (cubeAmount - 1), 2, true), + }) + ), + }; }, prerequisites: { - ambrosiaTutorial: 10 - } + ambrosiaTutorial: 10, + }, }, ambrosiaLuck1: { maxLevel: 100, costPerLevel: 1, blueberryCost: 0, costFormula: (level: number, baseCost: number): number => { - return baseCost * (Math.pow(level + 1, 3) - Math.pow(level, 3)) + return baseCost * (Math.pow(level + 1, 3) - Math.pow(level, 3)); }, rewards: (n: number) => { - const val = 2 * n + 12 * Math.floor(n / 10) + const val = 2 * n + 12 * Math.floor(n / 10); return { ambrosiaLuck: val, - desc: String(i18next.t('ambrosia.data.ambrosiaLuck1.effect', { amount: format(val) })) - } + desc: String( + i18next.t("ambrosia.data.ambrosiaLuck1.effect", { + amount: format(val), + }) + ), + }; }, prerequisites: { - ambrosiaTutorial: 10 + ambrosiaTutorial: 10, }, cacheUpdates: [ - () => player.caches.ambrosiaLuck.updateVal('BlueberryUpgrade1'), - () => player.caches.ambrosiaLuck.updateVal('BlueberryUpgrade2') - ] + () => player.caches.ambrosiaLuck.updateVal("BlueberryUpgrade1"), + () => player.caches.ambrosiaLuck.updateVal("BlueberryUpgrade2"), + ], }, ambrosiaQuarkCube1: { maxLevel: 25, costPerLevel: 250, blueberryCost: 1, costFormula: (level: number, baseCost: number): number => { - return baseCost * (Math.pow(level + 1, 3) - Math.pow(level, 3)) + return baseCost * (Math.pow(level + 1, 3) - Math.pow(level, 3)); }, rewards: (n: number) => { - const baseVal = 0.0005 * n - const val = 1 + baseVal * Math.floor(Math.pow(Math.log10(Number(player.worlds) + 1) + 1, 2)) + const baseVal = 0.0005 * n; + const val = + 1 + + baseVal * + Math.floor(Math.pow(Math.log10(Number(player.worlds) + 1) + 1, 2)); return { cubes: val, - desc: String(i18next.t('ambrosia.data.ambrosiaQuarkCube1.effect', { amount: format(100 * (val - 1), 2, true) })) - } + desc: String( + i18next.t("ambrosia.data.ambrosiaQuarkCube1.effect", { + amount: format(100 * (val - 1), 2, true), + }) + ), + }; }, prerequisites: { ambrosiaCubes1: 30, - ambrosiaQuarks1: 20 - } + ambrosiaQuarks1: 20, + }, }, ambrosiaLuckCube1: { maxLevel: 25, costPerLevel: 250, blueberryCost: 1, costFormula: (level: number, baseCost: number): number => { - return baseCost * (Math.pow(level + 1, 3) - Math.pow(level, 3)) + return baseCost * (Math.pow(level + 1, 3) - Math.pow(level, 3)); }, rewards: (n: number) => { - const baseVal = 0.0002 * n - const val = 1 + baseVal * player.caches.ambrosiaLuck.totalVal + const baseVal = 0.0002 * n; + const val = 1 + baseVal * player.caches.ambrosiaLuck.totalVal; return { cubes: val, - desc: String(i18next.t('ambrosia.data.ambrosiaLuckCube1.effect', { amount: format(100 * (val - 1), 2, true) })) - } + desc: String( + i18next.t("ambrosia.data.ambrosiaLuckCube1.effect", { + amount: format(100 * (val - 1), 2, true), + }) + ), + }; }, prerequisites: { ambrosiaCubes1: 30, - ambrosiaLuck1: 20 - } + ambrosiaLuck1: 20, + }, }, ambrosiaCubeQuark1: { maxLevel: 25, costPerLevel: 500, blueberryCost: 1, costFormula: (level: number, baseCost: number): number => { - return baseCost * (Math.pow(level + 1, 3) - Math.pow(level, 3)) + return baseCost * (Math.pow(level + 1, 3) - Math.pow(level, 3)); }, rewards: (n: number) => { - const baseVal = 0.0001 * n - const val = 1 + baseVal * (Math.floor(Math.log10(Number(player.wowCubes) + 1)) - + Math.floor(Math.log10(Number(player.wowTesseracts) + 1)) - + Math.floor(Math.log10(Number(player.wowHypercubes) + 1)) - + Math.floor(Math.log10(Number(player.wowPlatonicCubes) + 1)) - + Math.floor(Math.log10(player.wowAbyssals + 1)) - + Math.floor(Math.log10(player.wowOcteracts + 1)) + 6) + const baseVal = 0.0001 * n; + const val = + 1 + + baseVal * + (Math.floor(Math.log10(Number(player.wowCubes) + 1)) + + Math.floor(Math.log10(Number(player.wowTesseracts) + 1)) + + Math.floor(Math.log10(Number(player.wowHypercubes) + 1)) + + Math.floor(Math.log10(Number(player.wowPlatonicCubes) + 1)) + + Math.floor(Math.log10(player.wowAbyssals + 1)) + + Math.floor(Math.log10(player.wowOcteracts + 1)) + + 6); return { quarks: val, - desc: String(i18next.t('ambrosia.data.ambrosiaCubeQuark1.effect', { amount: format(100 * (val - 1), 2, true) })) - } + desc: String( + i18next.t("ambrosia.data.ambrosiaCubeQuark1.effect", { + amount: format(100 * (val - 1), 2, true), + }) + ), + }; }, prerequisites: { ambrosiaQuarks1: 30, - ambrosiaCubes1: 20 - } + ambrosiaCubes1: 20, + }, }, ambrosiaLuckQuark1: { maxLevel: 25, costPerLevel: 500, blueberryCost: 1, costFormula: (level: number, baseCost: number): number => { - return baseCost * (Math.pow(level + 1, 3) - Math.pow(level, 3)) + return baseCost * (Math.pow(level + 1, 3) - Math.pow(level, 3)); }, rewards: (n: number) => { - const baseVal = 0.0001 * n + const baseVal = 0.0001 * n; const effectiveLuck = Math.min( player.caches.ambrosiaLuck.totalVal, Math.pow(1000, 0.5) * Math.pow(player.caches.ambrosiaLuck.totalVal, 0.5) - ) - const val = 1 + baseVal * effectiveLuck + ); + const val = 1 + baseVal * effectiveLuck; return { quarks: val, - desc: String(i18next.t('ambrosia.data.ambrosiaLuckQuark1.effect', { amount: format(100 * (val - 1), 2, true) })) - } + desc: String( + i18next.t("ambrosia.data.ambrosiaLuckQuark1.effect", { + amount: format(100 * (val - 1), 2, true), + }) + ), + }; }, prerequisites: { ambrosiaQuarks1: 30, - ambrosiaLuck1: 20 - } + ambrosiaLuck1: 20, + }, }, ambrosiaCubeLuck1: { maxLevel: 25, costPerLevel: 100, blueberryCost: 1, costFormula: (level: number, baseCost: number): number => { - return baseCost * (Math.pow(level + 1, 3) - Math.pow(level, 3)) + return baseCost * (Math.pow(level + 1, 3) - Math.pow(level, 3)); }, rewards: (n: number) => { - const baseVal = 0.02 * n - const val = baseVal * (Math.floor(Math.log10(Number(player.wowCubes) + 1)) - + Math.floor(Math.log10(Number(player.wowTesseracts) + 1)) - + Math.floor(Math.log10(Number(player.wowHypercubes) + 1)) - + Math.floor(Math.log10(Number(player.wowPlatonicCubes) + 1)) - + Math.floor(Math.log10(player.wowAbyssals + 1)) - + Math.floor(Math.log10(player.wowOcteracts + 1)) + 6) + const baseVal = 0.02 * n; + const val = + baseVal * + (Math.floor(Math.log10(Number(player.wowCubes) + 1)) + + Math.floor(Math.log10(Number(player.wowTesseracts) + 1)) + + Math.floor(Math.log10(Number(player.wowHypercubes) + 1)) + + Math.floor(Math.log10(Number(player.wowPlatonicCubes) + 1)) + + Math.floor(Math.log10(player.wowAbyssals + 1)) + + Math.floor(Math.log10(player.wowOcteracts + 1)) + + 6); return { ambrosiaLuck: val, - desc: String(i18next.t('ambrosia.data.ambrosiaCubeLuck1.effect', { amount: format(val, 2, true) })) - } + desc: String( + i18next.t("ambrosia.data.ambrosiaCubeLuck1.effect", { + amount: format(val, 2, true), + }) + ), + }; }, prerequisites: { ambrosiaLuck1: 30, - ambrosiaCubes1: 20 + ambrosiaCubes1: 20, }, - cacheUpdates: [() => player.caches.ambrosiaLuck.updateVal('BlueberryCubeLuck1')] + cacheUpdates: [ + () => player.caches.ambrosiaLuck.updateVal("BlueberryCubeLuck1"), + ], }, ambrosiaQuarkLuck1: { maxLevel: 25, costPerLevel: 100, blueberryCost: 1, costFormula: (level: number, baseCost: number): number => { - return baseCost * (Math.pow(level + 1, 3) - Math.pow(level, 3)) + return baseCost * (Math.pow(level + 1, 3) - Math.pow(level, 3)); }, rewards: (n: number) => { - const baseVal = 0.02 * n - const val = baseVal * Math.floor(Math.pow(Math.log10(Number(player.worlds) + 1) + 1, 2)) + const baseVal = 0.02 * n; + const val = + baseVal * + Math.floor(Math.pow(Math.log10(Number(player.worlds) + 1) + 1, 2)); return { ambrosiaLuck: val, - desc: String(i18next.t('ambrosia.data.ambrosiaQuarkLuck1.effect', { amount: format(val, 2, true) })) - } + desc: String( + i18next.t("ambrosia.data.ambrosiaQuarkLuck1.effect", { + amount: format(val, 2, true), + }) + ), + }; }, prerequisites: { ambrosiaLuck1: 30, - ambrosiaQuarks1: 20 + ambrosiaQuarks1: 20, }, - cacheUpdates: [() => player.caches.ambrosiaLuck.updateVal('BlueberryQuarkLuck1')] + cacheUpdates: [ + () => player.caches.ambrosiaLuck.updateVal("BlueberryQuarkLuck1"), + ], }, ambrosiaQuarks2: { maxLevel: 100, costPerLevel: 500, blueberryCost: 1, costFormula: (level: number, baseCost: number): number => { - return baseCost * (Math.pow(level + 1, 2) - Math.pow(level, 2)) + return baseCost * (Math.pow(level + 1, 2) - Math.pow(level, 2)); }, rewards: (n: number) => { - const quarkAmount = 1 + (0.01 + Math.floor(player.blueberryUpgrades.ambrosiaQuarks1.level / 10) / 1000) * n + const quarkAmount = + 1 + + (0.01 + + Math.floor(player.blueberryUpgrades.ambrosiaQuarks1.level / 10) / + 1000) * + n; return { quarks: quarkAmount, desc: String( - i18next.t('ambrosia.data.ambrosiaQuarks2.effect', { amount: format(100 * (quarkAmount - 1), 0, true) }) - ) - } + i18next.t("ambrosia.data.ambrosiaQuarks2.effect", { + amount: format(100 * (quarkAmount - 1), 0, true), + }) + ), + }; }, prerequisites: { - ambrosiaQuarks1: 40 - } + ambrosiaQuarks1: 40, + }, }, ambrosiaCubes2: { maxLevel: 100, costPerLevel: 500, blueberryCost: 1, costFormula: (level: number, baseCost: number): number => { - return baseCost * (Math.pow(level + 1, 2) - Math.pow(level, 2)) + return baseCost * (Math.pow(level + 1, 2) - Math.pow(level, 2)); }, rewards: (n: number) => { - const cubeAmount = (1 + (0.06 + 6 * (Math.floor(player.blueberryUpgrades.ambrosiaCubes1.level / 10) / 1000)) * n) - * Math.pow(1.13, Math.floor(n / 10)) + const cubeAmount = + (1 + + (0.06 + + 6 * + (Math.floor(player.blueberryUpgrades.ambrosiaCubes1.level / 10) / + 1000)) * + n) * + Math.pow(1.13, Math.floor(n / 10)); return { cubes: cubeAmount, desc: String( - i18next.t('ambrosia.data.ambrosiaCubes2.effect', { amount: format(100 * (cubeAmount - 1), 2, true) }) - ) - } + i18next.t("ambrosia.data.ambrosiaCubes2.effect", { + amount: format(100 * (cubeAmount - 1), 2, true), + }) + ), + }; }, prerequisites: { - ambrosiaCubes1: 40 - } + ambrosiaCubes1: 40, + }, }, ambrosiaLuck2: { maxLevel: 100, costPerLevel: 250, blueberryCost: 1, costFormula: (level: number, baseCost: number): number => { - return baseCost * (Math.pow(level + 1, 2) - Math.pow(level, 2)) + return baseCost * (Math.pow(level + 1, 2) - Math.pow(level, 2)); }, rewards: (n: number) => { - const val = (3 + 0.3 * Math.floor(player.blueberryUpgrades.ambrosiaLuck1.level / 10)) * n - + 40 * Math.floor(n / 10) + const val = + (3 + + 0.3 * Math.floor(player.blueberryUpgrades.ambrosiaLuck1.level / 10)) * + n + + 40 * Math.floor(n / 10); return { ambrosiaLuck: val, - desc: String(i18next.t('ambrosia.data.ambrosiaLuck2.effect', { amount: format(val, 1, true) })) - } + desc: String( + i18next.t("ambrosia.data.ambrosiaLuck2.effect", { + amount: format(val, 1, true), + }) + ), + }; }, prerequisites: { - ambrosiaLuck1: 40 + ambrosiaLuck1: 40, }, - cacheUpdates: [() => player.caches.ambrosiaLuck.updateVal('BlueberryUpgrade2')] + cacheUpdates: [ + () => player.caches.ambrosiaLuck.updateVal("BlueberryUpgrade2"), + ], }, ambrosiaPatreon: { maxLevel: 1, costPerLevel: 1, blueberryCost: 0, costFormula: (level: number, baseCost: number): number => { - return baseCost * (Math.pow(level + 1, 2) - Math.pow(level, 2)) + return baseCost * (Math.pow(level + 1, 2) - Math.pow(level, 2)); }, rewards: (n: number) => { - const val = 1 + n * player.worlds.BONUS / 100 + const val = 1 + (n * player.worlds.BONUS) / 100; return { blueberryGeneration: val, - desc: String(i18next.t('ambrosia.data.ambrosiaPatreon.effect', { amount: format(100 * (val - 1), 0, true) })) - } + desc: String( + i18next.t("ambrosia.data.ambrosiaPatreon.effect", { + amount: format(100 * (val - 1), 0, true), + }) + ), + }; }, - cacheUpdates: [() => player.caches.ambrosiaGeneration.updateVal('BlueberryPatreon')] - } -} + cacheUpdates: [ + () => player.caches.ambrosiaGeneration.updateVal("BlueberryPatreon"), + ], + }, + ambrosiaObtainium1: { + maxLevel: 1, + costPerLevel: 50000, + blueberryCost: 1, + costFormula: (level: number, baseCost: number): number => { + return baseCost + 0 * level; + }, + rewards: (n: number) => { + const luck = player.caches.ambrosiaLuck.totalVal; + return { + luckMult: n, + obtainiumMult: n * luck, + desc: String( + i18next.t("ambrosia.data.ambrosiaObtainium1.effect", { + amount: format((n * luck) / 10, 1, true), + }) + ), + }; + }, + }, + ambrosiaOffering1: { + maxLevel: 1, + costPerLevel: 50000, + blueberryCost: 1, + costFormula: (level: number, baseCost: number): number => { + return baseCost + 0 * level; + }, + rewards: (n: number) => { + const luck = player.caches.ambrosiaLuck.totalVal; + return { + luckMult: n, + offeringMult: n * luck, + desc: String( + i18next.t("ambrosia.data.ambrosiaOffering1.effect", { + amount: format((n * luck) / 10, 1, true), + }) + ), + }; + }, + }, + ambrosiaHyperflux: { + maxLevel: 5, + costPerLevel: 33333, + blueberryCost: 3, + costFormula: (level: number, baseCost: number): number => { + return baseCost + 33333 * level; + }, + rewards: (n: number) => { + const fourByFourBase = n; + return { + hyperFlux: Math.pow( + 1 + (1 / 100) * fourByFourBase, + player.platonicUpgrades[19] + ), + desc: String( + i18next.t("ambrosia.data.ambrosiaHyperflux.effect", { + amount: format( + 100 * + (Math.pow( + 1 + fourByFourBase / 100, + player.platonicUpgrades[19] + ) - + 1) + ), + }) + ), + }; + }, + }, +}; export const resetBlueberryTree = async (giveAlert = true) => { for (const upgrade of Object.keys(player.blueberryUpgrades)) { - const k = upgrade as keyof Player['blueberryUpgrades'] - player.blueberryUpgrades[k].refund() + const k = upgrade as keyof Player["blueberryUpgrades"]; + player.blueberryUpgrades[k].refund(); } - if (giveAlert) return Alert(i18next.t('ambrosia.refund')) -} + if (giveAlert) return Alert(i18next.t("ambrosia.refund")); +}; export const validateBlueberryTree = (modules: BlueberryOpt) => { // Check for empty object (perhaps from the loadouts?) if (Object.keys(modules).length === 0) { - return false + return false; } - const ambrosiaBudget = player.lifetimeAmbrosia - const blueberryBudget = player.caches.blueberryInventory.totalVal + const ambrosiaBudget = player.lifetimeAmbrosia; + const blueberryBudget = player.caches.blueberryInventory.totalVal; - let spentAmbrosia = 0 - let spentBlueberries = 0 + let spentAmbrosia = 0; + let spentBlueberries = 0; - let meetsPrerequisites = true - let meetsAmbrosia = true - let meetsBlueberries = true + let meetsPrerequisites = true; + let meetsAmbrosia = true; + let meetsBlueberries = true; for (const [key, val] of Object.entries(modules)) { - const k = key as keyof Player['blueberryUpgrades'] + const k = key as keyof Player["blueberryUpgrades"]; // Nix malicious or bad values - if (val < 0 || !Number.isFinite(val) || !Number.isInteger(val) || Number.isNaN(val)) { - return false + if ( + val < 0 || + !Number.isFinite(val) || + !Number.isInteger(val) || + Number.isNaN(val) + ) { + return false; } // Nix nonexistent modules - if (player.blueberryUpgrades[k] === undefined) return false + if (player.blueberryUpgrades[k] === undefined) return false; // Set val to max if it exceeds it, since it is possible module caps change over time. - const effectiveVal = Math.min(player.blueberryUpgrades[k].maxLevel, val) + const effectiveVal = Math.min(player.blueberryUpgrades[k].maxLevel, val); // Check prereq for this specific module - const prereqs = player.blueberryUpgrades[k].preRequisites + const prereqs = player.blueberryUpgrades[k].preRequisites; if (prereqs !== undefined && val > 0) { for (const [key2, val2] of Object.entries(prereqs)) { - const k2 = key2 as keyof BlueberryOpt - const level = modules[k2] ?? -1 /* If undefined, this is saying 'We need to have module + const k2 = key2 as keyof BlueberryOpt; + const level = + modules[k2] ?? + -1; /* If undefined, this is saying 'We need to have module set to level val2 but it isn't even in our module loadout, so it cannot possibly satisfy prereqs'*/ if (level < val2) { - meetsPrerequisites = false + meetsPrerequisites = false; } } } // Check blueberry costs if (effectiveVal > 0) { - spentBlueberries += player.blueberryUpgrades[k].blueberryCost + spentBlueberries += player.blueberryUpgrades[k].blueberryCost; } // Check ambrosia costs if (effectiveVal > 0) { - const valFunc = player.blueberryUpgrades[k].costFormula - const baseCost = player.blueberryUpgrades[k].costPerLevel - let tempCost = 0 + const valFunc = player.blueberryUpgrades[k].costFormula; + const baseCost = player.blueberryUpgrades[k].costPerLevel; + let tempCost = 0; for (let i = 0; i < val; i++) { - tempCost += valFunc(i, baseCost) + tempCost += valFunc(i, baseCost); } - spentAmbrosia += tempCost + spentAmbrosia += tempCost; } } - meetsAmbrosia = ambrosiaBudget >= spentAmbrosia - meetsBlueberries = blueberryBudget >= spentBlueberries + meetsAmbrosia = ambrosiaBudget >= spentAmbrosia; + meetsBlueberries = blueberryBudget >= spentBlueberries; - return (meetsPrerequisites && meetsAmbrosia && meetsBlueberries) -} + return meetsPrerequisites && meetsAmbrosia && meetsBlueberries; +}; export const getBlueberryTree = () => { return Object.fromEntries( Object.entries(player.blueberryUpgrades).map(([key, value]) => { - return [key, value.level] + return [key, value.level]; }) - ) as BlueberryOpt -} + ) as BlueberryOpt; +}; export const fixBlueberryLevel = (modules: BlueberryOpt) => { return Object.fromEntries( Object.entries(modules).map(([key, value]) => { - return [key, Math.min(value, player.blueberryUpgrades[key].maxLevel)] + return [key, Math.min(value, player.blueberryUpgrades[key].maxLevel)]; }) - ) -} + ); +}; export const exportBlueberryTree = () => { - const modules = getBlueberryTree() - const save = JSON.stringify(modules) - const name = `BBTree-${saveFilename()}` - void exportData(save, name) -} + const modules = getBlueberryTree(); + const save = JSON.stringify(modules); + const name = `BBTree-${saveFilename()}`; + void exportData(save, name); +}; export const createBlueberryTree = async (modules: BlueberryOpt) => { // Check to see if tree being created is valid. - const isPossible = validateBlueberryTree(modules) + const isPossible = validateBlueberryTree(modules); if (!isPossible) { - void Alert(i18next.t('ambrosia.importTree.failure')) - return + void Alert(i18next.t("ambrosia.importTree.failure")); + return; } // If valid, we will create the tree. // Refund (reset) the tree! - await resetBlueberryTree(false) // no alert; return type is undefined + await resetBlueberryTree(false); // no alert; return type is undefined // Fix blueberry levels on a valid tree (not done by validation) - const actualModules = fixBlueberryLevel(modules) + const actualModules = fixBlueberryLevel(modules); for (const [key, val] of Object.entries(actualModules)) { - const k = key as keyof Player['blueberryUpgrades'] - const { costFormula, costPerLevel, blueberryCost } = player.blueberryUpgrades[k] + const k = key as keyof Player["blueberryUpgrades"]; + const { costFormula, costPerLevel, blueberryCost } = + player.blueberryUpgrades[k]; if (val > 0) { - player.blueberryUpgrades[k].blueberriesInvested = blueberryCost - player.spentBlueberries += blueberryCost - let tempCost = 0 + player.blueberryUpgrades[k].blueberriesInvested = blueberryCost; + player.spentBlueberries += blueberryCost; + let tempCost = 0; for (let i = 0; i < val; i++) { - tempCost += costFormula(i, costPerLevel) + tempCost += costFormula(i, costPerLevel); } - player.ambrosia -= tempCost - player.blueberryUpgrades[k].ambrosiaInvested = tempCost - player.blueberryUpgrades[k].level = val + player.ambrosia -= tempCost; + player.blueberryUpgrades[k].ambrosiaInvested = tempCost; + player.blueberryUpgrades[k].level = val; } } - void Alert(i18next.t('ambrosia.importTree.success')) -} + void Alert(i18next.t("ambrosia.importTree.success")); +}; export const importBlueberryTree = async (input: string | null) => { - if (typeof input !== 'string') { - return Alert(i18next.t('importexport.unableImport')) + if (typeof input !== "string") { + return Alert(i18next.t("importexport.unableImport")); } else { try { - const modules = JSON.parse(input) as BlueberryOpt - await createBlueberryTree(modules) - createLoadoutDescription(0, modules) + const modules = JSON.parse(input) as BlueberryOpt; + await createBlueberryTree(modules); + createLoadoutDescription(0, modules); } catch (err) { - return Alert(i18next.t('ambrosia.importTree.error')) + return Alert(i18next.t("ambrosia.importTree.error")); } } -} +}; export const loadoutHandler = async (n: number, modules: BlueberryOpt) => { - if (player.blueberryLoadoutMode === 'saveTree') { - await saveBlueberryTree(n, modules) + if (player.blueberryLoadoutMode === "saveTree") { + await saveBlueberryTree(n, modules); } - if (player.blueberryLoadoutMode === 'loadTree') { - await createBlueberryTree(modules) + if (player.blueberryLoadoutMode === "loadTree") { + await createBlueberryTree(modules); } -} +}; export const updateLoadoutHoverClasses = () => { - const upgradeNames = Object.keys(blueberryUpgradeData) as blueberryUpgradeNames[] + const upgradeNames = Object.keys( + blueberryUpgradeData + ) as blueberryUpgradeNames[]; for (const loadoutKey of Object.keys(player.blueberryLoadouts)) { - const i = Number.parseInt(loadoutKey, 10) - const loadout = player.blueberryLoadouts[i] + const i = Number.parseInt(loadoutKey, 10); + const loadout = player.blueberryLoadouts[i]; - const upgradeHoverClass = `bbPurchasedLoadout${i}` + const upgradeHoverClass = `bbPurchasedLoadout${i}`; for (const upgradeKey of upgradeNames) { if (loadout[upgradeKey]) { - DOMCacheGetOrSet(upgradeKey).parentElement?.classList.add(upgradeHoverClass) + DOMCacheGetOrSet(upgradeKey).parentElement?.classList.add( + upgradeHoverClass + ); } else { - DOMCacheGetOrSet(upgradeKey).parentElement?.classList.remove(upgradeHoverClass) + DOMCacheGetOrSet(upgradeKey).parentElement?.classList.remove( + upgradeHoverClass + ); } } } -} +}; -export const saveBlueberryTree = async (input: number, previous: BlueberryOpt) => { +export const saveBlueberryTree = async ( + input: number, + previous: BlueberryOpt +) => { if (Object.keys(previous).length > 0) { - const p = await Confirm(i18next.t('ambrosia.loadouts.confirmation')) - if (!p) return + const p = await Confirm(i18next.t("ambrosia.loadouts.confirmation")); + if (!p) return; } - player.blueberryLoadouts[input] = getBlueberryTree() - createLoadoutDescription(input, player.blueberryLoadouts[input]) + player.blueberryLoadouts[input] = getBlueberryTree(); + createLoadoutDescription(input, player.blueberryLoadouts[input]); - updateLoadoutHoverClasses() -} + updateLoadoutHoverClasses(); +}; -export const createLoadoutDescription = (input: number, modules: BlueberryOpt) => { - let str = '' +export const createLoadoutDescription = ( + input: number, + modules: BlueberryOpt +) => { + let str = ""; for (const [key, val] of Object.entries(modules)) { /* * If the entry (saved purchase level) for an upgrade is 0, undefined, or null, we skip it. @@ -737,21 +943,21 @@ export const createLoadoutDescription = (input: number, modules: BlueberryOpt) = * If undefined - it's new, so it's unpurchased - the user couldn't have saved it to a loadout yet * I don't think anything sets an upgrade to null... but we may as well skip then too. */ - if (!val) continue + if (!val) continue; - const k = key as keyof Player['blueberryUpgrades'] - const name = player.blueberryUpgrades[k].name - str = `${str}${name} lv${val} | ` + const k = key as keyof Player["blueberryUpgrades"]; + const name = player.blueberryUpgrades[k].name; + str = `${str}${name} lv${val} | `; } if (Object.keys(modules).length === 0) { - str = i18next.t('ambrosia.loadouts.none') + str = i18next.t("ambrosia.loadouts.none"); } - let loadoutTitle = `${i18next.t('ambrosia.loadouts.loadout')} ${input}` + let loadoutTitle = `${i18next.t("ambrosia.loadouts.loadout")} ${input}`; if (input === 0) { - loadoutTitle = i18next.t('ambrosia.loadouts.imported') + loadoutTitle = i18next.t("ambrosia.loadouts.imported"); } - DOMCacheGetOrSet('singularityAmbrosiaMultiline').innerHTML = ` ${loadoutTitle} - ${str}` -} + DOMCacheGetOrSet("singularityAmbrosiaMultiline").innerHTML = ` ${loadoutTitle} + ${str}`; +}; diff --git a/src/Calculate.ts b/src/Calculate.ts index b73605855..39f297b8a 100644 --- a/src/Calculate.ts +++ b/src/Calculate.ts @@ -1,108 +1,149 @@ -import Decimal from 'break_infinity.js' -import i18next from 'i18next' -import { achievementaward } from './Achievements' -import { DOMCacheGetOrSet } from './Cache/DOM' -import { CalcECC } from './Challenges' -import { BuffType, calculateEventSourceBuff } from './Event' -import { addTimers, automaticTools } from './Helper' -import { hepteractEffective } from './Hepteracts' -import { disableHotkeys, enableHotkeys } from './Hotkeys' -import { quarkHandler } from './Quark' -import { reset } from './Reset' -import { calculateSingularityDebuff } from './singularity' -import { getFastForwardTotalMultiplier } from './singularity' -import { format, getTimePinnedToLoadDate, player, resourceGain, saveSynergy, updateAll } from './Synergism' -import { toggleTalismanBuy, updateTalismanInventory } from './Talismans' -import { clearInterval, setInterval } from './Timers' -import type { resetNames } from './types/Synergism' -import { Alert, Prompt } from './UpdateHTML' -import { productContents, sumContents } from './Utility' -import { Globals as G } from './Variables' +import Decimal from "break_infinity.js"; +import i18next from "i18next"; +import { achievementaward } from "./Achievements"; +import { DOMCacheGetOrSet } from "./Cache/DOM"; +import { CalcECC } from "./Challenges"; +import { BuffType, calculateEventSourceBuff } from "./Event"; +import { addTimers, automaticTools } from "./Helper"; +import { hepteractEffective } from "./Hepteracts"; +import { disableHotkeys, enableHotkeys } from "./Hotkeys"; +import { quarkHandler } from "./Quark"; +import { reset } from "./Reset"; +import { calculateSingularityDebuff } from "./singularity"; +import { getFastForwardTotalMultiplier } from "./singularity"; +import { + format, + getTimePinnedToLoadDate, + player, + resourceGain, + saveSynergy, + updateAll, +} from "./Synergism"; +import { toggleTalismanBuy, updateTalismanInventory } from "./Talismans"; +import { clearInterval, setInterval } from "./Timers"; +import type { resetNames } from "./types/Synergism"; +import { Alert, Prompt } from "./UpdateHTML"; +import { productContents, sumContents } from "./Utility"; +import { Globals as G } from "./Variables"; export const calculateTotalCoinOwned = () => { - G.totalCoinOwned = player.firstOwnedCoin - + player.secondOwnedCoin - + player.thirdOwnedCoin - + player.fourthOwnedCoin - + player.fifthOwnedCoin -} + G.totalCoinOwned = + player.firstOwnedCoin + + player.secondOwnedCoin + + player.thirdOwnedCoin + + player.fourthOwnedCoin + + player.fifthOwnedCoin; +}; export const calculateTotalAcceleratorBoost = () => { - let b = 0 + let b = 0; if (player.upgrades[26] > 0.5) { - b += 1 + b += 1; } if (player.upgrades[31] > 0.5) { - b += Math.floor(G.totalCoinOwned / 2000) * 100 / 100 + b += (Math.floor(G.totalCoinOwned / 2000) * 100) / 100; } if (player.achievements[7] > 0.5) { - b += Math.floor(player.firstOwnedCoin / 2000) + b += Math.floor(player.firstOwnedCoin / 2000); } if (player.achievements[14] > 0.5) { - b += Math.floor(player.secondOwnedCoin / 2000) + b += Math.floor(player.secondOwnedCoin / 2000); } if (player.achievements[21] > 0.5) { - b += Math.floor(player.thirdOwnedCoin / 2000) + b += Math.floor(player.thirdOwnedCoin / 2000); } if (player.achievements[28] > 0.5) { - b += Math.floor(player.fourthOwnedCoin / 2000) + b += Math.floor(player.fourthOwnedCoin / 2000); } if (player.achievements[35] > 0.5) { - b += Math.floor(player.fifthOwnedCoin / 2000) - } - - b += player.researches[93] - * Math.floor(1 / 20 * (G.rune1level + G.rune2level + G.rune3level + G.rune4level + G.rune5level)) - b += Math.floor((0.01 + G.rune1level) * G.effectiveLevelMult / 20) - b *= 1 + 1 / 5 * player.researches[3] * (1 + 1 / 2 * CalcECC('ascension', player.challengecompletions[14])) - b *= 1 + 1 / 20 * player.researches[16] + 1 / 20 * player.researches[17] - b *= 1 + 1 / 20 * player.researches[88] - b *= calculateSigmoidExponential(20, (player.antUpgrades[4 - 1]! + G.bonusant4) / 1000 * 20 / 19) - b *= 1 + 1 / 100 * player.researches[127] - b *= 1 + 0.8 / 100 * player.researches[142] - b *= 1 + 0.6 / 100 * player.researches[157] - b *= 1 + 0.4 / 100 * player.researches[172] - b *= 1 + 0.2 / 100 * player.researches[187] - b *= 1 + 0.01 / 100 * player.researches[200] - b *= 1 + 0.01 / 100 * player.cubeUpgrades[50] - b *= 1 + 1 / 1000 * hepteractEffective('acceleratorBoost') - if (player.upgrades[73] > 0.5 && player.currentChallenge.reincarnation !== 0) { - b *= 2 - } - b = Math.min(1e100, Math.floor(b)) - G.freeAcceleratorBoost = b - - G.totalAcceleratorBoost = Math.floor(player.acceleratorBoostBought + G.freeAcceleratorBoost) * 100 / 100 -} + b += Math.floor(player.fifthOwnedCoin / 2000); + } + + b += + player.researches[93] * + Math.floor( + (1 / 20) * + (G.rune1level + + G.rune2level + + G.rune3level + + G.rune4level + + G.rune5level) + ); + b += Math.floor(((0.01 + G.rune1level) * G.effectiveLevelMult) / 20); + b *= + 1 + + (1 / 5) * + player.researches[3] * + (1 + (1 / 2) * CalcECC("ascension", player.challengecompletions[14])); + b *= 1 + (1 / 20) * player.researches[16] + (1 / 20) * player.researches[17]; + b *= 1 + (1 / 20) * player.researches[88]; + b *= calculateSigmoidExponential( + 20, + (((player.antUpgrades[4 - 1]! + G.bonusant4) / 1000) * 20) / 19 + ); + b *= 1 + (1 / 100) * player.researches[127]; + b *= 1 + (0.8 / 100) * player.researches[142]; + b *= 1 + (0.6 / 100) * player.researches[157]; + b *= 1 + (0.4 / 100) * player.researches[172]; + b *= 1 + (0.2 / 100) * player.researches[187]; + b *= 1 + (0.01 / 100) * player.researches[200]; + b *= 1 + (0.01 / 100) * player.cubeUpgrades[50]; + b *= 1 + (1 / 1000) * hepteractEffective("acceleratorBoost"); + if ( + player.upgrades[73] > 0.5 && + player.currentChallenge.reincarnation !== 0 + ) { + b *= 2; + } + b = Math.min(1e100, Math.floor(b)); + G.freeAcceleratorBoost = b; + + G.totalAcceleratorBoost = + (Math.floor(player.acceleratorBoostBought + G.freeAcceleratorBoost) * 100) / + 100; +}; export const calculateAcceleratorMultiplier = () => { - G.acceleratorMultiplier = 1 - G.acceleratorMultiplier *= 1 + player.achievements[60] / 100 - G.acceleratorMultiplier *= 1 + player.achievements[61] / 100 - G.acceleratorMultiplier *= 1 + player.achievements[62] / 100 - G.acceleratorMultiplier *= 1 - + 1 / 5 * player.researches[1] * (1 + 1 / 2 * CalcECC('ascension', player.challengecompletions[14])) - G.acceleratorMultiplier *= 1 + 1 / 20 * player.researches[6] + 1 / 25 * player.researches[7] - + 1 / 40 * player.researches[8] + 3 / 200 * player.researches[9] + 1 / 200 * player.researches[10] - G.acceleratorMultiplier *= 1 + 1 / 20 * player.researches[86] - G.acceleratorMultiplier *= 1 + 1 / 100 * player.researches[126] - G.acceleratorMultiplier *= 1 + 0.8 / 100 * player.researches[141] - G.acceleratorMultiplier *= 1 + 0.6 / 100 * player.researches[156] - G.acceleratorMultiplier *= 1 + 0.4 / 100 * player.researches[171] - G.acceleratorMultiplier *= 1 + 0.2 / 100 * player.researches[186] - G.acceleratorMultiplier *= 1 + 0.01 / 100 * player.researches[200] - G.acceleratorMultiplier *= 1 + 0.01 / 100 * player.cubeUpgrades[50] + G.acceleratorMultiplier = 1; + G.acceleratorMultiplier *= 1 + player.achievements[60] / 100; + G.acceleratorMultiplier *= 1 + player.achievements[61] / 100; + G.acceleratorMultiplier *= 1 + player.achievements[62] / 100; + G.acceleratorMultiplier *= + 1 + + (1 / 5) * + player.researches[1] * + (1 + (1 / 2) * CalcECC("ascension", player.challengecompletions[14])); + G.acceleratorMultiplier *= + 1 + + (1 / 20) * player.researches[6] + + (1 / 25) * player.researches[7] + + (1 / 40) * player.researches[8] + + (3 / 200) * player.researches[9] + + (1 / 200) * player.researches[10]; + G.acceleratorMultiplier *= 1 + (1 / 20) * player.researches[86]; + G.acceleratorMultiplier *= 1 + (1 / 100) * player.researches[126]; + G.acceleratorMultiplier *= 1 + (0.8 / 100) * player.researches[141]; + G.acceleratorMultiplier *= 1 + (0.6 / 100) * player.researches[156]; + G.acceleratorMultiplier *= 1 + (0.4 / 100) * player.researches[171]; + G.acceleratorMultiplier *= 1 + (0.2 / 100) * player.researches[186]; + G.acceleratorMultiplier *= 1 + (0.01 / 100) * player.researches[200]; + G.acceleratorMultiplier *= 1 + (0.01 / 100) * player.cubeUpgrades[50]; G.acceleratorMultiplier *= Math.pow( 1.01, - player.upgrades[21] + player.upgrades[22] + player.upgrades[23] + player.upgrades[24] + player.upgrades[25] - ) + player.upgrades[21] + + player.upgrades[22] + + player.upgrades[23] + + player.upgrades[24] + + player.upgrades[25] + ); if ( - (player.currentChallenge.transcension !== 0 || player.currentChallenge.reincarnation !== 0) - && player.upgrades[50] > 0.5 + (player.currentChallenge.transcension !== 0 || + player.currentChallenge.reincarnation !== 0) && + player.upgrades[50] > 0.5 ) { - G.acceleratorMultiplier *= 1.25 + G.acceleratorMultiplier *= 1.25; } -} +}; export const calculateRecycleMultiplier = () => { // Factors where recycle bonus comes from @@ -117,42 +158,42 @@ export const calculateRecycleMultiplier = () => { 0.075 * player.achievements[129], 0.05 * player.upgrades[61], 0.25 * Math.min(1, G.rune4level / 400), - 0.005 * player.cubeUpgrades[2] - ]) + 0.005 * player.cubeUpgrades[2], + ]); - return 1 / (1 - recycleFactors) -} + return 1 / (1 - recycleFactors); +}; -export function calculateRuneExpGiven ( +export function calculateRuneExpGiven( runeIndex: number, all: boolean, runeLevel: number, returnFactors: true -): number[] -export function calculateRuneExpGiven ( +): number[]; +export function calculateRuneExpGiven( runeIndex: number, all: boolean, runeLevel?: number, returnFactors?: false -): number -export function calculateRuneExpGiven ( +): number; +export function calculateRuneExpGiven( runeIndex: number, all = false, runeLevel = player.runelevels[runeIndex], returnFactors = false ) { // recycleMult accounted for all recycle chance, but inversed so it's a multiplier instead - const recycleMultiplier = calculateRecycleMultiplier() + const recycleMultiplier = calculateRecycleMultiplier(); // Rune multiplier that is summed instead of added - let allRuneExpAdditiveMultiplier: number | null = null + let allRuneExpAdditiveMultiplier: number | null = null; if (all) { allRuneExpAdditiveMultiplier = sumContents([ // Challenge 3 completions - 1 / 100 * player.highestchallengecompletions[3], + (1 / 100) * player.highestchallengecompletions[3], // Reincarnation 2x1 - 1 * player.upgrades[66] - ]) + 1 * player.upgrades[66], + ]); } else { allRuneExpAdditiveMultiplier = sumContents([ // Base amount multiplied per offering @@ -160,7 +201,7 @@ export function calculateRuneExpGiven ( // +1 if C1 completion Math.min(1, player.highestchallengecompletions[1]), // +0.10 per C1 completion - 0.4 / 10 * player.highestchallengecompletions[1], + (0.4 / 10) * player.highestchallengecompletions[1], // Research 5x2 0.6 * player.researches[22], // Research 5x3 @@ -168,115 +209,130 @@ export function calculateRuneExpGiven ( // Particle Upgrade 1x1 2 * player.upgrades[61], // Particle upgrade 3x1 - player.upgrades[71] * runeLevel / 25 - ]) + (player.upgrades[71] * runeLevel) / 25, + ]); } // Rune multiplier that gets applied to all runes const allRuneExpMultiplier = productContents([ // Research 4x16 - 1 + (player.researches[91] / 20), + 1 + player.researches[91] / 20, // Research 4x17 - 1 + (player.researches[92] / 20), + 1 + player.researches[92] / 20, // Ant 8 - calculateSigmoidExponential(999, 1 / 10000 * Math.pow(player.antUpgrades[8 - 1]! + G.bonusant8, 1.1)), + calculateSigmoidExponential( + 999, + (1 / 10000) * Math.pow(player.antUpgrades[8 - 1]! + G.bonusant8, 1.1) + ), // Cube Bonus G.cubeBonusMultiplier[4], // Cube Upgrade Bonus - 1 + player.ascensionCounter / 1000 * player.cubeUpgrades[32], + 1 + (player.ascensionCounter / 1000) * player.cubeUpgrades[32], // Constant Upgrade Multiplier - 1 + 1 / 10 * player.constantUpgrades[8], + 1 + (1 / 10) * player.constantUpgrades[8], // Challenge 15 reward multiplier - G.challenge15Rewards.runeExp - ]) + G.challenge15Rewards.runeExp, + ]); // Corruption Divisor - const droughtEffect = 1 - / Math.pow(G.droughtMultiplier[player.usedCorruptions[8]], 1 - 1 / 2 * player.platonicUpgrades[13]) + const droughtEffect = + 1 / + Math.pow( + G.droughtMultiplier[player.usedCorruptions[8]], + 1 - (1 / 2) * player.platonicUpgrades[13] + ); // Rune multiplier that gets applied to specific runes const runeExpMultiplier = [ productContents([ - 1 + (player.researches[78] / 50), - 1 + (player.researches[111] / 100), - 1 + (CalcECC('reincarnation', player.challengecompletions[7]) / 10), - droughtEffect + 1 + player.researches[78] / 50, + 1 + player.researches[111] / 100, + 1 + CalcECC("reincarnation", player.challengecompletions[7]) / 10, + droughtEffect, ]), productContents([ - 1 + (player.researches[80] / 50), - 1 + (player.researches[112] / 100), - 1 + (CalcECC('reincarnation', player.challengecompletions[7]) / 10), - droughtEffect + 1 + player.researches[80] / 50, + 1 + player.researches[112] / 100, + 1 + CalcECC("reincarnation", player.challengecompletions[7]) / 10, + droughtEffect, ]), productContents([ - 1 + (player.researches[79] / 50), - 1 + (player.researches[113] / 100), - 1 + (CalcECC('reincarnation', player.challengecompletions[8]) / 5), - droughtEffect + 1 + player.researches[79] / 50, + 1 + player.researches[113] / 100, + 1 + CalcECC("reincarnation", player.challengecompletions[8]) / 5, + droughtEffect, ]), productContents([ - 1 + (player.researches[77] / 50), - 1 + (player.researches[114] / 100), - 1 + (CalcECC('reincarnation', player.challengecompletions[6]) / 10), - droughtEffect + 1 + player.researches[77] / 50, + 1 + player.researches[114] / 100, + 1 + CalcECC("reincarnation", player.challengecompletions[6]) / 10, + droughtEffect, ]), productContents([ - 1 + (player.researches[83] / 20), - 1 + (player.researches[115] / 100), - 1 + (CalcECC('reincarnation', player.challengecompletions[9]) / 5), - droughtEffect + 1 + player.researches[83] / 20, + 1 + player.researches[115] / 100, + 1 + CalcECC("reincarnation", player.challengecompletions[9]) / 5, + droughtEffect, ]), productContents([1]), - productContents([1]) - ] + productContents([1]), + ]; const fact = [ allRuneExpAdditiveMultiplier, allRuneExpMultiplier, recycleMultiplier, - runeExpMultiplier[runeIndex] - ] + runeExpMultiplier[runeIndex], + ]; - return returnFactors ? fact : Math.min(1e200, productContents(fact)) + return returnFactors ? fact : Math.min(1e200, productContents(fact)); } export const lookupTableGen = (runeLevel: number) => { // Rune exp required to level multipliers const allRuneExpRequiredMultiplier = productContents([ Math.pow((runeLevel + 1) / 2, 3), - ((3.5 * runeLevel) + 100) / 500, + (3.5 * runeLevel + 100) / 500, Math.max(1, (runeLevel - 200) / 9), Math.max(1, (runeLevel - 400) / 12), Math.max(1, (runeLevel - 600) / 15), - Math.max(1, Math.pow(1.03, (runeLevel - 800) / 4)) - ]) + Math.max(1, Math.pow(1.03, (runeLevel - 800) / 4)), + ]); - return allRuneExpRequiredMultiplier -} + return allRuneExpRequiredMultiplier; +}; -let lookupTableRuneExp: number[] | null = null +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 + 1 }, (_, i) => lookupTableGen(i)) +export const calculateRuneExpToLevel = ( + runeIndex: number, + runeLevel = player.runelevels[runeIndex] +) => { + lookupTableRuneExp ??= Array.from({ length: 40000 + 1 }, (_, i) => + lookupTableGen(i) + ); // For runes 6 and 7 we will apply a special multiplier - let multiplier = lookupTableRuneExp[runeLevel] + let multiplier = lookupTableRuneExp[runeLevel]; if (runeIndex === 5) { - multiplier = Math.pow(100, runeLevel) + multiplier = Math.pow(100, runeLevel); } if (runeIndex === 6) { - multiplier = Math.pow(1e25, runeLevel) * (player.highestSingularityCount + 1) + multiplier = + Math.pow(1e25, runeLevel) * (player.highestSingularityCount + 1); } - return multiplier * G.runeexpbase[runeIndex] -} + return multiplier * G.runeexpbase[runeIndex]; +}; export const calculateMaxRunes = (i: number) => { - let max = 1000 - - const increaseAll = 20 * (player.cubeUpgrades[16] + player.cubeUpgrades[37]) - + 3 * player.constantUpgrades[7] + 80 * CalcECC('ascension', player.challengecompletions[11]) - + 200 * CalcECC('ascension', player.challengecompletions[14]) - + Math.floor(0.04 * player.researches[200] + 0.04 * player.cubeUpgrades[50]) + let max = 1000; + + const increaseAll = + 20 * (player.cubeUpgrades[16] + player.cubeUpgrades[37]) + + 3 * player.constantUpgrades[7] + + 80 * CalcECC("ascension", player.challengecompletions[11]) + + 200 * CalcECC("ascension", player.challengecompletions[14]) + + Math.floor(0.04 * player.researches[200] + 0.04 * player.cubeUpgrades[50]); const increaseMaxLevel = [ null, 10 * (player.researches[78] + player.researches[111]) + increaseAll, @@ -285,117 +341,164 @@ export const calculateMaxRunes = (i: number) => { 10 * (player.researches[77] + player.researches[114]) + increaseAll, 10 * player.researches[115] + increaseAll, -901, - -999 - ] + -999, + ]; - max = increaseMaxLevel[i]! > G.runeMaxLvl ? G.runeMaxLvl : max + increaseMaxLevel[i]! - return max -} + max = + increaseMaxLevel[i]! > G.runeMaxLvl + ? G.runeMaxLvl + : max + increaseMaxLevel[i]!; + return max; +}; export const calculateEffectiveIALevel = () => { - return player.runelevels[5] + Math.max(0, player.runelevels[5] - 74) + Math.max(0, player.runelevels[5] - 98) -} - -export function calculateOfferings (input: resetNames): number -export function calculateOfferings (input: resetNames, calcMult: false, statistic?: boolean): number[] -export function calculateOfferings (input: resetNames, calcMult: true, statistic: boolean): number -export function calculateOfferings (input: resetNames, calcMult = true, statistic = false) { - if (input === 'acceleratorBoost' || input === 'ascension' || input === 'ascensionChallenge') { - return 0 + return ( + player.runelevels[5] + + Math.max(0, player.runelevels[5] - 74) + + Math.max(0, player.runelevels[5] - 98) + ); +}; + +export function calculateOfferings(input: resetNames): number; +export function calculateOfferings( + input: resetNames, + calcMult: false, + statistic?: boolean +): number[]; +export function calculateOfferings( + input: resetNames, + calcMult: true, + statistic: boolean +): number; +export function calculateOfferings( + input: resetNames, + calcMult = true, + statistic = false +) { + if ( + input === "acceleratorBoost" || + input === "ascension" || + input === "ascensionChallenge" + ) { + return 0; } - let q = 0 - let a = 0 - let b = 0 - let c = 0 + let q = 0; + let a = 0; + let b = 0; + let c = 0; - if (input === 'reincarnation' || input === 'reincarnationChallenge') { - a += 3 + if (input === "reincarnation" || input === "reincarnationChallenge") { + a += 3; if (player.achievements[52] > 0.5) { - a += 25 * Math.min(player.reincarnationcounter / 1800, 1) + a += 25 * Math.min(player.reincarnationcounter / 1800, 1); } if (player.upgrades[62] > 0.5) { - a += 1 / 50 * (sumContents(player.challengecompletions)) + a += (1 / 50) * sumContents(player.challengecompletions); } - a += 0.6 * player.researches[25] + a += 0.6 * player.researches[25]; if (player.researches[95] === 1) { - a += 4 + a += 4; } - a += 1 / 200 * G.rune5level * G.effectiveLevelMult * (1 + player.researches[85] / 200) - a *= 1 + Math.pow(Decimal.log(player.reincarnationShards.add(1), 10), 2 / 3) / 4 - a *= Math.min(Math.pow(player.reincarnationcounter / 10 + 1, 2), 1) + a += + (1 / 200) * + G.rune5level * + G.effectiveLevelMult * + (1 + player.researches[85] / 200); + a *= + 1 + + Math.pow(Decimal.log(player.reincarnationShards.add(1), 10), 2 / 3) / 4; + a *= Math.min(Math.pow(player.reincarnationcounter / 10 + 1, 2), 1); if (player.reincarnationcounter >= 5) { - a *= Math.max(1, player.reincarnationcounter / 10) + a *= Math.max(1, player.reincarnationcounter / 10); } } if ( - input === 'transcension' || input === 'transcensionChallenge' || input === 'reincarnation' - || input === 'reincarnationChallenge' + input === "transcension" || + input === "transcensionChallenge" || + input === "reincarnation" || + input === "reincarnationChallenge" ) { - b += 2 + b += 2; if (player.reincarnationCount > 0) { - b += 2 + b += 2; } if (player.achievements[44] > 0.5) { - b += 15 * Math.min(player.transcendcounter / 1800, 1) + b += 15 * Math.min(player.transcendcounter / 1800, 1); } if (player.challengecompletions[2] > 0) { - b += 1 + b += 1; } - b += 0.2 * player.researches[24] - b += 1 / 200 * G.rune5level * G.effectiveLevelMult * (1 + player.researches[85] / 200) - b *= 1 + Math.pow(Decimal.log(player.transcendShards.add(1), 10), 1 / 2) / 5 - b *= 1 + CalcECC('reincarnation', player.challengecompletions[8]) / 25 - b *= Math.min(Math.pow(player.transcendcounter / 10, 2), 1) + b += 0.2 * player.researches[24]; + b += + (1 / 200) * + G.rune5level * + G.effectiveLevelMult * + (1 + player.researches[85] / 200); + b *= + 1 + Math.pow(Decimal.log(player.transcendShards.add(1), 10), 1 / 2) / 5; + b *= 1 + CalcECC("reincarnation", player.challengecompletions[8]) / 25; + b *= Math.min(Math.pow(player.transcendcounter / 10, 2), 1); if (player.transcendCount >= 5) { - b *= Math.max(1, player.transcendcounter / 10) + b *= Math.max(1, player.transcendcounter / 10); } } // This will always be calculated if '0' is not already returned - c += 1 + c += 1; if (player.transcendCount > 0 || player.reincarnationCount > 0) { - c += 1 + c += 1; } if (player.reincarnationCount > 0) { - c += 2 + c += 2; } if (player.achievements[37] > 0.5) { - c += 15 * Math.min(player.prestigecounter / 1800, 1) + c += 15 * Math.min(player.prestigecounter / 1800, 1); } if (player.challengecompletions[2] > 0) { - c += 1 - } - c += 0.2 * player.researches[24] - c += 1 / 200 * G.rune5level * G.effectiveLevelMult * (1 + player.researches[85] / 200) - c *= 1 + Math.pow(Decimal.log(player.prestigeShards.add(1), 10), 1 / 2) / 5 - c *= 1 + CalcECC('reincarnation', player.challengecompletions[6]) / 50 - c *= Math.min(Math.pow(player.prestigecounter / 10, 2), 1) + c += 1; + } + c += 0.2 * player.researches[24]; + c += + (1 / 200) * + G.rune5level * + G.effectiveLevelMult * + (1 + player.researches[85] / 200); + c *= 1 + Math.pow(Decimal.log(player.prestigeShards.add(1), 10), 1 / 2) / 5; + c *= 1 + CalcECC("reincarnation", player.challengecompletions[6]) / 50; + c *= Math.min(Math.pow(player.prestigecounter / 10, 2), 1); if (player.prestigeCount >= 5) { - c *= Math.max(1, player.prestigecounter / 10) + c *= Math.max(1, player.prestigecounter / 10); } - q = a + b + c + q = a + b + c; const arr = [ - 1 + 10 * player.achievements[33] / 100, // Alchemy Achievement 5 - 1 + 15 * player.achievements[34] / 100, // Alchemy Achievement 6 - 1 + 25 * player.achievements[35] / 100, // Alchemy Achievement 7 - 1 + 20 * player.upgrades[38] / 100, // Diamond Upgrade 4x3 - 1 + player.upgrades[75] * 2 * Math.min(1, Math.pow(player.maxobtainium / 30000000, 0.5)), // Particle Upgrade 3x5 - 1 + 1 / 50 * player.shopUpgrades.offeringAuto, // Auto Offering Shop - 1 + 1 / 25 * player.shopUpgrades.offeringEX, // Offering EX Shop - 1 + 1 / 100 * player.shopUpgrades.cashGrab, // Cash Grab - 1 + 1 / 10000 * sumContents(player.challengecompletions) * player.researches[85], // Research 4x10 - 1 + Math.pow(player.antUpgrades[6 - 1]! + G.bonusant6, .66), // Ant Upgrade: + 1 + (10 * player.achievements[33]) / 100, // Alchemy Achievement 5 + 1 + (15 * player.achievements[34]) / 100, // Alchemy Achievement 6 + 1 + (25 * player.achievements[35]) / 100, // Alchemy Achievement 7 + 1 + (20 * player.upgrades[38]) / 100, // Diamond Upgrade 4x3 + 1 + + player.upgrades[75] * + 2 * + Math.min(1, Math.pow(player.maxobtainium / 30000000, 0.5)), // Particle Upgrade 3x5 + 1 + (1 / 50) * player.shopUpgrades.offeringAuto, // Auto Offering Shop + 1 + (1 / 25) * player.shopUpgrades.offeringEX, // Offering EX Shop + 1 + (1 / 100) * player.shopUpgrades.cashGrab, // Cash Grab + 1 + + (1 / 10000) * + sumContents(player.challengecompletions) * + player.researches[85], // Research 4x10 + 1 + Math.pow(player.antUpgrades[6 - 1]! + G.bonusant6, 0.66), // Ant Upgrade: G.cubeBonusMultiplier[3], // Brutus 1 + 0.02 * player.constantUpgrades[3], // Constant Upgrade 3 - 1 + 0.0003 * player.talismanLevels[3 - 1] * player.researches[149] - + 0.0004 * player.talismanLevels[3 - 1] * player.researches[179], // Research 6x24,8x4 - 1 + 0.12 * CalcECC('ascension', player.challengecompletions[12]), // Challenge 12 - 1 + 0.01 / 100 * player.researches[200], // Research 8x25 + 1 + + 0.0003 * player.talismanLevels[3 - 1] * player.researches[149] + + 0.0004 * player.talismanLevels[3 - 1] * player.researches[179], // Research 6x24,8x4 + 1 + 0.12 * CalcECC("ascension", player.challengecompletions[12]), // Challenge 12 + 1 + (0.01 / 100) * player.researches[200], // Research 8x25 1 + Math.min(1, player.ascensionCount / 1e6) * player.achievements[187], // Ascension Count Achievement - 1 + .6 * player.achievements[250] + 1 * player.achievements[251], // Sun&Moon Achievements + 1 + 0.6 * player.achievements[250] + 1 * player.achievements[251], // Sun&Moon Achievements 1 + 0.05 * player.cubeUpgrades[46], // Cube Upgrade 5x6 - 1 + 0.02 / 100 * player.cubeUpgrades[50], // Cube Upgrade 5x10 + 1 + (0.02 / 100) * player.cubeUpgrades[50], // Cube Upgrade 5x10 1 + player.platonicUpgrades[5], // Platonic ALPHA 1 + 2.5 * player.platonicUpgrades[10], // Platonic BETA 1 + 5 * player.platonicUpgrades[15], // Platonic OMEGA @@ -408,282 +511,404 @@ export function calculateOfferings (input: resetNames, calcMult = true, statisti +player.singularityUpgrades.singCitadel2.getEffect().bonus, // Citadel 2 GQ Upgrade 1 + player.cubeUpgrades[54] / 100, // Cube upgrade 6x4 (Cx4) +player.octeractUpgrades.octeractOfferings1.getEffect().bonus, // Offering Electrolosis OC Upgrade - 1 + calculateEventBuff(BuffType.Offering) // Event - ] + 1 + 0.001 * +player.blueberryUpgrades.ambrosiaOffering1.bonus.offeringMult, // Ambrosia!! + 1 + calculateEventBuff(BuffType.Offering), // Event + ]; if (calcMult) { - q *= productContents(arr) + q *= productContents(arr); } else { - return arr + return arr; } if (statistic) { - return productContents(arr) + return productContents(arr); } if (G.eventClicked && G.isEvent) { - q *= 1.05 + q *= 1.05; } - q /= calculateSingularityDebuff('Offering') - q = Math.floor(q) * 100 / 100 + q /= calculateSingularityDebuff("Offering"); + q = (Math.floor(q) * 100) / 100; if (player.currentChallenge.ascension === 15) { - q *= 1 + 7 * player.cubeUpgrades[62] + q *= 1 + 7 * player.cubeUpgrades[62]; } - q *= 1 + 1 / 200 * player.shopUpgrades.cashGrab2 - q *= 1 + 1 / 100 * player.shopUpgrades.offeringEX2 * player.singularityCount - q *= Math.pow(1.02, player.shopUpgrades.offeringEX3) - q *= calculateTotalOcteractOfferingBonus() - q = Math.min(1e300, q) + q *= 1 + (1 / 200) * player.shopUpgrades.cashGrab2; + q *= + 1 + (1 / 100) * player.shopUpgrades.offeringEX2 * player.singularityCount; + q *= Math.pow(1.02, player.shopUpgrades.offeringEX3); + q *= calculateTotalOcteractOfferingBonus(); + q = Math.min(1e300, q); - let persecond = 0 - if (input === 'prestige') { - persecond = q / (1 + player.prestigecounter) + let persecond = 0; + if (input === "prestige") { + persecond = q / (1 + player.prestigecounter); } - if (input === 'transcension' || input === 'transcensionChallenge') { - persecond = q / (1 + player.transcendcounter) + if (input === "transcension" || input === "transcensionChallenge") { + persecond = q / (1 + player.transcendcounter); } - if (input === 'reincarnation' || input === 'reincarnationChallenge') { - persecond = q / (1 + player.reincarnationcounter) + if (input === "reincarnation" || input === "reincarnationChallenge") { + persecond = q / (1 + player.reincarnationcounter); } if (persecond > player.offeringpersecond) { - player.offeringpersecond = persecond + player.offeringpersecond = persecond; } - return q + return q; } export const calculateObtainium = () => { - G.obtainiumGain = 1 + G.obtainiumGain = 1; if (player.upgrades[69] > 0) { G.obtainiumGain *= Math.min( 10, - new Decimal(Decimal.pow(Decimal.log(G.reincarnationPointGain.add(10), 10), 0.5)).toNumber() - ) + new Decimal( + Decimal.pow(Decimal.log(G.reincarnationPointGain.add(10), 10), 0.5) + ).toNumber() + ); } if (player.upgrades[72] > 0) { G.obtainiumGain *= Math.min( 50, - 1 + 2 * player.challengecompletions[6] + 2 * player.challengecompletions[7] + 2 - * player.challengecompletions[8] - + 2 * player.challengecompletions[9] + 2 * player.challengecompletions[10] - ) + 1 + + 2 * player.challengecompletions[6] + + 2 * player.challengecompletions[7] + + 2 * player.challengecompletions[8] + + 2 * player.challengecompletions[9] + + 2 * player.challengecompletions[10] + ); } if (player.upgrades[74] > 0) { - G.obtainiumGain *= 1 + 4 * Math.min(1, Math.pow(player.maxofferings / 100000, 0.5)) - } - G.obtainiumGain *= 1 + player.researches[65] / 5 - G.obtainiumGain *= 1 + player.researches[76] / 10 - G.obtainiumGain *= 1 + player.researches[81] / 10 - G.obtainiumGain *= 1 + player.shopUpgrades.obtainiumAuto / 50 - G.obtainiumGain *= 1 + player.shopUpgrades.cashGrab / 100 - G.obtainiumGain *= 1 - + G.rune5level / 200 * G.effectiveLevelMult - * (1 + player.researches[84] / 200 * (1 + 1 * G.effectiveRuneSpiritPower[5] * calculateCorruptionPoints() / 400)) - G.obtainiumGain *= 1 + 0.01 * player.achievements[84] + 0.03 * player.achievements[91] - + 0.05 * player.achievements[98] + 0.07 - * player.achievements[105] - + 0.09 * player.achievements[112] + 0.11 * player.achievements[119] + 0.13 * player.achievements[126] + 0.15 - * player.achievements[133] - + 0.17 * player.achievements[140] + 0.19 * player.achievements[147] - G.obtainiumGain *= 1 + 2 * Math.pow((player.antUpgrades[10 - 1]! + G.bonusant10) / 50, 2 / 3) - G.obtainiumGain *= 1 + player.achievements[188] * Math.min(2, player.ascensionCount / 5e6) - G.obtainiumGain *= 1 + 0.6 * player.achievements[250] + 1 * player.achievements[251] - G.obtainiumGain *= G.cubeBonusMultiplier[5] - G.obtainiumGain *= 1 + 0.04 * player.constantUpgrades[4] - G.obtainiumGain *= 1 + 0.1 * player.cubeUpgrades[47] - G.obtainiumGain *= 1 + 0.1 * player.cubeUpgrades[3] - G.obtainiumGain *= 1 + 0.5 * CalcECC('ascension', player.challengecompletions[12]) - G.obtainiumGain *= 1 + calculateCorruptionPoints() / 400 * G.effectiveRuneSpiritPower[4] - G.obtainiumGain *= 1 + 0.03 * Math.log(player.uncommonFragments + 1) / Math.log(4) * player.researches[144] - G.obtainiumGain *= 1 + 0.02 / 100 * player.cubeUpgrades[50] + G.obtainiumGain *= + 1 + 4 * Math.min(1, Math.pow(player.maxofferings / 100000, 0.5)); + } + G.obtainiumGain *= 1 + player.researches[65] / 5; + G.obtainiumGain *= 1 + player.researches[76] / 10; + G.obtainiumGain *= 1 + player.researches[81] / 10; + G.obtainiumGain *= 1 + player.shopUpgrades.obtainiumAuto / 50; + G.obtainiumGain *= 1 + player.shopUpgrades.cashGrab / 100; + G.obtainiumGain *= + 1 + + (G.rune5level / 200) * + G.effectiveLevelMult * + (1 + + (player.researches[84] / 200) * + (1 + + (1 * G.effectiveRuneSpiritPower[5] * calculateCorruptionPoints()) / + 400)); + G.obtainiumGain *= + 1 + + 0.01 * player.achievements[84] + + 0.03 * player.achievements[91] + + 0.05 * player.achievements[98] + + 0.07 * player.achievements[105] + + 0.09 * player.achievements[112] + + 0.11 * player.achievements[119] + + 0.13 * player.achievements[126] + + 0.15 * player.achievements[133] + + 0.17 * player.achievements[140] + + 0.19 * player.achievements[147]; + G.obtainiumGain *= + 1 + 2 * Math.pow((player.antUpgrades[10 - 1]! + G.bonusant10) / 50, 2 / 3); + G.obtainiumGain *= + 1 + player.achievements[188] * Math.min(2, player.ascensionCount / 5e6); + G.obtainiumGain *= + 1 + 0.6 * player.achievements[250] + 1 * player.achievements[251]; + G.obtainiumGain *= G.cubeBonusMultiplier[5]; + G.obtainiumGain *= 1 + 0.04 * player.constantUpgrades[4]; + G.obtainiumGain *= 1 + 0.1 * player.cubeUpgrades[47]; + G.obtainiumGain *= 1 + 0.1 * player.cubeUpgrades[3]; + G.obtainiumGain *= + 1 + 0.5 * CalcECC("ascension", player.challengecompletions[12]); + G.obtainiumGain *= + 1 + (calculateCorruptionPoints() / 400) * G.effectiveRuneSpiritPower[4]; + G.obtainiumGain *= + 1 + + ((0.03 * Math.log(player.uncommonFragments + 1)) / Math.log(4)) * + player.researches[144]; + G.obtainiumGain *= 1 + (0.02 / 100) * player.cubeUpgrades[50]; if (player.achievements[53] > 0) { - G.obtainiumGain *= 1 + 1 / 800 * (G.runeSum) + G.obtainiumGain *= 1 + (1 / 800) * G.runeSum; } if (player.achievements[128]) { - G.obtainiumGain *= 1.5 + G.obtainiumGain *= 1.5; } if (player.achievements[129]) { - G.obtainiumGain *= 1.25 + G.obtainiumGain *= 1.25; } if (player.achievements[51] > 0) { - G.obtainiumGain += 4 + G.obtainiumGain += 4; } if (player.reincarnationcounter >= 2) { - G.obtainiumGain += 1 * player.researches[63] + G.obtainiumGain += 1 * player.researches[63]; } if (player.reincarnationcounter >= 5) { - G.obtainiumGain += 2 * player.researches[64] + G.obtainiumGain += 2 * player.researches[64]; } - G.obtainiumGain *= Math.min(1, Math.pow(player.reincarnationcounter / 10, 2)) - G.obtainiumGain *= 1 + 1 / 25 * player.shopUpgrades.obtainiumEX + G.obtainiumGain *= Math.min(1, Math.pow(player.reincarnationcounter / 10, 2)); + G.obtainiumGain *= 1 + (1 / 25) * player.shopUpgrades.obtainiumEX; if (player.reincarnationCount >= 5) { - G.obtainiumGain *= Math.max(1, player.reincarnationcounter / 10) + G.obtainiumGain *= Math.max(1, player.reincarnationcounter / 10); } - G.obtainiumGain *= Math.pow(Decimal.log(player.transcendShards.add(1), 10) / 300, 2) + G.obtainiumGain *= Math.pow( + Decimal.log(player.transcendShards.add(1), 10) / 300, + 2 + ); G.obtainiumGain = Math.pow( G.obtainiumGain, Math.min( 1, - G.illiteracyPower[player.usedCorruptions[5]] - * (1 + 9 / 100 * player.platonicUpgrades[9] * Math.min(100, Math.log10(player.researchPoints + 10))) + G.illiteracyPower[player.usedCorruptions[5]] * + (1 + + (9 / 100) * + player.platonicUpgrades[9] * + Math.min(100, Math.log10(player.researchPoints + 10))) ) - ) - G.obtainiumGain *= 1 + 4 / 100 * player.cubeUpgrades[42] - G.obtainiumGain *= 1 + 3 / 100 * player.cubeUpgrades[43] - G.obtainiumGain *= 1 + player.platonicUpgrades[5] - G.obtainiumGain *= 1 + 1.5 * player.platonicUpgrades[9] - G.obtainiumGain *= 1 + 2.5 * player.platonicUpgrades[10] - G.obtainiumGain *= 1 + 5 * player.platonicUpgrades[15] - G.obtainiumGain *= G.challenge15Rewards.obtainium - G.obtainiumGain *= 1 + 5 * (player.singularityUpgrades.starterPack.getEffect().bonus ? 1 : 0) - G.obtainiumGain *= +player.singularityUpgrades.singObtainium1.getEffect().bonus - G.obtainiumGain *= +player.singularityUpgrades.singObtainium2.getEffect().bonus - G.obtainiumGain *= +player.singularityUpgrades.singObtainium3.getEffect().bonus - G.obtainiumGain *= 1 + player.cubeUpgrades[55] / 100 // Cube Upgrade 6x5 (Cx5) - G.obtainiumGain *= 1 + 1 / 200 * player.shopUpgrades.cashGrab2 - G.obtainiumGain *= 1 + 1 / 100 * player.shopUpgrades.obtainiumEX2 * player.singularityCount - G.obtainiumGain *= 1 + calculateEventBuff(BuffType.Obtainium) - G.obtainiumGain *= +player.singularityUpgrades.singCitadel.getEffect().bonus - G.obtainiumGain *= +player.singularityUpgrades.singCitadel2.getEffect().bonus - G.obtainiumGain *= +player.octeractUpgrades.octeractObtainium1.getEffect().bonus - G.obtainiumGain *= Math.pow(1.02, player.shopUpgrades.obtainiumEX3) - G.obtainiumGain *= calculateTotalOcteractObtainiumBonus() + ); + G.obtainiumGain *= 1 + (4 / 100) * player.cubeUpgrades[42]; + G.obtainiumGain *= 1 + (3 / 100) * player.cubeUpgrades[43]; + G.obtainiumGain *= 1 + player.platonicUpgrades[5]; + G.obtainiumGain *= 1 + 1.5 * player.platonicUpgrades[9]; + G.obtainiumGain *= 1 + 2.5 * player.platonicUpgrades[10]; + G.obtainiumGain *= 1 + 5 * player.platonicUpgrades[15]; + G.obtainiumGain *= G.challenge15Rewards.obtainium; + G.obtainiumGain *= + 1 + 5 * (player.singularityUpgrades.starterPack.getEffect().bonus ? 1 : 0); + G.obtainiumGain *= + +player.singularityUpgrades.singObtainium1.getEffect().bonus; + G.obtainiumGain *= + +player.singularityUpgrades.singObtainium2.getEffect().bonus; + G.obtainiumGain *= + +player.singularityUpgrades.singObtainium3.getEffect().bonus; + G.obtainiumGain *= 1 + player.cubeUpgrades[55] / 100; // Cube Upgrade 6x5 (Cx5) + G.obtainiumGain *= 1 + (1 / 200) * player.shopUpgrades.cashGrab2; + G.obtainiumGain *= + 1 + (1 / 100) * player.shopUpgrades.obtainiumEX2 * player.singularityCount; + G.obtainiumGain *= 1 + calculateEventBuff(BuffType.Obtainium); + G.obtainiumGain *= +player.singularityUpgrades.singCitadel.getEffect().bonus; + G.obtainiumGain *= +player.singularityUpgrades.singCitadel2.getEffect().bonus; + G.obtainiumGain *= + +player.octeractUpgrades.octeractObtainium1.getEffect().bonus; + G.obtainiumGain *= Math.pow(1.02, player.shopUpgrades.obtainiumEX3); + G.obtainiumGain *= calculateTotalOcteractObtainiumBonus(); if (G.eventClicked && G.isEvent) { - G.obtainiumGain *= 1.05 + G.obtainiumGain *= 1.05; } if (player.currentChallenge.ascension === 15) { - G.obtainiumGain += 1 - G.obtainiumGain *= 1 + 7 * player.cubeUpgrades[62] + G.obtainiumGain += 1; + G.obtainiumGain *= 1 + 7 * player.cubeUpgrades[62]; } + G.obtainiumGain *= + 1 + + 0.001 * +player.blueberryUpgrades.ambrosiaObtainium1.bonus.obtainiumMult; + if (!isFinite(G.obtainiumGain)) { - G.obtainiumGain = 1e300 + G.obtainiumGain = 1e300; } - G.obtainiumGain = Math.min(1e300, G.obtainiumGain) - G.obtainiumGain /= calculateSingularityDebuff('Obtainium') + G.obtainiumGain = Math.min(1e300, G.obtainiumGain); + G.obtainiumGain /= calculateSingularityDebuff("Obtainium"); if (player.usedCorruptions[5] >= 15) { - G.obtainiumGain = Math.pow(G.obtainiumGain, 1 / 4) + G.obtainiumGain = Math.pow(G.obtainiumGain, 1 / 4); } if (player.usedCorruptions[5] >= 16) { - G.obtainiumGain = Math.pow(G.obtainiumGain, 1 / 3) + G.obtainiumGain = Math.pow(G.obtainiumGain, 1 / 3); } - G.obtainiumGain = Math.max(1 + player.singularityCount, G.obtainiumGain) + G.obtainiumGain = Math.max(1 + player.singularityCount, G.obtainiumGain); if (player.currentChallenge.ascension === 14) { - G.obtainiumGain = 0 + G.obtainiumGain = 0; } - player.obtainiumpersecond = Math.min(1e300, G.obtainiumGain) / (0.1 + player.reincarnationcounter) - player.maxobtainiumpersecond = Math.max(player.maxobtainiumpersecond, player.obtainiumpersecond) -} + player.obtainiumpersecond = + Math.min(1e300, G.obtainiumGain) / (0.1 + player.reincarnationcounter); + player.maxobtainiumpersecond = Math.max( + player.maxobtainiumpersecond, + player.obtainiumpersecond + ); +}; export const calculateAutomaticObtainium = () => { - return 0.05 * (10 * player.researches[61] + 2 * player.researches[62]) * player.maxobtainiumpersecond - * (1 + 4 * player.cubeUpgrades[3] / 5) -} + return ( + 0.05 * + (10 * player.researches[61] + 2 * player.researches[62]) * + player.maxobtainiumpersecond * + (1 + (4 * player.cubeUpgrades[3]) / 5) + ); +}; // TODO: REFACTOR THIS - May 15, 2022. export const calculateTalismanEffects = () => { - let positiveBonus = 0 - let negativeBonus = 0 + let positiveBonus = 0; + let negativeBonus = 0; if (player.achievements[135] === 1) { - positiveBonus += 0.02 + positiveBonus += 0.02; } if (player.achievements[136] === 1) { - positiveBonus += 0.02 - } - positiveBonus += 0.02 * (player.talismanRarity[4 - 1] - 1) - positiveBonus += 3 * player.researches[106] / 100 - positiveBonus += 3 * player.researches[107] / 100 - positiveBonus += 3 * player.researches[116] / 200 - positiveBonus += 3 * player.researches[117] / 200 - positiveBonus += G.cubeBonusMultiplier[9] - 1 - positiveBonus += 0.0004 * player.cubeUpgrades[50] - negativeBonus += 0.06 * player.researches[118] - negativeBonus += 0.0004 * player.cubeUpgrades[50] + positiveBonus += 0.02; + } + positiveBonus += 0.02 * (player.talismanRarity[4 - 1] - 1); + positiveBonus += (3 * player.researches[106]) / 100; + positiveBonus += (3 * player.researches[107]) / 100; + positiveBonus += (3 * player.researches[116]) / 200; + positiveBonus += (3 * player.researches[117]) / 200; + positiveBonus += G.cubeBonusMultiplier[9] - 1; + positiveBonus += 0.0004 * player.cubeUpgrades[50]; + negativeBonus += 0.06 * player.researches[118]; + negativeBonus += 0.0004 * player.cubeUpgrades[50]; if (player.highestSingularityCount >= 7) { - positiveBonus += negativeBonus - negativeBonus = positiveBonus + positiveBonus += negativeBonus; + negativeBonus = positiveBonus; } if (player.highestSingularityCount < 7) { for (let i = 1; i <= 5; i++) { - if (player.talismanOne[i] === (1)) { - G.talisman1Effect[i] = (G.talismanPositiveModifier[player.talismanRarity[1 - 1]]! + positiveBonus) - * player.talismanLevels[1 - 1] * G.challenge15Rewards.talismanBonus + if (player.talismanOne[i] === 1) { + G.talisman1Effect[i] = + (G.talismanPositiveModifier[player.talismanRarity[1 - 1]]! + + positiveBonus) * + player.talismanLevels[1 - 1] * + G.challenge15Rewards.talismanBonus; } else { - G.talisman1Effect[i] = (G.talismanNegativeModifier[player.talismanRarity[1 - 1]]! - negativeBonus) - * player.talismanLevels[1 - 1] * (-1) * G.challenge15Rewards.talismanBonus + G.talisman1Effect[i] = + (G.talismanNegativeModifier[player.talismanRarity[1 - 1]]! - + negativeBonus) * + player.talismanLevels[1 - 1] * + -1 * + G.challenge15Rewards.talismanBonus; } - if (player.talismanTwo[i] === (1)) { - G.talisman2Effect[i] = (G.talismanPositiveModifier[player.talismanRarity[2 - 1]]! + positiveBonus) - * player.talismanLevels[2 - 1] * G.challenge15Rewards.talismanBonus + if (player.talismanTwo[i] === 1) { + G.talisman2Effect[i] = + (G.talismanPositiveModifier[player.talismanRarity[2 - 1]]! + + positiveBonus) * + player.talismanLevels[2 - 1] * + G.challenge15Rewards.talismanBonus; } else { - G.talisman2Effect[i] = (G.talismanNegativeModifier[player.talismanRarity[2 - 1]]! - negativeBonus) - * player.talismanLevels[2 - 1] * (-1) * G.challenge15Rewards.talismanBonus + G.talisman2Effect[i] = + (G.talismanNegativeModifier[player.talismanRarity[2 - 1]]! - + negativeBonus) * + player.talismanLevels[2 - 1] * + -1 * + G.challenge15Rewards.talismanBonus; } - if (player.talismanThree[i] === (1)) { - G.talisman3Effect[i] = (G.talismanPositiveModifier[player.talismanRarity[3 - 1]]! + positiveBonus) - * player.talismanLevels[3 - 1] * G.challenge15Rewards.talismanBonus + if (player.talismanThree[i] === 1) { + G.talisman3Effect[i] = + (G.talismanPositiveModifier[player.talismanRarity[3 - 1]]! + + positiveBonus) * + player.talismanLevels[3 - 1] * + G.challenge15Rewards.talismanBonus; } else { - G.talisman3Effect[i] = (G.talismanNegativeModifier[player.talismanRarity[3 - 1]]! - negativeBonus) - * player.talismanLevels[3 - 1] * (-1) * G.challenge15Rewards.talismanBonus + G.talisman3Effect[i] = + (G.talismanNegativeModifier[player.talismanRarity[3 - 1]]! - + negativeBonus) * + player.talismanLevels[3 - 1] * + -1 * + G.challenge15Rewards.talismanBonus; } - if (player.talismanFour[i] === (1)) { - G.talisman4Effect[i] = (G.talismanPositiveModifier[player.talismanRarity[4 - 1]]! + positiveBonus) - * player.talismanLevels[4 - 1] * G.challenge15Rewards.talismanBonus + if (player.talismanFour[i] === 1) { + G.talisman4Effect[i] = + (G.talismanPositiveModifier[player.talismanRarity[4 - 1]]! + + positiveBonus) * + player.talismanLevels[4 - 1] * + G.challenge15Rewards.talismanBonus; } else { - G.talisman4Effect[i] = (G.talismanNegativeModifier[player.talismanRarity[4 - 1]]! - negativeBonus) - * player.talismanLevels[4 - 1] * (-1) * G.challenge15Rewards.talismanBonus + G.talisman4Effect[i] = + (G.talismanNegativeModifier[player.talismanRarity[4 - 1]]! - + negativeBonus) * + player.talismanLevels[4 - 1] * + -1 * + G.challenge15Rewards.talismanBonus; } - if (player.talismanFive[i] === (1)) { - G.talisman5Effect[i] = (G.talismanPositiveModifier[player.talismanRarity[5 - 1]]! + positiveBonus) - * player.talismanLevels[5 - 1] * G.challenge15Rewards.talismanBonus + if (player.talismanFive[i] === 1) { + G.talisman5Effect[i] = + (G.talismanPositiveModifier[player.talismanRarity[5 - 1]]! + + positiveBonus) * + player.talismanLevels[5 - 1] * + G.challenge15Rewards.talismanBonus; } else { - G.talisman5Effect[i] = (G.talismanNegativeModifier[player.talismanRarity[5 - 1]]! - negativeBonus) - * player.talismanLevels[5 - 1] * (-1) * G.challenge15Rewards.talismanBonus + G.talisman5Effect[i] = + (G.talismanNegativeModifier[player.talismanRarity[5 - 1]]! - + negativeBonus) * + player.talismanLevels[5 - 1] * + -1 * + G.challenge15Rewards.talismanBonus; } - if (player.talismanSix[i] === (1)) { - G.talisman6Effect[i] = (G.talismanPositiveModifier[player.talismanRarity[6 - 1]]! + positiveBonus) - * player.talismanLevels[6 - 1] * G.challenge15Rewards.talismanBonus + if (player.talismanSix[i] === 1) { + G.talisman6Effect[i] = + (G.talismanPositiveModifier[player.talismanRarity[6 - 1]]! + + positiveBonus) * + player.talismanLevels[6 - 1] * + G.challenge15Rewards.talismanBonus; } else { - G.talisman6Effect[i] = (G.talismanNegativeModifier[player.talismanRarity[6 - 1]]! - negativeBonus) - * player.talismanLevels[6 - 1] * (-1) * G.challenge15Rewards.talismanBonus + G.talisman6Effect[i] = + (G.talismanNegativeModifier[player.talismanRarity[6 - 1]]! - + negativeBonus) * + player.talismanLevels[6 - 1] * + -1 * + G.challenge15Rewards.talismanBonus; } - if (player.talismanSeven[i] === (1)) { - G.talisman7Effect[i] = (G.talismanPositiveModifier[player.talismanRarity[7 - 1]]! + positiveBonus) - * player.talismanLevels[7 - 1] * G.challenge15Rewards.talismanBonus + if (player.talismanSeven[i] === 1) { + G.talisman7Effect[i] = + (G.talismanPositiveModifier[player.talismanRarity[7 - 1]]! + + positiveBonus) * + player.talismanLevels[7 - 1] * + G.challenge15Rewards.talismanBonus; } else { - G.talisman7Effect[i] = (G.talismanNegativeModifier[player.talismanRarity[7 - 1]]! - negativeBonus) - * player.talismanLevels[7 - 1] * (-1) * G.challenge15Rewards.talismanBonus + G.talisman7Effect[i] = + (G.talismanNegativeModifier[player.talismanRarity[7 - 1]]! - + negativeBonus) * + player.talismanLevels[7 - 1] * + -1 * + G.challenge15Rewards.talismanBonus; } } } else { for (let i = 1; i <= 5; i++) { - G.talisman1Effect[i] = (G.talismanPositiveModifier[player.talismanRarity[1 - 1]]! + positiveBonus) - * player.talismanLevels[1 - 1] * G.challenge15Rewards.talismanBonus - G.talisman2Effect[i] = (G.talismanPositiveModifier[player.talismanRarity[2 - 1]]! + positiveBonus) - * player.talismanLevels[2 - 1] * G.challenge15Rewards.talismanBonus - G.talisman3Effect[i] = (G.talismanPositiveModifier[player.talismanRarity[3 - 1]]! + positiveBonus) - * player.talismanLevels[3 - 1] * G.challenge15Rewards.talismanBonus - G.talisman4Effect[i] = (G.talismanPositiveModifier[player.talismanRarity[4 - 1]]! + positiveBonus) - * player.talismanLevels[4 - 1] * G.challenge15Rewards.talismanBonus - G.talisman5Effect[i] = (G.talismanPositiveModifier[player.talismanRarity[5 - 1]]! + positiveBonus) - * player.talismanLevels[5 - 1] * G.challenge15Rewards.talismanBonus - G.talisman6Effect[i] = (G.talismanPositiveModifier[player.talismanRarity[6 - 1]]! + positiveBonus) - * player.talismanLevels[6 - 1] * G.challenge15Rewards.talismanBonus - G.talisman7Effect[i] = (G.talismanPositiveModifier[player.talismanRarity[7 - 1]]! + positiveBonus) - * player.talismanLevels[7 - 1] * G.challenge15Rewards.talismanBonus + G.talisman1Effect[i] = + (G.talismanPositiveModifier[player.talismanRarity[1 - 1]]! + + positiveBonus) * + player.talismanLevels[1 - 1] * + G.challenge15Rewards.talismanBonus; + G.talisman2Effect[i] = + (G.talismanPositiveModifier[player.talismanRarity[2 - 1]]! + + positiveBonus) * + player.talismanLevels[2 - 1] * + G.challenge15Rewards.talismanBonus; + G.talisman3Effect[i] = + (G.talismanPositiveModifier[player.talismanRarity[3 - 1]]! + + positiveBonus) * + player.talismanLevels[3 - 1] * + G.challenge15Rewards.talismanBonus; + G.talisman4Effect[i] = + (G.talismanPositiveModifier[player.talismanRarity[4 - 1]]! + + positiveBonus) * + player.talismanLevels[4 - 1] * + G.challenge15Rewards.talismanBonus; + G.talisman5Effect[i] = + (G.talismanPositiveModifier[player.talismanRarity[5 - 1]]! + + positiveBonus) * + player.talismanLevels[5 - 1] * + G.challenge15Rewards.talismanBonus; + G.talisman6Effect[i] = + (G.talismanPositiveModifier[player.talismanRarity[6 - 1]]! + + positiveBonus) * + player.talismanLevels[6 - 1] * + G.challenge15Rewards.talismanBonus; + G.talisman7Effect[i] = + (G.talismanPositiveModifier[player.talismanRarity[7 - 1]]! + + positiveBonus) * + player.talismanLevels[7 - 1] * + G.challenge15Rewards.talismanBonus; } } const talismansEffects = [ @@ -693,386 +918,545 @@ export const calculateTalismanEffects = () => { G.talisman4Effect, G.talisman5Effect, G.talisman6Effect, - G.talisman7Effect - ] - const runesTalisman = [0, 0, 0, 0, 0, 0] + G.talisman7Effect, + ]; + const runesTalisman = [0, 0, 0, 0, 0, 0]; talismansEffects.forEach((talismanEffect) => { talismanEffect.forEach((levels, runeNumber) => { - runesTalisman[runeNumber] += levels! - }) - }) - ;[, G.rune1Talisman, G.rune2Talisman, G.rune3Talisman, G.rune4Talisman, G.rune5Talisman] = runesTalisman - G.talisman6Power = 0 - G.talisman7Quarks = 0 + runesTalisman[runeNumber] += levels!; + }); + }); + [ + , + G.rune1Talisman, + G.rune2Talisman, + G.rune3Talisman, + G.rune4Talisman, + G.rune5Talisman, + ] = runesTalisman; + G.talisman6Power = 0; + G.talisman7Quarks = 0; if (player.talismanRarity[1 - 1] === 6) { - G.rune2Talisman += 400 + G.rune2Talisman += 400; } if (player.talismanRarity[2 - 1] === 6) { - G.rune1Talisman += 400 + G.rune1Talisman += 400; } if (player.talismanRarity[3 - 1] === 6) { - G.rune4Talisman += 400 + G.rune4Talisman += 400; } if (player.talismanRarity[4 - 1] === 6) { - G.rune3Talisman += 400 + G.rune3Talisman += 400; } if (player.talismanRarity[5 - 1] === 6) { - G.rune5Talisman += 400 + G.rune5Talisman += 400; } if (player.talismanRarity[6 - 1] === 6) { - G.talisman6Power = 2.5 + G.talisman6Power = 2.5; } if (player.talismanRarity[7 - 1] === 6) { - G.talisman7Quarks = 2 + G.talisman7Quarks = 2; } -} +}; export const calculateRuneLevels = () => { - calculateTalismanEffects() + calculateTalismanEffects(); if (player.currentChallenge.reincarnation !== 9) { - const antUpgrade8 = player.antUpgrades[8] ?? 0 + const antUpgrade8 = player.antUpgrades[8] ?? 0; G.rune1level = Math.max( 1, - player.runelevels[0] + Math.min(1e7, antUpgrade8 + G.bonusant9) * 1 + (G.rune1Talisman) - + 7 * player.constantUpgrades[7] - ) + player.runelevels[0] + + Math.min(1e7, antUpgrade8 + G.bonusant9) * 1 + + G.rune1Talisman + + 7 * player.constantUpgrades[7] + ); G.rune2level = Math.max( 1, - player.runelevels[1] + Math.min(1e7, antUpgrade8 + G.bonusant9) * 1 + (G.rune2Talisman) - + 7 * player.constantUpgrades[7] - ) + player.runelevels[1] + + Math.min(1e7, antUpgrade8 + G.bonusant9) * 1 + + G.rune2Talisman + + 7 * player.constantUpgrades[7] + ); G.rune3level = Math.max( 1, - player.runelevels[2] + Math.min(1e7, antUpgrade8 + G.bonusant9) * 1 + (G.rune3Talisman) - + 7 * player.constantUpgrades[7] - ) + player.runelevels[2] + + Math.min(1e7, antUpgrade8 + G.bonusant9) * 1 + + G.rune3Talisman + + 7 * player.constantUpgrades[7] + ); G.rune4level = Math.max( 1, - player.runelevels[3] + Math.min(1e7, antUpgrade8 + G.bonusant9) * 1 + (G.rune4Talisman) - + 7 * player.constantUpgrades[7] - ) + player.runelevels[3] + + Math.min(1e7, antUpgrade8 + G.bonusant9) * 1 + + G.rune4Talisman + + 7 * player.constantUpgrades[7] + ); G.rune5level = Math.max( 1, - player.runelevels[4] + Math.min(1e7, antUpgrade8 + G.bonusant9) * 1 + (G.rune5Talisman) - + 7 * player.constantUpgrades[7] - ) - } - - G.runeSum = sumContents([G.rune1level, G.rune2level, G.rune3level, G.rune4level, G.rune5level]) - calculateRuneBonuses() -} + player.runelevels[4] + + Math.min(1e7, antUpgrade8 + G.bonusant9) * 1 + + G.rune5Talisman + + 7 * player.constantUpgrades[7] + ); + } + + G.runeSum = sumContents([ + G.rune1level, + G.rune2level, + G.rune3level, + G.rune4level, + G.rune5level, + ]); + calculateRuneBonuses(); +}; export const calculateRuneBonuses = () => { - G.blessingMultiplier = 1 - G.spiritMultiplier = 1 - - G.blessingMultiplier *= 1 + 6.9 * player.researches[134] / 100 - G.blessingMultiplier *= 1 + (player.talismanRarity[3 - 1] - 1) / 10 - G.blessingMultiplier *= 1 + 0.10 * Math.log10(player.epicFragments + 1) * player.researches[174] - G.blessingMultiplier *= 1 + 2 * player.researches[194] / 100 + G.blessingMultiplier = 1; + G.spiritMultiplier = 1; + + G.blessingMultiplier *= 1 + (6.9 * player.researches[134]) / 100; + G.blessingMultiplier *= 1 + (player.talismanRarity[3 - 1] - 1) / 10; + G.blessingMultiplier *= + 1 + 0.1 * Math.log10(player.epicFragments + 1) * player.researches[174]; + G.blessingMultiplier *= 1 + (2 * player.researches[194]) / 100; if (player.researches[160] > 0) { - G.blessingMultiplier *= Math.pow(1.25, 8) + G.blessingMultiplier *= Math.pow(1.25, 8); } - G.spiritMultiplier *= 1 + 8 * player.researches[164] / 100 + G.spiritMultiplier *= 1 + (8 * player.researches[164]) / 100; if (player.researches[165] > 0 && player.currentChallenge.ascension !== 0) { - G.spiritMultiplier *= Math.pow(2, 8) + G.spiritMultiplier *= Math.pow(2, 8); } - G.spiritMultiplier *= 1 + 0.15 * Math.log10(player.legendaryFragments + 1) * player.researches[189] - G.spiritMultiplier *= 1 + 2 * player.researches[194] / 100 - G.spiritMultiplier *= 1 + (player.talismanRarity[5 - 1] - 1) / 100 + G.spiritMultiplier *= + 1 + + 0.15 * Math.log10(player.legendaryFragments + 1) * player.researches[189]; + G.spiritMultiplier *= 1 + (2 * player.researches[194]) / 100; + G.spiritMultiplier *= 1 + (player.talismanRarity[5 - 1] - 1) / 100; for (let i = 1; i <= 5; i++) { - G.runeBlessings[i] = G.blessingMultiplier * player.runelevels[i - 1] * player.runeBlessingLevels[i] - G.runeSpirits[i] = G.spiritMultiplier * player.runelevels[i - 1] * player.runeSpiritLevels[i] + G.runeBlessings[i] = + G.blessingMultiplier * + player.runelevels[i - 1] * + player.runeBlessingLevels[i]; + G.runeSpirits[i] = + G.spiritMultiplier * + player.runelevels[i - 1] * + player.runeSpiritLevels[i]; } for (let i = 1; i <= 5; i++) { if (G.runeBlessings[i] <= 1e30) { - G.effectiveRuneBlessingPower[i] = (Math.pow(G.runeBlessings[i], 1 / 8)) / 75 * G.challenge15Rewards.blessingBonus + G.effectiveRuneBlessingPower[i] = + (Math.pow(G.runeBlessings[i], 1 / 8) / 75) * + G.challenge15Rewards.blessingBonus; } else if (G.runeBlessings[i] > 1e30) { - G.effectiveRuneBlessingPower[i] = Math.pow(10, 5 / 2) * (Math.pow(G.runeBlessings[i], 1 / 24)) / 75 - * G.challenge15Rewards.blessingBonus + G.effectiveRuneBlessingPower[i] = + ((Math.pow(10, 5 / 2) * Math.pow(G.runeBlessings[i], 1 / 24)) / 75) * + G.challenge15Rewards.blessingBonus; } if (G.runeSpirits[i] <= 1e25) { - G.effectiveRuneSpiritPower[i] = (Math.pow(G.runeSpirits[i], 1 / 8)) / 75 * G.challenge15Rewards.spiritBonus + G.effectiveRuneSpiritPower[i] = + (Math.pow(G.runeSpirits[i], 1 / 8) / 75) * + G.challenge15Rewards.spiritBonus; } else if (G.runeSpirits[i] > 1e25) { - G.effectiveRuneSpiritPower[i] = Math.pow(10, 25 / 12) * (Math.pow(G.runeSpirits[i], 1 / 24)) / 75 - * G.challenge15Rewards.spiritBonus + G.effectiveRuneSpiritPower[i] = + ((Math.pow(10, 25 / 12) * Math.pow(G.runeSpirits[i], 1 / 24)) / 75) * + G.challenge15Rewards.spiritBonus; } } -} +}; export const calculateAnts = () => { - let bonusLevels = 0 - bonusLevels += 2 * (player.talismanRarity[6 - 1] - 1) - bonusLevels += CalcECC('reincarnation', player.challengecompletions[9]) - bonusLevels += 2 * player.constantUpgrades[6] - bonusLevels += 12 * CalcECC('ascension', player.challengecompletions[11]) - bonusLevels += Math.floor(1 / 200 * player.researches[200]) - bonusLevels *= G.challenge15Rewards.bonusAntLevel - let c11 = 0 - let c11bonus = 0 + let bonusLevels = 0; + bonusLevels += 2 * (player.talismanRarity[6 - 1] - 1); + bonusLevels += CalcECC("reincarnation", player.challengecompletions[9]); + bonusLevels += 2 * player.constantUpgrades[6]; + bonusLevels += 12 * CalcECC("ascension", player.challengecompletions[11]); + bonusLevels += Math.floor((1 / 200) * player.researches[200]); + bonusLevels *= G.challenge15Rewards.bonusAntLevel; + let c11 = 0; + let c11bonus = 0; if (player.currentChallenge.ascension === 11) { - c11 = 999 + c11 = 999; } if (player.currentChallenge.ascension === 11) { c11bonus = Math.floor( - (4 * player.challengecompletions[8] + 23 * player.challengecompletions[9]) - * Math.max(0, 1 - player.challengecompletions[11] / 10) - ) + (4 * player.challengecompletions[8] + + 23 * player.challengecompletions[9]) * + Math.max(0, 1 - player.challengecompletions[11] / 10) + ); } G.bonusant1 = Math.min( player.antUpgrades[1 - 1]! + c11, - 4 * player.researches[97] + bonusLevels + player.researches[102] + 2 * player.researches[132] + c11bonus - ) + 4 * player.researches[97] + + bonusLevels + + player.researches[102] + + 2 * player.researches[132] + + c11bonus + ); G.bonusant2 = Math.min( player.antUpgrades[2 - 1]! + c11, - 4 * player.researches[97] + bonusLevels + player.researches[102] + 2 * player.researches[132] + c11bonus - ) + 4 * player.researches[97] + + bonusLevels + + player.researches[102] + + 2 * player.researches[132] + + c11bonus + ); G.bonusant3 = Math.min( player.antUpgrades[3 - 1]! + c11, - 4 * player.researches[97] + bonusLevels + player.researches[102] + 2 * player.researches[132] + c11bonus - ) + 4 * player.researches[97] + + bonusLevels + + player.researches[102] + + 2 * player.researches[132] + + c11bonus + ); G.bonusant4 = Math.min( player.antUpgrades[4 - 1]! + c11, - 4 * player.researches[97] + bonusLevels + player.researches[102] + 2 * player.researches[132] + c11bonus - ) + 4 * player.researches[97] + + bonusLevels + + player.researches[102] + + 2 * player.researches[132] + + c11bonus + ); G.bonusant5 = Math.min( player.antUpgrades[5 - 1]! + c11, - 4 * player.researches[97] + bonusLevels + player.researches[102] + 2 * player.researches[132] + c11bonus - ) + 4 * player.researches[97] + + bonusLevels + + player.researches[102] + + 2 * player.researches[132] + + c11bonus + ); G.bonusant6 = Math.min( player.antUpgrades[6 - 1]! + c11, - 4 * player.researches[97] + bonusLevels + player.researches[102] + 2 * player.researches[132] + c11bonus - ) + 4 * player.researches[97] + + bonusLevels + + player.researches[102] + + 2 * player.researches[132] + + c11bonus + ); G.bonusant7 = Math.min( player.antUpgrades[7 - 1]! + c11, - 4 * player.researches[98] + bonusLevels + player.researches[102] + 2 * player.researches[132] + c11bonus - ) + 4 * player.researches[98] + + bonusLevels + + player.researches[102] + + 2 * player.researches[132] + + c11bonus + ); G.bonusant8 = Math.min( player.antUpgrades[8 - 1]! + c11, - 4 * player.researches[98] + bonusLevels + player.researches[102] + 2 * player.researches[132] + c11bonus - ) + 4 * player.researches[98] + + bonusLevels + + player.researches[102] + + 2 * player.researches[132] + + c11bonus + ); G.bonusant9 = Math.min( player.antUpgrades[9 - 1]! + c11, - 4 * player.researches[98] + bonusLevels + player.researches[102] + 2 * player.researches[132] + c11bonus - ) + 4 * player.researches[98] + + bonusLevels + + player.researches[102] + + 2 * player.researches[132] + + c11bonus + ); G.bonusant10 = Math.min( player.antUpgrades[10 - 1]! + c11, - 4 * player.researches[98] + bonusLevels + player.researches[102] + 2 * player.researches[132] + c11bonus - ) + 4 * player.researches[98] + + bonusLevels + + player.researches[102] + + 2 * player.researches[132] + + c11bonus + ); G.bonusant11 = Math.min( player.antUpgrades[11 - 1]! + c11, - 4 * player.researches[98] + bonusLevels + player.researches[102] + 2 * player.researches[132] + c11bonus - ) + 4 * player.researches[98] + + bonusLevels + + player.researches[102] + + 2 * player.researches[132] + + c11bonus + ); G.bonusant12 = Math.min( player.antUpgrades[12 - 1]! + c11, - 4 * player.researches[98] + bonusLevels + player.researches[102] + 2 * player.researches[132] + c11bonus - ) -} + 4 * player.researches[98] + + bonusLevels + + player.researches[102] + + 2 * player.researches[132] + + c11bonus + ); +}; export const calculateAntSacrificeELO = () => { - G.antELO = 0 - G.effectiveELO = 0 - const antUpgradeSum = sumContents(player.antUpgrades as number[]) - if (player.antPoints.gte('1e40')) { - G.antELO += Decimal.log(player.antPoints, 10) - G.antELO += 1 / 2 * antUpgradeSum - G.antELO += 1 / 10 * player.firstOwnedAnts - G.antELO += 1 / 5 * player.secondOwnedAnts - G.antELO += 1 / 3 * player.thirdOwnedAnts - G.antELO += 1 / 2 * player.fourthOwnedAnts - G.antELO += player.fifthOwnedAnts - G.antELO += 2 * player.sixthOwnedAnts - G.antELO += 4 * player.seventhOwnedAnts - G.antELO += 8 * player.eighthOwnedAnts - G.antELO += 666 * player.researches[178] - G.antELO *= 1 + 0.01 * player.achievements[180] + 0.02 * player.achievements[181] + 0.03 * player.achievements[182] - G.antELO *= 1 + player.researches[110] / 100 - G.antELO *= 1 + 2.5 * player.researches[148] / 100 + G.antELO = 0; + G.effectiveELO = 0; + const antUpgradeSum = sumContents(player.antUpgrades as number[]); + if (player.antPoints.gte("1e40")) { + G.antELO += Decimal.log(player.antPoints, 10); + G.antELO += (1 / 2) * antUpgradeSum; + G.antELO += (1 / 10) * player.firstOwnedAnts; + G.antELO += (1 / 5) * player.secondOwnedAnts; + G.antELO += (1 / 3) * player.thirdOwnedAnts; + G.antELO += (1 / 2) * player.fourthOwnedAnts; + G.antELO += player.fifthOwnedAnts; + G.antELO += 2 * player.sixthOwnedAnts; + G.antELO += 4 * player.seventhOwnedAnts; + G.antELO += 8 * player.eighthOwnedAnts; + G.antELO += 666 * player.researches[178]; + G.antELO *= + 1 + + 0.01 * player.achievements[180] + + 0.02 * player.achievements[181] + + 0.03 * player.achievements[182]; + G.antELO *= 1 + player.researches[110] / 100; + G.antELO *= 1 + (2.5 * player.researches[148]) / 100; if (player.achievements[176] === 1) { - G.antELO += 25 + G.antELO += 25; } if (player.achievements[177] === 1) { - G.antELO += 50 + G.antELO += 50; } if (player.achievements[178] === 1) { - G.antELO += 75 + G.antELO += 75; } if (player.achievements[179] === 1) { - G.antELO += 100 + G.antELO += 100; } - G.antELO += 25 * player.researches[108] - G.antELO += 25 * player.researches[109] - G.antELO += 40 * player.researches[123] - G.antELO += 100 * CalcECC('reincarnation', player.challengecompletions[10]) - G.antELO += 75 * player.upgrades[80] - G.antELO = 1 / 10 * Math.floor(10 * G.antELO) - - G.effectiveELO += 0.5 * Math.min(3500, G.antELO) - G.effectiveELO += 0.1 * Math.min(4000, G.antELO) - G.effectiveELO += 0.1 * Math.min(6000, G.antELO) - G.effectiveELO += 0.1 * Math.min(10000, G.antELO) - G.effectiveELO += 0.2 * G.antELO - G.effectiveELO += G.cubeBonusMultiplier[8] - 1 - G.effectiveELO += 1 * player.cubeUpgrades[50] - G.effectiveELO *= 1 + 0.03 * player.upgrades[124] - } -} + G.antELO += 25 * player.researches[108]; + G.antELO += 25 * player.researches[109]; + G.antELO += 40 * player.researches[123]; + G.antELO += 100 * CalcECC("reincarnation", player.challengecompletions[10]); + G.antELO += 75 * player.upgrades[80]; + G.antELO = (1 / 10) * Math.floor(10 * G.antELO); + + G.effectiveELO += 0.5 * Math.min(3500, G.antELO); + G.effectiveELO += 0.1 * Math.min(4000, G.antELO); + G.effectiveELO += 0.1 * Math.min(6000, G.antELO); + G.effectiveELO += 0.1 * Math.min(10000, G.antELO); + G.effectiveELO += 0.2 * G.antELO; + G.effectiveELO += G.cubeBonusMultiplier[8] - 1; + G.effectiveELO += 1 * player.cubeUpgrades[50]; + G.effectiveELO *= 1 + 0.03 * player.upgrades[124]; + } +}; const calculateAntSacrificeMultipliers = () => { - G.timeMultiplier = Math.min(1, Math.pow(player.antSacrificeTimer / 10, 2)) + G.timeMultiplier = Math.min(1, Math.pow(player.antSacrificeTimer / 10, 2)); if (player.achievements[177] === 0) { - G.timeMultiplier *= Math.min(1000, Math.max(1, player.antSacrificeTimer / 10)) + G.timeMultiplier *= Math.min( + 1000, + Math.max(1, player.antSacrificeTimer / 10) + ); } if (player.achievements[177] > 0) { - G.timeMultiplier *= Math.max(1, player.antSacrificeTimer / 10) + G.timeMultiplier *= Math.max(1, player.antSacrificeTimer / 10); } - G.upgradeMultiplier = 1 - G.upgradeMultiplier *= 1 + 2 * (1 - Math.pow(2, -(player.antUpgrades[11 - 1]! + G.bonusant11) / 125)) - G.upgradeMultiplier *= 1 + player.researches[103] / 20 - G.upgradeMultiplier *= 1 + player.researches[104] / 20 + G.upgradeMultiplier = 1; + G.upgradeMultiplier *= + 1 + + 2 * (1 - Math.pow(2, -(player.antUpgrades[11 - 1]! + G.bonusant11) / 125)); + G.upgradeMultiplier *= 1 + player.researches[103] / 20; + G.upgradeMultiplier *= 1 + player.researches[104] / 20; if (player.achievements[132] === 1) { - G.upgradeMultiplier *= 1.25 + G.upgradeMultiplier *= 1.25; } if (player.achievements[137] === 1) { - G.upgradeMultiplier *= 1.25 - } - G.upgradeMultiplier *= 1 + 20 / 3 * G.effectiveRuneBlessingPower[3] - G.upgradeMultiplier *= 1 + 1 / 50 * CalcECC('reincarnation', player.challengecompletions[10]) - G.upgradeMultiplier *= 1 + 1 / 50 * player.researches[122] - G.upgradeMultiplier *= 1 + 3 / 100 * player.researches[133] - G.upgradeMultiplier *= 1 + 2 / 100 * player.researches[163] - G.upgradeMultiplier *= 1 + 1 / 100 * player.researches[193] - G.upgradeMultiplier *= 1 + 1 / 10 * player.upgrades[79] - G.upgradeMultiplier *= 1 + 1 / 4 * player.upgrades[40] - G.upgradeMultiplier *= G.cubeBonusMultiplier[7] - G.upgradeMultiplier *= 1 + calculateEventBuff(BuffType.AntSacrifice) - G.upgradeMultiplier = Math.min(1e300, G.upgradeMultiplier) -} + G.upgradeMultiplier *= 1.25; + } + G.upgradeMultiplier *= 1 + (20 / 3) * G.effectiveRuneBlessingPower[3]; + G.upgradeMultiplier *= + 1 + (1 / 50) * CalcECC("reincarnation", player.challengecompletions[10]); + G.upgradeMultiplier *= 1 + (1 / 50) * player.researches[122]; + G.upgradeMultiplier *= 1 + (3 / 100) * player.researches[133]; + G.upgradeMultiplier *= 1 + (2 / 100) * player.researches[163]; + G.upgradeMultiplier *= 1 + (1 / 100) * player.researches[193]; + G.upgradeMultiplier *= 1 + (1 / 10) * player.upgrades[79]; + G.upgradeMultiplier *= 1 + (1 / 4) * player.upgrades[40]; + G.upgradeMultiplier *= G.cubeBonusMultiplier[7]; + G.upgradeMultiplier *= 1 + calculateEventBuff(BuffType.AntSacrifice); + G.upgradeMultiplier = Math.min(1e300, G.upgradeMultiplier); +}; interface IAntSacRewards { - antSacrificePoints: number - offerings: number - obtainium: number - talismanShards: number - commonFragments: number - uncommonFragments: number - rareFragments: number - epicFragments: number - legendaryFragments: number - mythicalFragments: number + antSacrificePoints: number; + offerings: number; + obtainium: number; + talismanShards: number; + commonFragments: number; + uncommonFragments: number; + rareFragments: number; + epicFragments: number; + legendaryFragments: number; + mythicalFragments: number; } export const calculateAntSacrificeRewards = (): IAntSacRewards => { - calculateAntSacrificeELO() - calculateAntSacrificeMultipliers() + calculateAntSacrificeELO(); + calculateAntSacrificeMultipliers(); - const maxCap = 1e300 - const rewardsMult = Math.min(maxCap, G.timeMultiplier * G.upgradeMultiplier) + const maxCap = 1e300; + const rewardsMult = Math.min(maxCap, G.timeMultiplier * G.upgradeMultiplier); const rewards: IAntSacRewards = { - antSacrificePoints: G.effectiveELO * rewardsMult / 85, - offerings: Math.min(maxCap, player.offeringpersecond * 0.15 * G.effectiveELO * rewardsMult / 180), - obtainium: Math.min(maxCap, player.maxobtainiumpersecond * 0.24 * G.effectiveELO * rewardsMult / 180), - talismanShards: (G.antELO > 500) - ? Math.min( - maxCap, - Math.max(1, Math.floor(rewardsMult / 210 * Math.pow(1 / 4 * (Math.max(0, G.effectiveELO - 500)), 2))) - ) - : 0, - commonFragments: (G.antELO > 750) - ? Math.min( - maxCap, - Math.max(1, Math.floor(rewardsMult / 110 * Math.pow(1 / 9 * (Math.max(0, G.effectiveELO - 750)), 1.83))) - ) - : 0, - uncommonFragments: (G.antELO > 1000) - ? Math.min( - maxCap, - Math.max(1, Math.floor(rewardsMult / 170 * Math.pow(1 / 16 * (Math.max(0, G.effectiveELO - 1000)), 1.66))) - ) - : 0, - rareFragments: (G.antELO > 1500) - ? Math.min( - maxCap, - Math.max(1, Math.floor(rewardsMult / 200 * Math.pow(1 / 25 * (Math.max(0, G.effectiveELO - 1500)), 1.50))) - ) - : 0, - epicFragments: (G.antELO > 2000) - ? Math.min( - maxCap, - Math.max(1, Math.floor(rewardsMult / 200 * Math.pow(1 / 36 * (Math.max(0, G.effectiveELO - 2000)), 1.33))) - ) - : 0, - legendaryFragments: (G.antELO > 3000) - ? Math.min( - maxCap, - Math.max(1, Math.floor(rewardsMult / 230 * Math.pow(1 / 49 * (Math.max(0, G.effectiveELO - 3000)), 1.16))) - ) - : 0, - mythicalFragments: (G.antELO > 5000) - ? Math.min( - maxCap, - Math.max(1, Math.floor(rewardsMult / 220 * Math.pow(1 / 64 * (Math.max(0, G.effectiveELO - 4150)), 1))) - ) - : 0 - } - - return rewards -} + antSacrificePoints: (G.effectiveELO * rewardsMult) / 85, + offerings: Math.min( + maxCap, + (player.offeringpersecond * 0.15 * G.effectiveELO * rewardsMult) / 180 + ), + obtainium: Math.min( + maxCap, + (player.maxobtainiumpersecond * 0.24 * G.effectiveELO * rewardsMult) / 180 + ), + talismanShards: + G.antELO > 500 + ? Math.min( + maxCap, + Math.max( + 1, + Math.floor( + (rewardsMult / 210) * + Math.pow((1 / 4) * Math.max(0, G.effectiveELO - 500), 2) + ) + ) + ) + : 0, + commonFragments: + G.antELO > 750 + ? Math.min( + maxCap, + Math.max( + 1, + Math.floor( + (rewardsMult / 110) * + Math.pow((1 / 9) * Math.max(0, G.effectiveELO - 750), 1.83) + ) + ) + ) + : 0, + uncommonFragments: + G.antELO > 1000 + ? Math.min( + maxCap, + Math.max( + 1, + Math.floor( + (rewardsMult / 170) * + Math.pow((1 / 16) * Math.max(0, G.effectiveELO - 1000), 1.66) + ) + ) + ) + : 0, + rareFragments: + G.antELO > 1500 + ? Math.min( + maxCap, + Math.max( + 1, + Math.floor( + (rewardsMult / 200) * + Math.pow((1 / 25) * Math.max(0, G.effectiveELO - 1500), 1.5) + ) + ) + ) + : 0, + epicFragments: + G.antELO > 2000 + ? Math.min( + maxCap, + Math.max( + 1, + Math.floor( + (rewardsMult / 200) * + Math.pow((1 / 36) * Math.max(0, G.effectiveELO - 2000), 1.33) + ) + ) + ) + : 0, + legendaryFragments: + G.antELO > 3000 + ? Math.min( + maxCap, + Math.max( + 1, + Math.floor( + (rewardsMult / 230) * + Math.pow((1 / 49) * Math.max(0, G.effectiveELO - 3000), 1.16) + ) + ) + ) + : 0, + mythicalFragments: + G.antELO > 5000 + ? Math.min( + maxCap, + Math.max( + 1, + Math.floor( + (rewardsMult / 220) * + Math.pow((1 / 64) * Math.max(0, G.effectiveELO - 4150), 1) + ) + ) + ) + : 0, + }; + + return rewards; +}; export const timeWarp = async () => { - const time = await Prompt(i18next.t('calculate.timePrompt')) - const timeUse = Number(time) - if ( - Number.isNaN(timeUse) - || timeUse <= 0 - ) { - return Alert(i18next.t('calculate.timePromptError')) + const time = await Prompt(i18next.t("calculate.timePrompt")); + const timeUse = Number(time); + if (Number.isNaN(timeUse) || timeUse <= 0) { + return Alert(i18next.t("calculate.timePromptError")); } - DOMCacheGetOrSet('offlineContainer').style.display = 'flex' - DOMCacheGetOrSet('offlineBlur').style.display = '' - await calculateOffline(timeUse) -} + DOMCacheGetOrSet("offlineContainer").style.display = "flex"; + DOMCacheGetOrSet("offlineBlur").style.display = ""; + await calculateOffline(timeUse); +}; export const calculateOffline = async (forceTime = 0) => { - disableHotkeys() + disableHotkeys(); - G.timeWarp = true + G.timeWarp = true; // Variable Declarations i guess - const maximumTimer = 86400 * 3 + 7200 * 2 * player.researches[31] + 7200 * 2 * player.researches[32] - const updatedTime = Date.now() - const timeAdd = Math.min(maximumTimer, Math.max(forceTime, (updatedTime - player.offlinetick) / 1000)) - const timeTick = timeAdd / 200 - let resourceTicks = 200 - - DOMCacheGetOrSet('offlineTimer').textContent = i18next.t('calculate.offlineTimer', { value: format(timeAdd, 0) }) + const maximumTimer = + 86400 * 3 + + 7200 * 2 * player.researches[31] + + 7200 * 2 * player.researches[32]; + const updatedTime = Date.now(); + const timeAdd = Math.min( + maximumTimer, + Math.max(forceTime, (updatedTime - player.offlinetick) / 1000) + ); + const timeTick = timeAdd / 200; + let resourceTicks = 200; + + DOMCacheGetOrSet("offlineTimer").textContent = i18next.t( + "calculate.offlineTimer", + { value: format(timeAdd, 0) } + ); // May 11, 2021: I've revamped calculations for this significantly. Note to May 11 Platonic: Fuck off -May 15 Platonic // Some one-time tick things that are relatively important - toggleTalismanBuy(player.buyTalismanShardPercent) - updateTalismanInventory() + toggleTalismanBuy(player.buyTalismanShardPercent); + updateTalismanInventory(); - const offlineDialog = player.offlinetick > 0 + const offlineDialog = player.offlinetick > 0; - player.offlinetick = (player.offlinetick < 1.5e12) ? (Date.now()) : player.offlinetick + player.offlinetick = + player.offlinetick < 1.5e12 ? Date.now() : player.offlinetick; - G.timeMultiplier = calculateTimeAcceleration().mult - calculateObtainium() - const obtainiumGain = calculateAutomaticObtainium() + G.timeMultiplier = calculateTimeAcceleration().mult; + calculateObtainium(); + const obtainiumGain = calculateAutomaticObtainium(); const resetAdd = { prestige: timeAdd / Math.max(0.01, player.fastestprestige), offering: Math.floor(timeAdd), transcension: timeAdd / Math.max(0.01, player.fastesttranscend), reincarnation: timeAdd / Math.max(0.01, player.fastestreincarnate), - obtainium: timeAdd * obtainiumGain * G.timeMultiplier - } + obtainium: timeAdd * obtainiumGain * G.timeMultiplier, + }; const timerAdd = { prestige: timeAdd * G.timeMultiplier, @@ -1081,150 +1465,199 @@ export const calculateOffline = async (forceTime = 0) => { ants: timeAdd * G.timeMultiplier, antsReal: timeAdd, ascension: player.ascensionCounter, // Calculate this after the fact - quarks: quarkHandler().gain // Calculate this after the fact - } - - addTimers('ascension', timeAdd) - addTimers('quarks', timeAdd) - addTimers('goldenQuarks', timeAdd) - addTimers('singularity', timeAdd) - addTimers('octeracts', timeTick) - addTimers('ambrosia', timeAdd) - - player.prestigeCount += resetAdd.prestige - player.transcendCount += resetAdd.transcension - player.reincarnationCount += resetAdd.reincarnation - timerAdd.ascension = player.ascensionCounter - timerAdd.ascension - timerAdd.quarks = quarkHandler().gain - timerAdd.quarks + quarks: quarkHandler().gain, // Calculate this after the fact + }; + + addTimers("ascension", timeAdd); + addTimers("quarks", timeAdd); + addTimers("goldenQuarks", timeAdd); + addTimers("singularity", timeAdd); + addTimers("octeracts", timeTick); + addTimers("ambrosia", timeAdd); + + player.prestigeCount += resetAdd.prestige; + player.transcendCount += resetAdd.transcension; + player.reincarnationCount += resetAdd.reincarnation; + timerAdd.ascension = player.ascensionCounter - timerAdd.ascension; + timerAdd.quarks = quarkHandler().gain - timerAdd.quarks; // 200 simulated all ticks [July 12, 2021] const runOffline = setInterval(() => { - G.timeMultiplier = calculateTimeAcceleration().mult - calculateObtainium() + G.timeMultiplier = calculateTimeAcceleration().mult; + calculateObtainium(); // Reset Stuff lmao! - addTimers('prestige', timeTick) - addTimers('transcension', timeTick) - addTimers('reincarnation', timeTick) - addTimers('octeracts', timeTick) + addTimers("prestige", timeTick); + addTimers("transcension", timeTick); + addTimers("reincarnation", timeTick); + addTimers("octeracts", timeTick); - resourceGain(timeTick * G.timeMultiplier) + resourceGain(timeTick * G.timeMultiplier); // Auto Obtainium Stuff if (player.researches[61] > 0 && player.currentChallenge.ascension !== 14) { - automaticTools('addObtainium', timeTick) + automaticTools("addObtainium", timeTick); } // Auto Ant Sacrifice Stuff if (player.achievements[173] > 0) { - automaticTools('antSacrifice', timeTick) + automaticTools("antSacrifice", timeTick); } // Auto Offerings - automaticTools('addOfferings', timeTick) + automaticTools("addOfferings", timeTick); // Auto Rune Sacrifice Stuff if (player.shopUpgrades.offeringAuto > 0 && player.autoSacrificeToggle) { - automaticTools('runeSacrifice', timeTick) + automaticTools("runeSacrifice", timeTick); } if (resourceTicks % 5 === 1) { // 196, 191, ... , 6, 1 ticks remaining - updateAll() + updateAll(); } - resourceTicks -= 1 + resourceTicks -= 1; // Misc functions if (resourceTicks < 1) { - clearInterval(runOffline) - G.timeWarp = false + clearInterval(runOffline); + G.timeWarp = false; + } + }, 0); + + DOMCacheGetOrSet("offlinePrestigeCountNumber").textContent = format( + resetAdd.prestige, + 0, + true + ); + DOMCacheGetOrSet("offlinePrestigeTimer").innerHTML = i18next.t( + "offlineProgress.currentPrestigeTimer", + { + value: format(timerAdd.prestige, 2, false), + } + ); + DOMCacheGetOrSet("offlineOfferingCount").innerHTML = i18next.t( + "offlineProgress.offeringsGenerated", + { + value: format(resetAdd.offering, 0, true), + } + ); + DOMCacheGetOrSet("offlineTranscensionCount").innerHTML = i18next.t( + "offlineProgress.transcensionCount", + { + value: format(resetAdd.transcension, 0, true), + } + ); + DOMCacheGetOrSet("offlineTranscensionTimer").innerHTML = i18next.t( + "offlineProgress.currentTranscensionCounter", + { + value: format(timerAdd.transcension, 2, false), + } + ); + DOMCacheGetOrSet("offlineReincarnationCount").innerHTML = i18next.t( + "offlineProgress.reincarnationCount", + { + value: format(resetAdd.reincarnation, 0, true), } - }, 0) - - DOMCacheGetOrSet('offlinePrestigeCountNumber').textContent = format(resetAdd.prestige, 0, true) - DOMCacheGetOrSet('offlinePrestigeTimer').innerHTML = i18next.t('offlineProgress.currentPrestigeTimer', { - value: format(timerAdd.prestige, 2, false) - }) - DOMCacheGetOrSet('offlineOfferingCount').innerHTML = i18next.t('offlineProgress.offeringsGenerated', { - value: format(resetAdd.offering, 0, true) - }) - DOMCacheGetOrSet('offlineTranscensionCount').innerHTML = i18next.t('offlineProgress.transcensionCount', { - value: format(resetAdd.transcension, 0, true) - }) - DOMCacheGetOrSet('offlineTranscensionTimer').innerHTML = i18next.t('offlineProgress.currentTranscensionCounter', { - value: format(timerAdd.transcension, 2, false) - }) - DOMCacheGetOrSet('offlineReincarnationCount').innerHTML = i18next.t('offlineProgress.reincarnationCount', { - value: format(resetAdd.reincarnation, 0, true) - }) - DOMCacheGetOrSet('offlineReincarnationTimer').innerHTML = i18next.t('offlineProgress.currentReincarnationTimer', { - value: format(timerAdd.reincarnation, 2, false) - }) - DOMCacheGetOrSet('offlineObtainiumCount').innerHTML = i18next.t('offlineProgress.obtainiumGenerated', { - value: format(resetAdd.obtainium, 0, true) - }) - DOMCacheGetOrSet('offlineAntTimer').innerHTML = i18next.t('offlineProgress.ingameAntSacTimer', { - value: format(timerAdd.ants, 2, false) - }) - DOMCacheGetOrSet('offlineRealAntTimer').innerHTML = i18next.t('offlineProgress.realAntSacTimer', { - value: format(timerAdd.antsReal, 2, true) - }) - DOMCacheGetOrSet('offlineAscensionTimer').innerHTML = i18next.t('offlineProgress.currentAscensionTimer', { - value: format(timerAdd.ascension, 2, true) - }) - DOMCacheGetOrSet('offlineQuarkCount').innerHTML = i18next.t('offlineProgress.exportQuarks', { - value: format(timerAdd.quarks, 0, true) - }) - - DOMCacheGetOrSet('progressbardescription').textContent = i18next.t('calculate.offlineEarnings') - - player.offlinetick = updatedTime + ); + DOMCacheGetOrSet("offlineReincarnationTimer").innerHTML = i18next.t( + "offlineProgress.currentReincarnationTimer", + { + value: format(timerAdd.reincarnation, 2, false), + } + ); + DOMCacheGetOrSet("offlineObtainiumCount").innerHTML = i18next.t( + "offlineProgress.obtainiumGenerated", + { + value: format(resetAdd.obtainium, 0, true), + } + ); + DOMCacheGetOrSet("offlineAntTimer").innerHTML = i18next.t( + "offlineProgress.ingameAntSacTimer", + { + value: format(timerAdd.ants, 2, false), + } + ); + DOMCacheGetOrSet("offlineRealAntTimer").innerHTML = i18next.t( + "offlineProgress.realAntSacTimer", + { + value: format(timerAdd.antsReal, 2, true), + } + ); + DOMCacheGetOrSet("offlineAscensionTimer").innerHTML = i18next.t( + "offlineProgress.currentAscensionTimer", + { + value: format(timerAdd.ascension, 2, true), + } + ); + DOMCacheGetOrSet("offlineQuarkCount").innerHTML = i18next.t( + "offlineProgress.exportQuarks", + { + value: format(timerAdd.quarks, 0, true), + } + ); + + DOMCacheGetOrSet("progressbardescription").textContent = i18next.t( + "calculate.offlineEarnings" + ); + + player.offlinetick = updatedTime; if (!player.loadedNov13Vers) { - if (player.challengecompletions[14] > 0 || player.highestchallengecompletions[14] > 0) { - const ascCount = player.ascensionCount - reset('ascensionChallenge') - player.ascensionCount = ascCount + 1 + if ( + player.challengecompletions[14] > 0 || + player.highestchallengecompletions[14] > 0 + ) { + const ascCount = player.ascensionCount; + reset("ascensionChallenge"); + player.ascensionCount = ascCount + 1; } - player.loadedNov13Vers = true + player.loadedNov13Vers = true; } - await saveSynergy() + await saveSynergy(); - updateTalismanInventory() - calculateObtainium() - calculateAnts() - calculateRuneLevels() + updateTalismanInventory(); + calculateObtainium(); + calculateAnts(); + calculateRuneLevels(); // allow aesthetic offline progress if (offlineDialog) { - const el = DOMCacheGetOrSet('notification') - el.classList.add('slide-out') - el.classList.remove('slide-in') - document.body.classList.remove('scrollbar') - document.body.classList.add('loading') - DOMCacheGetOrSet('exitOffline').style.visibility = 'hidden' - DOMCacheGetOrSet('offlineContainer').style.display = 'flex' - DOMCacheGetOrSet('transparentBG').style.display = 'block' + const el = DOMCacheGetOrSet("notification"); + el.classList.add("slide-out"); + el.classList.remove("slide-in"); + document.body.classList.remove("scrollbar"); + document.body.classList.add("loading"); + DOMCacheGetOrSet("exitOffline").style.visibility = "hidden"; + DOMCacheGetOrSet("offlineContainer").style.display = "flex"; + DOMCacheGetOrSet("transparentBG").style.display = "block"; } else { - exitOffline() + exitOffline(); } -} +}; export const exitOffline = () => { - document.body.classList.remove('loading') - document.body.classList.add('scrollbar') - DOMCacheGetOrSet('transparentBG').style.display = 'none' - DOMCacheGetOrSet('offlineContainer').style.display = 'none' - DOMCacheGetOrSet('offlineBlur').style.display = 'none' - enableHotkeys() -} - -export const calculateSigmoid = (constant: number, factor: number, divisor: number) => { - return (1 + (constant - 1) * (1 - Math.pow(2, -factor / divisor))) -} + document.body.classList.remove("loading"); + document.body.classList.add("scrollbar"); + DOMCacheGetOrSet("transparentBG").style.display = "none"; + DOMCacheGetOrSet("offlineContainer").style.display = "none"; + DOMCacheGetOrSet("offlineBlur").style.display = "none"; + enableHotkeys(); +}; + +export const calculateSigmoid = ( + constant: number, + factor: number, + divisor: number +) => { + return 1 + (constant - 1) * (1 - Math.pow(2, -factor / divisor)); +}; -export const calculateSigmoidExponential = (constant: number, coefficient: number) => { - return (1 + (constant - 1) * (1 - Math.exp(-coefficient))) -} +export const calculateSigmoidExponential = ( + constant: number, + coefficient: number +) => { + return 1 + (constant - 1) * (1 - Math.exp(-coefficient)); +}; export const calculateCubeBlessings = () => { // The visual updates are handled in visualUpdateCubes() @@ -1238,8 +1671,8 @@ export const calculateCubeBlessings = () => { player.cubeBlessings.antSacrifice, player.cubeBlessings.antELO, player.cubeBlessings.talismanBonus, - player.cubeBlessings.globalSpeed - ] + player.cubeBlessings.globalSpeed, + ]; const powerBonus = [ player.cubeUpgrades[45] / 100, player.cubeUpgrades[35] / 100, @@ -1250,100 +1683,124 @@ export const calculateCubeBlessings = () => { player.cubeUpgrades[15] / 100, player.cubeUpgrades[25] / 100, player.cubeUpgrades[44] / 100, - player.cubeUpgrades[34] / 100 - ] + player.cubeUpgrades[34] / 100, + ]; for (let i = 1; i <= 10; i++) { - let power = 1 - let mult = 1 + let power = 1; + let mult = 1; if (cubeArray[i - 1] >= 1000) { - power = G.blessingDRPower[i]! - mult *= Math.pow(1000, (1 - G.blessingDRPower[i]!) * (1 + powerBonus[i - 1])) + power = G.blessingDRPower[i]!; + mult *= Math.pow( + 1000, + (1 - G.blessingDRPower[i]!) * (1 + powerBonus[i - 1]) + ); } if (i === 6) { - power = 2.25 - mult = 1 + power = 2.25; + mult = 1; } G.cubeBonusMultiplier[i] = Math.min( 1e300, - 1 + mult * G.blessingbase[i]! * Math.pow(cubeArray[i - 1], power * (1 + powerBonus[i - 1])) - * G.tesseractBonusMultiplier[i]! - ) - } - calculateRuneLevels() - calculateAntSacrificeELO() - calculateObtainium() -} + 1 + + mult * + G.blessingbase[i]! * + Math.pow(cubeArray[i - 1], power * (1 + powerBonus[i - 1])) * + G.tesseractBonusMultiplier[i]! + ); + } + calculateRuneLevels(); + calculateAntSacrificeELO(); + calculateObtainium(); +}; export const calculateTotalOcteractCubeBonus = () => { if (player.singularityChallenges.noOcteracts.enabled) { - return 1 + return 1; } if (player.totalWowOcteracts < 1000) { - const bonus = 1 + 2 / 1000 * player.totalWowOcteracts // At 1,000 returns 3 - return bonus > 1.00001 ? bonus : 1 + const bonus = 1 + (2 / 1000) * player.totalWowOcteracts; // At 1,000 returns 3 + return bonus > 1.00001 ? bonus : 1; } else { - const power = 2 + +player.singularityChallenges.noOcteracts.rewards.octeractPow - return 3 * Math.pow(Math.log10(player.totalWowOcteracts) - 2, power) // At 1,000 returns 3 + const power = + 2 + +player.singularityChallenges.noOcteracts.rewards.octeractPow; + return 3 * Math.pow(Math.log10(player.totalWowOcteracts) - 2, power); // At 1,000 returns 3 } -} +}; export const calculateTotalOcteractQuarkBonus = () => { if (player.singularityChallenges.noOcteracts.enabled) { - return 1 + return 1; } if (player.totalWowOcteracts < 1000) { - const bonus = 1 + 0.2 / 1000 * player.totalWowOcteracts // At 1,000 returns 1.20 - return bonus > 1.00001 ? bonus : 1 + const bonus = 1 + (0.2 / 1000) * player.totalWowOcteracts; // At 1,000 returns 1.20 + return bonus > 1.00001 ? bonus : 1; } else { - return 1.1 + 0.1 * (Math.log10(player.totalWowOcteracts) - 2) // At 1,000 returns 1.20 + return 1.1 + 0.1 * (Math.log10(player.totalWowOcteracts) - 2); // At 1,000 returns 1.20 } -} +}; export const calculateTotalOcteractOfferingBonus = () => { if (!player.singularityChallenges.noOcteracts.rewards.offeringBonus) { - return 1 + return 1; } - return Math.pow(calculateTotalOcteractQuarkBonus(), 1.5) -} + return Math.pow(calculateTotalOcteractQuarkBonus(), 1.5); +}; export const calculateTotalOcteractObtainiumBonus = () => { if (!player.singularityChallenges.noOcteracts.rewards.obtainiumBonus) { - return 1 + return 1; } - return Math.pow(calculateTotalOcteractQuarkBonus(), 1.4) -} + return Math.pow(calculateTotalOcteractQuarkBonus(), 1.4); +}; export const calculateAllCubeMultiplier = () => { const arr = [ // Ascension Time Multiplier to cubes - Math.pow(Math.min(1, player.ascensionCounter / 10), 2) * (1 + (1 / 4 * player.achievements[204] + 1 / 4 - * player.achievements[211] - + 1 / 2 * player.achievements[218]) * Math.max(0, player.ascensionCounter / 10 - 1)), + Math.pow(Math.min(1, player.ascensionCounter / 10), 2) * + (1 + + ((1 / 4) * player.achievements[204] + + (1 / 4) * player.achievements[211] + + (1 / 2) * player.achievements[218]) * + Math.max(0, player.ascensionCounter / 10 - 1)), // Sun and Moon achievements - 1 + 6 / 100 * player.achievements[250] + 10 / 100 * player.achievements[251], + 1 + + (6 / 100) * player.achievements[250] + + (10 / 100) * player.achievements[251], // Speed Achievement - 1 - + player.achievements[240] - * Math.min(0.5, Math.max(0.1, 1 / 20 * Math.log10(calculateTimeAcceleration().mult + 0.01))), + 1 + + player.achievements[240] * + Math.min( + 0.5, + Math.max( + 0.1, + (1 / 20) * Math.log10(calculateTimeAcceleration().mult + 0.01) + ) + ), // Challenge 15: All Cube Gain bonuses 1-5 - G.challenge15Rewards.cube1 * G.challenge15Rewards.cube2 * G.challenge15Rewards.cube3 * G.challenge15Rewards.cube4 - * G.challenge15Rewards.cube5, + G.challenge15Rewards.cube1 * + G.challenge15Rewards.cube2 * + G.challenge15Rewards.cube3 * + G.challenge15Rewards.cube4 * + G.challenge15Rewards.cube5, // Rune 6: Infinite Ascent - 1 + 1 / 100 * calculateEffectiveIALevel(), + 1 + (1 / 100) * calculateEffectiveIALevel(), // BETA: 2x Cubes 1 + player.platonicUpgrades[10], // OMEGA: C9 Cube Bonus - Math.pow(1.01, player.platonicUpgrades[15] * player.challengecompletions[9]), + Math.pow( + 1.01, + player.platonicUpgrades[15] * player.challengecompletions[9] + ), // Powder Bonus calculateCubeMultFromPowder(), // Event 1 + calculateEventBuff(BuffType.Cubes), // Singularity Factor - 1 / calculateSingularityDebuff('Cubes'), + 1 / calculateSingularityDebuff("Cubes"), // Wow Pass Y - 1 + 0.75 * player.shopUpgrades.seasonPassY / 100, + 1 + (0.75 * player.shopUpgrades.seasonPassY) / 100, // BUY THIS! Golden Quark Upgrade 1 + 4 * (player.singularityUpgrades.starterPack.getEffect().bonus ? 1 : 0), // Cube Flame [GQ] @@ -1353,7 +1810,7 @@ export const calculateAllCubeMultiplier = () => { // Cube Inferno [GQ] +player.singularityUpgrades.singCubes3.getEffect().bonus, // Wow Pass Z - 1 + player.shopUpgrades.seasonPassZ * player.singularityCount / 100, + 1 + (player.shopUpgrades.seasonPassZ * player.singularityCount) / 100, // Cookie Upgrade 16 1 + 1 * player.cubeUpgrades[66] * (1 - player.platonicUpgrades[15]), // Cookie Upgrade 8 (now actually works) @@ -1367,9 +1824,9 @@ export const calculateAllCubeMultiplier = () => { // Singularity Citadel 2 +player.singularityUpgrades.singCitadel2.getEffect().bonus, // Platonic DELTA - 1 - + +player.singularityUpgrades.platonicDelta.getEffect().bonus - * Math.min(9, player.singularityCounter / (3600 * 24)), + 1 + + +player.singularityUpgrades.platonicDelta.getEffect().bonus * + Math.min(9, player.singularityCounter / (3600 * 24)), // Wow Pass INF Math.pow(1.02, player.shopUpgrades.seasonPassInfinity), // Ambrosia Mult @@ -1383,20 +1840,22 @@ export const calculateAllCubeMultiplier = () => { // Module - Quark-Cube 1 +player.blueberryUpgrades.ambrosiaQuarkCube1.bonus.cubes, // Module - Cubes 2 - +player.blueberryUpgrades.ambrosiaCubes2.bonus.cubes + +player.blueberryUpgrades.ambrosiaCubes2.bonus.cubes, + // Module - Hyperflux + +player.blueberryUpgrades.ambrosiaHyperflux.bonus.hyperFlux, // Total Global Cube Multipliers: 30 - ] + ]; - const extraMult = (G.isEvent && G.eventClicked) ? 1.05 : 1 + const extraMult = G.isEvent && G.eventClicked ? 1.05 : 1; return { mult: productContents(arr) * extraMult, - list: arr - } -} + list: arr, + }; +}; export const calculateCubeMultiplier = (score = -1) => { if (score < 0) { - score = calculateAscensionScore().effectiveScore + score = calculateAscensionScore().effectiveScore; } const arr = [ @@ -1405,169 +1864,228 @@ export const calculateCubeMultiplier = (score = -1) => { // Global Multiplier calculateAllCubeMultiplier().mult, // Season Pass 1 - 1 + 2.25 * player.shopUpgrades.seasonPass / 100, + 1 + (2.25 * player.shopUpgrades.seasonPass) / 100, // Researches (Excl 8x25) - (1 + player.researches[119] / 400) // 5x19 - * (1 + player.researches[120] / 400) // 5x20 - * (1 + player.researches[137] / 100) // 6x12 - * (1 + 0.9 * player.researches[152] / 100) // 7x2 - * (1 + 0.8 * player.researches[167] / 100) // 7x17 - * (1 + 0.7 * player.researches[182] / 100) // 8x7 - * (1 + 0.03 / 100 * player.researches[192] * player.antUpgrades[12 - 1]!) // 8x17 - * (1 + 0.6 * player.researches[197] / 100), // 8x22 + (1 + player.researches[119] / 400) * // 5x19 + (1 + player.researches[120] / 400) * // 5x20 + (1 + player.researches[137] / 100) * // 6x12 + (1 + (0.9 * player.researches[152]) / 100) * // 7x2 + (1 + (0.8 * player.researches[167]) / 100) * // 7x17 + (1 + (0.7 * player.researches[182]) / 100) * // 8x7 + (1 + + (0.03 / 100) * player.researches[192] * player.antUpgrades[12 - 1]!) * // 8x17 + (1 + (0.6 * player.researches[197]) / 100), // 8x22 // Research 8x25 - 1 + 0.004 / 100 * player.researches[200], + 1 + (0.004 / 100) * player.researches[200], // Cube Upgrades - (1 + player.cubeUpgrades[1] / 6) // 1x1 - * (1 + player.cubeUpgrades[11] / 11) // 2x1 - * (1 + 0.4 * player.cubeUpgrades[30]), // 3x10 + (1 + player.cubeUpgrades[1] / 6) * // 1x1 + (1 + player.cubeUpgrades[11] / 11) * // 2x1 + (1 + 0.4 * player.cubeUpgrades[30]), // 3x10 // Constant Upgrade 10 - 1 + 0.01 * Decimal.log(player.ascendShards.add(1), 4) * Math.min(1, player.constantUpgrades[10]), + 1 + + 0.01 * + Decimal.log(player.ascendShards.add(1), 4) * + Math.min(1, player.constantUpgrades[10]), // Achievement 189 Bonus 1 + player.achievements[189] * Math.min(2, player.ascensionCount / 2.5e8), // Achievement 193 Bonus - 1 + player.achievements[193] * Decimal.log(player.ascendShards.add(1), 10) / 400, + 1 + + (player.achievements[193] * Decimal.log(player.ascendShards.add(1), 10)) / + 400, // Achievement 195 Bonus - 1 + Math.min(250, player.achievements[195] * Decimal.log(player.ascendShards.add(1), 10) / 400), + 1 + + Math.min( + 250, + (player.achievements[195] * + Decimal.log(player.ascendShards.add(1), 10)) / + 400 + ), // Achievement 198-201 Bonus - 1 + 4 / 100 * (player.achievements[198] + player.achievements[199] + player.achievements[200]) - + 3 / 100 * player.achievements[201], + 1 + + (4 / 100) * + (player.achievements[198] + + player.achievements[199] + + player.achievements[200]) + + (3 / 100) * player.achievements[201], // Achievement 254 Bonus - 1 + (Math.min(0.15, 0.6 / 100 * Math.log10(score + 1))) * player.achievements[254], + 1 + + Math.min(0.15, (0.6 / 100) * Math.log10(score + 1)) * + player.achievements[254], // Spirit Power - 1 + calculateCorruptionPoints() / 400 * G.effectiveRuneSpiritPower[2], + 1 + (calculateCorruptionPoints() / 400) * G.effectiveRuneSpiritPower[2], // Platonic Cube Opening Bonus G.platonicBonusMultiplier[0], // Platonic 1x1 - 1 + 0.000090 * sumContents(player.usedCorruptions) * player.platonicUpgrades[1], + 1 + + 0.00009 * + sumContents(player.usedCorruptions) * + player.platonicUpgrades[1], // Cube Upgrade 63 (Cx13) - 1 + Math.pow(1.03, Math.log10(Math.max(1, player.wowAbyssals))) * player.cubeUpgrades[63] - player.cubeUpgrades[63] + 1 + + Math.pow(1.03, Math.log10(Math.max(1, player.wowAbyssals))) * + player.cubeUpgrades[63] - + player.cubeUpgrades[63], // Total Multipliers to cubes: 15 - ] + ]; // Decided to return a copy of list as well as the actual multiplier, instead of differentiating return { list: arr, - mult: productContents(arr) - } -} + mult: productContents(arr), + }; +}; export const calculateTesseractMultiplier = (score = -1) => { if (score < 0) { - score = calculateAscensionScore().effectiveScore + score = calculateAscensionScore().effectiveScore; } - const corrSum = sumContents(player.usedCorruptions.slice(2, 10)) + const corrSum = sumContents(player.usedCorruptions.slice(2, 10)); const arr = [ // Ascension Score Multiplier - Math.pow(1 + Math.max(0, score - 1e5) / 1e4, .35), + Math.pow(1 + Math.max(0, score - 1e5) / 1e4, 0.35), // Global Multiplier calculateAllCubeMultiplier().mult, // Season Pass 1 - 1 + 2.25 * player.shopUpgrades.seasonPass / 100, + 1 + (2.25 * player.shopUpgrades.seasonPass) / 100, // 10th Const Upgrade +Tesseract% - 1 + 0.01 * Decimal.log(player.ascendShards.add(1), 4) * Math.min(1, player.constantUpgrades[10]), + 1 + + 0.01 * + Decimal.log(player.ascendShards.add(1), 4) * + Math.min(1, player.constantUpgrades[10]), // Cube Upgrade 3x10 1 + 0.4 * player.cubeUpgrades[30], // Cube Upgrade 4x8 - 1 + 1 / 200 * player.cubeUpgrades[38] * corrSum, + 1 + (1 / 200) * player.cubeUpgrades[38] * corrSum, // Achievement 195 Bonus - 1 + Math.min(250, player.achievements[195] * Decimal.log(player.ascendShards.add(1), 10) / 400), + 1 + + Math.min( + 250, + (player.achievements[195] * + Decimal.log(player.ascendShards.add(1), 10)) / + 400 + ), // Achievement 202 Bonus 1 + player.achievements[202] * Math.min(2, player.ascensionCount / 5e8), // Achievement 205-208 Bonus - 1 + 4 / 100 * (player.achievements[205] + player.achievements[206] + player.achievements[207]) - + 3 / 100 * player.achievements[208], + 1 + + (4 / 100) * + (player.achievements[205] + + player.achievements[206] + + player.achievements[207]) + + (3 / 100) * player.achievements[208], // Achievement 255 Bonus - 1 + Math.min(0.15, 0.6 / 100 * Math.log10(score + 1)) * player.achievements[255], + 1 + + Math.min(0.15, (0.6 / 100) * Math.log10(score + 1)) * + player.achievements[255], // Platonic Cube Bonus G.platonicBonusMultiplier[1], // Platonic Upgrade 1x2 - 1 + 0.00018 * corrSum * player.platonicUpgrades[2] + 1 + 0.00018 * corrSum * player.platonicUpgrades[2], // Total Tesseract Multipliers: 12 - ] + ]; return { list: arr, - mult: productContents(arr) - } -} + mult: productContents(arr), + }; +}; export const calculateHypercubeMultiplier = (score = -1) => { if (score < 0) { - score = calculateAscensionScore().effectiveScore + score = calculateAscensionScore().effectiveScore; } const arr = [ // Ascension Score Multiplier - Math.pow(1 + Math.max(0, score - 1e9) / 1e8, .5), + Math.pow(1 + Math.max(0, score - 1e9) / 1e8, 0.5), // Global Multiplier calculateAllCubeMultiplier().mult, // Season Pass 2 - 1 + 1.5 * player.shopUpgrades.seasonPass2 / 100, + 1 + (1.5 * player.shopUpgrades.seasonPass2) / 100, // Achievement 212 - 215 Bonus - 1 + 4 / 100 * (player.achievements[212] + player.achievements[213] + player.achievements[214]) - + 3 / 100 * player.achievements[215], + 1 + + (4 / 100) * + (player.achievements[212] + + player.achievements[213] + + player.achievements[214]) + + (3 / 100) * player.achievements[215], // Achievement 216 Bonus 1 + player.achievements[216] * Math.min(2, player.ascensionCount / 1e9), // Achievement 253 Bonus - 1 + 1 / 10 * player.achievements[253], + 1 + (1 / 10) * player.achievements[253], // Achievement 256 Bonus - 1 + Math.min(0.15, 0.6 / 100 * Math.log10(score + 1)) * player.achievements[256], + 1 + + Math.min(0.15, (0.6 / 100) * Math.log10(score + 1)) * + player.achievements[256], // Achievement 265 Bonus 1 + Math.min(2, player.ascensionCount / 2.5e10) * player.achievements[265], // Platonic Cubes Opened Bonus G.platonicBonusMultiplier[2], // Platonic Upgrade 1x3 - 1 + 0.00054 * sumContents(player.usedCorruptions) * player.platonicUpgrades[3], + 1 + + 0.00054 * + sumContents(player.usedCorruptions) * + player.platonicUpgrades[3], // Hyperreal Hepteract Bonus - 1 + 0.6 / 1000 * hepteractEffective('hyperrealism') + 1 + (0.6 / 1000) * hepteractEffective("hyperrealism"), // Total Hypercube Multipliers: 11 - ] + ]; return { list: arr, - mult: productContents(arr) - } -} + mult: productContents(arr), + }; +}; export const calculatePlatonicMultiplier = (score = -1) => { if (score < 0) { - score = calculateAscensionScore().effectiveScore + score = calculateAscensionScore().effectiveScore; } const arr = [ // Ascension Score Multiplier - Math.pow(1 + Math.max(0, score - 2.666e12) / 2.666e11, .75), + Math.pow(1 + Math.max(0, score - 2.666e12) / 2.666e11, 0.75), // Global Multipliers calculateAllCubeMultiplier().mult, // Season Pass 2 - 1 + 1.5 * player.shopUpgrades.seasonPass2 / 100, + 1 + (1.5 * player.shopUpgrades.seasonPass2) / 100, // Achievement 196 Bonus - 1 + Math.min(20, player.achievements[196] * 1 / 5000 * Decimal.log(player.ascendShards.add(1), 10)), + 1 + + Math.min( + 20, + ((player.achievements[196] * 1) / 5000) * + Decimal.log(player.ascendShards.add(1), 10) + ), // Achievement 219-222 Bonus - 1 + 4 / 100 * (player.achievements[219] + player.achievements[220] + player.achievements[221]) - + 3 / 100 * player.achievements[222], + 1 + + (4 / 100) * + (player.achievements[219] + + player.achievements[220] + + player.achievements[221]) + + (3 / 100) * player.achievements[222], // Achievement 223 Bonus 1 + player.achievements[223] * Math.min(2, player.ascensionCount / 1.337e9), // Achievement 257 Bonus - 1 + Math.min(0.15, 0.6 / 100 * Math.log10(score + 1)) * player.achievements[257], + 1 + + Math.min(0.15, (0.6 / 100) * Math.log10(score + 1)) * + player.achievements[257], // Platonic Cube Opening Bonus G.platonicBonusMultiplier[3], // Platonic Upgrade 1x4 - 1 + 1.2 * player.platonicUpgrades[4] / 50 + 1 + (1.2 * player.platonicUpgrades[4]) / 50, // Total Platonic Multipliers: 9 - ] + ]; return { list: arr, - mult: productContents(arr) - } -} + mult: productContents(arr), + }; +}; export const calculateHepteractMultiplier = (score = -1) => { if (score < 0) { - score = calculateAscensionScore().effectiveScore + score = calculateAscensionScore().effectiveScore; } const arr = [ @@ -1576,34 +2094,44 @@ export const calculateHepteractMultiplier = (score = -1) => { // Global Multiplier calculateAllCubeMultiplier().mult, // Season Pass 3 - 1 + 1.5 * player.shopUpgrades.seasonPass3 / 100, + 1 + (1.5 * player.shopUpgrades.seasonPass3) / 100, // Achievement 258 Bonus - 1 + Math.min(0.15, 0.6 / 100 * Math.log10(score + 1)) * player.achievements[258], + 1 + + Math.min(0.15, (0.6 / 100) * Math.log10(score + 1)) * + player.achievements[258], // Achievement 264 Bonus [Max: 8T Asc] 1 + Math.min(0.4, player.ascensionCount / 2e13) * player.achievements[264], // Achievement 265 Bonus [Max: 160T Asc] 1 + Math.min(0.2, player.ascensionCount / 8e14) * player.achievements[265], // Achievement 270 Bonus - Math.min(2, 1 + 1 / 1000000 * Decimal.log(player.ascendShards.add(1), 10) * player.achievements[270]) + Math.min( + 2, + 1 + + (1 / 1000000) * + Decimal.log(player.ascendShards.add(1), 10) * + player.achievements[270] + ), // Total Hepteract Multipliers: 7 - ] + ]; return { list: arr, - mult: productContents(arr) - } -} + mult: productContents(arr), + }; +}; export const getOcteractValueMultipliers = () => { - const corruptionLevelSum = sumContents(player.usedCorruptions.slice(2, 10)) + const corruptionLevelSum = sumContents(player.usedCorruptions.slice(2, 10)); return [ - 1 + 1.5 * player.shopUpgrades.seasonPass3 / 100, - 1 + 0.75 * player.shopUpgrades.seasonPassY / 100, - 1 + player.shopUpgrades.seasonPassZ * player.singularityCount / 100, + 1 + (1.5 * player.shopUpgrades.seasonPass3) / 100, + 1 + (0.75 * player.shopUpgrades.seasonPassY) / 100, + 1 + (player.shopUpgrades.seasonPassZ * player.singularityCount) / 100, 1 + player.shopUpgrades.seasonPassLost / 1000, // cube upgrade 70, ie Cx20 - 1 + +(corruptionLevelSum >= 14 * 8) * player.cubeUpgrades[70] / 10000, - 1 + +(corruptionLevelSum >= 14 * 8) * +player.singularityUpgrades.divinePack.getEffect().bonus, + 1 + (+(corruptionLevelSum >= 14 * 8) * player.cubeUpgrades[70]) / 10000, + 1 + + +(corruptionLevelSum >= 14 * 8) * + +player.singularityUpgrades.divinePack.getEffect().bonus, // next three are flame/blaze/inferno +player.singularityUpgrades.singCubes1.getEffect().bonus, +player.singularityUpgrades.singCubes2.getEffect().bonus, @@ -1615,7 +2143,9 @@ export const getOcteractValueMultipliers = () => { +player.singularityUpgrades.singOcteractGain4.getEffect().bonus, +player.singularityUpgrades.singOcteractGain5.getEffect().bonus, // Patreon bonus - 1 + (player.worlds.BONUS / 100) * +player.singularityUpgrades.singOcteractPatreonBonus.getEffect().bonus, + 1 + + (player.worlds.BONUS / 100) * + +player.singularityUpgrades.singOcteractPatreonBonus.getEffect().bonus, // octeracts for dummies 1 + 0.2 * +player.octeractUpgrades.octeractStarter.getEffect().bonus, // cogenesis and trigenesis @@ -1624,13 +2154,15 @@ export const getOcteractValueMultipliers = () => { derpsmithCornucopiaBonus(), // digital octeract accumulator Math.pow( - 1 + +player.octeractUpgrades.octeractAscensionsOcteractGain.getEffect().bonus, + 1 + + +player.octeractUpgrades.octeractAscensionsOcteractGain.getEffect() + .bonus, 1 + Math.floor(Math.log10(1 + player.ascensionCount)) ), 1 + calculateEventBuff(BuffType.Octeract), - 1 - + +player.singularityUpgrades.platonicDelta.getEffect().bonus - * Math.min(9, player.singularityCounter / (3600 * 24)), + 1 + + +player.singularityUpgrades.platonicDelta.getEffect().bonus * + Math.min(9, player.singularityCounter / (3600 * 24)), // No Singulairty Upgrades +player.singularityChallenges.noSingularityUpgrades.rewards.cubes, // Wow Pass INF @@ -1646,61 +2178,70 @@ export const getOcteractValueMultipliers = () => { // Module- Quark-Cube 1 +player.blueberryUpgrades.ambrosiaQuarkCube1.bonus.cubes, // Module- Cubes 2 - +player.blueberryUpgrades.ambrosiaCubes2.bonus.cubes - ] -} + +player.blueberryUpgrades.ambrosiaCubes2.bonus.cubes, + ]; +}; export const octeractGainPerSecond = () => { - const SCOREREQ = 1e23 - const currentScore = calculateAscensionScore().effectiveScore + const SCOREREQ = 1e23; + const currentScore = calculateAscensionScore().effectiveScore; - const baseMultiplier = (currentScore >= SCOREREQ) ? currentScore / SCOREREQ : 0 + const baseMultiplier = currentScore >= SCOREREQ ? currentScore / SCOREREQ : 0; - const valueMultipliers = getOcteractValueMultipliers() + const valueMultipliers = getOcteractValueMultipliers(); const ascensionSpeed = player.singularityUpgrades.oneMind.getEffect().bonus ? Math.pow(10, 1 / 2) - : Math.pow(calculateAscensionAcceleration(), 1 / 2) + : Math.pow(calculateAscensionAcceleration(), 1 / 2); const oneMindModifier = player.singularityUpgrades.oneMind.getEffect().bonus ? Math.pow( - calculateAscensionAcceleration() / 10, - +player.octeractUpgrades.octeractOneMindImprover.getEffect().bonus - ) - : 1 - const extraMult = (G.isEvent && G.eventClicked) ? 1.05 : 1 - const perSecond = 1 / (24 * 3600 * 365 * 1e15) * baseMultiplier * productContents(valueMultipliers) * ascensionSpeed - * oneMindModifier * extraMult - return perSecond -} + calculateAscensionAcceleration() / 10, + +player.octeractUpgrades.octeractOneMindImprover.getEffect().bonus + ) + : 1; + const extraMult = G.isEvent && G.eventClicked ? 1.05 : 1; + const perSecond = + (1 / (24 * 3600 * 365 * 1e15)) * + baseMultiplier * + productContents(valueMultipliers) * + ascensionSpeed * + oneMindModifier * + extraMult; + return perSecond; +}; // This is an old calculation used only for Stats for Nerds export const calculateOcteractMultiplier = (score = -1) => { - const SCOREREQ = 1e23 + const SCOREREQ = 1e23; if (score < 0) { - score = calculateAscensionScore().effectiveScore + score = calculateAscensionScore().effectiveScore; } - const arr = getOcteractValueMultipliers() + const arr = getOcteractValueMultipliers(); // add base score to the beginning and ascension speed mult to the end of the list - arr.unshift((score >= SCOREREQ) ? score / SCOREREQ : 0) - const ascensionSpeed = calculateAscensionAcceleration() - - const ascensionSpeedMulti = (player.singularityUpgrades.oneMind.getEffect().bonus) - ? Math.pow(10, 1 / 2) - * Math.pow(ascensionSpeed / 10, +player.octeractUpgrades.octeractOneMindImprover.getEffect().bonus) - : Math.pow(ascensionSpeed, 1 / 2) - arr.push(ascensionSpeedMulti) + arr.unshift(score >= SCOREREQ ? score / SCOREREQ : 0); + const ascensionSpeed = calculateAscensionAcceleration(); + + const ascensionSpeedMulti = player.singularityUpgrades.oneMind.getEffect() + .bonus + ? Math.pow(10, 1 / 2) * + Math.pow( + ascensionSpeed / 10, + +player.octeractUpgrades.octeractOneMindImprover.getEffect().bonus + ) + : Math.pow(ascensionSpeed, 1 / 2); + arr.push(ascensionSpeedMulti); return { list: arr, - mult: productContents(arr) - } -} + mult: productContents(arr), + }; +}; export const calculateTimeAcceleration = () => { const preCorruptionArr = [ - 1 + 1 / 300 * Math.log10(player.maxobtainium + 1) * player.upgrades[70], // Particle upgrade 2x5 + 1 + (1 / 300) * Math.log10(player.maxobtainium + 1) * player.upgrades[70], // Particle upgrade 2x5 1 + player.researches[121] / 50, // research 5x21 1 + 0.015 * player.researches[136], // research 6x11 1 + 0.012 * player.researches[151], // research 7x1 @@ -1708,246 +2249,310 @@ export const calculateTimeAcceleration = () => { 1 + 0.006 * player.researches[181], // research 8x6 1 + 0.003 * player.researches[196], // research 8x21 1 + 8 * G.effectiveRuneBlessingPower[1], // speed blessing - 1 + calculateCorruptionPoints() / 400 * G.effectiveRuneSpiritPower[1], // speed SPIRIT + 1 + (calculateCorruptionPoints() / 400) * G.effectiveRuneSpiritPower[1], // speed SPIRIT G.cubeBonusMultiplier[10], // Chronos cube blessing 1 + player.cubeUpgrades[18] / 5, // cube upgrade 2x8 calculateSigmoid(2, player.antUpgrades[12 - 1]! + G.bonusant12, 69), // ant 12 - 1 + 0.10 * (player.talismanRarity[2 - 1] - 1), // Chronos Talisman bonus + 1 + 0.1 * (player.talismanRarity[2 - 1] - 1), // Chronos Talisman bonus G.challenge15Rewards.globalSpeed, // Challenge 15 reward - 1 + 0.01 * player.cubeUpgrades[52] // cube upgrade 6x2 (Cx2) - ] + 1 + 0.01 * player.cubeUpgrades[52], // cube upgrade 6x2 (Cx2) + ]; // Global Speed softcap + Corruption / Corruption-like effects const corruptionArr: number[] = [ - G.lazinessMultiplier[player.usedCorruptions[3]] // Corruption: Spacial Dilation - ] + G.lazinessMultiplier[player.usedCorruptions[3]], // Corruption: Spacial Dilation + ]; - const corruptableTimeMult = productContents(preCorruptionArr) * corruptionArr[0] // DR applies after base corruption. + const corruptableTimeMult = + productContents(preCorruptionArr) * corruptionArr[0]; // DR applies after base corruption. if (corruptableTimeMult > 100) { - const postSoftcap = 10 * Math.sqrt(corruptableTimeMult) - const softcapRatio = postSoftcap / corruptableTimeMult + const postSoftcap = 10 * Math.sqrt(corruptableTimeMult); + const softcapRatio = postSoftcap / corruptableTimeMult; - corruptionArr.push(softcapRatio) + corruptionArr.push(softcapRatio); } else { - corruptionArr.push(1) + corruptionArr.push(1); } if (corruptableTimeMult < 1) { - const postPlat2x2 = Math.pow(corruptableTimeMult, 1 - player.platonicUpgrades[7] / 30) - const plat2x2Ratio = postPlat2x2 / corruptableTimeMult + const postPlat2x2 = Math.pow( + corruptableTimeMult, + 1 - player.platonicUpgrades[7] / 30 + ); + const plat2x2Ratio = postPlat2x2 / corruptableTimeMult; - corruptionArr.push(plat2x2Ratio) + corruptionArr.push(plat2x2Ratio); } else { - corruptionArr.push(1) + corruptionArr.push(1); } - corruptionArr.push(1.0 / calculateSingularityDebuff('Global Speed')) + corruptionArr.push(1.0 / calculateSingularityDebuff("Global Speed")); // Uncorruptable effects const postCorruptionArr = [ G.platonicBonusMultiplier[7], // Chronos statue 1 + (player.singularityUpgrades.intermediatePack.getEffect().bonus ? 1 : 0), - 1 + +player.octeractUpgrades.octeractImprovedGlobalSpeed.getEffect().bonus * player.singularityCount - ] + 1 + + +player.octeractUpgrades.octeractImprovedGlobalSpeed.getEffect().bonus * + player.singularityCount, + ]; - const timeMult = productContents(preCorruptionArr) * productContents(corruptionArr) - * productContents(postCorruptionArr) + const timeMult = + productContents(preCorruptionArr) * + productContents(corruptionArr) * + productContents(postCorruptionArr); if (player.usedCorruptions[3] >= 6 && player.achievements[241] < 1) { - achievementaward(241) + achievementaward(241); } if (timeMult > 3600 && player.achievements[242] < 1) { - achievementaward(242) + achievementaward(242); } return { preList: preCorruptionArr, drList: corruptionArr, postList: postCorruptionArr, - mult: timeMult - } -} + mult: timeMult, + }; +}; export const calculateLimitedAscensionsDebuff = () => { if (!player.singularityChallenges.limitedAscensions.enabled) { - return 1 + return 1; } else { - let exponent = player.ascensionCount - Math.max(0, 20 - player.singularityChallenges.limitedAscensions.completions) - exponent = Math.max(0, exponent) - return Math.pow(2, exponent) + let exponent = + player.ascensionCount - + Math.max( + 0, + 20 - player.singularityChallenges.limitedAscensions.completions + ); + exponent = Math.max(0, exponent); + return Math.pow(2, exponent); } -} +}; export const calculateAscensionSpeedMultiplier = () => { const arr = [ - 1 + 1.2 / 100 * player.shopUpgrades.chronometer, // Chronometer - 1 + 0.6 / 100 * player.shopUpgrades.chronometer2, // Chronometer 2 - 1 + 1.5 / 100 * player.shopUpgrades.chronometer3, // Chronometer 3 - 1 + 0.6 / 1000 * hepteractEffective('chronos'), // Chronos Hepteract - 1 + Math.min(0.10, 1 / 100 * Math.log10(player.ascensionCount + 1)) * player.achievements[262], // Achievement 262 Bonus - 1 + Math.min(0.10, 1 / 100 * Math.log10(player.ascensionCount + 1)) * player.achievements[263], // Achievement 263 Bonus - 1 + 0.002 * sumContents(player.usedCorruptions) * player.platonicUpgrades[15], // Platonic Omega + 1 + (1.2 / 100) * player.shopUpgrades.chronometer, // Chronometer + 1 + (0.6 / 100) * player.shopUpgrades.chronometer2, // Chronometer 2 + 1 + (1.5 / 100) * player.shopUpgrades.chronometer3, // Chronometer 3 + 1 + (0.6 / 1000) * hepteractEffective("chronos"), // Chronos Hepteract + 1 + + Math.min(0.1, (1 / 100) * Math.log10(player.ascensionCount + 1)) * + player.achievements[262], // Achievement 262 Bonus + 1 + + Math.min(0.1, (1 / 100) * Math.log10(player.ascensionCount + 1)) * + player.achievements[263], // Achievement 263 Bonus + 1 + + 0.002 * sumContents(player.usedCorruptions) * player.platonicUpgrades[15], // Platonic Omega G.challenge15Rewards.ascensionSpeed, // Challenge 15 Reward - 1 + 1 / 400 * player.cubeUpgrades[59], // Cookie Upgrade 9 - 1 + 0.5 * (player.singularityUpgrades.intermediatePack.getEffect().bonus ? 1 : 0), // Intermediate Pack, Sing Shop - 1 + 1 / 1000 * player.singularityCount * player.shopUpgrades.chronometerZ, // Chronometer Z - 1 + +player.octeractUpgrades.octeractImprovedAscensionSpeed.getEffect().bonus * player.singularityCount, // Abstract Photokinetics, Oct Upg - 1 + +player.octeractUpgrades.octeractImprovedAscensionSpeed2.getEffect().bonus * player.singularityCount, // Abstract Exokinetics, Oct Upg + 1 + (1 / 400) * player.cubeUpgrades[59], // Cookie Upgrade 9 + 1 + + 0.5 * + (player.singularityUpgrades.intermediatePack.getEffect().bonus ? 1 : 0), // Intermediate Pack, Sing Shop + 1 + (1 / 1000) * player.singularityCount * player.shopUpgrades.chronometerZ, // Chronometer Z + 1 + + +player.octeractUpgrades.octeractImprovedAscensionSpeed.getEffect() + .bonus * + player.singularityCount, // Abstract Photokinetics, Oct Upg + 1 + + +player.octeractUpgrades.octeractImprovedAscensionSpeed2.getEffect() + .bonus * + player.singularityCount, // Abstract Exokinetics, Oct Upg 1 + calculateEventBuff(BuffType.AscensionSpeed), // Event - (player.singularityUpgrades.singAscensionSpeed2.level > 0 && player.runelevels[6] < 1) ? 6 : 1, // A mediocre ascension speedup! + player.singularityUpgrades.singAscensionSpeed2.level > 0 && + player.runelevels[6] < 1 + ? 6 + : 1, // A mediocre ascension speedup! Math.pow(1.01, player.shopUpgrades.chronometerInfinity), // Chronometer INF 1 / calculateLimitedAscensionsDebuff(), // EXALT Debuff Math.pow( - 1 + +player.singularityChallenges.limitedAscensions.rewards.ascensionSpeedMult, + 1 + + +player.singularityChallenges.limitedAscensions.rewards + .ascensionSpeedMult, 1 + Math.max(0, Math.floor(Math.log10(player.ascensionCount))) - ) // EXALT Buff // EXALT Buff - ] + ), // EXALT Buff // EXALT Buff + ]; // A hecking good ascension speedup! - const baseMultiplier = productContents(arr) - const exponent = player.singularityUpgrades.singAscensionSpeed.level > 0 - ? (baseMultiplier >= 1 - ? 1.03 - : 0.97) - : 1 - arr.push(Math.pow(baseMultiplier, exponent) / baseMultiplier) + const baseMultiplier = productContents(arr); + const exponent = + player.singularityUpgrades.singAscensionSpeed.level > 0 + ? baseMultiplier >= 1 + ? 1.03 + : 0.97 + : 1; + arr.push(Math.pow(baseMultiplier, exponent) / baseMultiplier); // Singularity Penalty - arr.push(1 / calculateSingularityDebuff('Ascension Speed')) + arr.push(1 / calculateSingularityDebuff("Ascension Speed")); - let multiplier = productContents(arr) + let multiplier = productContents(arr); if (!isFinite(multiplier)) { - multiplier = 0 + multiplier = 0; } return { list: arr, - mult: multiplier - } -} + mult: multiplier, + }; +}; export const calculateAscensionAcceleration = () => { - return calculateAscensionSpeedMultiplier().mult -} + return calculateAscensionSpeedMultiplier().mult; +}; export const calculateSingularityQuarkMilestoneMultiplier = () => { - let multiplier = 1 + let multiplier = 1; // dprint-ignore - const singThresholds = [5, 20, 35, 50, 65, 80, 90, 100, 121, 144, 150, 160, 166, 169, 170, 175, 180, 190, 196, 200, 200, 201, 202, 203, 204, 205, 210, 212, 214, 216, 218, 220, 225, 250] + const singThresholds = [ + 5, 20, 35, 50, 65, 80, 90, 100, 121, 144, 150, 160, 166, 169, 170, 175, 180, + 190, 196, 200, 200, 201, 202, 203, 204, 205, 210, 212, 214, 216, 218, 220, + 225, 250, + ]; for (const sing of singThresholds) { if (player.highestSingularityCount >= sing) { - multiplier *= 1.05 + multiplier *= 1.05; } } if (player.highestSingularityCount >= 200) { - multiplier *= Math.pow((player.highestSingularityCount - 179) / 20, 2) + multiplier *= Math.pow((player.highestSingularityCount - 179) / 20, 2); } - return multiplier -} + return multiplier; +}; export const calculateQuarkMultiplier = () => { - let multiplier = 1 - if (player.achievementPoints > 0) { // Achievement Points - multiplier += player.achievementPoints / 25000 // Cap of +0.20 at 5,000 Pts + let multiplier = 1; + if (player.achievementPoints > 0) { + // Achievement Points + multiplier += player.achievementPoints / 25000; // Cap of +0.20 at 5,000 Pts } - if (player.achievements[250] > 0) { // Max research 8x25 - multiplier += 0.10 + if (player.achievements[250] > 0) { + // Max research 8x25 + multiplier += 0.1; } - if (player.achievements[251] > 0) { // Max Wow! Cube Upgrade 5x10 - multiplier += 0.10 + if (player.achievements[251] > 0) { + // Max Wow! Cube Upgrade 5x10 + multiplier += 0.1; } - if (player.platonicUpgrades[5] > 0) { // Platonic ALPHA upgrade - multiplier += 0.20 + if (player.platonicUpgrades[5] > 0) { + // Platonic ALPHA upgrade + multiplier += 0.2; } - if (player.platonicUpgrades[10] > 0) { // Platonic BETA Upgrade - multiplier += 0.25 + if (player.platonicUpgrades[10] > 0) { + // Platonic BETA Upgrade + multiplier += 0.25; } - if (player.platonicUpgrades[15] > 0) { // Platonic OMEGA upgrade - multiplier += 0.30 + if (player.platonicUpgrades[15] > 0) { + // Platonic OMEGA upgrade + multiplier += 0.3; } - if (player.challenge15Exponent >= 1e11) { // Challenge 15: Exceed 1e11 exponent reward - multiplier += G.challenge15Rewards.quarks - 1 + if (player.challenge15Exponent >= 1e11) { + // Challenge 15: Exceed 1e11 exponent reward + multiplier += G.challenge15Rewards.quarks - 1; } - if (player.shopUpgrades.infiniteAscent) { // Purchased Infinite Ascent Rune - multiplier *= 1.1 + 0.15 / 75 * calculateEffectiveIALevel() + if (player.shopUpgrades.infiniteAscent) { + // Purchased Infinite Ascent Rune + multiplier *= 1.1 + (0.15 / 75) * calculateEffectiveIALevel(); } - if (player.challenge15Exponent >= 1e15) { // Challenge 15: Exceed 1e15 exponent reward - multiplier *= 1 + 5 / 10000 * hepteractEffective('quark') + if (player.challenge15Exponent >= 1e15) { + // Challenge 15: Exceed 1e15 exponent reward + multiplier *= 1 + (5 / 10000) * hepteractEffective("quark"); } - if (player.overfluxPowder > 0) { // Overflux Powder [Max: 10% at 10,000] - multiplier *= calculateQuarkMultFromPowder() + if (player.overfluxPowder > 0) { + // Overflux Powder [Max: 10% at 10,000] + multiplier *= calculateQuarkMultFromPowder(); } - if (player.achievements[266] > 0) { // Achievement 266 [Max: 10% at 1Qa Ascensions] - multiplier *= 1 + Math.min(0.1, (player.ascensionCount) / 1e16) + if (player.achievements[266] > 0) { + // Achievement 266 [Max: 10% at 1Qa Ascensions] + multiplier *= 1 + Math.min(0.1, player.ascensionCount / 1e16); } - if (player.singularityCount > 0) { // Singularity Modifier - multiplier *= 1 + player.singularityCount / 10 + if (player.singularityCount > 0) { + // Singularity Modifier + multiplier *= 1 + player.singularityCount / 10; } if (G.isEvent) { - multiplier *= 1 + calculateEventBuff(BuffType.Quark) + calculateEventBuff(BuffType.OneMind) - } - if (player.cubeUpgrades[53] > 0) { // Cube Upgrade 6x3 (Cx3) - multiplier *= 1 + 0.10 * player.cubeUpgrades[53] / 100 - } - if (player.cubeUpgrades[68] > 0) { // Cube Upgrade 7x8 - multiplier *= 1 + 1 / 10000 * player.cubeUpgrades[68] + 0.05 * (Math.floor(player.cubeUpgrades[68] / 1000)) - } - - multiplier *= calculateSingularityQuarkMilestoneMultiplier() - - multiplier *= +player.octeractUpgrades.octeractQuarkGain.getEffect().bonus // Oct Improver 1 - multiplier *= 1 + 0.3 * +player.octeractUpgrades.octeractStarter.getEffect().bonus // Oct Starter Pack - - multiplier *= 1 + 1 / 10000 * Math.floor(player.octeractUpgrades.octeractQuarkGain.level / 111) - * player.octeractUpgrades.octeractQuarkGain2.level - * Math.floor(1 + Math.log10(Math.max(1, player.hepteractCrafts.quark.BAL))) // Improver 2 - - multiplier *= 1 + 0.02 * player.singularityUpgrades.intermediatePack.level // 1.02 - + 0.04 * player.singularityUpgrades.advancedPack.level // 1.06 - + 0.06 * player.singularityUpgrades.expertPack.level // 1.12 - + 0.08 * player.singularityUpgrades.masterPack.level // 1.20 - + 0.10 * player.singularityUpgrades.divinePack.level // 1.30 - - multiplier *= 1 + +player.singularityUpgrades.singQuarkImprover1.getEffect().bonus // Doohickey - multiplier *= calculateTotalOcteractQuarkBonus() - - multiplier *= calculateAmbrosiaQuarkMult() - multiplier *= +player.blueberryUpgrades.ambrosiaTutorial.bonus.quarks - multiplier *= +player.blueberryUpgrades.ambrosiaQuarks1.bonus.quarks - multiplier *= +player.blueberryUpgrades.ambrosiaCubeQuark1.bonus.quarks - multiplier *= +player.blueberryUpgrades.ambrosiaLuckQuark1.bonus.quarks - multiplier *= +player.blueberryUpgrades.ambrosiaQuarks2.bonus.quarks + multiplier *= + 1 + + calculateEventBuff(BuffType.Quark) + + calculateEventBuff(BuffType.OneMind); + } + if (player.cubeUpgrades[53] > 0) { + // Cube Upgrade 6x3 (Cx3) + multiplier *= 1 + (0.1 * player.cubeUpgrades[53]) / 100; + } + if (player.cubeUpgrades[68] > 0) { + // Cube Upgrade 7x8 + multiplier *= + 1 + + (1 / 10000) * player.cubeUpgrades[68] + + 0.05 * Math.floor(player.cubeUpgrades[68] / 1000); + } + + multiplier *= calculateSingularityQuarkMilestoneMultiplier(); + + multiplier *= +player.octeractUpgrades.octeractQuarkGain.getEffect().bonus; // Oct Improver 1 + multiplier *= + 1 + 0.3 * +player.octeractUpgrades.octeractStarter.getEffect().bonus; // Oct Starter Pack + + multiplier *= + 1 + + (1 / 10000) * + Math.floor(player.octeractUpgrades.octeractQuarkGain.level / 111) * + player.octeractUpgrades.octeractQuarkGain2.level * + Math.floor(1 + Math.log10(Math.max(1, player.hepteractCrafts.quark.BAL))); // Improver 2 + + multiplier *= + 1 + + 0.02 * player.singularityUpgrades.intermediatePack.level + // 1.02 + 0.04 * player.singularityUpgrades.advancedPack.level + // 1.06 + 0.06 * player.singularityUpgrades.expertPack.level + // 1.12 + 0.08 * player.singularityUpgrades.masterPack.level + // 1.20 + 0.1 * player.singularityUpgrades.divinePack.level; // 1.30 + + multiplier *= + 1 + +player.singularityUpgrades.singQuarkImprover1.getEffect().bonus; // Doohickey + multiplier *= calculateTotalOcteractQuarkBonus(); + + multiplier *= calculateAmbrosiaQuarkMult(); + multiplier *= +player.blueberryUpgrades.ambrosiaTutorial.bonus.quarks; + multiplier *= +player.blueberryUpgrades.ambrosiaQuarks1.bonus.quarks; + multiplier *= +player.blueberryUpgrades.ambrosiaCubeQuark1.bonus.quarks; + multiplier *= +player.blueberryUpgrades.ambrosiaLuckQuark1.bonus.quarks; + multiplier *= +player.blueberryUpgrades.ambrosiaQuarks2.bonus.quarks; if (player.highestSingularityCount === 0) { - multiplier *= 1.25 + multiplier *= 1.25; } - return multiplier -} + return multiplier; +}; /** * Calculate the number of Golden Quarks earned in current singularity */ export const calculateGoldenQuarkMultiplier = (computeMultiplier = false) => { - const base = 2 * player.singularityCount + 10 + const base = 2 * player.singularityCount + 10; - let bonus = (player.singularityCount < 10) ? (200 - 10 * player.singularityCount) : 0 + let bonus = + player.singularityCount < 10 ? 200 - 10 * player.singularityCount : 0; if (player.singularityCount === 0) { - bonus += 200 + bonus += 200; } - let perkMultiplier = 1 + let perkMultiplier = 1; if (player.highestSingularityCount >= 200) { - perkMultiplier = 3 + perkMultiplier = 3; } if (player.highestSingularityCount >= 208) { - perkMultiplier = 5 + perkMultiplier = 5; } if (player.highestSingularityCount >= 221) { - perkMultiplier = 8 + perkMultiplier = 8; } const arr = [ @@ -1958,37 +2563,44 @@ export const calculateGoldenQuarkMultiplier = (computeMultiplier = false) => { +player.singularityChallenges.noSingularityUpgrades.rewards.goldenQuarks, // No Singularity Upgrades 1 + calculateEventBuff(BuffType.GoldenQuark), // Event 1 + getFastForwardTotalMultiplier(), // Singularity Fast Forwards - player.highestSingularityCount >= 100 ? 1 + Math.min(1, player.highestSingularityCount / 250) : 1, // Golden Revolution II - perkMultiplier // Immaculate Alchemy - ] + player.highestSingularityCount >= 100 + ? 1 + Math.min(1, player.highestSingularityCount / 250) + : 1, // Golden Revolution II + perkMultiplier, // Immaculate Alchemy + ]; // Total Quarks Coefficient arr.push( computeMultiplier ? 1 / 1e5 - : ((base + player.quarksThisSingularity / 1e5) * productContents(arr) + bonus) / productContents(arr) - ) + : ((base + player.quarksThisSingularity / 1e5) * productContents(arr) + + bonus) / + productContents(arr) + ); return { list: arr, - mult: productContents(arr) - } -} + mult: productContents(arr), + }; +}; export const calculateGoldenQuarkGain = (computeMultiplier = false): number => { - return calculateGoldenQuarkMultiplier(computeMultiplier).mult -} + return calculateGoldenQuarkMultiplier(computeMultiplier).mult; +}; export const calculateCorruptionPoints = () => { - let basePoints = 400 - const bonusLevel = player.singularityUpgrades.corruptionFifteen.getEffect().bonus ? 1 : 0 + let basePoints = 400; + const bonusLevel = player.singularityUpgrades.corruptionFifteen.getEffect() + .bonus + ? 1 + : 0; for (let i = 1; i <= 9; i++) { - basePoints += 16 * Math.pow(player.usedCorruptions[i] + bonusLevel, 2) + basePoints += 16 * Math.pow(player.usedCorruptions[i] + bonusLevel, 2); } - return basePoints -} + return basePoints; +}; // If you want to sum from a baseline level i to the maximum buyable level n, what would the cost be and how many levels would you get? export const calculateSummationLinear = ( @@ -1997,18 +2609,19 @@ export const calculateSummationLinear = ( resourceAvailable: number, differenceCap = 1e9 ): [number, number] => { - const subtractCost = baseCost * baseLevel * (1 + baseLevel) / 2 + const subtractCost = (baseCost * baseLevel * (1 + baseLevel)) / 2; const buyToLevel = Math.min( baseLevel + differenceCap, - Math.floor(-1 / 2 + Math.sqrt(1 / 4 + 2 * (resourceAvailable + subtractCost) / baseCost)) - ) - const realCost = (baseCost * buyToLevel * (1 + buyToLevel) / 2) - subtractCost + Math.floor( + -1 / 2 + + Math.sqrt(1 / 4 + (2 * (resourceAvailable + subtractCost)) / baseCost) + ) + ); + const realCost = + (baseCost * buyToLevel * (1 + buyToLevel)) / 2 - subtractCost; - return [ - buyToLevel, - realCost - ] -} + return [buyToLevel, realCost]; +}; // If you want to sum from a baseline level baseLevel to some level where the cost per level is base * (1 + level * diffPerLevel), this finds out how many total levels you can buy. export const calculateSummationNonLinear = ( @@ -2018,26 +2631,36 @@ export const calculateSummationNonLinear = ( diffPerLevel: number, buyAmount: number ): { levelCanBuy: number; cost: number } => { - const c = diffPerLevel / 2 - resourceAvailable = resourceAvailable || 0 - const alreadySpent = baseCost * (c * Math.pow(baseLevel, 2) + baseLevel * (1 - c)) - resourceAvailable += alreadySpent - const v = resourceAvailable / baseCost - let buyToLevel = c > 0 - ? Math.max(0, Math.floor((c - 1) / (2 * c) + Math.pow(Math.pow(1 - c, 2) + 4 * c * v, 1 / 2) / (2 * c))) - : Math.floor(v) - - buyToLevel = Math.min(buyToLevel, buyAmount + baseLevel) - buyToLevel = Math.max(buyToLevel, baseLevel) - let totalCost = baseCost * (c * Math.pow(buyToLevel, 2) + buyToLevel * (1 - c)) - alreadySpent + const c = diffPerLevel / 2; + resourceAvailable = resourceAvailable || 0; + const alreadySpent = + baseCost * (c * Math.pow(baseLevel, 2) + baseLevel * (1 - c)); + resourceAvailable += alreadySpent; + const v = resourceAvailable / baseCost; + let buyToLevel = + c > 0 + ? Math.max( + 0, + Math.floor( + (c - 1) / (2 * c) + + Math.pow(Math.pow(1 - c, 2) + 4 * c * v, 1 / 2) / (2 * c) + ) + ) + : Math.floor(v); + + buyToLevel = Math.min(buyToLevel, buyAmount + baseLevel); + buyToLevel = Math.max(buyToLevel, baseLevel); + let totalCost = + baseCost * (c * Math.pow(buyToLevel, 2) + buyToLevel * (1 - c)) - + alreadySpent; if (buyToLevel === baseLevel) { - totalCost = baseCost * (1 + 2 * c * baseLevel) + totalCost = baseCost * (1 + 2 * c * baseLevel); } return { levelCanBuy: buyToLevel, - cost: totalCost - } -} + cost: totalCost, + }; +}; /** * @param n A nonnegative integer @@ -2045,14 +2668,14 @@ export const calculateSummationNonLinear = ( */ export const calculateSummationCubic = (n: number) => { if (n < 0) { - return -1 + return -1; } if (!Number.isInteger(n)) { - return -1 + return -1; } - return Math.pow(n * (n + 1) / 2, 2) -} + return Math.pow((n * (n + 1)) / 2, 2); +}; /** * Solves a*n^2 + b*n + c = 0 for real solutions. @@ -2062,27 +2685,32 @@ export const calculateSummationCubic = (n: number) => { * @param positive Boolean which if true makes solution use positive discriminant. * @returns Positive root of the quadratic, if it exists, and positive is true, otherwise false */ -export const solveQuadratic = (a: number, b: number, c: number, positive: boolean) => { +export const solveQuadratic = ( + a: number, + b: number, + c: number, + positive: boolean +) => { if (a < 0) { - throw new Error(String(i18next.t('calculate.quadraticImproperError'))) + throw new Error(String(i18next.t("calculate.quadraticImproperError"))); } - const determinant = Math.pow(b, 2) - 4 * a * c + const determinant = Math.pow(b, 2) - 4 * a * c; if (determinant < 0) { - throw new Error(String(i18next.t('calculate.quadraticDeterminantError'))) + throw new Error(String(i18next.t("calculate.quadraticDeterminantError"))); } if (determinant === 0) { - return -b / (2 * a) + return -b / (2 * a); } - const numeratorPos = -b + Math.sqrt(Math.pow(b, 2) - 4 * a * c) - const numeratorNeg = -b - Math.sqrt(Math.pow(b, 2) - 4 * a * c) + const numeratorPos = -b + Math.sqrt(Math.pow(b, 2) - 4 * a * c); + const numeratorNeg = -b - Math.sqrt(Math.pow(b, 2) - 4 * a * c); if (positive) { - return numeratorPos / (2 * a) + return numeratorPos / (2 * a); } else { - return numeratorNeg / (2 * a) + return numeratorNeg / (2 * a); } -} +}; /** * @param initialLevel @@ -2098,34 +2726,38 @@ export const calculateCubicSumData = ( if (initialLevel >= maxLevel) { return { levelCanBuy: maxLevel, - cost: 0 - } + cost: 0, + }; } - const alreadySpent = baseCost * calculateSummationCubic(initialLevel) - const totalToSpend = alreadySpent + amountToSpend + const alreadySpent = baseCost * calculateSummationCubic(initialLevel); + const totalToSpend = alreadySpent + amountToSpend; // Solves (n(n+1)/2)^2 * baseCost = totalToSpend /* Create a det = Sqrt(totalToSpend / baseCost) - * Simplification gives n * (n+1) = 2 * det - * We can rewrite as n^2 + n - 2 * det = 0 and solve for n. - */ + * Simplification gives n * (n+1) = 2 * det + * We can rewrite as n^2 + n - 2 * det = 0 and solve for n. + */ if (totalToSpend < 0) { - throw new Error(String(i18next.t('calculate.cubicSumNegativeError'))) + throw new Error(String(i18next.t("calculate.cubicSumNegativeError"))); } - const determinantRoot = Math.pow(totalToSpend / baseCost, 0.5) // Assume nonnegative! - const solution = solveQuadratic(1, 1, -2 * determinantRoot, true) + const determinantRoot = Math.pow(totalToSpend / baseCost, 0.5); // Assume nonnegative! + const solution = solveQuadratic(1, 1, -2 * determinantRoot, true); - const levelToBuy = Math.max(Math.min(maxLevel, Math.floor(solution)), initialLevel) - const realCost = (levelToBuy === initialLevel) - ? baseCost * Math.pow(initialLevel + 1, 3) - : baseCost * calculateSummationCubic(levelToBuy) - alreadySpent + const levelToBuy = Math.max( + Math.min(maxLevel, Math.floor(solution)), + initialLevel + ); + const realCost = + levelToBuy === initialLevel + ? baseCost * Math.pow(initialLevel + 1, 3) + : baseCost * calculateSummationCubic(levelToBuy) - alreadySpent; return { levelCanBuy: levelToBuy, - cost: realCost - } -} + cost: realCost, + }; +}; // IDEA: Rework this shit to be friendly for Stats for Nerds /* May 25, 2021 - Platonic @@ -2135,67 +2767,89 @@ export const calculateCubicSumData = ( */ export const computeAscensionScoreBonusMultiplier = () => { - let multiplier = 1 - multiplier *= G.challenge15Rewards.score - multiplier *= G.platonicBonusMultiplier[6] + let multiplier = 1; + multiplier *= G.challenge15Rewards.score; + multiplier *= G.platonicBonusMultiplier[6]; if (player.cubeUpgrades[21] > 0) { - multiplier *= 1 + 0.05 * player.cubeUpgrades[21] + multiplier *= 1 + 0.05 * player.cubeUpgrades[21]; } if (player.cubeUpgrades[31] > 0) { - multiplier *= 1 + 0.05 * player.cubeUpgrades[31] + multiplier *= 1 + 0.05 * player.cubeUpgrades[31]; } if (player.cubeUpgrades[41] > 0) { - multiplier *= 1 + 0.05 * player.cubeUpgrades[41] + multiplier *= 1 + 0.05 * player.cubeUpgrades[41]; } if (player.achievements[267] > 0) { - multiplier *= 1 + Math.min(1, 1 / 100000 * Decimal.log(player.ascendShards.add(1), 10)) + multiplier *= + 1 + + Math.min(1, (1 / 100000) * Decimal.log(player.ascendShards.add(1), 10)); } if (player.achievements[259] > 0) { - multiplier *= Math.max(1, Math.pow(1.01, Math.log2(player.hepteractCrafts.abyss.CAP))) + multiplier *= Math.max( + 1, + Math.pow(1.01, Math.log2(player.hepteractCrafts.abyss.CAP)) + ); } if (G.isEvent) { - multiplier *= 1 + calculateEventBuff(BuffType.AscensionScore) + multiplier *= 1 + calculateEventBuff(BuffType.AscensionScore); } - return multiplier -} + return multiplier; +}; export const calculateAscensionScore = () => { - let baseScore = 0 - let corruptionMultiplier = 1 - let effectiveScore = 0 - - let bonusLevel = player.singularityUpgrades.corruptionFifteen.getEffect().bonus ? 1 : 0 - bonusLevel += +player.singularityChallenges.oneChallengeCap.rewards.freeCorruptionLevel + let baseScore = 0; + let corruptionMultiplier = 1; + let effectiveScore = 0; + + let bonusLevel = player.singularityUpgrades.corruptionFifteen.getEffect() + .bonus + ? 1 + : 0; + bonusLevel += + +player.singularityChallenges.oneChallengeCap.rewards.freeCorruptionLevel; // Init Arrays with challenge values :) - const challengeScoreArrays1 = [0, 8, 10, 12, 15, 20, 60, 80, 120, 180, 300] - const challengeScoreArrays2 = [0, 10, 12, 15, 20, 30, 80, 120, 180, 300, 450] - const challengeScoreArrays3 = [0, 20, 30, 50, 100, 200, 250, 300, 400, 500, 750] - const challengeScoreArrays4 = [0, 10000, 10000, 10000, 10000, 10000, 2000, 3000, 4000, 5000, 7500] - - challengeScoreArrays1[1] += player.cubeUpgrades[56] - challengeScoreArrays1[2] += player.cubeUpgrades[56] - challengeScoreArrays1[3] += player.cubeUpgrades[56] + const challengeScoreArrays1 = [0, 8, 10, 12, 15, 20, 60, 80, 120, 180, 300]; + const challengeScoreArrays2 = [0, 10, 12, 15, 20, 30, 80, 120, 180, 300, 450]; + const challengeScoreArrays3 = [ + 0, 20, 30, 50, 100, 200, 250, 300, 400, 500, 750, + ]; + const challengeScoreArrays4 = [ + 0, 10000, 10000, 10000, 10000, 10000, 2000, 3000, 4000, 5000, 7500, + ]; + + challengeScoreArrays1[1] += player.cubeUpgrades[56]; + challengeScoreArrays1[2] += player.cubeUpgrades[56]; + challengeScoreArrays1[3] += player.cubeUpgrades[56]; // Iterate challenges 1 through 10 and award base score according to the array values // Transcend Challenge: First Threshold at 75 completions, second at 750 // Reincarnation Challenge: First at 25, second at 60. It probably should be higher but Platonic is a dumb dumb for (let i = 1; i <= 10; i++) { - baseScore += challengeScoreArrays1[i] * player.highestchallengecompletions[i] + baseScore += + challengeScoreArrays1[i] * player.highestchallengecompletions[i]; if (i <= 5 && player.highestchallengecompletions[i] >= 75) { - baseScore += challengeScoreArrays2[i] * (player.highestchallengecompletions[i] - 75) + baseScore += + challengeScoreArrays2[i] * (player.highestchallengecompletions[i] - 75); if (player.highestchallengecompletions[i] >= 750) { - baseScore += challengeScoreArrays3[i] * (player.highestchallengecompletions[i] - 750) + baseScore += + challengeScoreArrays3[i] * + (player.highestchallengecompletions[i] - 750); } if (player.highestchallengecompletions[i] >= 9000) { - baseScore += challengeScoreArrays4[i] * (player.highestchallengecompletions[i] - 9000) + baseScore += + challengeScoreArrays4[i] * + (player.highestchallengecompletions[i] - 9000); } } if (i <= 10 && i > 5 && player.highestchallengecompletions[i] >= 25) { - baseScore += challengeScoreArrays2[i] * (player.highestchallengecompletions[i] - 25) + baseScore += + challengeScoreArrays2[i] * (player.highestchallengecompletions[i] - 25); if (player.highestchallengecompletions[i] >= 60) { - baseScore += challengeScoreArrays3[i] * (player.highestchallengecompletions[i] - 60) + baseScore += + challengeScoreArrays3[i] * + (player.highestchallengecompletions[i] - 60); } } } @@ -2207,91 +2861,114 @@ export const calculateAscensionScore = () => { // 0.005 from Platonic BETA (Plat 2x5) // Max: 1.0425 baseScore *= Math.pow( - 1.03 + 0.005 * player.cubeUpgrades[39] + 0.0025 * (player.platonicUpgrades[5] + player.platonicUpgrades[10]), + 1.03 + + 0.005 * player.cubeUpgrades[39] + + 0.0025 * (player.platonicUpgrades[5] + player.platonicUpgrades[10]), player.highestchallengecompletions[10] - ) + ); // Corruption Multiplier is the product of all Corruption Score multipliers based on used corruptions - let bonusVal = player.singularityUpgrades.advancedPack.getEffect().bonus ? 0.33 : 0 - bonusVal += +player.singularityChallenges.oneChallengeCap.rewards.corrScoreIncrease + let bonusVal = player.singularityUpgrades.advancedPack.getEffect().bonus + ? 0.33 + : 0; + bonusVal += + +player.singularityChallenges.oneChallengeCap.rewards.corrScoreIncrease; for (let i = 2; i < 10; i++) { - const exponent = ((i === 2) && player.usedCorruptions[i] >= 10) - ? 1 + 2 * Math.min(1, player.platonicUpgrades[17]) + 0.04 * player.platonicUpgrades[17] - : 1 - corruptionMultiplier *= Math.pow(G.corruptionPointMultipliers[player.usedCorruptions[i] + bonusLevel], exponent) - + bonusVal - - if (player.usedCorruptions[i] >= 14 && player.singularityUpgrades.masterPack.getEffect().bonus) { - corruptionMultiplier *= 1.1 + const exponent = + i === 2 && player.usedCorruptions[i] >= 10 + ? 1 + + 2 * Math.min(1, player.platonicUpgrades[17]) + + 0.04 * player.platonicUpgrades[17] + : 1; + corruptionMultiplier *= + Math.pow( + G.corruptionPointMultipliers[player.usedCorruptions[i] + bonusLevel], + exponent + ) + bonusVal; + + if ( + player.usedCorruptions[i] >= 14 && + player.singularityUpgrades.masterPack.getEffect().bonus + ) { + corruptionMultiplier *= 1.1; } } - const bonusMultiplier = computeAscensionScoreBonusMultiplier() + const bonusMultiplier = computeAscensionScoreBonusMultiplier(); - effectiveScore = baseScore * corruptionMultiplier * bonusMultiplier + effectiveScore = baseScore * corruptionMultiplier * bonusMultiplier; if (effectiveScore > 1e23) { - effectiveScore = Math.pow(effectiveScore, 0.5) * Math.pow(1e23, 0.5) + effectiveScore = Math.pow(effectiveScore, 0.5) * Math.pow(1e23, 0.5); } - player.singularityUpgrades.expertPack.getEffect().bonus ? effectiveScore *= 1.5 : effectiveScore *= 1 + player.singularityUpgrades.expertPack.getEffect().bonus + ? (effectiveScore *= 1.5) + : (effectiveScore *= 1); return { baseScore, corruptionMultiplier, bonusMultiplier, - effectiveScore - } -} + effectiveScore, + }; +}; export const CalcCorruptionStuff = () => { - let cubeBank = 0 - let challengeModifier = 1 - const scores = calculateAscensionScore() + let cubeBank = 0; + let challengeModifier = 1; + const scores = calculateAscensionScore(); - const baseScore = scores.baseScore - const corruptionMultiplier = scores.corruptionMultiplier - const bonusMultiplier = scores.bonusMultiplier - const effectiveScore = scores.effectiveScore + const baseScore = scores.baseScore; + const corruptionMultiplier = scores.corruptionMultiplier; + const bonusMultiplier = scores.bonusMultiplier; + const effectiveScore = scores.effectiveScore; for (let i = 1; i <= 10; i++) { - challengeModifier = (i >= 6) ? 2 : 1 - cubeBank += challengeModifier * player.highestchallengecompletions[i] + challengeModifier = i >= 6 ? 2 : 1; + cubeBank += challengeModifier * player.highestchallengecompletions[i]; } - const oneMindModifier = (player.singularityUpgrades.oneMind.getEffect().bonus) + const oneMindModifier = player.singularityUpgrades.oneMind.getEffect().bonus ? calculateAscensionAcceleration() / 10 - : 1 + : 1; // Calculation of Cubes :) - let cubeGain = cubeBank - cubeGain *= calculateCubeMultiplier(effectiveScore).mult - cubeGain *= oneMindModifier + let cubeGain = cubeBank; + cubeGain *= calculateCubeMultiplier(effectiveScore).mult; + cubeGain *= oneMindModifier; - const bonusCubeExponent = (player.singularityUpgrades.platonicTau.getEffect().bonus) ? 1.01 : 1 - cubeGain = Math.pow(cubeGain, bonusCubeExponent) + const bonusCubeExponent = player.singularityUpgrades.platonicTau.getEffect() + .bonus + ? 1.01 + : 1; + cubeGain = Math.pow(cubeGain, bonusCubeExponent); // Calculation of Tesseracts :)) - let tesseractGain = 1 + let tesseractGain = 1; if (effectiveScore >= 100000) { - tesseractGain += 0.5 + tesseractGain += 0.5; } - tesseractGain *= calculateTesseractMultiplier(effectiveScore).mult - tesseractGain *= oneMindModifier + tesseractGain *= calculateTesseractMultiplier(effectiveScore).mult; + tesseractGain *= oneMindModifier; // Calculation of Hypercubes :))) - let hypercubeGain = (effectiveScore >= 1e9) ? 1 : 0 - hypercubeGain *= calculateHypercubeMultiplier(effectiveScore).mult - hypercubeGain *= oneMindModifier + let hypercubeGain = effectiveScore >= 1e9 ? 1 : 0; + hypercubeGain *= calculateHypercubeMultiplier(effectiveScore).mult; + hypercubeGain *= oneMindModifier; // Calculation of Platonic Cubes :)))) - let platonicGain = (effectiveScore >= 2.666e12) ? 1 : 0 - platonicGain *= calculatePlatonicMultiplier(effectiveScore).mult - platonicGain *= oneMindModifier + let platonicGain = effectiveScore >= 2.666e12 ? 1 : 0; + platonicGain *= calculatePlatonicMultiplier(effectiveScore).mult; + platonicGain *= oneMindModifier; // Calculation of Hepteracts :))))) let hepteractGain = - (G.challenge15Rewards.hepteractUnlocked && effectiveScore >= 1.666e17 && player.achievements[255] > 0) ? 1 : 0 - hepteractGain *= calculateHepteractMultiplier(effectiveScore).mult - hepteractGain *= oneMindModifier + G.challenge15Rewards.hepteractUnlocked && + effectiveScore >= 1.666e17 && + player.achievements[255] > 0 + ? 1 + : 0; + hepteractGain *= calculateHepteractMultiplier(effectiveScore).mult; + hepteractGain *= oneMindModifier; return [ cubeBank, @@ -2299,52 +2976,68 @@ export const CalcCorruptionStuff = () => { corruptionMultiplier, Math.floor(effectiveScore), Math.min(1e300, Math.floor(cubeGain)), - Math.min(1e300, Math.max(player.singularityCount, Math.floor(tesseractGain))), + 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 - ] -} + bonusMultiplier, + ]; +}; export const calcAscensionCount = () => { - let ascCount = 1 + let ascCount = 1; if (player.singularityChallenges.limitedAscensions.enabled) { - return ascCount + return ascCount; } if (player.challengecompletions[10] > 0 && player.achievements[197] === 1) { - const { effectiveScore } = calculateAscensionScore() + const { effectiveScore } = calculateAscensionScore(); if (player.ascensionCounter >= 10) { if (player.achievements[188] > 0) { - ascCount += 99 + ascCount += 99; } - ascCount *= 1 + (player.ascensionCounter / 10 - 1) * 0.2 - * (player.achievements[189] + player.achievements[202] + player.achievements[209] + player.achievements[216] - + player.achievements[223]) + ascCount *= + 1 + + (player.ascensionCounter / 10 - 1) * + 0.2 * + (player.achievements[189] + + player.achievements[202] + + player.achievements[209] + + player.achievements[216] + + player.achievements[223]); } - ascCount *= player.achievements[187] && Math.floor(effectiveScore) > 1e8 - ? (Math.log10(Math.floor(effectiveScore) + 1) - 1) - : 1 - ascCount *= G.challenge15Rewards.ascensions - ascCount *= player.achievements[260] > 0 ? 1.1 : 1 - ascCount *= player.achievements[261] > 0 ? 1.1 : 1 - ascCount *= player.platonicUpgrades[15] > 0 ? 2 : 1 - ascCount *= 1 + 0.02 * player.platonicUpgrades[16] - ascCount *= 1 + 0.02 * player.platonicUpgrades[16] * Math.min(1, player.overfluxPowder / 100000) - ascCount *= 1 + player.singularityCount / 10 - ascCount *= +player.singularityUpgrades.ascensions.getEffect().bonus - ascCount *= +player.octeractUpgrades.octeractAscensions.getEffect().bonus - ascCount *= +player.octeractUpgrades.octeractAscensions2.getEffect().bonus - ascCount *= (player.singularityUpgrades.oneMind.getEffect().bonus) ? calculateAscensionAcceleration() / 10 : 1 - } - - return Math.floor(ascCount) -} + ascCount *= + player.achievements[187] && Math.floor(effectiveScore) > 1e8 + ? Math.log10(Math.floor(effectiveScore) + 1) - 1 + : 1; + ascCount *= G.challenge15Rewards.ascensions; + ascCount *= player.achievements[260] > 0 ? 1.1 : 1; + ascCount *= player.achievements[261] > 0 ? 1.1 : 1; + ascCount *= player.platonicUpgrades[15] > 0 ? 2 : 1; + ascCount *= 1 + 0.02 * player.platonicUpgrades[16]; + ascCount *= + 1 + + 0.02 * + player.platonicUpgrades[16] * + Math.min(1, player.overfluxPowder / 100000); + ascCount *= 1 + player.singularityCount / 10; + ascCount *= +player.singularityUpgrades.ascensions.getEffect().bonus; + ascCount *= +player.octeractUpgrades.octeractAscensions.getEffect().bonus; + ascCount *= +player.octeractUpgrades.octeractAscensions2.getEffect().bonus; + ascCount *= player.singularityUpgrades.oneMind.getEffect().bonus + ? calculateAscensionAcceleration() / 10 + : 1; + } + + return Math.floor(ascCount); +}; /** * Calculates the product of all Powder bonuses. @@ -2358,249 +3051,310 @@ export const calculatePowderConversion = () => { 1 + player.achievements[256] / 20, // Achievement 256, 5% 1 + player.achievements[257] / 20, // Achievement 257, 5% 1 + 0.01 * player.platonicUpgrades[16], // Platonic Upgrade 4x1 - 1 + calculateEventBuff(BuffType.PowderConversion) // Event - ] + 1 + calculateEventBuff(BuffType.PowderConversion), // Event + ]; return { list: arr, - mult: productContents(arr) - } -} + mult: productContents(arr), + }; +}; export const calculateCubeQuarkMultiplier = () => { - return (calculateSigmoid(2, Math.pow(player.overfluxOrbs, 0.5), 40) - + calculateSigmoid(1.5, Math.pow(player.overfluxOrbs, 0.5), 160) - + calculateSigmoid(1.5, Math.pow(player.overfluxOrbs, 0.5), 640) - + calculateSigmoid(1.15, +(player.highestSingularityCount >= 1) * Math.pow(player.overfluxOrbs, 0.45), 2560) - + calculateSigmoid(1.15, +(player.highestSingularityCount >= 2) * Math.pow(player.overfluxOrbs, 0.4), 10000) - + calculateSigmoid(1.25, +(player.highestSingularityCount >= 5) * Math.pow(player.overfluxOrbs, 0.35), 40000) - + calculateSigmoid(1.25, +(player.highestSingularityCount >= 10) * Math.pow(player.overfluxOrbs, 0.32), 160000) - + calculateSigmoid(1.35, +(player.highestSingularityCount >= 15) * Math.pow(player.overfluxOrbs, 0.27), 640000) - + calculateSigmoid(1.45, +(player.highestSingularityCount >= 20) * Math.pow(player.overfluxOrbs, 0.24), 2e6) - + calculateSigmoid(1.55, +(player.highestSingularityCount >= 25) * Math.pow(player.overfluxOrbs, 0.21), 1e7) - + calculateSigmoid(1.85, +(player.highestSingularityCount >= 30) * Math.pow(player.overfluxOrbs, 0.18), 4e7) - + calculateSigmoid(3, +(player.highestSingularityCount >= 35) * Math.pow(player.overfluxOrbs, 0.15), 1e8) - - 11) - * (1 + 1 / 500 * player.shopUpgrades.cubeToQuarkAll) - * (player.autoWarpCheck ? 1 + player.dailyPowderResetUses : 1) -} + return ( + (calculateSigmoid(2, Math.pow(player.overfluxOrbs, 0.5), 40) + + calculateSigmoid(1.5, Math.pow(player.overfluxOrbs, 0.5), 160) + + calculateSigmoid(1.5, Math.pow(player.overfluxOrbs, 0.5), 640) + + calculateSigmoid( + 1.15, + +(player.highestSingularityCount >= 1) * + Math.pow(player.overfluxOrbs, 0.45), + 2560 + ) + + calculateSigmoid( + 1.15, + +(player.highestSingularityCount >= 2) * + Math.pow(player.overfluxOrbs, 0.4), + 10000 + ) + + calculateSigmoid( + 1.25, + +(player.highestSingularityCount >= 5) * + Math.pow(player.overfluxOrbs, 0.35), + 40000 + ) + + calculateSigmoid( + 1.25, + +(player.highestSingularityCount >= 10) * + Math.pow(player.overfluxOrbs, 0.32), + 160000 + ) + + calculateSigmoid( + 1.35, + +(player.highestSingularityCount >= 15) * + Math.pow(player.overfluxOrbs, 0.27), + 640000 + ) + + calculateSigmoid( + 1.45, + +(player.highestSingularityCount >= 20) * + Math.pow(player.overfluxOrbs, 0.24), + 2e6 + ) + + calculateSigmoid( + 1.55, + +(player.highestSingularityCount >= 25) * + Math.pow(player.overfluxOrbs, 0.21), + 1e7 + ) + + calculateSigmoid( + 1.85, + +(player.highestSingularityCount >= 30) * + Math.pow(player.overfluxOrbs, 0.18), + 4e7 + ) + + calculateSigmoid( + 3, + +(player.highestSingularityCount >= 35) * + Math.pow(player.overfluxOrbs, 0.15), + 1e8 + ) - + 11) * + (1 + (1 / 500) * player.shopUpgrades.cubeToQuarkAll) * + (player.autoWarpCheck ? 1 + player.dailyPowderResetUses : 1) + ); +}; export const calculateCubeMultFromPowder = () => { - return (player.overfluxPowder > 10000) - ? (1 + 1 / 16 * Math.pow(Math.log10(player.overfluxPowder), 2)) - : (1 + 1 / 10000 * player.overfluxPowder) -} + return player.overfluxPowder > 10000 + ? 1 + (1 / 16) * Math.pow(Math.log10(player.overfluxPowder), 2) + : 1 + (1 / 10000) * player.overfluxPowder; +}; export const calculateQuarkMultFromPowder = () => { - return (player.overfluxPowder > 10000) - ? (1 + 1 / 40 * Math.log10(player.overfluxPowder)) - : (1 + 1 / 100000 * player.overfluxPowder) -} + return player.overfluxPowder > 10000 + ? 1 + (1 / 40) * Math.log10(player.overfluxPowder) + : 1 + (1 / 100000) * player.overfluxPowder; +}; export const calculateSingularityAmbrosiaLuckMilestoneBonus = () => { - let bonus = 0 - const singThresholds1 = [35, 42, 49, 56, 63, 70, 77] - const singThresholds2 = [135, 142, 149, 156, 163, 170, 177] + let bonus = 0; + const singThresholds1 = [35, 42, 49, 56, 63, 70, 77]; + const singThresholds2 = [135, 142, 149, 156, 163, 170, 177]; for (const sing of singThresholds1) { if (player.highestSingularityCount >= sing) { - bonus += 5 + bonus += 5; } } for (const sing of singThresholds2) { if (player.highestSingularityCount >= sing) { - bonus += 6 + bonus += 6; } } - return bonus -} + return bonus; +}; export const calculateAmbrosiaGenerationShopUpgrade = () => { const multipliers = [ 1 + player.shopUpgrades.shopAmbrosiaGeneration1 / 100, 1 + player.shopUpgrades.shopAmbrosiaGeneration2 / 100, 1 + player.shopUpgrades.shopAmbrosiaGeneration3 / 100, - 1 + player.shopUpgrades.shopAmbrosiaGeneration4 / 1000 - ] + 1 + player.shopUpgrades.shopAmbrosiaGeneration4 / 1000, + ]; - return productContents(multipliers) -} + return productContents(multipliers); +}; export const calculateAmbrosiaLuckShopUpgrade = () => { const vals = [ 2 * player.shopUpgrades.shopAmbrosiaLuck1, 2 * player.shopUpgrades.shopAmbrosiaLuck2, 2 * player.shopUpgrades.shopAmbrosiaLuck3, - 0.6 * player.shopUpgrades.shopAmbrosiaLuck4 - ] + 0.6 * player.shopUpgrades.shopAmbrosiaLuck4, + ]; - return sumContents(vals) -} + return sumContents(vals); +}; export const calculateAmbrosiaGenerationSingularityUpgrade = () => { const vals = [ +player.singularityUpgrades.singAmbrosiaGeneration.getEffect().bonus, +player.singularityUpgrades.singAmbrosiaGeneration2.getEffect().bonus, +player.singularityUpgrades.singAmbrosiaGeneration3.getEffect().bonus, - +player.singularityUpgrades.singAmbrosiaGeneration4.getEffect().bonus - ] + +player.singularityUpgrades.singAmbrosiaGeneration4.getEffect().bonus, + ]; - return productContents(vals) -} + return productContents(vals); +}; export const calculateAmbrosiaLuckSingularityUpgrade = () => { const vals = [ +player.singularityUpgrades.singAmbrosiaLuck.getEffect().bonus, +player.singularityUpgrades.singAmbrosiaLuck2.getEffect().bonus, +player.singularityUpgrades.singAmbrosiaLuck3.getEffect().bonus, - +player.singularityUpgrades.singAmbrosiaLuck4.getEffect().bonus - ] + +player.singularityUpgrades.singAmbrosiaLuck4.getEffect().bonus, + ]; - return sumContents(vals) -} + return sumContents(vals); +}; export const calculateAmbrosiaGenerationOcteractUpgrade = () => { const vals = [ +player.octeractUpgrades.octeractAmbrosiaGeneration.getEffect().bonus, +player.octeractUpgrades.octeractAmbrosiaGeneration2.getEffect().bonus, +player.octeractUpgrades.octeractAmbrosiaGeneration3.getEffect().bonus, - +player.octeractUpgrades.octeractAmbrosiaGeneration4.getEffect().bonus - ] + +player.octeractUpgrades.octeractAmbrosiaGeneration4.getEffect().bonus, + ]; - return productContents(vals) -} + return productContents(vals); +}; export const calculateAmbrosiaLuckOcteractUpgrade = () => { const vals = [ +player.octeractUpgrades.octeractAmbrosiaLuck.getEffect().bonus, +player.octeractUpgrades.octeractAmbrosiaLuck2.getEffect().bonus, +player.octeractUpgrades.octeractAmbrosiaLuck3.getEffect().bonus, - +player.octeractUpgrades.octeractAmbrosiaLuck4.getEffect().bonus - ] + +player.octeractUpgrades.octeractAmbrosiaLuck4.getEffect().bonus, + ]; - return sumContents(vals) -} + return sumContents(vals); +}; export const calculateRequiredBlueberryTime = () => { - let val = G.TIME_PER_AMBROSIA // Currently 600 - val += Math.floor(player.lifetimeAmbrosia / 30) + let val = G.TIME_PER_AMBROSIA; // Currently 600 + val += Math.floor(player.lifetimeAmbrosia / 30); - const baseVal = val + const baseVal = val; - const timeThresholds = [5000, 25000, 75000, 250000, 500000, 1e6, 2e6, 4e6, 1e7, 2e7, 4e7, 1e8] + const timeThresholds = [ + 5000, 25000, 75000, 250000, 500000, 1e6, 2e6, 4e6, 1e7, 2e7, 4e7, 1e8, + ]; for (const threshold of timeThresholds) { if (baseVal >= threshold) { - val *= 2 + val *= 2; } } - return val -} + return val; +}; export const calculateSingularityMilestoneBlueberries = () => { - let val = 0 - if (player.highestSingularityCount >= 254) val = 4 - else if (player.highestSingularityCount >= 198) val = 3 - else if (player.highestSingularityCount >= 132) val = 2 - else if (player.highestSingularityCount >= 66) val = 1 + let val = 0; + if (player.highestSingularityCount >= 254) val = 4; + else if (player.highestSingularityCount >= 198) val = 3; + else if (player.highestSingularityCount >= 132) val = 2; + else if (player.highestSingularityCount >= 66) val = 1; - return val -} + return val; +}; export const calculateAmbrosiaCubeMult = () => { - let multiplier = 1 - multiplier += Math.min(1.5, Math.floor(player.lifetimeAmbrosia / 66) / 100) + let multiplier = 1; + multiplier += Math.min(1.5, Math.floor(player.lifetimeAmbrosia / 66) / 100); if (player.lifetimeAmbrosia >= 10000) { - multiplier += Math.min(1.5, Math.floor(player.lifetimeAmbrosia / 666) / 100) + multiplier += Math.min( + 1.5, + Math.floor(player.lifetimeAmbrosia / 666) / 100 + ); } if (player.lifetimeAmbrosia >= 100000) { - multiplier += Math.floor(player.lifetimeAmbrosia / 6666) / 100 + multiplier += Math.floor(player.lifetimeAmbrosia / 6666) / 100; } - return multiplier -} + return multiplier; +}; export const calculateAmbrosiaQuarkMult = () => { - let multiplier = 1 - multiplier += Math.min(0.3, Math.floor(player.lifetimeAmbrosia / 1666) / 100) + let multiplier = 1; + multiplier += Math.min(0.3, Math.floor(player.lifetimeAmbrosia / 1666) / 100); if (player.lifetimeAmbrosia >= 50000) { - multiplier += Math.min(0.3, Math.floor(player.lifetimeAmbrosia / 16666) / 100) + multiplier += Math.min( + 0.3, + Math.floor(player.lifetimeAmbrosia / 16666) / 100 + ); } if (player.lifetimeAmbrosia >= 500000) { - multiplier += Math.floor(player.lifetimeAmbrosia / 166666) / 100 + multiplier += Math.floor(player.lifetimeAmbrosia / 166666) / 100; } - return multiplier -} + return multiplier; +}; export const dailyResetCheck = () => { if (!player.dayCheck) { - return + return; } - const now = new Date(getTimePinnedToLoadDate()) - const day = new Date(now.getFullYear(), now.getMonth(), now.getDate()) - const h = now.getHours() - const m = now.getMinutes() - const s = now.getSeconds() - player.dayTimer = (60 * 60 * 24) - (60 * 60 * h) - (60 * m) - s + const now = new Date(getTimePinnedToLoadDate()); + const day = new Date(now.getFullYear(), now.getMonth(), now.getDate()); + const h = now.getHours(); + const m = now.getMinutes(); + const s = now.getSeconds(); + player.dayTimer = 60 * 60 * 24 - 60 * 60 * h - 60 * m - s; // Daily is not reset even if it is set to a past time. // If the daily is not reset, the data may have been set to a future time. if (day.getTime() - 3600000 > player.dayCheck.getTime()) { - player.dayCheck = day + player.dayCheck = day; - forcedDailyReset(true) - player.dailyPowderResetUses = 1 + player.shopUpgrades.extraWarp - player.dailyCodeUsed = false + forcedDailyReset(true); + player.dailyPowderResetUses = 1 + player.shopUpgrades.extraWarp; + player.dailyCodeUsed = false; - DOMCacheGetOrSet('cubeQuarksOpenRequirement').style.display = 'block' + DOMCacheGetOrSet("cubeQuarksOpenRequirement").style.display = "block"; if (player.challengecompletions[11] > 0) { - DOMCacheGetOrSet('tesseractQuarksOpenRequirement').style.display = 'block' + DOMCacheGetOrSet("tesseractQuarksOpenRequirement").style.display = + "block"; } if (player.challengecompletions[13] > 0) { - DOMCacheGetOrSet('hypercubeQuarksOpenRequirement').style.display = 'block' + DOMCacheGetOrSet("hypercubeQuarksOpenRequirement").style.display = + "block"; } if (player.challengecompletions[14] > 0) { - DOMCacheGetOrSet('platonicCubeQuarksOpenRequirement').style.display = 'block' + DOMCacheGetOrSet("platonicCubeQuarksOpenRequirement").style.display = + "block"; } } -} +}; /** * Resets Cube Counts and stuff. NOTE: It is intentional it does not award powder or expire orbs. */ export const forcedDailyReset = (rewards = false) => { - player.cubeQuarkDaily = 0 - player.tesseractQuarkDaily = 0 - player.hypercubeQuarkDaily = 0 - player.platonicCubeQuarkDaily = 0 - player.cubeOpenedDaily = 0 - player.tesseractOpenedDaily = 0 - player.hypercubeOpenedDaily = 0 - player.platonicCubeOpenedDaily = 0 + player.cubeQuarkDaily = 0; + player.tesseractQuarkDaily = 0; + player.hypercubeQuarkDaily = 0; + player.platonicCubeQuarkDaily = 0; + player.cubeOpenedDaily = 0; + player.tesseractOpenedDaily = 0; + player.hypercubeOpenedDaily = 0; + player.platonicCubeOpenedDaily = 0; if (rewards) { - player.overfluxPowder += player.overfluxOrbs * calculatePowderConversion().mult - player.overfluxOrbs = G.challenge15Rewards.freeOrbs + player.overfluxPowder += + player.overfluxOrbs * calculatePowderConversion().mult; + player.overfluxOrbs = G.challenge15Rewards.freeOrbs; } -} +}; export const calculateEventBuff = (buff: BuffType) => { if (!G.isEvent) { - return 0 + return 0; } - return calculateEventSourceBuff(buff) -} + return calculateEventSourceBuff(buff); +}; export const derpsmithCornucopiaBonus = () => { - let counter = 0 - const singCounts = [18, 38, 58, 78, 88, 98, 118, 148, 178, 188, 198, 208, 218, 228, 238, 248] + let counter = 0; + const singCounts = [ + 18, 38, 58, 78, 88, 98, 118, 148, 178, 188, 198, 208, 218, 228, 238, 248, + ]; for (const sing of singCounts) { if (player.highestSingularityCount >= sing) { - counter += 1 + counter += 1; } } - return 1 + counter * player.highestSingularityCount / 100 -} + return 1 + (counter * player.highestSingularityCount) / 100; +}; diff --git a/src/CheckVariables.ts b/src/CheckVariables.ts index 61138ae4b..4f08fa087 100644 --- a/src/CheckVariables.ts +++ b/src/CheckVariables.ts @@ -1,10 +1,18 @@ -import Decimal from 'break_infinity.js' -import i18next from 'i18next' -import { type IBlueberryData, updateLoadoutHoverClasses } from './BlueberryUpgrades' -import { BlueberryUpgrade, blueberryUpgradeData } from './BlueberryUpgrades' -import { calculateMaxRunes, calculateTimeAcceleration } from './Calculate' -import { testing } from './Config' -import { WowCubes, WowHypercubes, WowPlatonicCubes, WowTesseracts } from './CubeExperimental' +import Decimal from "break_infinity.js"; +import i18next from "i18next"; +import { + type IBlueberryData, + updateLoadoutHoverClasses, +} from "./BlueberryUpgrades"; +import { BlueberryUpgrade, blueberryUpgradeData } from "./BlueberryUpgrades"; +import { calculateMaxRunes, calculateTimeAcceleration } from "./Calculate"; +import { testing } from "./Config"; +import { + WowCubes, + WowHypercubes, + WowPlatonicCubes, + WowTesseracts, +} from "./CubeExperimental"; import { AbyssHepteract, AcceleratorBoostHepteract, @@ -14,23 +22,31 @@ import { createHepteract, HyperrealismHepteract, MultiplierHepteract, - QuarkHepteract -} from './Hepteracts' -import type { IOcteractData } from './Octeracts' -import { octeractData, OcteractUpgrade } from './Octeracts' -import { buyResearch } from './Research' -import { getQuarkInvestment, shopData } from './Shop' -import type { ISingularityData } from './singularity' -import { singularityData, SingularityUpgrade } from './singularity' -import type { ISingularityChallengeData } from './SingularityChallenges' -import { SingularityChallenge, singularityChallengeData } from './SingularityChallenges' -import { AmbrosiaGenerationCache, AmbrosiaLuckCache, BlueberryInventoryCache, cacheReinitialize } from './StatCache' -import { c15RewardUpdate } from './Statistics' -import { blankSave, player, resetCheck } from './Synergism' -import type { LegacyShopUpgrades, PlayerSave } from './types/LegacySynergism' -import type { Player } from './types/Synergism' -import { Alert } from './UpdateHTML' -import { padArray } from './Utility' + QuarkHepteract, +} from "./Hepteracts"; +import type { IOcteractData } from "./Octeracts"; +import { octeractData, OcteractUpgrade } from "./Octeracts"; +import { buyResearch } from "./Research"; +import { getQuarkInvestment, shopData } from "./Shop"; +import type { ISingularityData } from "./singularity"; +import { singularityData, SingularityUpgrade } from "./singularity"; +import type { ISingularityChallengeData } from "./SingularityChallenges"; +import { + SingularityChallenge, + singularityChallengeData, +} from "./SingularityChallenges"; +import { + AmbrosiaGenerationCache, + AmbrosiaLuckCache, + BlueberryInventoryCache, + cacheReinitialize, +} from "./StatCache"; +import { c15RewardUpdate } from "./Statistics"; +import { blankSave, player, resetCheck } from "./Synergism"; +import type { LegacyShopUpgrades, PlayerSave } from "./types/LegacySynergism"; +import type { Player } from "./types/Synergism"; +import { Alert } from "./UpdateHTML"; +import { padArray } from "./Utility"; /** * Given player data, it checks, on load if variables are undefined @@ -43,26 +59,36 @@ export const checkVariablesOnLoad = (data: PlayerSave) => { player.currentChallenge = { transcension: 0, reincarnation: 0, - ascension: 0 - } + ascension: 0, + }; } - data.shopUpgrades ??= { ...blankSave.shopUpgrades } - data.ascStatToggles ??= { ...blankSave.ascStatToggles } + data.shopUpgrades ??= { ...blankSave.shopUpgrades }; + data.ascStatToggles ??= { ...blankSave.ascStatToggles }; - if (typeof data.promoCodeTiming === 'object' && data.promoCodeTiming != null) { + if ( + typeof data.promoCodeTiming === "object" && + data.promoCodeTiming != null + ) { for (const key of Object.keys(data.promoCodeTiming)) { - const k = key as keyof typeof data.promoCodeTiming - player.promoCodeTiming[k] = data.promoCodeTiming[k] + const k = key as keyof typeof data.promoCodeTiming; + player.promoCodeTiming[k] = data.promoCodeTiming[k]; } } else { - player.promoCodeTiming.time = Date.now() - (60 * 1000 * 15) + player.promoCodeTiming.time = Date.now() - 60 * 1000 * 15; } // backwards compatibility for v1.0101 (and possibly older) saves - if (!Array.isArray(data.challengecompletions) && data.challengecompletions != null) { - player.challengecompletions = Object.values(data.challengecompletions) - padArray(player.challengecompletions, 0, blankSave.challengecompletions.length) + if ( + !Array.isArray(data.challengecompletions) && + data.challengecompletions != null + ) { + player.challengecompletions = Object.values(data.challengecompletions); + padArray( + player.challengecompletions, + 0, + blankSave.challengecompletions.length + ); } // backwards compatibility for v1.0101 (and possibly older) saves @@ -70,53 +96,105 @@ export const checkVariablesOnLoad = (data: PlayerSave) => { // if highestchallengecompletions is every added onto, this will need to be padded. player.highestchallengecompletions = Object.values( data.highestchallengecompletions as unknown as object - ) as number[] + ) as number[]; } if (data.wowCubes === undefined) { - player.wowCubes = new WowCubes() - player.wowTesseracts = new WowTesseracts(0) - player.wowHypercubes = new WowHypercubes(0) + player.wowCubes = new WowCubes(); + player.wowTesseracts = new WowTesseracts(0); + player.wowHypercubes = new WowHypercubes(0); // dprint-ignore - player.cubeUpgrades = [null, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + player.cubeUpgrades = [ + null, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ]; } if (data.shoptoggles?.reincarnate === undefined) { - player.shoptoggles.reincarnate = true + player.shoptoggles.reincarnate = true; } if (data.ascendBuilding1 === undefined) { player.ascendBuilding1 = { cost: 1, owned: 0, - generated: new Decimal('0'), - multiplier: 0.01 - } + generated: new Decimal("0"), + multiplier: 0.01, + }; player.ascendBuilding2 = { cost: 10, owned: 0, - generated: new Decimal('0'), - multiplier: 0.01 - } + generated: new Decimal("0"), + multiplier: 0.01, + }; player.ascendBuilding3 = { cost: 100, owned: 0, - generated: new Decimal('0'), - multiplier: 0.01 - } + generated: new Decimal("0"), + multiplier: 0.01, + }; player.ascendBuilding4 = { cost: 1000, owned: 0, - generated: new Decimal('0'), - multiplier: 0.01 - } + generated: new Decimal("0"), + multiplier: 0.01, + }; player.ascendBuilding5 = { cost: 10000, owned: 0, - generated: new Decimal('0'), - multiplier: 0.01 - } + generated: new Decimal("0"), + multiplier: 0.01, + }; } if (data.tesseractbuyamount === undefined) { - player.tesseractbuyamount = 1 + player.tesseractbuyamount = 1; } if (data.tesseractBlessings === undefined) { player.tesseractBlessings = { @@ -129,8 +207,8 @@ export const checkVariablesOnLoad = (data: PlayerSave) => { antSacrifice: 0, antELO: 0, talismanBonus: 0, - globalSpeed: 0 - } + globalSpeed: 0, + }; player.hypercubeBlessings = { accelerator: 0, multiplier: 0, @@ -141,368 +219,729 @@ export const checkVariablesOnLoad = (data: PlayerSave) => { antSacrifice: 0, antELO: 0, talismanBonus: 0, - globalSpeed: 0 - } + globalSpeed: 0, + }; } if (data.prototypeCorruptions === undefined) { - player.prototypeCorruptions = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] - player.usedCorruptions = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + player.prototypeCorruptions = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; + player.usedCorruptions = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; } if (data.constantUpgrades === undefined) { - player.ascendShards = new Decimal('0') - player.constantUpgrades = [null, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + player.ascendShards = new Decimal("0"); + player.constantUpgrades = [null, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; } if (data.roombaResearchIndex === undefined) { - player.roombaResearchIndex = 0 + player.roombaResearchIndex = 0; } if (data.history === undefined) { - player.history = { ants: [], ascend: [], reset: [], singularity: [] } + player.history = { ants: [], ascend: [], reset: [], singularity: [] }; } if (data.autoChallengeRunning === undefined) { - player.autoChallengeRunning = false - player.autoChallengeIndex = 1 + player.autoChallengeRunning = false; + player.autoChallengeIndex = 1; // dprint-ignore - player.autoChallengeToggles = [false, true, true, true, true, true, true, true, true, true, true, false, false, false, false, false] - player.autoChallengeStartExponent = 10 + player.autoChallengeToggles = [ + false, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + ]; + player.autoChallengeStartExponent = 10; player.autoChallengeTimer = { start: 10, exit: 2, - enter: 2 - } + enter: 2, + }; } if (data.autoAscend === undefined) { - player.autoAscend = false - player.autoAscendMode = 'c10Completions' - player.autoAscendThreshold = 1 + player.autoAscend = false; + player.autoAscendMode = "c10Completions"; + player.autoAscendThreshold = 1; } if (data.runeBlessingLevels === undefined) { - player.runeBlessingLevels = [0, 0, 0, 0, 0, 0] - player.runeSpiritLevels = [0, 0, 0, 0, 0, 0] - player.runeBlessingBuyAmount = 0 - player.runeSpiritBuyAmount = 0 + player.runeBlessingLevels = [0, 0, 0, 0, 0, 0]; + player.runeSpiritLevels = [0, 0, 0, 0, 0, 0]; + player.runeBlessingBuyAmount = 0; + player.runeSpiritBuyAmount = 0; } if (data.autoBuyFragment === undefined) { - player.autoBuyFragment = false - player.saveOfferingToggle = false + player.autoBuyFragment = false; + player.saveOfferingToggle = false; } if (data.autoTesseracts === undefined) { - player.autoTesseracts = [false, false, false, false, false, false] + player.autoTesseracts = [false, false, false, false, false, false]; } if (data.autoOpenCubes === undefined) { - player.autoOpenCubes = false - player.openCubes = 0 + player.autoOpenCubes = false; + player.openCubes = 0; } if (data.autoOpenTesseracts === undefined) { - player.autoOpenTesseracts = false - player.openTesseracts = 0 + player.autoOpenTesseracts = false; + player.openTesseracts = 0; } if (data.autoOpenHypercubes === undefined) { - player.autoOpenHypercubes = false - player.openHypercubes = 0 + player.autoOpenHypercubes = false; + player.openHypercubes = 0; } if (data.autoOpenPlatonicsCubes === undefined) { - player.autoOpenPlatonicsCubes = false - player.openPlatonicsCubes = 0 + player.autoOpenPlatonicsCubes = false; + player.openPlatonicsCubes = 0; } - if (player.prototypeCorruptions[0] === null || player.prototypeCorruptions[0] === undefined) { - player.usedCorruptions = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] - player.prototypeCorruptions = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + if ( + player.prototypeCorruptions[0] === null || + player.prototypeCorruptions[0] === undefined + ) { + player.usedCorruptions = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; + player.prototypeCorruptions = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; } if (player.corruptionLoadouts === undefined) { - player.corruptionLoadouts = { ...blankSave.corruptionLoadouts } - player.corruptionShowStats = true + player.corruptionLoadouts = { ...blankSave.corruptionLoadouts }; + player.corruptionShowStats = true; } const corruptionLoadouts = Object.keys( blankSave.corruptionLoadouts - ) as (`${keyof Player['corruptionLoadouts']}`)[] + ) as `${keyof Player["corruptionLoadouts"]}`[]; for (const key of corruptionLoadouts.map((k) => Number(k))) { if (player.corruptionLoadouts[key] !== undefined) { - continue + continue; } - player.corruptionLoadouts[key] = blankSave.corruptionLoadouts[key] + player.corruptionLoadouts[key] = blankSave.corruptionLoadouts[key]; } - if (player.corruptionLoadoutNames.length < blankSave.corruptionLoadoutNames.length) { - const diff = blankSave.corruptionLoadoutNames.slice(player.corruptionLoadoutNames.length) + if ( + player.corruptionLoadoutNames.length < + blankSave.corruptionLoadoutNames.length + ) { + const diff = blankSave.corruptionLoadoutNames.slice( + player.corruptionLoadoutNames.length + ); - player.corruptionLoadoutNames.push(...diff) + player.corruptionLoadoutNames.push(...diff); } for (let i = 0; i <= 4; i++) { if (player.runelevels[i] > calculateMaxRunes(i + 1)) { - player.runelevels[i] = 0 + player.runelevels[i] = 0; } } if (data.shopUpgrades.challengeExtension === undefined) { - player.shopUpgrades.challengeExtension = 0 - player.shopUpgrades.challengeTome = 0 - player.shopUpgrades.seasonPass = 0 - player.shopUpgrades.cubeToQuark = 0 - player.shopUpgrades.tesseractToQuark = 0 - player.shopUpgrades.hypercubeToQuark = 0 - } - if (data.cubeUpgrades == null || data.cubeUpgrades[19] === 0 || player.cubeUpgrades[19] === 0) { + player.shopUpgrades.challengeExtension = 0; + player.shopUpgrades.challengeTome = 0; + player.shopUpgrades.seasonPass = 0; + player.shopUpgrades.cubeToQuark = 0; + player.shopUpgrades.tesseractToQuark = 0; + player.shopUpgrades.hypercubeToQuark = 0; + } + if ( + data.cubeUpgrades == null || + data.cubeUpgrades[19] === 0 || + player.cubeUpgrades[19] === 0 + ) { for (let i = 121; i <= 125; i++) { - player.upgrades[i] = 0 + player.upgrades[i] = 0; } } // assign the save's toggles to the player toggles // will overwrite player.toggles keys that exist on both objects, // but new keys will default to the values on the player object - Object.assign(player.toggles, data.toggles) + Object.assign(player.toggles, data.toggles); for (const key in blankSave.toggles) { if (player.toggles[key] === undefined) { - player.toggles[key] = blankSave.toggles[key] + player.toggles[key] = blankSave.toggles[key]; } } if (data.dayCheck === undefined) { - player.dayCheck = null - player.dayTimer = 0 - player.cubeQuarkDaily = 0 - player.tesseractQuarkDaily = 0 - player.hypercubeQuarkDaily = 0 - player.cubeOpenedDaily = 0 - player.tesseractOpenedDaily = 0 - player.hypercubeOpenedDaily = 0 + player.dayCheck = null; + player.dayTimer = 0; + player.cubeQuarkDaily = 0; + player.tesseractQuarkDaily = 0; + player.hypercubeQuarkDaily = 0; + player.cubeOpenedDaily = 0; + player.tesseractOpenedDaily = 0; + player.hypercubeOpenedDaily = 0; } player.singularityUpgrades = { - goldenQuarks1: new SingularityUpgrade(singularityData.goldenQuarks1, 'goldenQuarks1'), - goldenQuarks2: new SingularityUpgrade(singularityData.goldenQuarks2, 'goldenQuarks2'), - goldenQuarks3: new SingularityUpgrade(singularityData.goldenQuarks3, 'goldenQuarks3'), - starterPack: new SingularityUpgrade(singularityData.starterPack, 'starterPack'), - wowPass: new SingularityUpgrade(singularityData.wowPass, 'wowPass'), - cookies: new SingularityUpgrade(singularityData.cookies, 'cookies'), - cookies2: new SingularityUpgrade(singularityData.cookies2, 'cookies2'), - cookies3: new SingularityUpgrade(singularityData.cookies3, 'cookies3'), - cookies4: new SingularityUpgrade(singularityData.cookies4, 'cookies4'), - cookies5: new SingularityUpgrade(singularityData.cookies5, 'cookies5'), - ascensions: new SingularityUpgrade(singularityData.ascensions, 'ascensions'), - corruptionFourteen: new SingularityUpgrade(singularityData.corruptionFourteen, 'corruptionFourteen'), - corruptionFifteen: new SingularityUpgrade(singularityData.corruptionFifteen, 'corruptionFifteen'), - singOfferings1: new SingularityUpgrade(singularityData.singOfferings1, 'singOfferings1'), - singOfferings2: new SingularityUpgrade(singularityData.singOfferings2, 'singOfferings2'), - singOfferings3: new SingularityUpgrade(singularityData.singOfferings3, 'singOfferings3'), - singObtainium1: new SingularityUpgrade(singularityData.singObtainium1, 'singObtainium1'), - singObtainium2: new SingularityUpgrade(singularityData.singObtainium2, 'singObtainium2'), - singObtainium3: new SingularityUpgrade(singularityData.singObtainium3, 'singObtainium3'), - singCubes1: new SingularityUpgrade(singularityData.singCubes1, 'singCubes1'), - singCubes2: new SingularityUpgrade(singularityData.singCubes2, 'singCubes2'), - singCubes3: new SingularityUpgrade(singularityData.singCubes3, 'singCubes3'), - singCitadel: new SingularityUpgrade(singularityData.singCitadel, 'singCitadel'), - singCitadel2: new SingularityUpgrade(singularityData.singCitadel2, 'singCitadel2'), - octeractUnlock: new SingularityUpgrade(singularityData.octeractUnlock, 'octeractUnlock'), + goldenQuarks1: new SingularityUpgrade( + singularityData.goldenQuarks1, + "goldenQuarks1" + ), + goldenQuarks2: new SingularityUpgrade( + singularityData.goldenQuarks2, + "goldenQuarks2" + ), + goldenQuarks3: new SingularityUpgrade( + singularityData.goldenQuarks3, + "goldenQuarks3" + ), + starterPack: new SingularityUpgrade( + singularityData.starterPack, + "starterPack" + ), + wowPass: new SingularityUpgrade(singularityData.wowPass, "wowPass"), + cookies: new SingularityUpgrade(singularityData.cookies, "cookies"), + cookies2: new SingularityUpgrade(singularityData.cookies2, "cookies2"), + cookies3: new SingularityUpgrade(singularityData.cookies3, "cookies3"), + cookies4: new SingularityUpgrade(singularityData.cookies4, "cookies4"), + cookies5: new SingularityUpgrade(singularityData.cookies5, "cookies5"), + ascensions: new SingularityUpgrade( + singularityData.ascensions, + "ascensions" + ), + corruptionFourteen: new SingularityUpgrade( + singularityData.corruptionFourteen, + "corruptionFourteen" + ), + corruptionFifteen: new SingularityUpgrade( + singularityData.corruptionFifteen, + "corruptionFifteen" + ), + singOfferings1: new SingularityUpgrade( + singularityData.singOfferings1, + "singOfferings1" + ), + singOfferings2: new SingularityUpgrade( + singularityData.singOfferings2, + "singOfferings2" + ), + singOfferings3: new SingularityUpgrade( + singularityData.singOfferings3, + "singOfferings3" + ), + singObtainium1: new SingularityUpgrade( + singularityData.singObtainium1, + "singObtainium1" + ), + singObtainium2: new SingularityUpgrade( + singularityData.singObtainium2, + "singObtainium2" + ), + singObtainium3: new SingularityUpgrade( + singularityData.singObtainium3, + "singObtainium3" + ), + singCubes1: new SingularityUpgrade( + singularityData.singCubes1, + "singCubes1" + ), + singCubes2: new SingularityUpgrade( + singularityData.singCubes2, + "singCubes2" + ), + singCubes3: new SingularityUpgrade( + singularityData.singCubes3, + "singCubes3" + ), + singCitadel: new SingularityUpgrade( + singularityData.singCitadel, + "singCitadel" + ), + singCitadel2: new SingularityUpgrade( + singularityData.singCitadel2, + "singCitadel2" + ), + octeractUnlock: new SingularityUpgrade( + singularityData.octeractUnlock, + "octeractUnlock" + ), singOcteractPatreonBonus: new SingularityUpgrade( singularityData.singOcteractPatreonBonus, - 'singOcteractPatreonBonus' - ), - intermediatePack: new SingularityUpgrade(singularityData.intermediatePack, 'intermediatePack'), - advancedPack: new SingularityUpgrade(singularityData.advancedPack, 'advancedPack'), - expertPack: new SingularityUpgrade(singularityData.expertPack, 'expertPack'), - masterPack: new SingularityUpgrade(singularityData.masterPack, 'masterPack'), - divinePack: new SingularityUpgrade(singularityData.divinePack, 'divinePack'), - wowPass2: new SingularityUpgrade(singularityData.wowPass2, 'wowPass2'), - potionBuff: new SingularityUpgrade(singularityData.potionBuff, 'potionBuff'), - potionBuff2: new SingularityUpgrade(singularityData.potionBuff2, 'potionBuff2'), - potionBuff3: new SingularityUpgrade(singularityData.potionBuff3, 'potionBuff3'), - singChallengeExtension: new SingularityUpgrade(singularityData.singChallengeExtension, 'singChallengeExtension'), - singChallengeExtension2: new SingularityUpgrade(singularityData.singChallengeExtension2, 'singChallengeExtension2'), - singChallengeExtension3: new SingularityUpgrade(singularityData.singChallengeExtension3, 'singChallengeExtension3'), - singQuarkImprover1: new SingularityUpgrade(singularityData.singQuarkImprover1, 'singQuarkImprover1'), - singQuarkHepteract: new SingularityUpgrade(singularityData.singQuarkHepteract, 'singQuarkHepteract'), - singQuarkHepteract2: new SingularityUpgrade(singularityData.singQuarkHepteract2, 'singQuarkHepteract2'), - singQuarkHepteract3: new SingularityUpgrade(singularityData.singQuarkHepteract3, 'singQuarkHepteract3'), - singOcteractGain: new SingularityUpgrade(singularityData.singOcteractGain, 'singOcteractGain'), - singOcteractGain2: new SingularityUpgrade(singularityData.singOcteractGain2, 'singOcteractGain2'), - singOcteractGain3: new SingularityUpgrade(singularityData.singOcteractGain3, 'singOcteractGain3'), - singOcteractGain4: new SingularityUpgrade(singularityData.singOcteractGain4, 'singOcteractGain4'), - singOcteractGain5: new SingularityUpgrade(singularityData.singOcteractGain5, 'singOcteractGain5'), - wowPass3: new SingularityUpgrade(singularityData.wowPass3, 'wowPass3'), - ultimatePen: new SingularityUpgrade(singularityData.ultimatePen, 'ultimatePen'), - platonicTau: new SingularityUpgrade(singularityData.platonicTau, 'platonicTau'), - platonicAlpha: new SingularityUpgrade(singularityData.platonicAlpha, 'platonicAlpha'), - platonicDelta: new SingularityUpgrade(singularityData.platonicDelta, 'platonicDelta'), - platonicPhi: new SingularityUpgrade(singularityData.platonicPhi, 'platonicPhi'), - singFastForward: new SingularityUpgrade(singularityData.singFastForward, 'singFastForward'), - singFastForward2: new SingularityUpgrade(singularityData.singFastForward2, 'singFastForward2'), - singAscensionSpeed: new SingularityUpgrade(singularityData.singAscensionSpeed, 'singAscensionSpeed'), - singAscensionSpeed2: new SingularityUpgrade(singularityData.singAscensionSpeed2, 'singAscensionSpeed2'), - oneMind: new SingularityUpgrade(singularityData.oneMind, 'oneMind'), - wowPass4: new SingularityUpgrade(singularityData.wowPass4, 'wowPass4'), - offeringAutomatic: new SingularityUpgrade(singularityData.offeringAutomatic, 'offeringAutomatic'), - blueberries: new SingularityUpgrade(singularityData.blueberries, 'blueberries'), - singAmbrosiaLuck: new SingularityUpgrade(singularityData.singAmbrosiaLuck, 'singAmbrosiaLuck'), - singAmbrosiaLuck2: new SingularityUpgrade(singularityData.singAmbrosiaLuck2, 'singAmbrosiaLuck2'), - singAmbrosiaLuck3: new SingularityUpgrade(singularityData.singAmbrosiaLuck3, 'singAmbrosiaLuck3'), - singAmbrosiaLuck4: new SingularityUpgrade(singularityData.singAmbrosiaLuck4, 'singAmbrosiaLuck4'), - singAmbrosiaGeneration: new SingularityUpgrade(singularityData.singAmbrosiaGeneration, 'singAmbrosiaGeneration'), - singAmbrosiaGeneration2: new SingularityUpgrade(singularityData.singAmbrosiaGeneration2, 'singAmbrosiaGeneration2'), - singAmbrosiaGeneration3: new SingularityUpgrade(singularityData.singAmbrosiaGeneration3, 'singAmbrosiaGeneration3'), - singAmbrosiaGeneration4: new SingularityUpgrade(singularityData.singAmbrosiaGeneration4, 'singAmbrosiaGeneration4') - } + "singOcteractPatreonBonus" + ), + intermediatePack: new SingularityUpgrade( + singularityData.intermediatePack, + "intermediatePack" + ), + advancedPack: new SingularityUpgrade( + singularityData.advancedPack, + "advancedPack" + ), + expertPack: new SingularityUpgrade( + singularityData.expertPack, + "expertPack" + ), + masterPack: new SingularityUpgrade( + singularityData.masterPack, + "masterPack" + ), + divinePack: new SingularityUpgrade( + singularityData.divinePack, + "divinePack" + ), + wowPass2: new SingularityUpgrade(singularityData.wowPass2, "wowPass2"), + potionBuff: new SingularityUpgrade( + singularityData.potionBuff, + "potionBuff" + ), + potionBuff2: new SingularityUpgrade( + singularityData.potionBuff2, + "potionBuff2" + ), + potionBuff3: new SingularityUpgrade( + singularityData.potionBuff3, + "potionBuff3" + ), + singChallengeExtension: new SingularityUpgrade( + singularityData.singChallengeExtension, + "singChallengeExtension" + ), + singChallengeExtension2: new SingularityUpgrade( + singularityData.singChallengeExtension2, + "singChallengeExtension2" + ), + singChallengeExtension3: new SingularityUpgrade( + singularityData.singChallengeExtension3, + "singChallengeExtension3" + ), + singQuarkImprover1: new SingularityUpgrade( + singularityData.singQuarkImprover1, + "singQuarkImprover1" + ), + singQuarkHepteract: new SingularityUpgrade( + singularityData.singQuarkHepteract, + "singQuarkHepteract" + ), + singQuarkHepteract2: new SingularityUpgrade( + singularityData.singQuarkHepteract2, + "singQuarkHepteract2" + ), + singQuarkHepteract3: new SingularityUpgrade( + singularityData.singQuarkHepteract3, + "singQuarkHepteract3" + ), + singOcteractGain: new SingularityUpgrade( + singularityData.singOcteractGain, + "singOcteractGain" + ), + singOcteractGain2: new SingularityUpgrade( + singularityData.singOcteractGain2, + "singOcteractGain2" + ), + singOcteractGain3: new SingularityUpgrade( + singularityData.singOcteractGain3, + "singOcteractGain3" + ), + singOcteractGain4: new SingularityUpgrade( + singularityData.singOcteractGain4, + "singOcteractGain4" + ), + singOcteractGain5: new SingularityUpgrade( + singularityData.singOcteractGain5, + "singOcteractGain5" + ), + wowPass3: new SingularityUpgrade(singularityData.wowPass3, "wowPass3"), + ultimatePen: new SingularityUpgrade( + singularityData.ultimatePen, + "ultimatePen" + ), + platonicTau: new SingularityUpgrade( + singularityData.platonicTau, + "platonicTau" + ), + platonicAlpha: new SingularityUpgrade( + singularityData.platonicAlpha, + "platonicAlpha" + ), + platonicDelta: new SingularityUpgrade( + singularityData.platonicDelta, + "platonicDelta" + ), + platonicPhi: new SingularityUpgrade( + singularityData.platonicPhi, + "platonicPhi" + ), + singFastForward: new SingularityUpgrade( + singularityData.singFastForward, + "singFastForward" + ), + singFastForward2: new SingularityUpgrade( + singularityData.singFastForward2, + "singFastForward2" + ), + singAscensionSpeed: new SingularityUpgrade( + singularityData.singAscensionSpeed, + "singAscensionSpeed" + ), + singAscensionSpeed2: new SingularityUpgrade( + singularityData.singAscensionSpeed2, + "singAscensionSpeed2" + ), + oneMind: new SingularityUpgrade(singularityData.oneMind, "oneMind"), + wowPass4: new SingularityUpgrade(singularityData.wowPass4, "wowPass4"), + offeringAutomatic: new SingularityUpgrade( + singularityData.offeringAutomatic, + "offeringAutomatic" + ), + blueberries: new SingularityUpgrade( + singularityData.blueberries, + "blueberries" + ), + singAmbrosiaLuck: new SingularityUpgrade( + singularityData.singAmbrosiaLuck, + "singAmbrosiaLuck" + ), + singAmbrosiaLuck2: new SingularityUpgrade( + singularityData.singAmbrosiaLuck2, + "singAmbrosiaLuck2" + ), + singAmbrosiaLuck3: new SingularityUpgrade( + singularityData.singAmbrosiaLuck3, + "singAmbrosiaLuck3" + ), + singAmbrosiaLuck4: new SingularityUpgrade( + singularityData.singAmbrosiaLuck4, + "singAmbrosiaLuck4" + ), + singAmbrosiaGeneration: new SingularityUpgrade( + singularityData.singAmbrosiaGeneration, + "singAmbrosiaGeneration" + ), + singAmbrosiaGeneration2: new SingularityUpgrade( + singularityData.singAmbrosiaGeneration2, + "singAmbrosiaGeneration2" + ), + singAmbrosiaGeneration3: new SingularityUpgrade( + singularityData.singAmbrosiaGeneration3, + "singAmbrosiaGeneration3" + ), + singAmbrosiaGeneration4: new SingularityUpgrade( + singularityData.singAmbrosiaGeneration4, + "singAmbrosiaGeneration4" + ), + }; player.octeractUpgrades = { - octeractStarter: new OcteractUpgrade(octeractData.octeractStarter, 'octeractStarter'), - octeractGain: new OcteractUpgrade(octeractData.octeractGain, 'octeractGain'), - octeractGain2: new OcteractUpgrade(octeractData.octeractGain2, 'octeractGain2'), - octeractQuarkGain: new OcteractUpgrade(octeractData.octeractQuarkGain, 'octeractQuarkGain'), - octeractQuarkGain2: new OcteractUpgrade(octeractData.octeractQuarkGain2, 'octeractQuarkGain2'), - octeractCorruption: new OcteractUpgrade(octeractData.octeractCorruption, 'octeractCorruption'), - octeractGQCostReduce: new OcteractUpgrade(octeractData.octeractGQCostReduce, 'octeractGQCostReduce'), - octeractExportQuarks: new OcteractUpgrade(octeractData.octeractExportQuarks, 'octeractExportQuarks'), - octeractImprovedDaily: new OcteractUpgrade(octeractData.octeractImprovedDaily, 'octeractImprovedDaily'), - octeractImprovedDaily2: new OcteractUpgrade(octeractData.octeractImprovedDaily2, 'octeractImprovedDaily2'), - octeractImprovedDaily3: new OcteractUpgrade(octeractData.octeractImprovedDaily3, 'octeractImprovedDaily3'), - octeractImprovedQuarkHept: new OcteractUpgrade(octeractData.octeractImprovedQuarkHept, 'octeractImprovedQuarkHept'), + octeractStarter: new OcteractUpgrade( + octeractData.octeractStarter, + "octeractStarter" + ), + octeractGain: new OcteractUpgrade( + octeractData.octeractGain, + "octeractGain" + ), + octeractGain2: new OcteractUpgrade( + octeractData.octeractGain2, + "octeractGain2" + ), + octeractQuarkGain: new OcteractUpgrade( + octeractData.octeractQuarkGain, + "octeractQuarkGain" + ), + octeractQuarkGain2: new OcteractUpgrade( + octeractData.octeractQuarkGain2, + "octeractQuarkGain2" + ), + octeractCorruption: new OcteractUpgrade( + octeractData.octeractCorruption, + "octeractCorruption" + ), + octeractGQCostReduce: new OcteractUpgrade( + octeractData.octeractGQCostReduce, + "octeractGQCostReduce" + ), + octeractExportQuarks: new OcteractUpgrade( + octeractData.octeractExportQuarks, + "octeractExportQuarks" + ), + octeractImprovedDaily: new OcteractUpgrade( + octeractData.octeractImprovedDaily, + "octeractImprovedDaily" + ), + octeractImprovedDaily2: new OcteractUpgrade( + octeractData.octeractImprovedDaily2, + "octeractImprovedDaily2" + ), + octeractImprovedDaily3: new OcteractUpgrade( + octeractData.octeractImprovedDaily3, + "octeractImprovedDaily3" + ), + octeractImprovedQuarkHept: new OcteractUpgrade( + octeractData.octeractImprovedQuarkHept, + "octeractImprovedQuarkHept" + ), octeractImprovedGlobalSpeed: new OcteractUpgrade( octeractData.octeractImprovedGlobalSpeed, - 'octeractImprovedGlobalSpeed' + "octeractImprovedGlobalSpeed" ), octeractImprovedAscensionSpeed: new OcteractUpgrade( octeractData.octeractImprovedAscensionSpeed, - 'octeractImprovedAscensionSpeed' + "octeractImprovedAscensionSpeed" ), octeractImprovedAscensionSpeed2: new OcteractUpgrade( octeractData.octeractImprovedAscensionSpeed2, - 'octeractImprovedAscensionSpeed2' - ), - octeractImprovedFree: new OcteractUpgrade(octeractData.octeractImprovedFree, 'octeractImprovedFree'), - octeractImprovedFree2: new OcteractUpgrade(octeractData.octeractImprovedFree2, 'octeractImprovedFree2'), - octeractImprovedFree3: new OcteractUpgrade(octeractData.octeractImprovedFree3, 'octeractImprovedFree3'), - octeractImprovedFree4: new OcteractUpgrade(octeractData.octeractImprovedFree4, 'octeractImprovedFree4'), - octeractSingUpgradeCap: new OcteractUpgrade(octeractData.octeractSingUpgradeCap, 'octeractSingUpgradeCap'), - octeractOfferings1: new OcteractUpgrade(octeractData.octeractOfferings1, 'octeractOfferings1'), - octeractObtainium1: new OcteractUpgrade(octeractData.octeractObtainium1, 'octeractObtainium1'), - octeractAscensions: new OcteractUpgrade(octeractData.octeractAscensions, 'octeractAscensions'), - octeractAscensions2: new OcteractUpgrade(octeractData.octeractAscensions2, 'octeractAscensions2'), + "octeractImprovedAscensionSpeed2" + ), + octeractImprovedFree: new OcteractUpgrade( + octeractData.octeractImprovedFree, + "octeractImprovedFree" + ), + octeractImprovedFree2: new OcteractUpgrade( + octeractData.octeractImprovedFree2, + "octeractImprovedFree2" + ), + octeractImprovedFree3: new OcteractUpgrade( + octeractData.octeractImprovedFree3, + "octeractImprovedFree3" + ), + octeractImprovedFree4: new OcteractUpgrade( + octeractData.octeractImprovedFree4, + "octeractImprovedFree4" + ), + octeractSingUpgradeCap: new OcteractUpgrade( + octeractData.octeractSingUpgradeCap, + "octeractSingUpgradeCap" + ), + octeractOfferings1: new OcteractUpgrade( + octeractData.octeractOfferings1, + "octeractOfferings1" + ), + octeractObtainium1: new OcteractUpgrade( + octeractData.octeractObtainium1, + "octeractObtainium1" + ), + octeractAscensions: new OcteractUpgrade( + octeractData.octeractAscensions, + "octeractAscensions" + ), + octeractAscensions2: new OcteractUpgrade( + octeractData.octeractAscensions2, + "octeractAscensions2" + ), octeractAscensionsOcteractGain: new OcteractUpgrade( octeractData.octeractAscensionsOcteractGain, - 'octeractAscensionsOcteractGain' + "octeractAscensionsOcteractGain" + ), + octeractFastForward: new OcteractUpgrade( + octeractData.octeractFastForward, + "octeractFastForward" + ), + octeractAutoPotionSpeed: new OcteractUpgrade( + octeractData.octeractAutoPotionSpeed, + "octeractAutoPotionSpeed" ), - octeractFastForward: new OcteractUpgrade(octeractData.octeractFastForward, 'octeractFastForward'), - octeractAutoPotionSpeed: new OcteractUpgrade(octeractData.octeractAutoPotionSpeed, 'octeractAutoPotionSpeed'), octeractAutoPotionEfficiency: new OcteractUpgrade( octeractData.octeractAutoPotionEfficiency, - 'octeractAutoPotionEfficiency' + "octeractAutoPotionEfficiency" + ), + octeractOneMindImprover: new OcteractUpgrade( + octeractData.octeractOneMindImprover, + "octeractOneMindImprover" + ), + octeractAmbrosiaLuck: new OcteractUpgrade( + octeractData.octeractAmbrosiaLuck, + "octeractAmbrosiaLuck" + ), + octeractAmbrosiaLuck2: new OcteractUpgrade( + octeractData.octeractAmbrosiaLuck2, + "octeractAmbrosiaLuck2" + ), + octeractAmbrosiaLuck3: new OcteractUpgrade( + octeractData.octeractAmbrosiaLuck3, + "octeractAmbrosiaLuck3" + ), + octeractAmbrosiaLuck4: new OcteractUpgrade( + octeractData.octeractAmbrosiaLuck4, + "octeractAmbrosiaLuck4" ), - octeractOneMindImprover: new OcteractUpgrade(octeractData.octeractOneMindImprover, 'octeractOneMindImprover'), - octeractAmbrosiaLuck: new OcteractUpgrade(octeractData.octeractAmbrosiaLuck, 'octeractAmbrosiaLuck'), - octeractAmbrosiaLuck2: new OcteractUpgrade(octeractData.octeractAmbrosiaLuck2, 'octeractAmbrosiaLuck2'), - octeractAmbrosiaLuck3: new OcteractUpgrade(octeractData.octeractAmbrosiaLuck3, 'octeractAmbrosiaLuck3'), - octeractAmbrosiaLuck4: new OcteractUpgrade(octeractData.octeractAmbrosiaLuck4, 'octeractAmbrosiaLuck4'), octeractAmbrosiaGeneration: new OcteractUpgrade( octeractData.octeractAmbrosiaGeneration, - 'octeractAmbrosiaGeneration' + "octeractAmbrosiaGeneration" ), octeractAmbrosiaGeneration2: new OcteractUpgrade( octeractData.octeractAmbrosiaGeneration2, - 'octeractAmbrosiaGeneration2' + "octeractAmbrosiaGeneration2" ), octeractAmbrosiaGeneration3: new OcteractUpgrade( octeractData.octeractAmbrosiaGeneration3, - 'octeractAmbrosiaGeneration3' + "octeractAmbrosiaGeneration3" ), octeractAmbrosiaGeneration4: new OcteractUpgrade( octeractData.octeractAmbrosiaGeneration4, - 'octeractAmbrosiaGeneration4' - ) - } + "octeractAmbrosiaGeneration4" + ), + }; player.singularityChallenges = { noSingularityUpgrades: new SingularityChallenge( singularityChallengeData.noSingularityUpgrades, - 'noSingularityUpgrades' + "noSingularityUpgrades" ), - oneChallengeCap: new SingularityChallenge(singularityChallengeData.oneChallengeCap, 'oneChallengeCap'), - noOcteracts: new SingularityChallenge(singularityChallengeData.noOcteracts, 'noOcteracts'), - limitedAscensions: new SingularityChallenge(singularityChallengeData.limitedAscensions, 'limitedAscensions') - } + oneChallengeCap: new SingularityChallenge( + singularityChallengeData.oneChallengeCap, + "oneChallengeCap" + ), + noOcteracts: new SingularityChallenge( + singularityChallengeData.noOcteracts, + "noOcteracts" + ), + limitedAscensions: new SingularityChallenge( + singularityChallengeData.limitedAscensions, + "limitedAscensions" + ), + }; player.blueberryUpgrades = { - ambrosiaTutorial: new BlueberryUpgrade(blueberryUpgradeData.ambrosiaTutorial, 'ambrosiaTutorial'), - ambrosiaQuarks1: new BlueberryUpgrade(blueberryUpgradeData.ambrosiaQuarks1, 'ambrosiaQuarks1'), - ambrosiaCubes1: new BlueberryUpgrade(blueberryUpgradeData.ambrosiaCubes1, 'ambrosiaQuarks1'), - ambrosiaLuck1: new BlueberryUpgrade(blueberryUpgradeData.ambrosiaLuck1, 'ambrosiaLuck1'), - ambrosiaCubeQuark1: new BlueberryUpgrade(blueberryUpgradeData.ambrosiaCubeQuark1, 'ambrosiaCubeQuark1'), - ambrosiaLuckQuark1: new BlueberryUpgrade(blueberryUpgradeData.ambrosiaLuckQuark1, 'ambrosiaLuckQuark1'), - ambrosiaLuckCube1: new BlueberryUpgrade(blueberryUpgradeData.ambrosiaLuckCube1, 'ambrosiaLuckCube1'), - ambrosiaQuarkCube1: new BlueberryUpgrade(blueberryUpgradeData.ambrosiaQuarkCube1, 'ambrosiaQuarkCube1'), - ambrosiaCubeLuck1: new BlueberryUpgrade(blueberryUpgradeData.ambrosiaCubeLuck1, 'ambrosiaCubeLuck1'), - ambrosiaQuarkLuck1: new BlueberryUpgrade(blueberryUpgradeData.ambrosiaQuarkLuck1, 'ambrosiaQuarkLuck1'), - ambrosiaQuarks2: new BlueberryUpgrade(blueberryUpgradeData.ambrosiaQuarks2, 'ambrosiaQuarks2'), - ambrosiaCubes2: new BlueberryUpgrade(blueberryUpgradeData.ambrosiaCubes2, 'ambrosiaQuarks2'), - ambrosiaLuck2: new BlueberryUpgrade(blueberryUpgradeData.ambrosiaLuck2, 'ambrosiaLuck2'), - ambrosiaPatreon: new BlueberryUpgrade(blueberryUpgradeData.ambrosiaPatreon, 'ambrosiaPatreon') - } + ambrosiaTutorial: new BlueberryUpgrade( + blueberryUpgradeData.ambrosiaTutorial, + "ambrosiaTutorial" + ), + ambrosiaQuarks1: new BlueberryUpgrade( + blueberryUpgradeData.ambrosiaQuarks1, + "ambrosiaQuarks1" + ), + ambrosiaCubes1: new BlueberryUpgrade( + blueberryUpgradeData.ambrosiaCubes1, + "ambrosiaQuarks1" + ), + ambrosiaLuck1: new BlueberryUpgrade( + blueberryUpgradeData.ambrosiaLuck1, + "ambrosiaLuck1" + ), + ambrosiaCubeQuark1: new BlueberryUpgrade( + blueberryUpgradeData.ambrosiaCubeQuark1, + "ambrosiaCubeQuark1" + ), + ambrosiaLuckQuark1: new BlueberryUpgrade( + blueberryUpgradeData.ambrosiaLuckQuark1, + "ambrosiaLuckQuark1" + ), + ambrosiaLuckCube1: new BlueberryUpgrade( + blueberryUpgradeData.ambrosiaLuckCube1, + "ambrosiaLuckCube1" + ), + ambrosiaQuarkCube1: new BlueberryUpgrade( + blueberryUpgradeData.ambrosiaQuarkCube1, + "ambrosiaQuarkCube1" + ), + ambrosiaCubeLuck1: new BlueberryUpgrade( + blueberryUpgradeData.ambrosiaCubeLuck1, + "ambrosiaCubeLuck1" + ), + ambrosiaQuarkLuck1: new BlueberryUpgrade( + blueberryUpgradeData.ambrosiaQuarkLuck1, + "ambrosiaQuarkLuck1" + ), + ambrosiaQuarks2: new BlueberryUpgrade( + blueberryUpgradeData.ambrosiaQuarks2, + "ambrosiaQuarks2" + ), + ambrosiaCubes2: new BlueberryUpgrade( + blueberryUpgradeData.ambrosiaCubes2, + "ambrosiaQuarks2" + ), + ambrosiaLuck2: new BlueberryUpgrade( + blueberryUpgradeData.ambrosiaLuck2, + "ambrosiaLuck2" + ), + ambrosiaPatreon: new BlueberryUpgrade( + blueberryUpgradeData.ambrosiaPatreon, + "ambrosiaPatreon" + ), + ambrosiaObtainium1: new BlueberryUpgrade( + blueberryUpgradeData.ambrosiaObtainium1, + "ambrosiaObtainium1" + ), + ambrosiaOffering1: new BlueberryUpgrade( + blueberryUpgradeData.ambrosiaOffering1, + "ambrosiaOffering1" + ), + ambrosiaHyperflux: new BlueberryUpgrade( + blueberryUpgradeData.ambrosiaHyperflux, + "ambrosiaHyperflux" + ), + }; if (data.loadedOct4Hotfix === undefined || !player.loadedOct4Hotfix) { - player.loadedOct4Hotfix = true + player.loadedOct4Hotfix = true; // Only process refund if the save's researches array is already updated to v2 if (player.researches.length > 200) { - player.researchPoints += player.researches[200] * 1e56 - player.researches[200] = 0 - buyResearch(200, true, 0.01) - player.researchPoints += player.researches[195] * 1e60 - player.worlds.add(250 * player.researches[195]) - player.researches[195] = 0 - player.wowCubes.add(player.cubeUpgrades[50] * 5e10) - player.cubeUpgrades[50] = 0 + player.researchPoints += player.researches[200] * 1e56; + player.researches[200] = 0; + buyResearch(200, true, 0.01); + player.researchPoints += player.researches[195] * 1e60; + player.worlds.add(250 * player.researches[195]); + player.researches[195] = 0; + player.wowCubes.add(player.cubeUpgrades[50] * 5e10); + player.cubeUpgrades[50] = 0; } } - if (player.ascStatToggles === undefined || data.ascStatToggles === undefined) { + if ( + player.ascStatToggles === undefined || + data.ascStatToggles === undefined + ) { player.ascStatToggles = { 1: false, 2: false, 3: false, - 4: false - } + 4: false, + }; } - if (player.ascStatToggles[4] === undefined || !('ascStatToggles' in data) || data.ascStatToggles[4] === undefined) { - player.ascStatToggles[4] = false + if ( + player.ascStatToggles[4] === undefined || + !("ascStatToggles" in data) || + data.ascStatToggles[4] === undefined + ) { + player.ascStatToggles[4] = false; } if ( - player.usedCorruptions[0] > 0 - || (Array.isArray(data.usedCorruptions) && data.usedCorruptions[0] > 0) + player.usedCorruptions[0] > 0 || + (Array.isArray(data.usedCorruptions) && data.usedCorruptions[0] > 0) ) { - player.prototypeCorruptions[0] = 0 - player.usedCorruptions[0] = 0 + player.prototypeCorruptions[0] = 0; + player.usedCorruptions[0] = 0; } if (player.antSacrificeTimerReal === undefined) { - player.antSacrificeTimerReal = player.antSacrificeTimer / calculateTimeAcceleration().mult + player.antSacrificeTimerReal = + player.antSacrificeTimer / calculateTimeAcceleration().mult; } if (player.subtabNumber === undefined || data.subtabNumber === undefined) { - player.subtabNumber = 0 + player.subtabNumber = 0; } if (data.wowPlatonicCubes === undefined) { - player.wowPlatonicCubes = new WowPlatonicCubes(0) - player.wowAbyssals = 0 + player.wowPlatonicCubes = new WowPlatonicCubes(0); + player.wowAbyssals = 0; } if (data.platonicBlessings === undefined) { - const ascCount = player.ascensionCount - if (player.currentChallenge.ascension !== 0 && player.currentChallenge.ascension !== 15) { - void resetCheck('ascensionChallenge', false, true) + const ascCount = player.ascensionCount; + if ( + player.currentChallenge.ascension !== 0 && + player.currentChallenge.ascension !== 15 + ) { + void resetCheck("ascensionChallenge", false, true); } if (player.currentChallenge.ascension === 15) { - void resetCheck('ascensionChallenge', false, true) - player.challenge15Exponent = 0 - c15RewardUpdate() + void resetCheck("ascensionChallenge", false, true); + player.challenge15Exponent = 0; + c15RewardUpdate(); } - player.ascensionCount = ascCount - player.challengecompletions[15] = 0 - player.highestchallengecompletions[15] = 0 + player.ascensionCount = ascCount; + player.challengecompletions[15] = 0; + player.highestchallengecompletions[15] = 0; player.platonicBlessings = { cubes: 0, tesseracts: 0, @@ -511,38 +950,38 @@ export const checkVariablesOnLoad = (data: PlayerSave) => { hypercubeBonus: 0, taxes: 0, scoreBonus: 0, - globalSpeed: 0 - } - player.platonicUpgrades = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] - player.challenge15Exponent = 0 - player.loadedNov13Vers = false + globalSpeed: 0, + }; + player.platonicUpgrades = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; + player.challenge15Exponent = 0; + player.loadedNov13Vers = false; } - if (player.researches.some((k) => typeof k !== 'number')) { + if (player.researches.some((k) => typeof k !== "number")) { for (let i = 0; i < 200; i++) { - player.researches[i + 1] = player.researches[i + 1] || 0 + player.researches[i + 1] = player.researches[i + 1] || 0; } } if (data.loadedDec16Vers === false || data.loadedDec16Vers === undefined) { if (player.currentChallenge.ascension === 15) { - void resetCheck('ascensionChallenge', false, true) - player.challenge15Exponent = 0 - c15RewardUpdate() + void resetCheck("ascensionChallenge", false, true); + player.challenge15Exponent = 0; + c15RewardUpdate(); } - player.challenge15Exponent = 0 - c15RewardUpdate() - player.loadedDec16Vers = true + player.challenge15Exponent = 0; + c15RewardUpdate(); + player.loadedDec16Vers = true; } // in old versions of the game (pre 2.5.0), the import function will only work // if this variable = "YES!". Don't ask Platonic why. - if (typeof data.exporttest === 'string') { - player.exporttest = !testing + if (typeof data.exporttest === "string") { + player.exporttest = !testing; } else { - player.exporttest = !!data.exporttest + player.exporttest = !!data.exporttest; } - const shop = data.shopUpgrades as LegacyShopUpgrades | Player['shopUpgrades'] - if (shop && 'offeringTimerLevel' in shop) { + const shop = data.shopUpgrades as LegacyShopUpgrades | Player["shopUpgrades"]; + if (shop && "offeringTimerLevel" in shop) { player.shopUpgrades = { offeringPotion: shop.offeringPotion, obtainiumPotion: shop.obtainiumPotion, @@ -609,51 +1048,65 @@ export const checkVariablesOnLoad = (data: PlayerSave) => { shopAmbrosiaLuck1: 0, shopAmbrosiaLuck2: 0, shopAmbrosiaLuck3: 0, - shopAmbrosiaLuck4: 0 - } + shopAmbrosiaLuck4: 0, + }; player.worlds.add( - 150 * shop.offeringTimerLevel + 25 / 2 * (shop.offeringTimerLevel - 1) * shop.offeringTimerLevel, + 150 * shop.offeringTimerLevel + + (25 / 2) * (shop.offeringTimerLevel - 1) * shop.offeringTimerLevel, + false + ); + player.worlds.add( + 150 * shop.obtainiumTimerLevel + + (25 / 2) * (shop.obtainiumTimerLevel - 1) * shop.obtainiumTimerLevel, false - ) + ); player.worlds.add( - 150 * shop.obtainiumTimerLevel + 25 / 2 * (shop.obtainiumTimerLevel - 1) * shop.obtainiumTimerLevel, + 150 * shop.offeringAutoLevel + + (25 / 2) * (shop.offeringAutoLevel - 1) * shop.offeringAutoLevel - + 150 * Math.min(1, shop.offeringAutoLevel), false - ) + ); player.worlds.add( - 150 * shop.offeringAutoLevel + 25 / 2 * (shop.offeringAutoLevel - 1) * shop.offeringAutoLevel - - 150 * Math.min(1, shop.offeringAutoLevel), + 150 * shop.obtainiumAutoLevel + + (25 / 2) * (shop.obtainiumAutoLevel - 1) * shop.obtainiumAutoLevel - + 150 * Math.min(1, shop.obtainiumAutoLevel), false - ) + ); player.worlds.add( - 150 * shop.obtainiumAutoLevel + 25 / 2 * (shop.obtainiumAutoLevel - 1) * shop.obtainiumAutoLevel - - 150 * Math.min(1, shop.obtainiumAutoLevel), + 100 * shop.cashGrabLevel + + (100 / 2) * (shop.cashGrabLevel - 1) * shop.cashGrabLevel, false - ) - player.worlds.add(100 * shop.cashGrabLevel + 100 / 2 * (shop.cashGrabLevel - 1) * shop.cashGrabLevel, false) - player.worlds.add(200 * shop.antSpeedLevel + 80 / 2 * (shop.antSpeedLevel - 1) * shop.antSpeedLevel, false) + ); + player.worlds.add( + 200 * shop.antSpeedLevel + + (80 / 2) * (shop.antSpeedLevel - 1) * shop.antSpeedLevel, + false + ); - const tomes = shop.challenge10Tomes ?? shop.challengeTome - player.worlds.add(500 * tomes + 250 / 2 * (tomes - 1) * tomes, false) + const tomes = shop.challenge10Tomes ?? shop.challengeTome; + player.worlds.add(500 * tomes + (250 / 2) * (tomes - 1) * tomes, false); player.worlds.add( - typeof shop.seasonPass === 'number' - ? 500 * shop.seasonPass + 250 / 2 * (shop.seasonPass - 1) * shop.seasonPass - : 500 * shop.seasonPassLevel + 250 / 2 * (shop.seasonPassLevel - 1) * shop.seasonPassLevel, + typeof shop.seasonPass === "number" + ? 500 * shop.seasonPass + + (250 / 2) * (shop.seasonPass - 1) * shop.seasonPass + : 500 * shop.seasonPassLevel + + (250 / 2) * (shop.seasonPassLevel - 1) * shop.seasonPassLevel, false - ) + ); } if (player.shopUpgrades.seasonPass2 === undefined) { - player.shopUpgrades.seasonPass2 = 0 - player.shopUpgrades.seasonPass3 = 0 - player.shopUpgrades.chronometer = 0 - player.shopUpgrades.infiniteAscent = 0 + player.shopUpgrades.seasonPass2 = 0; + player.shopUpgrades.seasonPass3 = 0; + player.shopUpgrades.chronometer = 0; + player.shopUpgrades.infiniteAscent = 0; } if (player.runeexp[5] === undefined) { - player.runeexp[5] = player.runeexp[6] = 0 - player.runelevels[5] = player.runelevels[6] = 0 + player.runeexp[5] = player.runeexp[6] = 0; + player.runelevels[5] = player.runelevels[6] = 0; } // resets all hepteract values on the player object @@ -665,138 +1118,154 @@ export const checkVariablesOnLoad = (data: PlayerSave) => { abyss: AbyssHepteract, accelerator: AcceleratorHepteract, acceleratorBoost: AcceleratorBoostHepteract, - multiplier: MultiplierHepteract - } + multiplier: MultiplierHepteract, + }; // if the player has hepteracts, we need to overwrite the player values // with the ones the save has. if (data.hepteractCrafts != null) { for (const item in blankSave.hepteractCrafts) { - const k = item as keyof Player['hepteractCrafts'] + const k = item as keyof Player["hepteractCrafts"]; // if more crafts are added, some keys might not exist in the save if (data.hepteractCrafts[k]) { - player.hepteractCrafts[k] = createHepteract({ ...player.hepteractCrafts[k], ...data.hepteractCrafts[k] }) + player.hepteractCrafts[k] = createHepteract({ + ...player.hepteractCrafts[k], + ...data.hepteractCrafts[k], + }); } } } if (data.platonicCubeOpenedDaily === undefined) { - player.platonicCubeOpenedDaily = 0 - player.platonicCubeQuarkDaily = 0 + player.platonicCubeOpenedDaily = 0; + player.platonicCubeQuarkDaily = 0; } if (data.shopUpgrades.calculator === undefined) { - player.shopUpgrades.calculator = 0 - player.shopUpgrades.calculator2 = 0 - player.shopUpgrades.calculator3 = 0 - player.shopUpgrades.constantEX = 0 + player.shopUpgrades.calculator = 0; + player.shopUpgrades.calculator2 = 0; + player.shopUpgrades.calculator3 = 0; + player.shopUpgrades.constantEX = 0; } while (player.achievements[280] === undefined) { - player.achievements.push(0) + player.achievements.push(0); } if (data.overfluxOrbs === undefined) { - player.overfluxOrbs = 0 + player.overfluxOrbs = 0; } if (data.overfluxOrbsAutoBuy === undefined) { - player.overfluxOrbsAutoBuy = false + player.overfluxOrbsAutoBuy = false; } if (data.overfluxPowder === undefined) { - player.overfluxPowder = 0 - player.shopUpgrades.powderEX = 0 - player.dailyPowderResetUses = 1 + player.overfluxPowder = 0; + player.shopUpgrades.powderEX = 0; + player.dailyPowderResetUses = 1; } if (data.ascStatToggles[5] === undefined) { - player.ascStatToggles[5] = false + player.ascStatToggles[5] = false; } while (player.platonicUpgrades[20] === undefined) { - player.platonicUpgrades.push(0) + player.platonicUpgrades.push(0); } if (data.loadedV253 === undefined) { - player.loadedV253 = true + player.loadedV253 = true; player.worlds.add( - 10000 * player.shopUpgrades.calculator - + 10000 / 2 * (player.shopUpgrades.calculator - 1) * (player.shopUpgrades.calculator), + 10000 * 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), + 10000 * 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 * player.shopUpgrades.calculator3 + + (25000 / 2) * + (player.shopUpgrades.calculator3 - 1) * + player.shopUpgrades.calculator3, false - ) - player.shopUpgrades.calculator = 0 - player.shopUpgrades.calculator2 = 0 - player.shopUpgrades.calculator3 = 0 - player.wowAbyssals += 1e8 * player.platonicUpgrades[16] // Refund based off of abyss hepteracts spent - void Alert(i18next.t('general.updateAlerts.june282021')) + ); + player.shopUpgrades.calculator = 0; + player.shopUpgrades.calculator2 = 0; + player.shopUpgrades.calculator3 = 0; + player.wowAbyssals += 1e8 * player.platonicUpgrades[16]; // Refund based off of abyss hepteracts spent + void Alert(i18next.t("general.updateAlerts.june282021")); } if (data.loadedV255 === undefined) { - player.loadedV255 = true + player.loadedV255 = true; player.worlds.add( - 1000 * player.shopUpgrades.powderEX - + 1000 / 2 * (player.shopUpgrades.powderEX - 1) * (player.shopUpgrades.powderEX), + 1000 * player.shopUpgrades.powderEX + + (1000 / 2) * + (player.shopUpgrades.powderEX - 1) * + player.shopUpgrades.powderEX, false - ) - player.shopUpgrades.powderEX = 0 - void Alert(i18next.t('general.updateAlerts.july22021')) - player.firstCostAnts = new Decimal('1e700') - player.firstOwnedAnts = 0 + ); + player.shopUpgrades.powderEX = 0; + void Alert(i18next.t("general.updateAlerts.july22021")); + player.firstCostAnts = new Decimal("1e700"); + player.firstOwnedAnts = 0; } if (data.autoResearchMode === undefined) { - player.autoResearchMode = 'manual' + player.autoResearchMode = "manual"; } if (data.singularityCount === undefined) { - player.singularityCount = 0 - player.goldenQuarks = 0 - - player.quarksThisSingularity = 0 - player.quarksThisSingularity += +player.worlds - const keys = Object.keys(player.shopUpgrades) as (keyof Player['shopUpgrades'])[] + player.singularityCount = 0; + player.goldenQuarks = 0; + + player.quarksThisSingularity = 0; + player.quarksThisSingularity += +player.worlds; + const keys = Object.keys( + player.shopUpgrades + ) as (keyof Player["shopUpgrades"])[]; for (const key of keys) { - player.quarksThisSingularity += getQuarkInvestment(key) + player.quarksThisSingularity += getQuarkInvestment(key); } } if (data.totalQuarksEver === undefined) { - player.totalQuarksEver = 0 + player.totalQuarksEver = 0; } if (data.hotkeys === undefined) { - player.hotkeys = {} - player.theme = 'Dark Mode' - player.notation = 'Default' + player.hotkeys = {}; + player.theme = "Dark Mode"; + player.notation = "Default"; } // Update (read: check) for undefined shop upgrades. Also checks above max level. - const shopKeys = Object.keys(blankSave.shopUpgrades) as (keyof Player['shopUpgrades'])[] + const shopKeys = Object.keys( + blankSave.shopUpgrades + ) as (keyof Player["shopUpgrades"])[]; for (const shopUpgrade of shopKeys) { if (player.shopUpgrades[shopUpgrade] === undefined) { - player.shopUpgrades[shopUpgrade] = 0 + player.shopUpgrades[shopUpgrade] = 0; } if (player.shopUpgrades[shopUpgrade] > shopData[shopUpgrade].maxLevel) { - player.shopUpgrades[shopUpgrade] = shopData[shopUpgrade].maxLevel + player.shopUpgrades[shopUpgrade] = shopData[shopUpgrade].maxLevel; } } if (data.singularityUpgrades != null) { for (const item in blankSave.singularityUpgrades) { - const k = item as keyof Player['singularityUpgrades'] + const k = item as keyof Player["singularityUpgrades"]; // if more crafts are added, some keys might not exist in the save - let updatedData: ISingularityData + let updatedData: ISingularityData; if (data.singularityUpgrades[k]) { - const { level, goldenQuarksInvested, toggleBuy, freeLevels } = data.singularityUpgrades[k] + const { level, goldenQuarksInvested, toggleBuy, freeLevels } = + data.singularityUpgrades[k]; updatedData = { maxLevel: singularityData[k].maxLevel, @@ -811,36 +1280,52 @@ export const checkVariablesOnLoad = (data: PlayerSave) => { canExceedCap: singularityData[k].canExceedCap, specialCostForm: singularityData[k].specialCostForm, qualityOfLife: singularityData[k].qualityOfLife, - cacheUpdates: singularityData[k].cacheUpdates - } - player.singularityUpgrades[k] = new SingularityUpgrade(updatedData, k.toString()) + cacheUpdates: singularityData[k].cacheUpdates, + }; + player.singularityUpgrades[k] = new SingularityUpgrade( + updatedData, + k.toString() + ); - if (player.singularityUpgrades[k].minimumSingularity > player.highestSingularityCount) { - player.singularityUpgrades[k].refund() + if ( + player.singularityUpgrades[k].minimumSingularity > + player.highestSingularityCount + ) { + player.singularityUpgrades[k].refund(); } - const cost = player.singularityUpgrades[k].level * (player.singularityUpgrades[k].level + 1) - * player.singularityUpgrades[k].costPerLevel / 2 + const cost = + (player.singularityUpgrades[k].level * + (player.singularityUpgrades[k].level + 1) * + player.singularityUpgrades[k].costPerLevel) / + 2; if ( - player.singularityUpgrades[k].maxLevel !== -1 - && player.singularityUpgrades[k].level <= player.singularityUpgrades[k].maxLevel - && player.singularityUpgrades[k].goldenQuarksInvested.toExponential(10) !== cost.toExponential(10) - && player.singularityUpgrades[k].specialCostForm === 'Default' + player.singularityUpgrades[k].maxLevel !== -1 && + player.singularityUpgrades[k].level <= + player.singularityUpgrades[k].maxLevel && + player.singularityUpgrades[k].goldenQuarksInvested.toExponential( + 10 + ) !== cost.toExponential(10) && + player.singularityUpgrades[k].specialCostForm === "Default" ) { - player.singularityUpgrades[k].refund() + player.singularityUpgrades[k].refund(); } } else { - player.singularityUpgrades[k].name = `[NEW!] ${player.singularityUpgrades[k].name}` + player.singularityUpgrades[ + k + ].name = `[NEW!] ${player.singularityUpgrades[k].name}`; } } } - if (data.octeractUpgrades != null) { // TODO: Make this more DRY -Platonic, July 15 2022 + if (data.octeractUpgrades != null) { + // TODO: Make this more DRY -Platonic, July 15 2022 for (const item in blankSave.octeractUpgrades) { - const k = item as keyof Player['octeractUpgrades'] - let updatedData: IOcteractData + const k = item as keyof Player["octeractUpgrades"]; + let updatedData: IOcteractData; if (data.octeractUpgrades[k]) { - const { level, octeractsInvested, toggleBuy, freeLevels } = data.octeractUpgrades[k] + const { level, octeractsInvested, toggleBuy, freeLevels } = + data.octeractUpgrades[k]; updatedData = { maxLevel: octeractData[k].maxLevel, costPerLevel: octeractData[k].costPerLevel, @@ -851,18 +1336,23 @@ export const checkVariablesOnLoad = (data: PlayerSave) => { costFormula: octeractData[k].costFormula, freeLevels, qualityOfLife: octeractData[k].qualityOfLife, - cacheUpdates: octeractData[k].cacheUpdates - } - player.octeractUpgrades[k] = new OcteractUpgrade(updatedData, k.toString()) + cacheUpdates: octeractData[k].cacheUpdates, + }; + player.octeractUpgrades[k] = new OcteractUpgrade( + updatedData, + k.toString() + ); if ( - player.octeractUpgrades[k].maxLevel !== -1 - && player.octeractUpgrades[k].level > player.octeractUpgrades[k].maxLevel + player.octeractUpgrades[k].maxLevel !== -1 && + player.octeractUpgrades[k].level > player.octeractUpgrades[k].maxLevel ) { - player.octeractUpgrades[k].refund() + player.octeractUpgrades[k].refund(); } } else { - player.octeractUpgrades[k].name = `[NEW!] ${player.octeractUpgrades[k].name}` + player.octeractUpgrades[ + k + ].name = `[NEW!] ${player.octeractUpgrades[k].name}`; } } } @@ -870,10 +1360,16 @@ export const checkVariablesOnLoad = (data: PlayerSave) => { if (data.blueberryUpgrades != null) { // blueberry loading here! for (const item of Object.keys(blankSave.blueberryUpgrades)) { - const k = item as keyof Player['blueberryUpgrades'] - let updatedData: IBlueberryData + const k = item as keyof Player["blueberryUpgrades"]; + let updatedData: IBlueberryData; if (data.blueberryUpgrades[k]) { - const { level, ambrosiaInvested, blueberriesInvested, toggleBuy, freeLevels } = data.blueberryUpgrades[k] + const { + level, + ambrosiaInvested, + blueberriesInvested, + toggleBuy, + freeLevels, + } = data.blueberryUpgrades[k]; updatedData = { maxLevel: blueberryUpgradeData[k].maxLevel, costPerLevel: blueberryUpgradeData[k].costPerLevel, @@ -886,38 +1382,49 @@ export const checkVariablesOnLoad = (data: PlayerSave) => { costFormula: blueberryUpgradeData[k].costFormula, freeLevels, prerequisites: blueberryUpgradeData[k].prerequisites, - cacheUpdates: blueberryUpgradeData[k].cacheUpdates - } - player.blueberryUpgrades[k] = new BlueberryUpgrade(updatedData, k.toString()) + cacheUpdates: blueberryUpgradeData[k].cacheUpdates, + }; + player.blueberryUpgrades[k] = new BlueberryUpgrade( + updatedData, + k.toString() + ); if ( - player.blueberryUpgrades[k].maxLevel !== -1 - && player.blueberryUpgrades[k].level > player.blueberryUpgrades[k].maxLevel + player.blueberryUpgrades[k].maxLevel !== -1 && + player.blueberryUpgrades[k].level > + player.blueberryUpgrades[k].maxLevel ) { - player.blueberryUpgrades[k].refund() + player.blueberryUpgrades[k].refund(); } } else { - player.blueberryUpgrades[k].name = `[NEW!] ${player.blueberryUpgrades[k].name}` + player.blueberryUpgrades[ + k + ].name = `[NEW!] ${player.blueberryUpgrades[k].name}`; } } - updateLoadoutHoverClasses() + updateLoadoutHoverClasses(); } if (data.singularityChallenges != null) { for (const item in blankSave.singularityChallenges) { - const k = item as keyof Player['singularityChallenges'] - let updatedData: ISingularityChallengeData + const k = item as keyof Player["singularityChallenges"]; + let updatedData: ISingularityChallengeData; if (data.singularityChallenges[k]) { // This is a HOTFIX. Please do not remove unless you can think of a better way - if (data.loadedV2927Hotfix1 === undefined && k === 'noSingularityUpgrades') { - const comps = data.singularityChallenges[k].completions + if ( + data.loadedV2927Hotfix1 === undefined && + k === "noSingularityUpgrades" + ) { + const comps = data.singularityChallenges[k].completions; if (comps > 0) { - data.singularityChallenges[k].highestSingularityCompleted = 4 * comps - 3 + data.singularityChallenges[k].highestSingularityCompleted = + 4 * comps - 3; } } - const { completions, highestSingularityCompleted, enabled } = data.singularityChallenges[k] + const { completions, highestSingularityCompleted, enabled } = + data.singularityChallenges[k]; updatedData = { baseReq: singularityChallengeData[k].baseReq, completions, @@ -926,206 +1433,231 @@ export const checkVariablesOnLoad = (data: PlayerSave) => { HTMLTag: singularityChallengeData[k].HTMLTag, highestSingularityCompleted, enabled, - singularityRequirement: singularityChallengeData[k].singularityRequirement, - effect: singularityChallengeData[k].effect - } - player.singularityChallenges[k] = new SingularityChallenge(updatedData, k.toString()) + singularityRequirement: + singularityChallengeData[k].singularityRequirement, + effect: singularityChallengeData[k].effect, + }; + player.singularityChallenges[k] = new SingularityChallenge( + updatedData, + k.toString() + ); } } } while (player.cubeUpgrades.length < 71) { - player.cubeUpgrades.push(0) + player.cubeUpgrades.push(0); } if (data.dailyCodeUsed === undefined) { - player.dailyCodeUsed = false + player.dailyCodeUsed = false; } if (player.usedCorruptions[1] > 0 || player.prototypeCorruptions[1] > 0) { - player.usedCorruptions[1] = 0 - player.prototypeCorruptions[1] = 0 + player.usedCorruptions[1] = 0; + player.prototypeCorruptions[1] = 0; } - if (data.goldenQuarksTimer === undefined || player.goldenQuarksTimer === undefined) { - player.goldenQuarksTimer = 90000 + if ( + data.goldenQuarksTimer === undefined || + player.goldenQuarksTimer === undefined + ) { + player.goldenQuarksTimer = 90000; } if (data.hepteractAutoCraftPercentage === undefined) { - player.hepteractAutoCraftPercentage = 50 + player.hepteractAutoCraftPercentage = 50; } if (data.autoWarpCheck === undefined || player.shopUpgrades.autoWarp === 0) { - player.autoWarpCheck = false + player.autoWarpCheck = false; } if (data.loadedV297Hotfix1 === undefined) { - player.loadedV297Hotfix1 = true + player.loadedV297Hotfix1 = true; - player.singularityUpgrades.singCubes1.refund() - player.singularityUpgrades.singObtainium1.refund() - player.singularityUpgrades.singOfferings1.refund() - player.singularityUpgrades.ascensions.refund() + player.singularityUpgrades.singCubes1.refund(); + player.singularityUpgrades.singObtainium1.refund(); + player.singularityUpgrades.singOfferings1.refund(); + player.singularityUpgrades.ascensions.refund(); if (player.codes.get(40) && player.singularityCount > 0) { - player.singularityUpgrades.singCubes1.freeLevels += 5 - player.singularityUpgrades.singOfferings1.freeLevels += 5 - player.singularityUpgrades.singObtainium1.freeLevels += 5 - player.singularityUpgrades.ascensions.freeLevels += 5 + player.singularityUpgrades.singCubes1.freeLevels += 5; + player.singularityUpgrades.singOfferings1.freeLevels += 5; + player.singularityUpgrades.singObtainium1.freeLevels += 5; + player.singularityUpgrades.ascensions.freeLevels += 5; } if (player.singularityCount > 0) { - void Alert(i18next.t('general.updateAlerts.v297hotfix1Sing')) + void Alert(i18next.t("general.updateAlerts.v297hotfix1Sing")); } else { - void Alert(i18next.t('general.updateAlerts.v297hotfix1NoSing')) + void Alert(i18next.t("general.updateAlerts.v297hotfix1NoSing")); } } if (data.shopBuyMaxToggle === undefined) { - player.shopBuyMaxToggle = false - player.shopConfirmationToggle = true + player.shopBuyMaxToggle = false; + player.shopConfirmationToggle = true; } if (data.wowOcteracts === undefined) { - player.wowOcteracts = 0 - player.octeractTimer = 0 + player.wowOcteracts = 0; + player.octeractTimer = 0; } if (data.shopHideToggle === undefined) { - player.shopHideToggle = false + player.shopHideToggle = false; } if (data.researchBuyMaxToggle === undefined) { - player.researchBuyMaxToggle = false + player.researchBuyMaxToggle = false; } if (data.cubeUpgradesBuyMaxToggle === undefined) { - player.cubeUpgradesBuyMaxToggle = false + player.cubeUpgradesBuyMaxToggle = false; } if (data.ascensionCounterRealReal === undefined) { - player.ascensionCounterRealReal = 0 + player.ascensionCounterRealReal = 0; } if (data.totalWowOcteracts === undefined) { - player.totalWowOcteracts = 0 + player.totalWowOcteracts = 0; } if (data.highestSingularityCount === undefined) { - player.highestSingularityCount = player.singularityCount + player.highestSingularityCount = player.singularityCount; if (player.singularityCount > 0) { - player.goldenQuarks += 200 - player.goldenQuarks += 100 * Math.min(10, player.singularityCount) + player.goldenQuarks += 200; + player.goldenQuarks += 100 * Math.min(10, player.singularityCount); if (player.singularityCount >= 5) { - player.singularityUpgrades.goldenQuarks3.freeLevels += 1 + player.singularityUpgrades.goldenQuarks3.freeLevels += 1; } if (player.singularityCount >= 10) { - player.singularityUpgrades.goldenQuarks3.freeLevels += 2 + player.singularityUpgrades.goldenQuarks3.freeLevels += 2; } } } if (data.autoPotionTimer === undefined) { - player.autoPotionTimer = 0 + player.autoPotionTimer = 0; } if (data.autoPotionTimerObtainium === undefined) { - player.autoPotionTimerObtainium = 0 + player.autoPotionTimerObtainium = 0; } if (data.insideSingularityChallenge === undefined) { - player.insideSingularityChallenge = false + player.insideSingularityChallenge = false; } if (data.loadedV2930Hotfix1 === undefined) { if (player.singularityCount > 230) { - player.singularityCount = 230 + player.singularityCount = 230; } if (player.highestSingularityCount > 230) { - player.highestSingularityCount = 230 - void Alert(i18next.t('general.updateAlerts.sing230Balancing')) + player.highestSingularityCount = 230; + void Alert(i18next.t("general.updateAlerts.sing230Balancing")); } - player.loadedV2930Hotfix1 = true + player.loadedV2930Hotfix1 = true; } if (data.loadedV2931Hotfix1 === undefined) { - player.loadedV2931Hotfix1 = true - player.shopUpgrades.obtainiumEX3 = Math.min(1000, player.shopUpgrades.obtainiumEX3 * 2) - player.shopUpgrades.offeringEX3 = Math.min(1000, player.shopUpgrades.offeringEX3 * 2) - player.shopUpgrades.seasonPassInfinity = Math.min(1000, player.shopUpgrades.seasonPassInfinity * 2) - player.shopUpgrades.chronometerInfinity = Math.min(1000, player.shopUpgrades.chronometerInfinity * 2) - player.shopUpgrades.improveQuarkHept5 = Math.min(100, player.shopUpgrades.improveQuarkHept5 * 2) - player.singularityUpgrades.offeringAutomatic.refund() - void Alert(i18next.t('general.updateAlerts.december22xxxx')) + player.loadedV2931Hotfix1 = true; + player.shopUpgrades.obtainiumEX3 = Math.min( + 1000, + player.shopUpgrades.obtainiumEX3 * 2 + ); + player.shopUpgrades.offeringEX3 = Math.min( + 1000, + player.shopUpgrades.offeringEX3 * 2 + ); + player.shopUpgrades.seasonPassInfinity = Math.min( + 1000, + player.shopUpgrades.seasonPassInfinity * 2 + ); + player.shopUpgrades.chronometerInfinity = Math.min( + 1000, + player.shopUpgrades.chronometerInfinity * 2 + ); + player.shopUpgrades.improveQuarkHept5 = Math.min( + 100, + player.shopUpgrades.improveQuarkHept5 * 2 + ); + player.singularityUpgrades.offeringAutomatic.refund(); + void Alert(i18next.t("general.updateAlerts.december22xxxx")); } if (data.loadedV21003Hotfix1 === undefined) { - player.loadedV21003Hotfix1 = true - player.singularityUpgrades.blueberries.refund() - void Alert(i18next.t('general.updateAlerts.january42023')) + player.loadedV21003Hotfix1 = true; + player.singularityUpgrades.blueberries.refund(); + void Alert(i18next.t("general.updateAlerts.january42023")); } if (data.loadedV21007Hotfix1 === undefined) { - player.loadedV21007Hotfix1 = true + player.loadedV21007Hotfix1 = true; if (player.octeractUpgrades.octeractQuarkGain.level >= 10000) { - player.octeractUpgrades.octeractQuarkGain.refund() + player.octeractUpgrades.octeractQuarkGain.refund(); } } if (data.ambrosia === undefined) { - player.ambrosia = 0 - player.lifetimeAmbrosia = 0 - player.ambrosiaRNG = 0 // NOW DEPRECIATED - player.visitedAmbrosiaSubtab = false + player.ambrosia = 0; + player.lifetimeAmbrosia = 0; + player.ambrosiaRNG = 0; // NOW DEPRECIATED + player.visitedAmbrosiaSubtab = false; } if (data.blueberryTime === undefined) { - player.blueberryTime = player.ambrosiaRNG + player.blueberryTime = player.ambrosiaRNG; } if (data.spentBlueberries === undefined) { - player.spentBlueberries = 0 + player.spentBlueberries = 0; if (player.singularityUpgrades.blueberries.level > 10) { - player.singularityUpgrades.blueberries.refund() + player.singularityUpgrades.blueberries.refund(); } if (player.highestSingularityCount >= 100) { - const reduce = Math.min(6, Math.ceil(1 / 20 * (player.highestSingularityCount - 100))) - player.highestSingularityCount -= reduce + const reduce = Math.min( + 6, + Math.ceil((1 / 20) * (player.highestSingularityCount - 100)) + ); + player.highestSingularityCount -= reduce; if (!player.insideSingularityChallenge) { - player.singularityCount -= reduce + player.singularityCount -= reduce; } void Alert( `Due to recent balance changes your highest singularity count was reduced by ${reduce}. This is for your own good!` - ) + ); } } player.caches = { ambrosiaLuck: new AmbrosiaLuckCache(), ambrosiaGeneration: new AmbrosiaGenerationCache(), - blueberryInventory: new BlueberryInventoryCache() - } + blueberryInventory: new BlueberryInventoryCache(), + }; - cacheReinitialize() + cacheReinitialize(); - const oldest = localStorage.getItem('firstPlayed') + const oldest = localStorage.getItem("firstPlayed"); if (data.firstPlayed == null) { // If the save is from before v2.9.7 staticians - player.firstPlayed = oldest ?? new Date().toISOString() - } else if (data.firstPlayed?.includes('Before')) { + player.firstPlayed = oldest ?? new Date().toISOString(); + } else if (data.firstPlayed?.includes("Before")) { // The first version with player.firstPlayed set the date to // "Before {date.toString}" - player.firstPlayed = oldest ?? new Date().toISOString() + player.firstPlayed = oldest ?? new Date().toISOString(); } else { // Otherwise just set the firstPlayed time to either the oldest // stored, or the date in the save being loaded. - player.firstPlayed = oldest ?? data.firstPlayed + player.firstPlayed = oldest ?? data.firstPlayed; } if (data.autoCubeUpgradesToggle === undefined) { - player.autoCubeUpgradesToggle = false - player.autoPlatonicUpgradesToggle = false + player.autoCubeUpgradesToggle = false; + player.autoPlatonicUpgradesToggle = false; } -} +}; diff --git a/src/Statistics.ts b/src/Statistics.ts index 586826696..87399a742 100644 --- a/src/Statistics.ts +++ b/src/Statistics.ts @@ -1,5 +1,5 @@ -import Decimal from 'break_infinity.js' -import { DOMCacheGetOrSet } from './Cache/DOM' +import Decimal from "break_infinity.js"; +import { DOMCacheGetOrSet } from "./Cache/DOM"; import { calculateAllCubeMultiplier, calculateAmbrosiaQuarkMult, @@ -21,945 +21,1335 @@ import { calculateSingularityQuarkMilestoneMultiplier, calculateTesseractMultiplier, calculateTimeAcceleration, - calculateTotalOcteractQuarkBonus -} from './Calculate' -import { challenge15ScoreMultiplier } from './Challenges' -import { BuffType } from './Event' -import { hepteractEffective } from './Hepteracts' + calculateTotalOcteractQuarkBonus, +} from "./Calculate"; +import { challenge15ScoreMultiplier } from "./Challenges"; +import { BuffType } from "./Event"; +import { hepteractEffective } from "./Hepteracts"; import { addCodeAvailableUses, addCodeBonuses, addCodeInterval, addCodeMaxUses, - addCodeTimeToNextUse -} from './ImportExport' -import { format, formatTimeShort, player } from './Synergism' -import type { GlobalVariables } from './types/Synergism' -import { Globals as G } from './Variables' + addCodeTimeToNextUse, +} from "./ImportExport"; +import { format, formatTimeShort, player } from "./Synergism"; +import type { GlobalVariables } from "./types/Synergism"; +import { Globals as G } from "./Variables"; const associated = new Map([ - ['kMisc', 'miscStats'], - ['kFreeAccel', 'acceleratorStats'], - ['kFreeMult', 'multiplierStats'], - ['kOfferingMult', 'offeringMultiplierStats'], - ['kGlobalCubeMult', 'globalCubeMultiplierStats'], - ['kQuarkMult', 'globalQuarkMultiplierStats'], - ['kGSpeedMult', 'globalSpeedMultiplierStats'], - ['kCubeMult', 'cubeMultiplierStats'], - ['kTessMult', 'tesseractMultiplierStats'], - ['kHypercubeMult', 'hypercubeMultiplierStats'], - ['kPlatMult', 'platonicMultiplierStats'], - ['kHeptMult', 'hepteractMultiplierStats'], - ['kOrbPowderMult', 'powderMultiplierStats'], - ['kOctMult', 'octeractMultiplierStats'], - ['kASCMult', 'ascensionSpeedMultiplierStats'], - ['kGQMult', 'goldenQuarkMultiplierStats'], - ['kAddStats', 'addCodeStats'], - ['kAmbrosiaLuck', 'ambrosiaLuckStats'], - ['kAmbrosiaGenMult', 'ambrosiaGenerationStats'] -]) + ["kMisc", "miscStats"], + ["kFreeAccel", "acceleratorStats"], + ["kFreeMult", "multiplierStats"], + ["kOfferingMult", "offeringMultiplierStats"], + ["kGlobalCubeMult", "globalCubeMultiplierStats"], + ["kQuarkMult", "globalQuarkMultiplierStats"], + ["kGSpeedMult", "globalSpeedMultiplierStats"], + ["kCubeMult", "cubeMultiplierStats"], + ["kTessMult", "tesseractMultiplierStats"], + ["kHypercubeMult", "hypercubeMultiplierStats"], + ["kPlatMult", "platonicMultiplierStats"], + ["kHeptMult", "hepteractMultiplierStats"], + ["kOrbPowderMult", "powderMultiplierStats"], + ["kOctMult", "octeractMultiplierStats"], + ["kASCMult", "ascensionSpeedMultiplierStats"], + ["kGQMult", "goldenQuarkMultiplierStats"], + ["kAddStats", "addCodeStats"], + ["kAmbrosiaLuck", "ambrosiaLuckStats"], + ["kAmbrosiaGenMult", "ambrosiaGenerationStats"], +]); export const displayStats = (btn: HTMLElement) => { for (const e of Array.from(btn.parentElement!.children) as HTMLElement[]) { - const statsEl = DOMCacheGetOrSet(associated.get(e.id)!) + const statsEl = DOMCacheGetOrSet(associated.get(e.id)!); if (e.id !== btn.id) { - e.style.backgroundColor = '' - statsEl.style.display = 'none' - statsEl.classList.remove('activeStats') + e.style.backgroundColor = ""; + statsEl.style.display = "none"; + statsEl.classList.remove("activeStats"); } else { - e.style.backgroundColor = 'crimson' - statsEl.style.display = 'block' - statsEl.classList.add('activeStats') + e.style.backgroundColor = "crimson"; + statsEl.style.display = "block"; + statsEl.classList.add("activeStats"); } } -} +}; export const loadStatisticsUpdate = () => { - const activeStats = document.getElementsByClassName('activeStats') as HTMLCollectionOf + const activeStats = document.getElementsByClassName( + "activeStats" + ) as HTMLCollectionOf; for (let i = 0; i < activeStats.length; i++) { switch (activeStats[i].id) { - case 'miscStats': - loadStatisticsMiscellaneous() - break - case 'acceleratorStats': - loadStatisticsAccelerator() - break - case 'multiplierStats': - loadStatisticsMultiplier() - break - case 'offeringMultiplierStats': - loadStatisticsOfferingMultipliers() - break - case 'globalQuarkMultiplierStats': - loadQuarkMultiplier() - break - case 'globalSpeedMultiplierStats': - loadGlobalSpeedMultiplier() - break - case 'powderMultiplierStats': - loadPowderMultiplier() - break - case 'ascensionSpeedMultiplierStats': - loadStatisticsAscensionSpeedMultipliers() - break - case 'goldenQuarkMultiplierStats': - loadStatisticsGoldenQuarkMultipliers() - break - case 'addCodeStats': - loadAddCodeModifiersAndEffects() - break - case 'ambrosiaLuckStats': - loadStatisticsAmbrosiaLuck() - break - case 'ambrosiaGenerationStats': - loadStatisticsAmbrosiaGeneration() - break + case "miscStats": + loadStatisticsMiscellaneous(); + break; + case "acceleratorStats": + loadStatisticsAccelerator(); + break; + case "multiplierStats": + loadStatisticsMultiplier(); + break; + case "offeringMultiplierStats": + loadStatisticsOfferingMultipliers(); + break; + case "globalQuarkMultiplierStats": + loadQuarkMultiplier(); + break; + case "globalSpeedMultiplierStats": + loadGlobalSpeedMultiplier(); + break; + case "powderMultiplierStats": + loadPowderMultiplier(); + break; + case "ascensionSpeedMultiplierStats": + loadStatisticsAscensionSpeedMultipliers(); + break; + case "goldenQuarkMultiplierStats": + loadStatisticsGoldenQuarkMultipliers(); + break; + case "addCodeStats": + loadAddCodeModifiersAndEffects(); + break; + case "ambrosiaLuckStats": + loadStatisticsAmbrosiaLuck(); + break; + case "ambrosiaGenerationStats": + loadStatisticsAmbrosiaGeneration(); + break; default: - loadStatisticsCubeMultipliers() - break + loadStatisticsCubeMultipliers(); + break; } } -} +}; export const loadStatisticsMiscellaneous = () => { - DOMCacheGetOrSet('sMisc1').textContent = format(player.prestigeCount, 0, true) - DOMCacheGetOrSet('sMisc2').textContent = `${format(1000 * player.fastestprestige)}ms` - DOMCacheGetOrSet('sMisc3').textContent = format(player.maxofferings) - DOMCacheGetOrSet('sMisc4').textContent = format(G.runeSum) - DOMCacheGetOrSet('sMisc5').textContent = format(player.transcendCount, 0, true) - DOMCacheGetOrSet('sMisc6').textContent = `${format(1000 * player.fastesttranscend)}ms` - DOMCacheGetOrSet('sMisc7').textContent = format(player.reincarnationCount, 0, true) - DOMCacheGetOrSet('sMisc8').textContent = `${format(1000 * player.fastestreincarnate)}ms` - DOMCacheGetOrSet('sMisc9').textContent = format(player.maxobtainium) - DOMCacheGetOrSet('sMisc10').textContent = format(player.maxobtainiumpersecond, 2, true) - DOMCacheGetOrSet('sMisc11').textContent = format(player.obtainiumpersecond, 2, true) - DOMCacheGetOrSet('sMisc12').textContent = format(player.ascensionCount, 0, true) - DOMCacheGetOrSet('sMisc13').textContent = format(player.quarksThisSingularity, 0, true) - DOMCacheGetOrSet('sMisc14').textContent = format(player.totalQuarksEver + player.quarksThisSingularity, 0, true) - DOMCacheGetOrSet('sMisc15').textContent = `${formatTimeShort(player.quarkstimer)} / ${ - formatTimeShort(90000 + 18000 * player.researches[195]) - }` - DOMCacheGetOrSet('sMisc16').textContent = synergismStage(0) -} + DOMCacheGetOrSet("sMisc1").textContent = format( + player.prestigeCount, + 0, + true + ); + DOMCacheGetOrSet("sMisc2").textContent = `${format( + 1000 * player.fastestprestige + )}ms`; + DOMCacheGetOrSet("sMisc3").textContent = format(player.maxofferings); + DOMCacheGetOrSet("sMisc4").textContent = format(G.runeSum); + DOMCacheGetOrSet("sMisc5").textContent = format( + player.transcendCount, + 0, + true + ); + DOMCacheGetOrSet("sMisc6").textContent = `${format( + 1000 * player.fastesttranscend + )}ms`; + DOMCacheGetOrSet("sMisc7").textContent = format( + player.reincarnationCount, + 0, + true + ); + DOMCacheGetOrSet("sMisc8").textContent = `${format( + 1000 * player.fastestreincarnate + )}ms`; + DOMCacheGetOrSet("sMisc9").textContent = format(player.maxobtainium); + DOMCacheGetOrSet("sMisc10").textContent = format( + player.maxobtainiumpersecond, + 2, + true + ); + DOMCacheGetOrSet("sMisc11").textContent = format( + player.obtainiumpersecond, + 2, + true + ); + DOMCacheGetOrSet("sMisc12").textContent = format( + player.ascensionCount, + 0, + true + ); + DOMCacheGetOrSet("sMisc13").textContent = format( + player.quarksThisSingularity, + 0, + true + ); + DOMCacheGetOrSet("sMisc14").textContent = format( + player.totalQuarksEver + player.quarksThisSingularity, + 0, + true + ); + DOMCacheGetOrSet("sMisc15").textContent = `${formatTimeShort( + player.quarkstimer + )} / ${formatTimeShort(90000 + 18000 * player.researches[195])}`; + DOMCacheGetOrSet("sMisc16").textContent = synergismStage(0); +}; export const loadStatisticsAccelerator = () => { - DOMCacheGetOrSet('sA1').textContent = `+${format(G.freeUpgradeAccelerator, 0, false)}` - DOMCacheGetOrSet('sA2').textContent = `+${ - format( - G.totalAcceleratorBoost - * (4 + 2 * player.researches[18] + 2 * player.researches[19] + 3 * player.researches[20] - + G.cubeBonusMultiplier[1]), - 0, - false - ) - }` - DOMCacheGetOrSet('sA3').textContent = `+${ - format(Math.floor(Math.pow(G.rune1level * G.effectiveLevelMult / 10, 1.1)), 0, true) - }` - DOMCacheGetOrSet('sA4').textContent = `x${format(1 + G.rune1level * 1 / 200 * G.effectiveLevelMult, 3, true)}` - DOMCacheGetOrSet('sA5').textContent = `x${ - format( - Math.pow( - 1.01, - player.upgrades[21] + player.upgrades[22] + player.upgrades[23] + player.upgrades[24] + player.upgrades[25] - ), - 3, - true - ) - }` - DOMCacheGetOrSet('sA6').textContent = `x${ - format(Math.pow(1.01, player.achievements[60] + player.achievements[61] + player.achievements[62]), 3, true) - }` - DOMCacheGetOrSet('sA7').textContent = `x${format(1 + 1 / 5 * player.researches[1], 3, true)}` - DOMCacheGetOrSet('sA8').textContent = `x${ - format( - 1 + 1 / 20 * player.researches[6] + 1 / 25 * player.researches[7] + 1 / 40 * player.researches[8] - + 3 / 200 * player.researches[9] + 1 / 200 * player.researches[10], - 3, - true - ) - }` - DOMCacheGetOrSet('sA9').textContent = `x${format(1 + 1 / 20 * player.researches[86], 3, true)}` - DOMCacheGetOrSet('sA10').textContent = `x${ - format( - (player.currentChallenge.transcension !== 0 || player.currentChallenge.reincarnation !== 0) - && player.upgrades[50] > 0.5 - ? 1.25 - : 1, - 3, - true - ) - }` - DOMCacheGetOrSet('sA11').textContent = `^${ - format(Math.min(1, (1 + player.platonicUpgrades[6] / 30) * G.viscosityPower[player.usedCorruptions[2]]), 3, true) - }` - DOMCacheGetOrSet('sA12').textContent = format(G.freeAccelerator, 0, true) -} + DOMCacheGetOrSet("sA1").textContent = `+${format( + G.freeUpgradeAccelerator, + 0, + false + )}`; + DOMCacheGetOrSet("sA2").textContent = `+${format( + G.totalAcceleratorBoost * + (4 + + 2 * player.researches[18] + + 2 * player.researches[19] + + 3 * player.researches[20] + + G.cubeBonusMultiplier[1]), + 0, + false + )}`; + DOMCacheGetOrSet("sA3").textContent = `+${format( + Math.floor(Math.pow((G.rune1level * G.effectiveLevelMult) / 10, 1.1)), + 0, + true + )}`; + DOMCacheGetOrSet("sA4").textContent = `x${format( + 1 + ((G.rune1level * 1) / 200) * G.effectiveLevelMult, + 3, + true + )}`; + DOMCacheGetOrSet("sA5").textContent = `x${format( + Math.pow( + 1.01, + player.upgrades[21] + + player.upgrades[22] + + player.upgrades[23] + + player.upgrades[24] + + player.upgrades[25] + ), + 3, + true + )}`; + DOMCacheGetOrSet("sA6").textContent = `x${format( + Math.pow( + 1.01, + player.achievements[60] + + player.achievements[61] + + player.achievements[62] + ), + 3, + true + )}`; + DOMCacheGetOrSet("sA7").textContent = `x${format( + 1 + (1 / 5) * player.researches[1], + 3, + true + )}`; + DOMCacheGetOrSet("sA8").textContent = `x${format( + 1 + + (1 / 20) * player.researches[6] + + (1 / 25) * player.researches[7] + + (1 / 40) * player.researches[8] + + (3 / 200) * player.researches[9] + + (1 / 200) * player.researches[10], + 3, + true + )}`; + DOMCacheGetOrSet("sA9").textContent = `x${format( + 1 + (1 / 20) * player.researches[86], + 3, + true + )}`; + DOMCacheGetOrSet("sA10").textContent = `x${format( + (player.currentChallenge.transcension !== 0 || + player.currentChallenge.reincarnation !== 0) && + player.upgrades[50] > 0.5 + ? 1.25 + : 1, + 3, + true + )}`; + DOMCacheGetOrSet("sA11").textContent = `^${format( + Math.min( + 1, + (1 + player.platonicUpgrades[6] / 30) * + G.viscosityPower[player.usedCorruptions[2]] + ), + 3, + true + )}`; + DOMCacheGetOrSet("sA12").textContent = format(G.freeAccelerator, 0, true); +}; export const loadStatisticsMultiplier = () => { - DOMCacheGetOrSet('sM1').textContent = `+${format(G.freeUpgradeMultiplier, 0, true)}` - DOMCacheGetOrSet('sM2').textContent = `+${ - format( - Math.floor( - Math.floor(G.rune2level / 10 * G.effectiveLevelMult) * Math.floor(10 + G.rune2level / 10 * G.effectiveLevelMult) - / 2 - ) * 100 / 100, - 0, - true - ) - }` - DOMCacheGetOrSet('sM3').textContent = `x${format(1 + G.rune2level / 200 * G.effectiveLevelMult, 3, true)}` - DOMCacheGetOrSet('sM4').textContent = `x${ - format( - Math.pow( - 1.01, - player.upgrades[21] + player.upgrades[22] + player.upgrades[23] + player.upgrades[24] + player.upgrades[25] - ) * (1 + player.upgrades[34] * 3 / 100) * (1 + player.upgrades[34] * (2 / 103)), - 3, - true - ) - }` - DOMCacheGetOrSet('sM5').textContent = `x${ - format(Math.pow(1.01, player.achievements[57] + player.achievements[58] + player.achievements[59]), 3, true) - }` - DOMCacheGetOrSet('sM6').textContent = `x${format(1 + 1 / 5 * player.researches[2], 3, true)}` - DOMCacheGetOrSet('sM7').textContent = `x${ - format( - 1 + 1 / 20 * player.researches[11] + 1 / 25 * player.researches[12] + 1 / 40 * player.researches[13] - + 3 / 200 * player.researches[14] + 1 / 200 * player.researches[15], - 3, - true - ) - }` - DOMCacheGetOrSet('sM8').textContent = `x${format(1 + 1 / 20 * player.researches[87], 3, true)}` - DOMCacheGetOrSet('sM9').textContent = `x${ - format(calculateSigmoidExponential(40, (player.antUpgrades[4]! + G.bonusant5) / 1000 * 40 / 39), 2, true) - }` - DOMCacheGetOrSet('sM10').textContent = `x${format(G.cubeBonusMultiplier[2], 3, true)}` - DOMCacheGetOrSet('sM11').textContent = `x${ - format( - (player.currentChallenge.transcension !== 0 || player.currentChallenge.reincarnation !== 0) - && player.upgrades[50] > 0.5 - ? 1.25 - : 1, - 3, - true - ) - }` - DOMCacheGetOrSet('sM12').textContent = `^${ - format(Math.min(1, (1 + player.platonicUpgrades[6] / 30) * G.viscosityPower[player.usedCorruptions[2]]), 3, true) - }` - DOMCacheGetOrSet('sM13').textContent = format(G.freeMultiplier, 3, true) -} + DOMCacheGetOrSet("sM1").textContent = `+${format( + G.freeUpgradeMultiplier, + 0, + true + )}`; + DOMCacheGetOrSet("sM2").textContent = `+${format( + (Math.floor( + (Math.floor((G.rune2level / 10) * G.effectiveLevelMult) * + Math.floor(10 + (G.rune2level / 10) * G.effectiveLevelMult)) / + 2 + ) * + 100) / + 100, + 0, + true + )}`; + DOMCacheGetOrSet("sM3").textContent = `x${format( + 1 + (G.rune2level / 200) * G.effectiveLevelMult, + 3, + true + )}`; + DOMCacheGetOrSet("sM4").textContent = `x${format( + Math.pow( + 1.01, + player.upgrades[21] + + player.upgrades[22] + + player.upgrades[23] + + player.upgrades[24] + + player.upgrades[25] + ) * + (1 + (player.upgrades[34] * 3) / 100) * + (1 + player.upgrades[34] * (2 / 103)), + 3, + true + )}`; + DOMCacheGetOrSet("sM5").textContent = `x${format( + Math.pow( + 1.01, + player.achievements[57] + + player.achievements[58] + + player.achievements[59] + ), + 3, + true + )}`; + DOMCacheGetOrSet("sM6").textContent = `x${format( + 1 + (1 / 5) * player.researches[2], + 3, + true + )}`; + DOMCacheGetOrSet("sM7").textContent = `x${format( + 1 + + (1 / 20) * player.researches[11] + + (1 / 25) * player.researches[12] + + (1 / 40) * player.researches[13] + + (3 / 200) * player.researches[14] + + (1 / 200) * player.researches[15], + 3, + true + )}`; + DOMCacheGetOrSet("sM8").textContent = `x${format( + 1 + (1 / 20) * player.researches[87], + 3, + true + )}`; + DOMCacheGetOrSet("sM9").textContent = `x${format( + calculateSigmoidExponential( + 40, + (((player.antUpgrades[4]! + G.bonusant5) / 1000) * 40) / 39 + ), + 2, + true + )}`; + DOMCacheGetOrSet("sM10").textContent = `x${format( + G.cubeBonusMultiplier[2], + 3, + true + )}`; + DOMCacheGetOrSet("sM11").textContent = `x${format( + (player.currentChallenge.transcension !== 0 || + player.currentChallenge.reincarnation !== 0) && + player.upgrades[50] > 0.5 + ? 1.25 + : 1, + 3, + true + )}`; + DOMCacheGetOrSet("sM12").textContent = `^${format( + Math.min( + 1, + (1 + player.platonicUpgrades[6] / 30) * + G.viscosityPower[player.usedCorruptions[2]] + ), + 3, + true + )}`; + DOMCacheGetOrSet("sM13").textContent = format(G.freeMultiplier, 3, true); +}; export const loadQuarkMultiplier = () => { - DOMCacheGetOrSet('sGQM1').textContent = `x${format(1, 3, true)}` // Base - DOMCacheGetOrSet('sGQM2').textContent = `+${format(player.achievementPoints / 25000, 3, true)}` // AP - DOMCacheGetOrSet('sGQM3').textContent = `+${format(player.achievements[250] > 0 ? 0.10 : 0, 3, true)}` // Max r8x25 - DOMCacheGetOrSet('sGQM4').textContent = `+${format(player.achievements[251] > 0 ? 0.10 : 0, 3, true)}` // Max w5x10 - DOMCacheGetOrSet('sGQM5').textContent = `+${format(player.platonicUpgrades[5] > 0 ? 0.20 : 0, 3, true)}` // ALPHA - DOMCacheGetOrSet('sGQM6').textContent = `+${format(player.platonicUpgrades[10] > 0 ? 0.25 : 0, 3, true)}` // BETA - DOMCacheGetOrSet('sGQM7').textContent = `+${format(player.platonicUpgrades[15] > 0 ? 0.30 : 0, 3, true)}` // OMEGA - DOMCacheGetOrSet('sGQM8').textContent = `+${format(G.challenge15Rewards.quarks - 1, 3, true)}` // Challenge 15 Reward - DOMCacheGetOrSet('sGQM9').textContent = `x${ - format(player.worlds.applyBonus(1 / calculateQuarkMultiplier()), 3, true) - }` // Patreon Bonus - DOMCacheGetOrSet('sGQM10').textContent = `x${ - format(G.isEvent ? 1 + calculateEventBuff(BuffType.Quark) + calculateEventBuff(BuffType.OneMind) : 1, 3, true) - }` // Event - DOMCacheGetOrSet('sGQM11').textContent = `x${format(1.1 + 0.15 / 75 * calculateEffectiveIALevel(), 3, true)}` // IA Rune - DOMCacheGetOrSet('sGQM12').textContent = `x${ - format(player.challenge15Exponent >= 1e15 ? 1 + 5 / 10000 * hepteractEffective('quark') : 1, 3, true) - }` // Quark Hepteract - DOMCacheGetOrSet('sGQM13').textContent = `x${format(calculateQuarkMultFromPowder(), 3, true)}` // Powder - DOMCacheGetOrSet('sGQM14').textContent = `x${ - format(1 + player.achievements[266] * Math.min(0.1, (player.ascensionCount) / 1e16), 3, true) - }` // Achievement 266 [Max: 10% at 1Qa Ascensions] - DOMCacheGetOrSet('sGQM15').textContent = `x${format(1 + player.singularityCount / 10, 3, true)}` // Singularity - DOMCacheGetOrSet('sGQM16').textContent = `x${format(calculateSingularityQuarkMilestoneMultiplier(), 3, true)}` // Singularity Milestones - DOMCacheGetOrSet('sGQM17').textContent = `x${format(1 + 0.10 * player.cubeUpgrades[53] / 100, 3, true)}` // Cube Upgrade 6x3 (Cx3) - DOMCacheGetOrSet('sGQM18').textContent = `x${ - format(1 + 1 / 10000 * player.cubeUpgrades[68] + 0.05 * (Math.floor(player.cubeUpgrades[68] / 1000)), 3, true) - }` - DOMCacheGetOrSet('sGQM19').textContent = `x${ - format( - 1 + 0.02 * player.singularityUpgrades.intermediatePack.level // 1.02 - + 0.04 * player.singularityUpgrades.advancedPack.level // 1.06 - + 0.06 * player.singularityUpgrades.expertPack.level // 1.12 - + 0.08 * player.singularityUpgrades.masterPack.level // 1.20 - + 0.10 * player.singularityUpgrades.divinePack.level, - 3, - true - ) - }` - DOMCacheGetOrSet('sGQM20').textContent = `x${ - format(1 + 0.25 * +player.octeractUpgrades.octeractStarter.getEffect().bonus, 3, true) - }` - DOMCacheGetOrSet('sGQM21').textContent = `x${ - format(+player.octeractUpgrades.octeractQuarkGain.getEffect().bonus, 3, true) - }` - DOMCacheGetOrSet('sGQM22').textContent = `x${format(calculateTotalOcteractQuarkBonus(), 3, true)}` - DOMCacheGetOrSet('sGQM23').textContent = `x${ - format(1 + +player.singularityUpgrades.singQuarkImprover1.getEffect().bonus, 3, true) - }` - DOMCacheGetOrSet('sGQM24').textContent = `x${ - format( - 1 + 1 / 10000 * Math.floor(player.octeractUpgrades.octeractQuarkGain.level / 199) - * player.octeractUpgrades.octeractQuarkGain2.level - * Math.floor(1 + Math.log10(Math.max(1, player.hepteractCrafts.quark.BAL))), - 3, - true - ) - }` - DOMCacheGetOrSet('sGQM25').textContent = `x${format(calculateAmbrosiaQuarkMult(), 2, true)}` - DOMCacheGetOrSet('sGQM26').textContent = `x${ - format(+player.blueberryUpgrades.ambrosiaTutorial.bonus.quarks, 2, true) - }` - DOMCacheGetOrSet('sGQM27').textContent = `x${format(+player.blueberryUpgrades.ambrosiaQuarks1.bonus.quarks, 2, true)}` - DOMCacheGetOrSet('sGQM28').textContent = `x${ - format(+player.blueberryUpgrades.ambrosiaCubeQuark1.bonus.quarks, 2, true) - }` - DOMCacheGetOrSet('sGQM29').textContent = `x${ - format(+player.blueberryUpgrades.ambrosiaLuckQuark1.bonus.quarks, 2, true) - }` - DOMCacheGetOrSet('sGQM30').textContent = `x${format(+player.blueberryUpgrades.ambrosiaQuarks2.bonus.quarks, 2, true)}` - DOMCacheGetOrSet('sGQMT').textContent = `x${format(player.worlds.applyBonus(1), 3, true)}` -} + DOMCacheGetOrSet("sGQM1").textContent = `x${format(1, 3, true)}`; // Base + DOMCacheGetOrSet("sGQM2").textContent = `+${format( + player.achievementPoints / 25000, + 3, + true + )}`; // AP + DOMCacheGetOrSet("sGQM3").textContent = `+${format( + player.achievements[250] > 0 ? 0.1 : 0, + 3, + true + )}`; // Max r8x25 + DOMCacheGetOrSet("sGQM4").textContent = `+${format( + player.achievements[251] > 0 ? 0.1 : 0, + 3, + true + )}`; // Max w5x10 + DOMCacheGetOrSet("sGQM5").textContent = `+${format( + player.platonicUpgrades[5] > 0 ? 0.2 : 0, + 3, + true + )}`; // ALPHA + DOMCacheGetOrSet("sGQM6").textContent = `+${format( + player.platonicUpgrades[10] > 0 ? 0.25 : 0, + 3, + true + )}`; // BETA + DOMCacheGetOrSet("sGQM7").textContent = `+${format( + player.platonicUpgrades[15] > 0 ? 0.3 : 0, + 3, + true + )}`; // OMEGA + DOMCacheGetOrSet("sGQM8").textContent = `+${format( + G.challenge15Rewards.quarks - 1, + 3, + true + )}`; // Challenge 15 Reward + DOMCacheGetOrSet("sGQM9").textContent = `x${format( + player.worlds.applyBonus(1 / calculateQuarkMultiplier()), + 3, + true + )}`; // Patreon Bonus + DOMCacheGetOrSet("sGQM10").textContent = `x${format( + G.isEvent + ? 1 + + calculateEventBuff(BuffType.Quark) + + calculateEventBuff(BuffType.OneMind) + : 1, + 3, + true + )}`; // Event + DOMCacheGetOrSet("sGQM11").textContent = `x${format( + 1.1 + (0.15 / 75) * calculateEffectiveIALevel(), + 3, + true + )}`; // IA Rune + DOMCacheGetOrSet("sGQM12").textContent = `x${format( + player.challenge15Exponent >= 1e15 + ? 1 + (5 / 10000) * hepteractEffective("quark") + : 1, + 3, + true + )}`; // Quark Hepteract + DOMCacheGetOrSet("sGQM13").textContent = `x${format( + calculateQuarkMultFromPowder(), + 3, + true + )}`; // Powder + DOMCacheGetOrSet("sGQM14").textContent = `x${format( + 1 + player.achievements[266] * Math.min(0.1, player.ascensionCount / 1e16), + 3, + true + )}`; // Achievement 266 [Max: 10% at 1Qa Ascensions] + DOMCacheGetOrSet("sGQM15").textContent = `x${format( + 1 + player.singularityCount / 10, + 3, + true + )}`; // Singularity + DOMCacheGetOrSet("sGQM16").textContent = `x${format( + calculateSingularityQuarkMilestoneMultiplier(), + 3, + true + )}`; // Singularity Milestones + DOMCacheGetOrSet("sGQM17").textContent = `x${format( + 1 + (0.1 * player.cubeUpgrades[53]) / 100, + 3, + true + )}`; // Cube Upgrade 6x3 (Cx3) + DOMCacheGetOrSet("sGQM18").textContent = `x${format( + 1 + + (1 / 10000) * player.cubeUpgrades[68] + + 0.05 * Math.floor(player.cubeUpgrades[68] / 1000), + 3, + true + )}`; + DOMCacheGetOrSet("sGQM19").textContent = `x${format( + 1 + + 0.02 * player.singularityUpgrades.intermediatePack.level + // 1.02 + 0.04 * player.singularityUpgrades.advancedPack.level + // 1.06 + 0.06 * player.singularityUpgrades.expertPack.level + // 1.12 + 0.08 * player.singularityUpgrades.masterPack.level + // 1.20 + 0.1 * player.singularityUpgrades.divinePack.level, + 3, + true + )}`; + DOMCacheGetOrSet("sGQM20").textContent = `x${format( + 1 + 0.25 * +player.octeractUpgrades.octeractStarter.getEffect().bonus, + 3, + true + )}`; + DOMCacheGetOrSet("sGQM21").textContent = `x${format( + +player.octeractUpgrades.octeractQuarkGain.getEffect().bonus, + 3, + true + )}`; + DOMCacheGetOrSet("sGQM22").textContent = `x${format( + calculateTotalOcteractQuarkBonus(), + 3, + true + )}`; + DOMCacheGetOrSet("sGQM23").textContent = `x${format( + 1 + +player.singularityUpgrades.singQuarkImprover1.getEffect().bonus, + 3, + true + )}`; + DOMCacheGetOrSet("sGQM24").textContent = `x${format( + 1 + + (1 / 10000) * + Math.floor(player.octeractUpgrades.octeractQuarkGain.level / 199) * + player.octeractUpgrades.octeractQuarkGain2.level * + Math.floor( + 1 + Math.log10(Math.max(1, player.hepteractCrafts.quark.BAL)) + ), + 3, + true + )}`; + DOMCacheGetOrSet("sGQM25").textContent = `x${format( + calculateAmbrosiaQuarkMult(), + 2, + true + )}`; + DOMCacheGetOrSet("sGQM26").textContent = `x${format( + +player.blueberryUpgrades.ambrosiaTutorial.bonus.quarks, + 2, + true + )}`; + DOMCacheGetOrSet("sGQM27").textContent = `x${format( + +player.blueberryUpgrades.ambrosiaQuarks1.bonus.quarks, + 2, + true + )}`; + DOMCacheGetOrSet("sGQM28").textContent = `x${format( + +player.blueberryUpgrades.ambrosiaCubeQuark1.bonus.quarks, + 2, + true + )}`; + DOMCacheGetOrSet("sGQM29").textContent = `x${format( + +player.blueberryUpgrades.ambrosiaLuckQuark1.bonus.quarks, + 2, + true + )}`; + DOMCacheGetOrSet("sGQM30").textContent = `x${format( + +player.blueberryUpgrades.ambrosiaQuarks2.bonus.quarks, + 2, + true + )}`; + DOMCacheGetOrSet("sGQMT").textContent = `x${format( + player.worlds.applyBonus(1), + 3, + true + )}`; +}; export const loadGlobalSpeedMultiplier = () => { - const globalSpeedStats = calculateTimeAcceleration() + const globalSpeedStats = calculateTimeAcceleration(); - const preDRlist = globalSpeedStats.preList + const preDRlist = globalSpeedStats.preList; for (let i = 0; i < preDRlist.length; i++) { - DOMCacheGetOrSet(`sGSMa${i + 1}`).textContent = `x${format(preDRlist[i], 3, true)}` + DOMCacheGetOrSet(`sGSMa${i + 1}`).textContent = `x${format( + preDRlist[i], + 3, + true + )}`; } - const drList = globalSpeedStats.drList + const drList = globalSpeedStats.drList; for (let i = 0; i < drList.length; i++) { - DOMCacheGetOrSet(`sGSMb${i + 1}`).textContent = `x${format(drList[i], 3, true)}` + DOMCacheGetOrSet(`sGSMb${i + 1}`).textContent = `x${format( + drList[i], + 3, + true + )}`; } - const postDRlist = globalSpeedStats.postList + const postDRlist = globalSpeedStats.postList; for (let i = 0; i < postDRlist.length; i++) { - DOMCacheGetOrSet(`sGSMc${i + 1}`).textContent = `x${format(postDRlist[i], 3, true)}` + DOMCacheGetOrSet(`sGSMc${i + 1}`).textContent = `x${format( + postDRlist[i], + 3, + true + )}`; } - DOMCacheGetOrSet('sGSMT').textContent = format(globalSpeedStats.mult, 3) -} + DOMCacheGetOrSet("sGSMT").textContent = format(globalSpeedStats.mult, 3); +}; export const loadStatisticsCubeMultipliers = () => { - const arr0 = calculateAllCubeMultiplier().list + const arr0 = calculateAllCubeMultiplier().list; const map0: Record = { - 1: { acc: 2, desc: 'Ascension Time Multiplier:' }, - 2: { acc: 2, desc: 'Sun and Moon Achievements:' }, - 3: { acc: 2, desc: 'Speed Achievement:' }, - 4: { acc: 2, desc: 'Challenge 15 All Cube Bonus:' }, - 5: { acc: 2, desc: 'Rune 6 - Infinite Ascent:' }, - 6: { acc: 2, desc: 'Platonic Beta:' }, - 7: { acc: 2, desc: 'Platonic Omega:' }, - 8: { acc: 2, desc: 'Overflux Powder:' }, - 9: { acc: 2, desc: 'Event:' }, - 10: { acc: 2, desc: 'Singularity Factor:' }, - 11: { acc: 2, desc: 'Wow Pass Y' }, - 12: { acc: 2, desc: 'Starter Pack:' }, - 13: { acc: 2, desc: 'Cube Flame [GQ]:' }, - 14: { acc: 2, desc: 'Cube Blaze [GQ]:' }, - 15: { acc: 2, desc: 'Cube Inferno [GQ]:' }, - 16: { acc: 2, desc: 'Wow Pass Z:' }, - 17: { acc: 2, desc: 'Cookie Upgrade 16:' }, - 18: { acc: 2, desc: 'Cookie Upgrade 8:' }, - 19: { acc: 2, desc: 'Total Octeract Bonus:' }, - 20: { acc: 2, desc: 'No Singularity Upgrades Challenge:' }, - 21: { acc: 2, desc: 'Citadel [GQ]' }, - 22: { acc: 2, desc: 'Citadel 2 [GQ]' }, - 23: { acc: 4, desc: 'Platonic DELTA' }, - 24: { acc: 2, desc: 'Wow Pass ∞' }, - 25: { acc: 2, desc: 'Unspent Ambrosia Bonus' }, - 26: { acc: 2, desc: 'Module- Tutorial' }, - 27: { acc: 2, desc: 'Module- Cubes 1' }, - 28: { acc: 2, desc: 'Module- Luck-Cube 1' }, - 29: { acc: 2, desc: 'Module- Quark-Cube 1' }, - 30: { acc: 2, desc: 'Module- Cubes 2' } - } + 1: { acc: 2, desc: "Ascension Time Multiplier:" }, + 2: { acc: 2, desc: "Sun and Moon Achievements:" }, + 3: { acc: 2, desc: "Speed Achievement:" }, + 4: { acc: 2, desc: "Challenge 15 All Cube Bonus:" }, + 5: { acc: 2, desc: "Rune 6 - Infinite Ascent:" }, + 6: { acc: 2, desc: "Platonic Beta:" }, + 7: { acc: 2, desc: "Platonic Omega:" }, + 8: { acc: 2, desc: "Overflux Powder:" }, + 9: { acc: 2, desc: "Event:" }, + 10: { acc: 2, desc: "Singularity Factor:" }, + 11: { acc: 2, desc: "Wow Pass Y" }, + 12: { acc: 2, desc: "Starter Pack:" }, + 13: { acc: 2, desc: "Cube Flame [GQ]:" }, + 14: { acc: 2, desc: "Cube Blaze [GQ]:" }, + 15: { acc: 2, desc: "Cube Inferno [GQ]:" }, + 16: { acc: 2, desc: "Wow Pass Z:" }, + 17: { acc: 2, desc: "Cookie Upgrade 16:" }, + 18: { acc: 2, desc: "Cookie Upgrade 8:" }, + 19: { acc: 2, desc: "Total Octeract Bonus:" }, + 20: { acc: 2, desc: "No Singularity Upgrades Challenge:" }, + 21: { acc: 2, desc: "Citadel [GQ]" }, + 22: { acc: 2, desc: "Citadel 2 [GQ]" }, + 23: { acc: 4, desc: "Platonic DELTA" }, + 24: { acc: 2, desc: "Wow Pass ∞" }, + 25: { acc: 2, desc: "Unspent Ambrosia Bonus" }, + 26: { acc: 2, desc: "Module- Tutorial" }, + 27: { acc: 2, desc: "Module- Cubes 1" }, + 28: { acc: 2, desc: "Module- Luck-Cube 1" }, + 29: { acc: 2, desc: "Module- Quark-Cube 1" }, + 30: { acc: 2, desc: "Module- Cubes 2" }, + 31: { acc: 2, desc: "Module- Hyperflux" }, + }; for (let i = 0; i < arr0.length; i++) { - const statGCMi = DOMCacheGetOrSet(`statGCM${i + 1}`) - statGCMi.childNodes[0].textContent = map0[i + 1].desc - DOMCacheGetOrSet(`sGCM${i + 1}`).textContent = `x${format(arr0[i], map0[i + 1].acc, true)}` + const statGCMi = DOMCacheGetOrSet(`statGCM${i + 1}`); + statGCMi.childNodes[0].textContent = map0[i + 1].desc; + DOMCacheGetOrSet(`sGCM${i + 1}`).textContent = `x${format( + arr0[i], + map0[i + 1].acc, + true + )}`; } - DOMCacheGetOrSet('sGCMT').textContent = `x${format(calculateAllCubeMultiplier().mult, 3)}` + DOMCacheGetOrSet("sGCMT").textContent = `x${format( + calculateAllCubeMultiplier().mult, + 3 + )}`; - const arr = calculateCubeMultiplier().list + const arr = calculateCubeMultiplier().list; const map: Record = { - 1: { acc: 2, desc: 'Ascension Score Multiplier:' }, - 2: { acc: 2, desc: 'Global Cube Multiplier:' }, - 3: { acc: 2, desc: 'Season Pass 1:' }, - 4: { acc: 2, desc: 'Researches (Except 8x25):' }, - 5: { acc: 2, desc: 'Research 8x25:' }, - 6: { acc: 2, desc: 'Cube Upgrades:' }, - 7: { acc: 2, desc: 'Constant Upgrade 10:' }, - 8: { acc: 2, desc: 'Achievement 189 Bonus:' }, - 9: { acc: 2, desc: 'Achievement 193 Bonus:' }, - 10: { acc: 2, desc: 'Achievement 195 Bonus:' }, - 11: { acc: 2, desc: 'Achievement 198-201 Bonus:' }, - 12: { acc: 2, desc: 'Achievement 254 Bonus:' }, - 13: { acc: 2, desc: 'Spirit Power:' }, - 14: { acc: 2, desc: 'Platonic Cubes:' }, - 15: { acc: 2, desc: 'Platonic 1x1:' }, - 16: { acc: 2, desc: 'Cookie Upgrade 13:' } - } + 1: { acc: 2, desc: "Ascension Score Multiplier:" }, + 2: { acc: 2, desc: "Global Cube Multiplier:" }, + 3: { acc: 2, desc: "Season Pass 1:" }, + 4: { acc: 2, desc: "Researches (Except 8x25):" }, + 5: { acc: 2, desc: "Research 8x25:" }, + 6: { acc: 2, desc: "Cube Upgrades:" }, + 7: { acc: 2, desc: "Constant Upgrade 10:" }, + 8: { acc: 2, desc: "Achievement 189 Bonus:" }, + 9: { acc: 2, desc: "Achievement 193 Bonus:" }, + 10: { acc: 2, desc: "Achievement 195 Bonus:" }, + 11: { acc: 2, desc: "Achievement 198-201 Bonus:" }, + 12: { acc: 2, desc: "Achievement 254 Bonus:" }, + 13: { acc: 2, desc: "Spirit Power:" }, + 14: { acc: 2, desc: "Platonic Cubes:" }, + 15: { acc: 2, desc: "Platonic 1x1:" }, + 16: { acc: 2, desc: "Cookie Upgrade 13:" }, + }; for (let i = 0; i < arr.length; i++) { - const statCMi = DOMCacheGetOrSet(`statCM${i + 1}`) - statCMi.childNodes[0].textContent = map[i + 1].desc - DOMCacheGetOrSet(`sCM${i + 1}`).textContent = `x${format(arr[i], map[i + 1].acc, true)}` + const statCMi = DOMCacheGetOrSet(`statCM${i + 1}`); + statCMi.childNodes[0].textContent = map[i + 1].desc; + DOMCacheGetOrSet(`sCM${i + 1}`).textContent = `x${format( + arr[i], + map[i + 1].acc, + true + )}`; } // PLAT - DOMCacheGetOrSet('sCMT').textContent = `x${format(calculateCubeMultiplier().mult, 3)}` + DOMCacheGetOrSet("sCMT").textContent = `x${format( + calculateCubeMultiplier().mult, + 3 + )}`; - const arr2 = calculateTesseractMultiplier().list + const arr2 = calculateTesseractMultiplier().list; const map2: Record = { - 1: { acc: 2, desc: 'Ascension Score Multiplier:' }, - 2: { acc: 2, desc: 'Global Cube Multiplier:' }, - 3: { acc: 2, desc: 'Season Pass 1:' }, - 4: { acc: 2, desc: 'Constant Upgrade 10:' }, - 5: { acc: 2, desc: 'Cube Upgrade 3x10:' }, - 6: { acc: 2, desc: 'Cube Upgrade 4x8:' }, - 7: { acc: 2, desc: 'Achievement 195 Bonus:' }, - 8: { acc: 2, desc: 'Achievement 202 Bonus:' }, - 9: { acc: 2, desc: 'Achievement 205-208 Bonus:' }, - 10: { acc: 2, desc: 'Achievement 255 Bonus:' }, - 11: { acc: 2, desc: 'Platonic Cubes:' }, - 12: { acc: 2, desc: 'Platonic 1x2:' } - } + 1: { acc: 2, desc: "Ascension Score Multiplier:" }, + 2: { acc: 2, desc: "Global Cube Multiplier:" }, + 3: { acc: 2, desc: "Season Pass 1:" }, + 4: { acc: 2, desc: "Constant Upgrade 10:" }, + 5: { acc: 2, desc: "Cube Upgrade 3x10:" }, + 6: { acc: 2, desc: "Cube Upgrade 4x8:" }, + 7: { acc: 2, desc: "Achievement 195 Bonus:" }, + 8: { acc: 2, desc: "Achievement 202 Bonus:" }, + 9: { acc: 2, desc: "Achievement 205-208 Bonus:" }, + 10: { acc: 2, desc: "Achievement 255 Bonus:" }, + 11: { acc: 2, desc: "Platonic Cubes:" }, + 12: { acc: 2, desc: "Platonic 1x2:" }, + }; for (let i = 0; i < arr2.length; i++) { - const statTeMi = DOMCacheGetOrSet(`statTeM${i + 1}`) - statTeMi.childNodes[0].textContent = map2[i + 1].desc - DOMCacheGetOrSet(`sTeM${i + 1}`).textContent = `x${format(arr2[i], map2[i + 1].acc, true)}` + const statTeMi = DOMCacheGetOrSet(`statTeM${i + 1}`); + statTeMi.childNodes[0].textContent = map2[i + 1].desc; + DOMCacheGetOrSet(`sTeM${i + 1}`).textContent = `x${format( + arr2[i], + map2[i + 1].acc, + true + )}`; } - DOMCacheGetOrSet('sTeMT').textContent = `x${format(calculateTesseractMultiplier().mult, 3)}` + DOMCacheGetOrSet("sTeMT").textContent = `x${format( + calculateTesseractMultiplier().mult, + 3 + )}`; - const arr3 = calculateHypercubeMultiplier().list + const arr3 = calculateHypercubeMultiplier().list; const map3: Record = { - 1: { acc: 2, desc: 'Ascension Score Multiplier:' }, - 2: { acc: 2, desc: 'Global Cube Multiplier:' }, - 3: { acc: 2, desc: 'Season Pass 2:' }, - 4: { acc: 2, desc: 'Achievement 212-215 Bonus:' }, - 5: { acc: 2, desc: 'Achievement 216 Bonus:' }, - 6: { acc: 2, desc: 'Achievement 253 Bonus:' }, - 7: { acc: 2, desc: 'Achievement 256 Bonus:' }, - 8: { acc: 2, desc: 'Achievement 265 Bonus:' }, - 9: { acc: 2, desc: 'Platonic Cubes:' }, - 10: { acc: 2, desc: 'Platonic 1x3:' }, - 11: { acc: 2, desc: 'Hyperreal Hepteract Bonus:' } - } + 1: { acc: 2, desc: "Ascension Score Multiplier:" }, + 2: { acc: 2, desc: "Global Cube Multiplier:" }, + 3: { acc: 2, desc: "Season Pass 2:" }, + 4: { acc: 2, desc: "Achievement 212-215 Bonus:" }, + 5: { acc: 2, desc: "Achievement 216 Bonus:" }, + 6: { acc: 2, desc: "Achievement 253 Bonus:" }, + 7: { acc: 2, desc: "Achievement 256 Bonus:" }, + 8: { acc: 2, desc: "Achievement 265 Bonus:" }, + 9: { acc: 2, desc: "Platonic Cubes:" }, + 10: { acc: 2, desc: "Platonic 1x3:" }, + 11: { acc: 2, desc: "Hyperreal Hepteract Bonus:" }, + }; for (let i = 0; i < arr3.length; i++) { - const statHyMi = DOMCacheGetOrSet(`statHyM${i + 1}`) - statHyMi.childNodes[0].textContent = map3[i + 1].desc - DOMCacheGetOrSet(`sHyM${i + 1}`).textContent = `x${format(arr3[i], map3[i + 1].acc, true)}` + const statHyMi = DOMCacheGetOrSet(`statHyM${i + 1}`); + statHyMi.childNodes[0].textContent = map3[i + 1].desc; + DOMCacheGetOrSet(`sHyM${i + 1}`).textContent = `x${format( + arr3[i], + map3[i + 1].acc, + true + )}`; } - DOMCacheGetOrSet('sHyMT').textContent = `x${format(calculateHypercubeMultiplier().mult, 3)}` + DOMCacheGetOrSet("sHyMT").textContent = `x${format( + calculateHypercubeMultiplier().mult, + 3 + )}`; - const arr4 = calculatePlatonicMultiplier().list + const arr4 = calculatePlatonicMultiplier().list; const map4: Record = { - 1: { acc: 2, desc: 'Ascension Score Multiplier:' }, - 2: { acc: 2, desc: 'Global Cube Multiplier:' }, - 3: { acc: 2, desc: 'Season Pass 2:' }, - 4: { acc: 2, desc: 'Achievement 196 Bonus:' }, - 5: { acc: 2, desc: 'Achievement 219-222 Bonus:' }, - 6: { acc: 2, desc: 'Achievement 223 Bonus:' }, - 7: { acc: 2, desc: 'Achievement 257 Bonus:' }, - 8: { acc: 2, desc: 'Platonic Cubes:' }, - 9: { acc: 2, desc: 'Platonic 1x4:' } - } + 1: { acc: 2, desc: "Ascension Score Multiplier:" }, + 2: { acc: 2, desc: "Global Cube Multiplier:" }, + 3: { acc: 2, desc: "Season Pass 2:" }, + 4: { acc: 2, desc: "Achievement 196 Bonus:" }, + 5: { acc: 2, desc: "Achievement 219-222 Bonus:" }, + 6: { acc: 2, desc: "Achievement 223 Bonus:" }, + 7: { acc: 2, desc: "Achievement 257 Bonus:" }, + 8: { acc: 2, desc: "Platonic Cubes:" }, + 9: { acc: 2, desc: "Platonic 1x4:" }, + }; for (let i = 0; i < arr4.length; i++) { - const statPlMi = DOMCacheGetOrSet(`statPlM${i + 1}`) - statPlMi.childNodes[0].textContent = map4[i + 1].desc - DOMCacheGetOrSet(`sPlM${i + 1}`).textContent = `x${format(arr4[i], map4[i + 1].acc, true)}` + const statPlMi = DOMCacheGetOrSet(`statPlM${i + 1}`); + statPlMi.childNodes[0].textContent = map4[i + 1].desc; + DOMCacheGetOrSet(`sPlM${i + 1}`).textContent = `x${format( + arr4[i], + map4[i + 1].acc, + true + )}`; } - DOMCacheGetOrSet('sPlMT').textContent = `x${format(calculatePlatonicMultiplier().mult, 3)}` + DOMCacheGetOrSet("sPlMT").textContent = `x${format( + calculatePlatonicMultiplier().mult, + 3 + )}`; - const arr5 = calculateHepteractMultiplier().list + const arr5 = calculateHepteractMultiplier().list; const map5: Record = { - 1: { acc: 2, desc: 'Ascension Score Multiplier:' }, - 2: { acc: 2, desc: 'Global Cube Multiplier:' }, - 3: { acc: 2, desc: 'Season Pass 3:' }, - 4: { acc: 2, desc: 'Achievement 258 Bonus:' }, - 5: { acc: 2, desc: 'Achievement 264 Bonus:' }, - 6: { acc: 2, desc: 'Achievement 265 Bonus:' }, - 7: { acc: 2, desc: 'Achievement 270 Bonus:' } - } + 1: { acc: 2, desc: "Ascension Score Multiplier:" }, + 2: { acc: 2, desc: "Global Cube Multiplier:" }, + 3: { acc: 2, desc: "Season Pass 3:" }, + 4: { acc: 2, desc: "Achievement 258 Bonus:" }, + 5: { acc: 2, desc: "Achievement 264 Bonus:" }, + 6: { acc: 2, desc: "Achievement 265 Bonus:" }, + 7: { acc: 2, desc: "Achievement 270 Bonus:" }, + }; for (let i = 0; i < arr5.length; i++) { - const statHeMi = DOMCacheGetOrSet(`statHeM${i + 1}`) - statHeMi.childNodes[0].textContent = map5[i + 1].desc - DOMCacheGetOrSet(`sHeM${i + 1}`).textContent = `x${format(arr5[i], map5[i + 1].acc, true)}` + const statHeMi = DOMCacheGetOrSet(`statHeM${i + 1}`); + statHeMi.childNodes[0].textContent = map5[i + 1].desc; + DOMCacheGetOrSet(`sHeM${i + 1}`).textContent = `x${format( + arr5[i], + map5[i + 1].acc, + true + )}`; } - DOMCacheGetOrSet('sHeMT').textContent = `x${format(calculateHepteractMultiplier().mult, 3)}` + DOMCacheGetOrSet("sHeMT").textContent = `x${format( + calculateHepteractMultiplier().mult, + 3 + )}`; - const octMults = calculateOcteractMultiplier() - const ascensionSpeedDesc = (player.singularityUpgrades.oneMind.getEffect().bonus) - ? 'One Mind Multiplier' - : 'Ascension Speed Multiplier' + const octMults = calculateOcteractMultiplier(); + const ascensionSpeedDesc = player.singularityUpgrades.oneMind.getEffect() + .bonus + ? "One Mind Multiplier" + : "Ascension Speed Multiplier"; const map6: Record = { - 1: { acc: 2, desc: 'Ascension Score Multiplier:' }, - 2: { acc: 2, desc: 'Season Pass 3:' }, - 3: { acc: 2, desc: 'Season Pass Y:' }, - 4: { acc: 2, desc: 'Season Pass Z:' }, - 5: { acc: 2, desc: 'Season Pass Lost:' }, - 6: { acc: 2, desc: 'Cookie Upgrade 20:' }, - 7: { acc: 2, desc: 'Divine Pack:' }, - 8: { acc: 2, desc: 'Cube Flame:' }, - 9: { acc: 2, desc: 'Cube Blaze:' }, - 10: { acc: 2, desc: 'Cube Inferno:' }, - 11: { acc: 2, desc: 'Octeract Absinthe' }, - 12: { acc: 2, desc: 'Pieces of Eight' }, - 13: { acc: 2, desc: 'Obelisk Shaped Like an Octagon' }, - 14: { acc: 2, desc: 'Octahedral Synthesis' }, - 15: { acc: 2, desc: 'Eighth Wonder of the World' }, - 16: { acc: 2, desc: 'Platonic is a fat sellout' }, - 17: { acc: 2, desc: 'Octeracts for Dummies' }, - 18: { acc: 2, desc: 'Octeract Cogenesis' }, - 19: { acc: 2, desc: 'Octeract Trigenesis' }, - 20: { acc: 2, desc: 'Singularity Factor' }, - 21: { acc: 2, desc: 'Digital Octeract Accumulator' }, - 22: { acc: 2, desc: 'Event Buff' }, - 23: { acc: 2, desc: 'Platonic DELTA' }, - 24: { acc: 2, desc: 'No Singularity Upgrades Challenge' }, - 25: { acc: 2, desc: 'Wow Pass ∞' }, - 26: { acc: 2, desc: 'Unspent Ambrosia Bonus' }, - 27: { acc: 2, desc: 'Module- Tutorial' }, - 28: { acc: 2, desc: 'Module- Cubes 1' }, - 29: { acc: 2, desc: 'Module- Luck-Cube 1' }, - 30: { acc: 2, desc: 'Module- Quark-Cube 1' }, - 31: { acc: 2, desc: 'Module- Cubes 2' }, - 32: { acc: 2, desc: ascensionSpeedDesc } - } + 1: { acc: 2, desc: "Ascension Score Multiplier:" }, + 2: { acc: 2, desc: "Season Pass 3:" }, + 3: { acc: 2, desc: "Season Pass Y:" }, + 4: { acc: 2, desc: "Season Pass Z:" }, + 5: { acc: 2, desc: "Season Pass Lost:" }, + 6: { acc: 2, desc: "Cookie Upgrade 20:" }, + 7: { acc: 2, desc: "Divine Pack:" }, + 8: { acc: 2, desc: "Cube Flame:" }, + 9: { acc: 2, desc: "Cube Blaze:" }, + 10: { acc: 2, desc: "Cube Inferno:" }, + 11: { acc: 2, desc: "Octeract Absinthe" }, + 12: { acc: 2, desc: "Pieces of Eight" }, + 13: { acc: 2, desc: "Obelisk Shaped Like an Octagon" }, + 14: { acc: 2, desc: "Octahedral Synthesis" }, + 15: { acc: 2, desc: "Eighth Wonder of the World" }, + 16: { acc: 2, desc: "Platonic is a fat sellout" }, + 17: { acc: 2, desc: "Octeracts for Dummies" }, + 18: { acc: 2, desc: "Octeract Cogenesis" }, + 19: { acc: 2, desc: "Octeract Trigenesis" }, + 20: { acc: 2, desc: "Singularity Factor" }, + 21: { acc: 2, desc: "Digital Octeract Accumulator" }, + 22: { acc: 2, desc: "Event Buff" }, + 23: { acc: 2, desc: "Platonic DELTA" }, + 24: { acc: 2, desc: "No Singularity Upgrades Challenge" }, + 25: { acc: 2, desc: "Wow Pass ∞" }, + 26: { acc: 2, desc: "Unspent Ambrosia Bonus" }, + 27: { acc: 2, desc: "Module- Tutorial" }, + 28: { acc: 2, desc: "Module- Cubes 1" }, + 29: { acc: 2, desc: "Module- Luck-Cube 1" }, + 30: { acc: 2, desc: "Module- Quark-Cube 1" }, + 31: { acc: 2, desc: "Module- Cubes 2" }, + 32: { acc: 2, desc: ascensionSpeedDesc }, + }; for (let i = 0; i < octMults.list.length; i++) { - const statOcMi = DOMCacheGetOrSet(`statOcM${i + 1}`) - statOcMi.childNodes[0].textContent = map6[i + 1].desc - DOMCacheGetOrSet(`sOcM${i + 1}`).textContent = `x${format(octMults.list[i], map6[i + 1].acc, true)}` + const statOcMi = DOMCacheGetOrSet(`statOcM${i + 1}`); + statOcMi.childNodes[0].textContent = map6[i + 1].desc; + DOMCacheGetOrSet(`sOcM${i + 1}`).textContent = `x${format( + octMults.list[i], + map6[i + 1].acc, + true + )}`; } - DOMCacheGetOrSet('sOcMT').textContent = `x${format(octMults.mult, 3)}` -} + DOMCacheGetOrSet("sOcMT").textContent = `x${format(octMults.mult, 3)}`; +}; export const loadStatisticsOfferingMultipliers = () => { - const arr = calculateOfferings('prestige', false) + const arr = calculateOfferings("prestige", false); const map: Record = { - 1: { acc: 3, desc: 'Alchemy Achievement 5:' }, - 2: { acc: 3, desc: 'Alchemy Achievement 6:' }, - 3: { acc: 3, desc: 'Alchemy Achievement 7:' }, - 4: { acc: 3, desc: 'Diamond Upgrade 4x3:' }, - 5: { acc: 3, desc: 'Particle Upgrade 3x5:' }, - 6: { acc: 3, desc: 'Auto Offering Shop Upgrade:' }, - 7: { acc: 3, desc: 'Offering EX Shop Upgrade:' }, - 8: { acc: 3, desc: 'Cash Grab Shop Upgrade:' }, - 9: { acc: 3, desc: 'Research 4x10:' }, - 10: { acc: 3, desc: 'Sacrificium Formicidae:' }, - 11: { acc: 3, desc: 'Plutus Cube Tribute:' }, - 12: { acc: 3, desc: 'Constant Upgrade 3:' }, - 13: { acc: 3, desc: 'Research 6x24,8x4:' }, - 14: { acc: 3, desc: 'Challenge 12:' }, - 15: { acc: 3, desc: 'Research 8x25:' }, - 16: { acc: 3, desc: 'Ascension Count Achievement:' }, - 17: { acc: 3, desc: 'Sun and Moon Achievements:' }, - 18: { acc: 3, desc: 'Cube Upgrade 5x6:' }, - 19: { acc: 3, desc: 'Cube Upgrade 5x10:' }, - 20: { acc: 3, desc: 'Platonic ALPHA:' }, - 21: { acc: 3, desc: 'Platonic BETA:' }, - 22: { acc: 3, desc: 'Platonic OMEGA:' }, - 23: { acc: 3, desc: 'Challenge 15:' }, - 24: { acc: 3, desc: 'Starter Pack:' }, - 25: { acc: 3, desc: 'Offering Charge [GQ]:' }, - 26: { acc: 3, desc: 'Offering Storm [GQ]:' }, - 27: { acc: 3, desc: 'Offering Tempest [GQ]:' }, - 28: { acc: 3, desc: 'Citadel [GQ]' }, - 29: { acc: 3, desc: 'Citadel 2 [GQ]' }, - 30: { acc: 3, desc: 'Cube Upgrade Cx4:' }, - 31: { acc: 3, desc: 'Offering Electrolosis [OC]:' }, - 32: { acc: 3, desc: 'Event:' } - } + 1: { acc: 3, desc: "Alchemy Achievement 5:" }, + 2: { acc: 3, desc: "Alchemy Achievement 6:" }, + 3: { acc: 3, desc: "Alchemy Achievement 7:" }, + 4: { acc: 3, desc: "Diamond Upgrade 4x3:" }, + 5: { acc: 3, desc: "Particle Upgrade 3x5:" }, + 6: { acc: 3, desc: "Auto Offering Shop Upgrade:" }, + 7: { acc: 3, desc: "Offering EX Shop Upgrade:" }, + 8: { acc: 3, desc: "Cash Grab Shop Upgrade:" }, + 9: { acc: 3, desc: "Research 4x10:" }, + 10: { acc: 3, desc: "Sacrificium Formicidae:" }, + 11: { acc: 3, desc: "Plutus Cube Tribute:" }, + 12: { acc: 3, desc: "Constant Upgrade 3:" }, + 13: { acc: 3, desc: "Research 6x24,8x4:" }, + 14: { acc: 3, desc: "Challenge 12:" }, + 15: { acc: 3, desc: "Research 8x25:" }, + 16: { acc: 3, desc: "Ascension Count Achievement:" }, + 17: { acc: 3, desc: "Sun and Moon Achievements:" }, + 18: { acc: 3, desc: "Cube Upgrade 5x6:" }, + 19: { acc: 3, desc: "Cube Upgrade 5x10:" }, + 20: { acc: 3, desc: "Platonic ALPHA:" }, + 21: { acc: 3, desc: "Platonic BETA:" }, + 22: { acc: 3, desc: "Platonic OMEGA:" }, + 23: { acc: 3, desc: "Challenge 15:" }, + 24: { acc: 3, desc: "Starter Pack:" }, + 25: { acc: 3, desc: "Offering Charge [GQ]:" }, + 26: { acc: 3, desc: "Offering Storm [GQ]:" }, + 27: { acc: 3, desc: "Offering Tempest [GQ]:" }, + 28: { acc: 3, desc: "Citadel [GQ]" }, + 29: { acc: 3, desc: "Citadel 2 [GQ]" }, + 30: { acc: 3, desc: "Cube Upgrade Cx4:" }, + 31: { acc: 3, desc: "Offering Electrolosis [OC]:" }, + 32: { acc: 3, desc: "RNG-based Offering Booster:" }, + 33: { acc: 3, desc: "Event:" }, + }; for (let i = 0; i < arr.length; i++) { - const statOffi = DOMCacheGetOrSet(`statOff${i + 1}`) - statOffi.childNodes[0].textContent = map[i + 1].desc - DOMCacheGetOrSet(`sOff${i + 1}`).textContent = `x${format(arr[i], map[i + 1].acc, true)}` + const statOffi = DOMCacheGetOrSet(`statOff${i + 1}`); + statOffi.childNodes[0].textContent = map[i + 1].desc; + DOMCacheGetOrSet(`sOff${i + 1}`).textContent = `x${format( + arr[i], + map[i + 1].acc, + true + )}`; } - DOMCacheGetOrSet('sOffT').textContent = `x${format(calculateOfferings('prestige', true, true), 3)}` -} + DOMCacheGetOrSet("sOffT").textContent = `x${format( + calculateOfferings("prestige", true, true), + 3 + )}`; +}; export const loadPowderMultiplier = () => { - const arr0 = calculatePowderConversion().list + const arr0 = calculatePowderConversion().list; const map0: Record = { - 1: { acc: 2, desc: 'Base:' }, - 2: { acc: 2, desc: 'Challenge 15 Bonus:' }, - 3: { acc: 2, desc: 'Powder EX:' }, - 4: { acc: 2, desc: 'Achievement 256:' }, - 5: { acc: 2, desc: 'Achievement 257:' }, - 6: { acc: 2, desc: 'Platonic Upgrade 16 [4x1]:' }, - 7: { acc: 2, desc: 'Event:' } - } + 1: { acc: 2, desc: "Base:" }, + 2: { acc: 2, desc: "Challenge 15 Bonus:" }, + 3: { acc: 2, desc: "Powder EX:" }, + 4: { acc: 2, desc: "Achievement 256:" }, + 5: { acc: 2, desc: "Achievement 257:" }, + 6: { acc: 2, desc: "Platonic Upgrade 16 [4x1]:" }, + 7: { acc: 2, desc: "Event:" }, + }; for (let i = 0; i < arr0.length; i++) { - const statGCMi = DOMCacheGetOrSet(`statPoM${i + 1}`) - statGCMi.childNodes[0].textContent = map0[i + 1].desc - DOMCacheGetOrSet(`sPoM${i + 1}`).textContent = `x${format(arr0[i], map0[i + 1].acc, true)}` + const statGCMi = DOMCacheGetOrSet(`statPoM${i + 1}`); + statGCMi.childNodes[0].textContent = map0[i + 1].desc; + DOMCacheGetOrSet(`sPoM${i + 1}`).textContent = `x${format( + arr0[i], + map0[i + 1].acc, + true + )}`; } - DOMCacheGetOrSet('sPoMT').textContent = `x${format(calculatePowderConversion().mult, 3)}` -} + DOMCacheGetOrSet("sPoMT").textContent = `x${format( + calculatePowderConversion().mult, + 3 + )}`; +}; export const loadStatisticsAscensionSpeedMultipliers = () => { - const arr = calculateAscensionSpeedMultiplier() + const arr = calculateAscensionSpeedMultiplier(); const map7: Record = { - 1: { acc: 2, desc: 'Chronometer:' }, - 2: { acc: 2, desc: 'Chronometer 2:' }, - 3: { acc: 2, desc: 'Chronometer 3:' }, - 4: { acc: 2, desc: 'Chronos Hepteract:' }, - 5: { acc: 2, desc: 'Achievement 262 Bonus:' }, - 6: { acc: 2, desc: 'Achievement 263 Bonus:' }, - 7: { acc: 2, desc: 'Platonic Omega:' }, - 8: { acc: 2, desc: 'Challenge 15 Reward:' }, - 9: { acc: 2, desc: 'Cookie Upgrade 9:' }, - 10: { acc: 2, desc: 'Intermediate Pack:' }, - 11: { acc: 2, desc: 'Chronometer Z:' }, - 12: { acc: 2, desc: 'Abstract Photokinetics:' }, - 13: { acc: 2, desc: 'Abstract Exokinetics:' }, - 14: { acc: 2, desc: 'Event:' }, - 15: { acc: 2, desc: 'Ascension Speedup 2 [GQ]:' }, - 16: { acc: 2, desc: 'Chronometer INF:' }, - 17: { acc: 2, desc: 'Limited Ascensions Penalty:' }, - 18: { acc: 2, desc: 'Limited Ascensions Reward:' }, - 19: { acc: 2, desc: 'Ascension Speedup [GQ]:' }, - 20: { acc: 2, desc: 'Singularity Penalty:' } - } + 1: { acc: 2, desc: "Chronometer:" }, + 2: { acc: 2, desc: "Chronometer 2:" }, + 3: { acc: 2, desc: "Chronometer 3:" }, + 4: { acc: 2, desc: "Chronos Hepteract:" }, + 5: { acc: 2, desc: "Achievement 262 Bonus:" }, + 6: { acc: 2, desc: "Achievement 263 Bonus:" }, + 7: { acc: 2, desc: "Platonic Omega:" }, + 8: { acc: 2, desc: "Challenge 15 Reward:" }, + 9: { acc: 2, desc: "Cookie Upgrade 9:" }, + 10: { acc: 2, desc: "Intermediate Pack:" }, + 11: { acc: 2, desc: "Chronometer Z:" }, + 12: { acc: 2, desc: "Abstract Photokinetics:" }, + 13: { acc: 2, desc: "Abstract Exokinetics:" }, + 14: { acc: 2, desc: "Event:" }, + 15: { acc: 2, desc: "Ascension Speedup 2 [GQ]:" }, + 16: { acc: 2, desc: "Chronometer INF:" }, + 17: { acc: 2, desc: "Limited Ascensions Penalty:" }, + 18: { acc: 2, desc: "Limited Ascensions Reward:" }, + 19: { acc: 2, desc: "Ascension Speedup [GQ]:" }, + 20: { acc: 2, desc: "Singularity Penalty:" }, + }; for (let i = 0; i < arr.list.length; i++) { - const statASMi = DOMCacheGetOrSet(`statASM${i + 1}`) - statASMi.childNodes[0].textContent = map7[i + 1].desc - DOMCacheGetOrSet(`sASM${i + 1}`).textContent = `x${format(arr.list[i], map7[i + 1].acc, true)}` + const statASMi = DOMCacheGetOrSet(`statASM${i + 1}`); + statASMi.childNodes[0].textContent = map7[i + 1].desc; + DOMCacheGetOrSet(`sASM${i + 1}`).textContent = `x${format( + arr.list[i], + map7[i + 1].acc, + true + )}`; } - DOMCacheGetOrSet('sASMT').textContent = `x${format(arr.mult, 3)}` -} + DOMCacheGetOrSet("sASMT").textContent = `x${format(arr.mult, 3)}`; +}; export const loadStatisticsGoldenQuarkMultipliers = () => { - const arr = calculateGoldenQuarkMultiplier() + const arr = calculateGoldenQuarkMultiplier(); const map: Record = { - 1: { acc: 2, desc: 'Challenge 15 Exponent:' }, - 2: { acc: 2, desc: 'Patreon Bonus:' }, - 3: { acc: 2, desc: 'Golden Quarks I:' }, - 4: { acc: 2, desc: 'Cookie Upgrade 19:' }, - 5: { acc: 2, desc: 'No Singularity Upgrades:' }, - 6: { acc: 2, desc: 'Event:' }, - 7: { acc: 2, desc: 'Singularity Fast Forwards:' }, - 8: { acc: 2, desc: 'Golden Revolution II:' }, - 9: { acc: 2, desc: 'Immaculate Alchemy:' }, - 10: { acc: 2, desc: 'Total Quarks Coefficient:' } - } + 1: { acc: 2, desc: "Challenge 15 Exponent:" }, + 2: { acc: 2, desc: "Patreon Bonus:" }, + 3: { acc: 2, desc: "Golden Quarks I:" }, + 4: { acc: 2, desc: "Cookie Upgrade 19:" }, + 5: { acc: 2, desc: "No Singularity Upgrades:" }, + 6: { acc: 2, desc: "Event:" }, + 7: { acc: 2, desc: "Singularity Fast Forwards:" }, + 8: { acc: 2, desc: "Golden Revolution II:" }, + 9: { acc: 2, desc: "Immaculate Alchemy:" }, + 10: { acc: 2, desc: "Total Quarks Coefficient:" }, + }; for (let i = 0; i < arr.list.length; i++) { - const statGQMi = DOMCacheGetOrSet(`statGQMS${i + 1}`) - statGQMi.childNodes[0].textContent = map[i + 1].desc - DOMCacheGetOrSet(`sGQMS${i + 1}`).textContent = `x${format(arr.list[i], map[i + 1].acc, true)}` + const statGQMi = DOMCacheGetOrSet(`statGQMS${i + 1}`); + statGQMi.childNodes[0].textContent = map[i + 1].desc; + DOMCacheGetOrSet(`sGQMS${i + 1}`).textContent = `x${format( + arr.list[i], + map[i + 1].acc, + true + )}`; } - DOMCacheGetOrSet('sGQMST').textContent = `x${format(arr.mult, 3)}` -} + DOMCacheGetOrSet("sGQMST").textContent = `x${format(arr.mult, 3)}`; +}; export const loadAddCodeModifiersAndEffects = () => { - const intervalStats = addCodeInterval() - const capacityStats = addCodeMaxUses() - const availableCount = addCodeAvailableUses() - const timeToNext = addCodeTimeToNextUse() + const intervalStats = addCodeInterval(); + const capacityStats = addCodeMaxUses(); + const availableCount = addCodeAvailableUses(); + const timeToNext = addCodeTimeToNextUse(); // Add interval stats const intervalMap: Record = { - 1: { acc: 0, desc: 'Base:' }, - 2: { acc: 2, desc: 'PL-AT δ calculator:' }, - 3: { acc: 2, desc: 'PL-AT Σ sing perk:' }, - 4: { acc: 2, desc: 'Ascension of Ant God:' }, - 5: { acc: 2, desc: 'Singularity factor:' } - } - intervalStats.list[0] /= 1000 // is originally in milliseconds, but players will expect it in seconds. + 1: { acc: 0, desc: "Base:" }, + 2: { acc: 2, desc: "PL-AT δ calculator:" }, + 3: { acc: 2, desc: "PL-AT Σ sing perk:" }, + 4: { acc: 2, desc: "Ascension of Ant God:" }, + 5: { acc: 2, desc: "Singularity factor:" }, + }; + intervalStats.list[0] /= 1000; // is originally in milliseconds, but players will expect it in seconds. for (let i = 0; i < intervalStats.list.length; i++) { - const statAddIntervalI = DOMCacheGetOrSet(`stat+time${i + 1}`) - statAddIntervalI.childNodes[0].textContent = intervalMap[i + 1].desc + const statAddIntervalI = DOMCacheGetOrSet(`stat+time${i + 1}`); + statAddIntervalI.childNodes[0].textContent = intervalMap[i + 1].desc; if (i === 0) { - DOMCacheGetOrSet(`s+time${i + 1}`).textContent = `${ - format(intervalStats.list[i], intervalMap[i + 1].acc, true) - } sec` + DOMCacheGetOrSet(`s+time${i + 1}`).textContent = `${format( + intervalStats.list[i], + intervalMap[i + 1].acc, + true + )} sec`; } else { - DOMCacheGetOrSet(`s+time${i + 1}`).textContent = `x${format(intervalStats.list[i], intervalMap[i + 1].acc, true)}` + DOMCacheGetOrSet(`s+time${i + 1}`).textContent = `x${format( + intervalStats.list[i], + intervalMap[i + 1].acc, + true + )}`; } } - DOMCacheGetOrSet('s+timeT').textContent = `${format(intervalStats.time / 1000, 1)} sec` + DOMCacheGetOrSet("s+timeT").textContent = `${format( + intervalStats.time / 1000, + 1 + )} sec`; if (availableCount !== capacityStats.total) { - DOMCacheGetOrSet('s+next').textContent = `+1 in ${format(timeToNext, 1)} sec` // is already in sec. + DOMCacheGetOrSet("s+next").textContent = `+1 in ${format( + timeToNext, + 1 + )} sec`; // is already in sec. } else { - DOMCacheGetOrSet('s+next').textContent = '' + DOMCacheGetOrSet("s+next").textContent = ""; } // Add capacity stats const capacityMap: Record = { - 1: { acc: 0, desc: 'Base:' }, - 2: { acc: 0, desc: 'PL-AT X:' }, - 3: { acc: 0, desc: 'PL-AT δ:' }, - 4: { acc: 0, desc: 'PL-AT Γ:' }, - 5: { acc: 0, desc: 'PL-AT _:' }, - 6: { acc: 3, desc: 'Singularity factor:' } - } + 1: { acc: 0, desc: "Base:" }, + 2: { acc: 0, desc: "PL-AT X:" }, + 3: { acc: 0, desc: "PL-AT δ:" }, + 4: { acc: 0, desc: "PL-AT Γ:" }, + 5: { acc: 0, desc: "PL-AT _:" }, + 6: { acc: 3, desc: "Singularity factor:" }, + }; for (let i = 0; i < capacityStats.list.length; i++) { - const statAddIntervalI = DOMCacheGetOrSet(`stat+cap${i + 1}`) - statAddIntervalI.childNodes[0].textContent = capacityMap[i + 1].desc - const prefix = i === 0 ? '' : (i === 5 ? 'x' : '+') - DOMCacheGetOrSet(`s+cap${i + 1}`).textContent = `${prefix}${ - format(capacityStats.list[i], capacityMap[i + 1].acc, true) - }` + const statAddIntervalI = DOMCacheGetOrSet(`stat+cap${i + 1}`); + statAddIntervalI.childNodes[0].textContent = capacityMap[i + 1].desc; + const prefix = i === 0 ? "" : i === 5 ? "x" : "+"; + DOMCacheGetOrSet(`s+cap${i + 1}`).textContent = `${prefix}${format( + capacityStats.list[i], + capacityMap[i + 1].acc, + true + )}`; } - DOMCacheGetOrSet('s+capT').textContent = `${format(availableCount, 0)} / ${format(capacityStats.total, 0)}` + DOMCacheGetOrSet("s+capT").textContent = `${format( + availableCount, + 0 + )} / ${format(capacityStats.total, 0)}`; // TODO: we also want to report on the effects of each add. - const addEffectStats = addCodeBonuses() + const addEffectStats = addCodeBonuses(); // Quark Bonus Rate; the bonus is typically applied when actually given to the player, rather than calculated before. - const qbr = player.worlds.applyBonus(1) + const qbr = player.worlds.applyBonus(1); - DOMCacheGetOrSet('stat+eff1').childNodes[0].textContent = 'Quarks: ' - if (Math.abs(addEffectStats.maxQuarks - addEffectStats.minQuarks) >= 0.5) { // b/c floating-point errors - DOMCacheGetOrSet('s+eff1').textContent = `+${format(qbr * addEffectStats.minQuarks, 3)} ~ ${ - format(qbr * addEffectStats.maxQuarks, 3) - }` + DOMCacheGetOrSet("stat+eff1").childNodes[0].textContent = "Quarks: "; + if (Math.abs(addEffectStats.maxQuarks - addEffectStats.minQuarks) >= 0.5) { + // b/c floating-point errors + DOMCacheGetOrSet("s+eff1").textContent = `+${format( + qbr * addEffectStats.minQuarks, + 3 + )} ~ ${format(qbr * addEffectStats.maxQuarks, 3)}`; } else { - DOMCacheGetOrSet('s+eff1').textContent = `+${format(qbr * addEffectStats.quarks, 3)}` + DOMCacheGetOrSet("s+eff1").textContent = `+${format( + qbr * addEffectStats.quarks, + 3 + )}`; } - DOMCacheGetOrSet('stat+eff2').childNodes[0].textContent = 'PL-AT X - bonus ascension time: ' - DOMCacheGetOrSet('s+eff2').textContent = `+${format(addEffectStats.ascensionTimer, 2)} sec` + DOMCacheGetOrSet("stat+eff2").childNodes[0].textContent = + "PL-AT X - bonus ascension time: "; + DOMCacheGetOrSet("s+eff2").textContent = `+${format( + addEffectStats.ascensionTimer, + 2 + )} sec`; - DOMCacheGetOrSet('stat+eff3').childNodes[0].textContent = 'PL-AT Γ - bonus GQ export time: ' - DOMCacheGetOrSet('s+eff3').textContent = `+${format(addEffectStats.gqTimer, 2)} sec` // does it need a / 1000? + DOMCacheGetOrSet("stat+eff3").childNodes[0].textContent = + "PL-AT Γ - bonus GQ export time: "; + DOMCacheGetOrSet("s+eff3").textContent = `+${format( + addEffectStats.gqTimer, + 2 + )} sec`; // does it need a / 1000? - DOMCacheGetOrSet('stat+eff4').childNodes[0].textContent = 'PL-AT _ - bonus octeract time: ' - DOMCacheGetOrSet('s+eff4').textContent = `+${format(addEffectStats.octeractTime, 2)} sec` // does it need a / 1000? + DOMCacheGetOrSet("stat+eff4").childNodes[0].textContent = + "PL-AT _ - bonus octeract time: "; + DOMCacheGetOrSet("s+eff4").textContent = `+${format( + addEffectStats.octeractTime, + 2 + )} sec`; // does it need a / 1000? // Might be worth converting to raw octeracts awarded. I don't have the calculator needed to test it, though. -} +}; export const loadStatisticsAmbrosiaLuck = () => { - const arr = player.caches.ambrosiaLuck.flatten() + const arr = player.caches.ambrosiaLuck.flatten(); const map: Record = { - 1: { acc: 0, desc: 'Irish Ants Singularity Perk' }, - 2: { acc: 1, desc: 'Shop Upgrade Bonus' }, - 3: { acc: 0, desc: 'Singularity Ambrosia Luck Upgrades' }, - 4: { acc: 0, desc: 'Octeract Ambrosia Luck Upgrades' }, - 5: { acc: 0, desc: 'Ambrosia Luck Module I' }, - 6: { acc: 1, desc: 'Ambrosia Luck Module II' }, - 7: { acc: 2, desc: 'Ambrosia Cube-Luck Hybrid Module I' }, - 8: { acc: 2, desc: 'Ambrosia Quark-Luck Hybrid Module I' }, - 9: { acc: 1, desc: 'Event Bonus' } - } + 1: { acc: 0, desc: "Irish Ants Singularity Perk" }, + 2: { acc: 1, desc: "Shop Upgrade Bonus" }, + 3: { acc: 0, desc: "Singularity Ambrosia Luck Upgrades" }, + 4: { acc: 0, desc: "Octeract Ambrosia Luck Upgrades" }, + 5: { acc: 0, desc: "Ambrosia Luck Module I" }, + 6: { acc: 1, desc: "Ambrosia Luck Module II" }, + 7: { acc: 2, desc: "Ambrosia Cube-Luck Hybrid Module I" }, + 8: { acc: 2, desc: "Ambrosia Quark-Luck Hybrid Module I" }, + 9: { acc: 1, desc: "Event Bonus" }, + }; for (let i = 0; i < arr.length - 1; i++) { - const statALuckMi = DOMCacheGetOrSet(`statALuckM${i + 1}`) - statALuckMi.childNodes[0].textContent = map[i + 1].desc - DOMCacheGetOrSet(`sALuckM${i + 1}`).textContent = `+${format(arr[i], map[i + 1].acc, true)}` + const statALuckMi = DOMCacheGetOrSet(`statALuckM${i + 1}`); + statALuckMi.childNodes[0].textContent = map[i + 1].desc; + DOMCacheGetOrSet(`sALuckM${i + 1}`).textContent = `+${format( + arr[i], + map[i + 1].acc, + true + )}`; } - const totalVal = arr[arr.length - 1] - DOMCacheGetOrSet('sALuckMT').innerHTML = `☘ ${format(totalVal, 0)}` -} + const totalVal = arr[arr.length - 1]; + DOMCacheGetOrSet("sALuckMT").innerHTML = `☘ ${format(totalVal, 0)}`; +}; export const loadStatisticsAmbrosiaGeneration = () => { - const arr = player.caches.ambrosiaGeneration.flatten() + const arr = player.caches.ambrosiaGeneration.flatten(); const map: Record = { - 1: { acc: 4, desc: 'Visited Ambrosia Subtab' }, - 2: { acc: 4, desc: 'Number of Blueberries' }, - 3: { acc: 4, desc: 'Shop Upgrade Bonus' }, - 4: { acc: 4, desc: 'Singularity Ambrosia Generation Upgrades' }, - 5: { acc: 4, desc: 'Octeract Ambrosia Generation Upgrades' }, - 6: { acc: 4, desc: 'Patreon Bonus' }, - 7: { acc: 4, desc: 'Event Bonus' } - } + 1: { acc: 4, desc: "Visited Ambrosia Subtab" }, + 2: { acc: 4, desc: "Number of Blueberries" }, + 3: { acc: 4, desc: "Shop Upgrade Bonus" }, + 4: { acc: 4, desc: "Singularity Ambrosia Generation Upgrades" }, + 5: { acc: 4, desc: "Octeract Ambrosia Generation Upgrades" }, + 6: { acc: 4, desc: "Patreon Bonus" }, + 7: { acc: 4, desc: "Event Bonus" }, + }; for (let i = 0; i < arr.length - 1; i++) { - const statAGenMi = DOMCacheGetOrSet(`statAGenM${i + 1}`) - statAGenMi.childNodes[0].textContent = map[i + 1].desc - DOMCacheGetOrSet(`sAGenM${i + 1}`).textContent = `x${format(arr[i], map[i + 1].acc, true)}` + const statAGenMi = DOMCacheGetOrSet(`statAGenM${i + 1}`); + statAGenMi.childNodes[0].textContent = map[i + 1].desc; + DOMCacheGetOrSet(`sAGenM${i + 1}`).textContent = `x${format( + arr[i], + map[i + 1].acc, + true + )}`; } - const totalVal = arr[arr.length - 1] - DOMCacheGetOrSet('sAGenMT').textContent = `${format(totalVal, 3, true)}` -} + const totalVal = arr[arr.length - 1]; + DOMCacheGetOrSet("sAGenMT").textContent = `${format(totalVal, 3, true)}`; +}; export const c15RewardUpdate = () => { // dprint-ignore - const exponentRequirements = [750, 1.5e3, 3e3, 5e3, 7.5e3, 7.5e3, 1e4, 1e4, 2e4, 4e4, 6e4, 1e5, 1e5, 2e5, 5e5, 1e6, 3e6, 1e7, 3e7, 1e8, 5e8, 2e9, 1e10, 1e11, 1e15, 2e15, 4e15, 7e15, 1e16, 2e16, 3.33e16, 3.33e16, 3.33e16, 2e17, 1.5e18] - type Key = keyof GlobalVariables['challenge15Rewards'] - const keys = Object.keys(G.challenge15Rewards) as Key[] - const e = player.challenge15Exponent + const exponentRequirements = [ + 750, 1.5e3, 3e3, 5e3, 7.5e3, 7.5e3, 1e4, 1e4, 2e4, 4e4, 6e4, 1e5, 1e5, 2e5, + 5e5, 1e6, 3e6, 1e7, 3e7, 1e8, 5e8, 2e9, 1e10, 1e11, 1e15, 2e15, 4e15, 7e15, + 1e16, 2e16, 3.33e16, 3.33e16, 3.33e16, 2e17, 1.5e18, + ]; + type Key = keyof GlobalVariables["challenge15Rewards"]; + const keys = Object.keys(G.challenge15Rewards) as Key[]; + const e = player.challenge15Exponent; for (const obj in G.challenge15Rewards) { - G.challenge15Rewards[obj as Key] = 1 + G.challenge15Rewards[obj as Key] = 1; } - G.challenge15Rewards.freeOrbs = 0 + G.challenge15Rewards.freeOrbs = 0; if (e >= exponentRequirements[0]) { // All Cube Types 1 [750] - G.challenge15Rewards[keys[0]] = 1 + 1 / 50 * Math.log(e / 175) / Math.log(2) + G.challenge15Rewards[keys[0]] = + 1 + ((1 / 50) * Math.log(e / 175)) / Math.log(2); } if (e >= exponentRequirements[1]) { // Ascension Count [1500] - G.challenge15Rewards[keys[1]] = 1 + 1 / 20 * Math.log(e / 375) / Math.log(2) + G.challenge15Rewards[keys[1]] = + 1 + ((1 / 20) * Math.log(e / 375)) / Math.log(2); } if (e >= exponentRequirements[2]) { // Coin Exponent [3000] - G.challenge15Rewards[keys[2]] = 1 + 1 / 150 * Math.log(e / 750) / Math.log(2) + G.challenge15Rewards[keys[2]] = + 1 + ((1 / 150) * Math.log(e / 750)) / Math.log(2); } if (e >= exponentRequirements[3]) { // Taxes [5000] - G.challenge15Rewards[keys[3]] = Math.pow(0.98, Math.log(e / 1.25e3) / Math.log(2)) + G.challenge15Rewards[keys[3]] = Math.pow( + 0.98, + Math.log(e / 1.25e3) / Math.log(2) + ); } if (e >= exponentRequirements[4]) { // Obtainium [7500] - G.challenge15Rewards[keys[4]] = 1 + 1 / 5 * Math.pow(e / 7.5e3, 0.75) + G.challenge15Rewards[keys[4]] = 1 + (1 / 5) * Math.pow(e / 7.5e3, 0.75); } if (e >= exponentRequirements[5]) { // Offerings [7500] - G.challenge15Rewards[keys[5]] = 1 + 1 / 5 * Math.pow(e / 7.5e3, 0.75) + G.challenge15Rewards[keys[5]] = 1 + (1 / 5) * Math.pow(e / 7.5e3, 0.75); } if (e >= exponentRequirements[6]) { // Accelerator Boost (Uncorruptable) [10000] - G.challenge15Rewards[keys[6]] = 1 + 1 / 20 * Math.log(e / 2.5e3) / Math.log(2) + G.challenge15Rewards[keys[6]] = + 1 + ((1 / 20) * Math.log(e / 2.5e3)) / Math.log(2); } if (e >= exponentRequirements[7]) { // Multiplier Boost (Uncorruptable) [10000] - G.challenge15Rewards[keys[7]] = 1 + 1 / 20 * Math.log(e / 2.5e3) / Math.log(2) + G.challenge15Rewards[keys[7]] = + 1 + ((1 / 20) * Math.log(e / 2.5e3)) / Math.log(2); } if (e >= exponentRequirements[8]) { // Rune EXP [20000] - G.challenge15Rewards[keys[8]] = 1 + Math.pow(e / 2e4, 1.5) + G.challenge15Rewards[keys[8]] = 1 + Math.pow(e / 2e4, 1.5); } if (e >= exponentRequirements[9]) { // Rune Effectiveness [40000] - G.challenge15Rewards[keys[9]] = 1 + 1 / 33 * Math.log(e / 1e4) / Math.log(2) + G.challenge15Rewards[keys[9]] = + 1 + ((1 / 33) * Math.log(e / 1e4)) / Math.log(2); } if (e >= exponentRequirements[10]) { // All Cube Types II [60000] - G.challenge15Rewards[keys[10]] = 1 + 1 / 100 * Math.log(e / 1.5e4) / Math.log(2) + G.challenge15Rewards[keys[10]] = + 1 + ((1 / 100) * Math.log(e / 1.5e4)) / Math.log(2); } if (e >= exponentRequirements[11]) { // Chal 1-5 Scaling [100000] - G.challenge15Rewards[keys[11]] = Math.pow(0.98, Math.log(e / 2.5e4) / Math.log(2)) + G.challenge15Rewards[keys[11]] = Math.pow( + 0.98, + Math.log(e / 2.5e4) / Math.log(2) + ); } if (e >= exponentRequirements[12]) { // Chal 6-10 Scaling [100000] - G.challenge15Rewards[keys[12]] = Math.pow(0.98, Math.log(e / 2.5e4) / Math.log(2)) + G.challenge15Rewards[keys[12]] = Math.pow( + 0.98, + Math.log(e / 2.5e4) / Math.log(2) + ); } if (e >= exponentRequirements[13]) { // Ant Speed [200k] - G.challenge15Rewards[keys[13]] = Math.pow(1 + Math.log(e / 2e5) / Math.log(2), 4) + G.challenge15Rewards[keys[13]] = Math.pow( + 1 + Math.log(e / 2e5) / Math.log(2), + 4 + ); } if (e >= exponentRequirements[14]) { // Ant Bonus Levels [500k] - G.challenge15Rewards[keys[14]] = 1 + 1 / 20 * Math.log(e / 1.5e5) / Math.log(2) + G.challenge15Rewards[keys[14]] = + 1 + ((1 / 20) * Math.log(e / 1.5e5)) / Math.log(2); } if (e >= exponentRequirements[15]) { // All Cube Types III [1m] - G.challenge15Rewards[keys[15]] = 1 + 1 / 150 * Math.log(e / 2.5e5) / Math.log(2) + G.challenge15Rewards[keys[15]] = + 1 + ((1 / 150) * Math.log(e / 2.5e5)) / Math.log(2); } if (e >= exponentRequirements[16]) { // Talisman Effectiveness [3m] - G.challenge15Rewards[keys[16]] = 1 + 1 / 20 * Math.log(e / 7.5e5) / Math.log(2) + G.challenge15Rewards[keys[16]] = + 1 + ((1 / 20) * Math.log(e / 7.5e5)) / Math.log(2); } if (e >= exponentRequirements[17]) { // Global Speed [10m] - G.challenge15Rewards[keys[17]] = 1 + 1 / 20 * Math.log(e / 2.5e6) / Math.log(2) + G.challenge15Rewards[keys[17]] = + 1 + ((1 / 20) * Math.log(e / 2.5e6)) / Math.log(2); } if (e >= exponentRequirements[18]) { // Blessing Effectiveness [30m] - G.challenge15Rewards[keys[18]] = 1 + 1 / 5 * Math.pow(e / 3e7, 1 / 4) + G.challenge15Rewards[keys[18]] = 1 + (1 / 5) * Math.pow(e / 3e7, 1 / 4); } if (e >= exponentRequirements[19]) { // Tesseract Building Speed [100m] - G.challenge15Rewards[keys[19]] = 1 + 1 / 5 * Math.pow(e / 1e8, 2 / 3) + G.challenge15Rewards[keys[19]] = 1 + (1 / 5) * Math.pow(e / 1e8, 2 / 3); } if (e >= exponentRequirements[20]) { // All Cube Types IV [500m] - G.challenge15Rewards[keys[20]] = 1 + 1 / 200 * Math.log(e / 1.25e8) / Math.log(2) + G.challenge15Rewards[keys[20]] = + 1 + ((1 / 200) * Math.log(e / 1.25e8)) / Math.log(2); } if (e >= exponentRequirements[21]) { // Spirit Effectiveness [2b] - G.challenge15Rewards[keys[21]] = 1 + 1 / 5 * Math.pow(e / 2e9, 1 / 4) + G.challenge15Rewards[keys[21]] = 1 + (1 / 5) * Math.pow(e / 2e9, 1 / 4); } if (e >= exponentRequirements[22]) { // Ascension Score [10b] - G.challenge15Rewards[keys[22]] = 1 + 1 / 4 * Math.pow(e / 1e10, 1 / 4) + G.challenge15Rewards[keys[22]] = 1 + (1 / 4) * Math.pow(e / 1e10, 1 / 4); if (e >= 1e20) { - G.challenge15Rewards[keys[22]] = 1 + 1 / 4 * Math.pow(e / 1e10, 1 / 8) * Math.pow(1e10, 1 / 8) + G.challenge15Rewards[keys[22]] = + 1 + (1 / 4) * Math.pow(e / 1e10, 1 / 8) * Math.pow(1e10, 1 / 8); } } if (e >= exponentRequirements[23]) { // Quark Gain [100b] - G.challenge15Rewards[keys[23]] = 1 + 1 / 100 * Math.log(e * 32 / 1e11) / Math.log(2) + G.challenge15Rewards[keys[23]] = + 1 + ((1 / 100) * Math.log((e * 32) / 1e11)) / Math.log(2); } if (e >= exponentRequirements[24]) { // Unlock Hepteract gain [1Qa] - G.challenge15Rewards[keys[24]] = 2 + G.challenge15Rewards[keys[24]] = 2; } if (e >= exponentRequirements[25]) { // Unlock Challenge hepteract [2Qa] - void player.hepteractCrafts.challenge.unlock('the Hepteract of Challenge') + void player.hepteractCrafts.challenge.unlock("the Hepteract of Challenge"); } if (e >= exponentRequirements[26]) { // All Cube Types V [4Qa] - G.challenge15Rewards[keys[25]] = 1 + 1 / 300 * Math.log2(e / (4e15 / 1024)) + G.challenge15Rewards[keys[25]] = + 1 + (1 / 300) * Math.log2(e / (4e15 / 1024)); } if (e >= exponentRequirements[27]) { // Powder Gain [7Qa] - G.challenge15Rewards[keys[26]] = 1 + 1 / 50 * Math.log2(e / (7e15 / 32)) + G.challenge15Rewards[keys[26]] = 1 + (1 / 50) * Math.log2(e / (7e15 / 32)); } if (e >= exponentRequirements[28]) { // Unlock Abyss Hepteract [10Qa] - void player.hepteractCrafts.abyss.unlock('the Hepteract of the Abyss') + void player.hepteractCrafts.abyss.unlock("the Hepteract of the Abyss"); } if (e >= exponentRequirements[29]) { // Constant Upgrade 2 [20Qa] - G.challenge15Rewards[keys[27]] = calculateSigmoid(1.05, e, 1e18) + G.challenge15Rewards[keys[27]] = calculateSigmoid(1.05, e, 1e18); } if (e >= exponentRequirements[30]) { // Unlock ACCELERATOR HEPT [33.33Qa] - void player.hepteractCrafts.accelerator.unlock('the Hepteract of Way Too Many Accelerators') + void player.hepteractCrafts.accelerator.unlock( + "the Hepteract of Way Too Many Accelerators" + ); } if (e >= exponentRequirements[31]) { // Unlock ACCELERATOR BOOST HEPT [33.33Qa] - void player.hepteractCrafts.acceleratorBoost.unlock('the Hepteract of Way Too Many Accelerator Boosts') + void player.hepteractCrafts.acceleratorBoost.unlock( + "the Hepteract of Way Too Many Accelerator Boosts" + ); } if (e >= exponentRequirements[32]) { // Unlock MULTIPLIER Hept [33.33Qa] - void player.hepteractCrafts.multiplier.unlock('the Hepteract of Way Too Many Multipliers') + void player.hepteractCrafts.multiplier.unlock( + "the Hepteract of Way Too Many Multipliers" + ); } if (e >= exponentRequirements[33]) { // FREE Daily Orbs - G.challenge15Rewards.freeOrbs = Math.floor(200 * Math.pow(e / 2e17, 0.5)) + G.challenge15Rewards.freeOrbs = Math.floor(200 * Math.pow(e / 2e17, 0.5)); } if (e >= exponentRequirements[34]) { // Ascension Speed - G.challenge15Rewards.ascensionSpeed = 1 + 5 / 100 + 2 * Math.log2(e / 1.5e18) / 100 + G.challenge15Rewards.ascensionSpeed = + 1 + 5 / 100 + (2 * Math.log2(e / 1.5e18)) / 100; } - updateDisplayC15Rewards() -} + updateDisplayC15Rewards(); +}; const updateDisplayC15Rewards = () => { - DOMCacheGetOrSet('c15Reward0Num').textContent = format(player.challenge15Exponent, 3, true) - DOMCacheGetOrSet('c15RequiredExponentNum').textContent = format( + DOMCacheGetOrSet("c15Reward0Num").textContent = format( + player.challenge15Exponent, + 3, + true + ); + DOMCacheGetOrSet("c15RequiredExponentNum").textContent = format( Decimal.pow(10, player.challenge15Exponent / challenge15ScoreMultiplier()), 0, true - ) + ); // dprint-ignore - const exponentRequirements = [750, 1.5e3, 3e3, 5e3, 7.5e3, 7.5e3, 1e4, 1e4, 2e4, 4e4, 6e4, 1e5, 1e5, 2e5, 5e5, 1e6, 3e6, 1e7, 3e7, 1e8, 5e8, 2e9, 1e10, 1e11, 1e15, 2e15, 4e15, 7e15, 1e16, 2e16, 3.33e16, 3.33e16, 3.33e16, 2e17, 1.5e18] - const isNum: Record = { // Shit solution to a shit problem -Platonic + const exponentRequirements = [ + 750, 1.5e3, 3e3, 5e3, 7.5e3, 7.5e3, 1e4, 1e4, 2e4, 4e4, 6e4, 1e5, 1e5, 2e5, + 5e5, 1e6, 3e6, 1e7, 3e7, 1e8, 5e8, 2e9, 1e10, 1e11, 1e15, 2e15, 4e15, 7e15, + 1e16, 2e16, 3.33e16, 3.33e16, 3.33e16, 2e17, 1.5e18, + ]; + const isNum: Record = { + // Shit solution to a shit problem -Platonic 0: true, 1: true, 2: true, @@ -994,220 +1384,247 @@ const updateDisplayC15Rewards = () => { 31: false, 32: false, 33: true, - 34: true - } - const values = Object.values(G.challenge15Rewards) - let keepExponent: string | number = 'None' - let skip = 0 + 34: true, + }; + const values = Object.values(G.challenge15Rewards); + let keepExponent: string | number = "None"; + let skip = 0; for (let i = 0; i < exponentRequirements.length; i++) { - if (keepExponent === 'None' && player.challenge15Exponent < exponentRequirements[i]) { - keepExponent = exponentRequirements[i] + if ( + keepExponent === "None" && + player.challenge15Exponent < exponentRequirements[i] + ) { + keepExponent = exponentRequirements[i]; } if (player.challenge15Exponent >= exponentRequirements[i]) { - DOMCacheGetOrSet(`c15Reward${i + 1}Num`).textContent = (isNum[i]) + DOMCacheGetOrSet(`c15Reward${i + 1}Num`).textContent = isNum[i] ? format(100 * values[i - skip] - 100, 2, true) - : 'Unlocked!' + : "Unlocked!"; - if (!isNum[i] && i !== 24) { // TODO: This sucks -Platonic - skip += 1 + if (!isNum[i] && i !== 24) { + // TODO: This sucks -Platonic + skip += 1; } if (i === 33) { - DOMCacheGetOrSet('c15Reward34Num').textContent = format(values[i - skip], 0, true) + DOMCacheGetOrSet("c15Reward34Num").textContent = format( + values[i - skip], + 0, + true + ); } } - DOMCacheGetOrSet(`c15Reward${i + 1}`).style.display = (player.challenge15Exponent >= exponentRequirements[i]) - ? 'block' - : 'none' - DOMCacheGetOrSet('c15RewardList').textContent = typeof keepExponent === 'string' - ? 'You have unlocked all reward types from Challenge 15!' - : `Next reward type requires ${format(keepExponent, 0, true)} exponent.` - } -} + DOMCacheGetOrSet(`c15Reward${i + 1}`).style.display = + player.challenge15Exponent >= exponentRequirements[i] ? "block" : "none"; + DOMCacheGetOrSet("c15RewardList").textContent = + typeof keepExponent === "string" + ? "You have unlocked all reward types from Challenge 15!" + : `Next reward type requires ${format( + keepExponent, + 0, + true + )} exponent.`; + } +}; interface Stage { - stage: number - tier: number - name: string - unlocked: boolean - reset: boolean + stage: number; + tier: number; + name: string; + unlocked: boolean; + reset: boolean; } export const gameStages = (): Stage[] => { const stages: Stage[] = [ - { stage: 0, tier: 1, name: 'start', unlocked: true, reset: true }, - { stage: 1, tier: 1, name: 'start-prestige', unlocked: player.unlocks.prestige, reset: player.unlocks.prestige }, + { stage: 0, tier: 1, name: "start", unlocked: true, reset: true }, + { + stage: 1, + tier: 1, + name: "start-prestige", + unlocked: player.unlocks.prestige, + reset: player.unlocks.prestige, + }, { stage: 2, tier: 2, - name: 'prestige-transcend', + name: "prestige-transcend", unlocked: player.unlocks.transcend, - reset: player.unlocks.transcend + reset: player.unlocks.transcend, }, { stage: 3, tier: 3, - name: 'transcend-reincarnate', + name: "transcend-reincarnate", unlocked: player.unlocks.reincarnate, - reset: player.unlocks.reincarnate + reset: player.unlocks.reincarnate, }, { stage: 4, tier: 4, - name: 'reincarnate-ant', + name: "reincarnate-ant", unlocked: player.firstOwnedAnts !== 0, - reset: player.unlocks.reincarnate + reset: player.unlocks.reincarnate, }, { stage: 5, tier: 4, - name: 'ant-sacrifice', + name: "ant-sacrifice", unlocked: player.achievements[173] === 1, - reset: player.unlocks.reincarnate + reset: player.unlocks.reincarnate, }, { stage: 6, tier: 4, - name: 'sacrifice-ascension', + name: "sacrifice-ascension", unlocked: player.achievements[183] === 1, - reset: player.unlocks.reincarnate + reset: player.unlocks.reincarnate, }, { stage: 7, tier: 5, - name: 'ascension-challenge10', + name: "ascension-challenge10", unlocked: player.ascensionCount > 1, - reset: player.achievements[183] === 1 + reset: player.achievements[183] === 1, }, { stage: 8, tier: 5, - name: 'challenge10-challenge11', + name: "challenge10-challenge11", unlocked: player.achievements[197] === 1, - reset: player.achievements[183] === 1 + reset: player.achievements[183] === 1, }, { stage: 9, tier: 5, - name: 'challenge11-challenge12', + name: "challenge11-challenge12", unlocked: player.achievements[204] === 1, - reset: player.achievements[183] === 1 + reset: player.achievements[183] === 1, }, { stage: 10, tier: 5, - name: 'challenge12-challenge13', + name: "challenge12-challenge13", unlocked: player.achievements[211] === 1, - reset: player.achievements[183] === 1 + reset: player.achievements[183] === 1, }, { stage: 11, tier: 5, - name: 'challenge13-challenge14', + name: "challenge13-challenge14", unlocked: player.achievements[218] === 1, - reset: player.achievements[183] === 1 + reset: player.achievements[183] === 1, }, { stage: 12, tier: 5, - name: 'challenge14-w5x10max', + name: "challenge14-w5x10max", unlocked: player.cubeUpgrades[50] >= 100000, - reset: player.achievements[183] === 1 + reset: player.achievements[183] === 1, }, { stage: 13, tier: 5, - name: 'w5x10max-alpha', + name: "w5x10max-alpha", unlocked: player.platonicUpgrades[5] > 0, - reset: player.achievements[183] === 1 + reset: player.achievements[183] === 1, }, { stage: 14, tier: 5, - name: 'alpha-p2x1x10', + name: "alpha-p2x1x10", unlocked: player.platonicUpgrades[6] >= 10, - reset: player.achievements[183] === 1 + reset: player.achievements[183] === 1, }, { stage: 15, tier: 5, - name: 'p2x1x10-p3x1', + name: "p2x1x10-p3x1", unlocked: player.platonicUpgrades[11] > 0, - reset: player.achievements[183] === 1 + reset: player.achievements[183] === 1, }, { stage: 16, tier: 5, - name: 'p3x1-beta', + name: "p3x1-beta", unlocked: player.platonicUpgrades[10] > 0, - reset: player.achievements[183] === 1 + reset: player.achievements[183] === 1, }, { stage: 17, tier: 5, - name: 'beta-1e15-expo', + name: "beta-1e15-expo", unlocked: player.challenge15Exponent >= 1e15, - reset: player.achievements[183] === 1 + reset: player.achievements[183] === 1, }, { stage: 18, tier: 5, - name: '1e15-expo-omega', + name: "1e15-expo-omega", unlocked: player.platonicUpgrades[15] > 0, - reset: player.achievements[183] === 1 + reset: player.achievements[183] === 1, }, { stage: 19, tier: 5, - name: 'omega-singularity', + name: "omega-singularity", unlocked: player.singularityCount > 0 && player.runelevels[6] > 0, - reset: player.achievements[183] === 1 + reset: player.achievements[183] === 1, }, { stage: 20, tier: 6, - name: 'singularity-exalt1x1', - unlocked: player.singularityChallenges.noSingularityUpgrades.completions > 0, - reset: player.highestSingularityCount > 0 + name: "singularity-exalt1x1", + unlocked: + player.singularityChallenges.noSingularityUpgrades.completions > 0, + reset: player.highestSingularityCount > 0, }, { stage: 21, tier: 6, - name: 'exalt1x1-onemind', + name: "exalt1x1-onemind", unlocked: player.singularityUpgrades.oneMind.level > 0, - reset: player.highestSingularityCount > 0 + reset: player.highestSingularityCount > 0, }, { stage: 22, tier: 6, - name: 'onemind-end', + name: "onemind-end", unlocked: player.singularityUpgrades.offeringAutomatic.level > 0, - reset: player.highestSingularityCount > 0 + reset: player.highestSingularityCount > 0, }, { stage: 23, tier: 6, - name: 'end-pen', + name: "end-pen", unlocked: player.singularityUpgrades.ultimatePen.level > 0, - reset: player.highestSingularityCount > 0 + reset: player.highestSingularityCount > 0, }, - { stage: 24, tier: 6, name: 'pen', unlocked: false, reset: player.highestSingularityCount > 0 } - ] - return stages -} + { + stage: 24, + tier: 6, + name: "pen", + unlocked: false, + reset: player.highestSingularityCount > 0, + }, + ]; + return stages; +}; // Calculate which progress in the game you are playing // The progress displayed is based on Progression Chat and Questions // This will be used to determine the behavior of the profile of the autopilot function in the future -export const synergismStage = (skipTier = player.singularityCount > 0 ? 5 : 0): string => { - const stages = gameStages() +export const synergismStage = ( + skipTier = player.singularityCount > 0 ? 5 : 0 +): string => { + const stages = gameStages(); for (let i = 0; i < stages.length; i++) { - const stage = stages[i] + const stage = stages[i]; if (skipTier < stage.tier && (!stage.reset || !stage.unlocked)) { - return stage.name + return stage.name; } } - const stagesZero = stages[0] - return stagesZero.name -} + const stagesZero = stages[0]; + return stagesZero.name; +}; diff --git a/src/Synergism.ts b/src/Synergism.ts index c589e3973..840bacbd5 100644 --- a/src/Synergism.ts +++ b/src/Synergism.ts @@ -1,7 +1,7 @@ -import '@ungap/custom-elements' -import type { DecimalSource } from 'break_infinity.js' -import Decimal from 'break_infinity.js' -import LZString from 'lz-string' +import "@ungap/custom-elements"; +import type { DecimalSource } from "break_infinity.js"; +import Decimal from "break_infinity.js"; +import LZString from "lz-string"; import { autoAscensionChallengeSweepUnlock, @@ -13,21 +13,31 @@ import { getMaxChallenges, getNextChallenge, highestChallengeRewards, - runChallengeSweep -} from './Challenges' -import { btoa, cleanString, isDecimal, sortWithIndices, sumContents } from './Utility' -import { blankGlobals, Globals as G } from './Variables' + runChallengeSweep, +} from "./Challenges"; +import { + btoa, + cleanString, + isDecimal, + sortWithIndices, + sumContents, +} from "./Utility"; +import { blankGlobals, Globals as G } from "./Variables"; import { achievementaward, ascensionAchievementCheck, buildingAchievementCheck, challengeachievementcheck, - resetachievementcheck -} from './Achievements' -import { antSacrificePointsToMultiplier, autoBuyAnts, calculateCrumbToCoinExp } from './Ants' -import { autoUpgrades } from './Automation' -import type { TesseractBuildings } from './Buy' + resetachievementcheck, +} from "./Achievements"; +import { + antSacrificePointsToMultiplier, + autoBuyAnts, + calculateCrumbToCoinExp, +} from "./Ants"; +import { autoUpgrades } from "./Automation"; +import type { TesseractBuildings } from "./Buy"; import { boostAccelerator, buyAccelerator, @@ -39,8 +49,8 @@ import { buyTesseractBuilding, calculateTessBuildingsInBudget, getCost, - getReductionValue -} from './Buy' + getReductionValue, +} from "./Buy"; import { calculateAcceleratorMultiplier, calculateAnts, @@ -56,8 +66,8 @@ import { calculateTotalAcceleratorBoost, calculateTotalCoinOwned, dailyResetCheck, - exitOffline -} from './Calculate' + exitOffline, +} from "./Calculate"; import { corrChallengeMinimum, corruptionButtonsAdd, @@ -66,16 +76,20 @@ import { corruptionLoadoutTableUpdate, corruptionStatsUpdate, maxCorruptionLevel, - updateCorruptionLoadoutNames -} from './Corruptions' -import { updateCubeUpgradeBG } from './Cubes' -import { generateEventHandlers } from './EventListeners' -import { addTimers, automaticTools } from './Helper' -import { resetHistoryRenderAllTables } from './History' -import { calculateHypercubeBlessings } from './Hypercubes' -import { calculatePlatonicBlessings } from './PlatonicCubes' -import { buyResearch, maxRoombaResearchIndex, updateResearchBG } from './Research' -import { autoResearchEnabled } from './Research' + updateCorruptionLoadoutNames, +} from "./Corruptions"; +import { updateCubeUpgradeBG } from "./Cubes"; +import { generateEventHandlers } from "./EventListeners"; +import { addTimers, automaticTools } from "./Helper"; +import { resetHistoryRenderAllTables } from "./History"; +import { calculateHypercubeBlessings } from "./Hypercubes"; +import { calculatePlatonicBlessings } from "./PlatonicCubes"; +import { + buyResearch, + maxRoombaResearchIndex, + updateResearchBG, +} from "./Research"; +import { autoResearchEnabled } from "./Research"; import { reset, resetrepeat, @@ -84,20 +98,20 @@ import { updateAutoReset, updateSingularityAchievements, updateSingularityGlobalPerks, - updateTesseractAutoBuyAmount -} from './Reset' -import { redeemShards } from './Runes' -import { c15RewardUpdate } from './Statistics' + updateTesseractAutoBuyAmount, +} from "./Reset"; +import { redeemShards } from "./Runes"; +import { c15RewardUpdate } from "./Statistics"; import { buyTalismanEnhance, buyTalismanLevels, calculateMaxTalismanLevel, toggleTalismanBuy, updateTalismanAppearance, - updateTalismanInventory -} from './Talismans' -import { calculatetax } from './Tax' -import { calculateTesseractBlessings } from './Tesseracts' + updateTalismanInventory, +} from "./Talismans"; +import { calculatetax } from "./Tax"; +import { calculateTesseractBlessings } from "./Tesseracts"; import { autoCubeUpgradesToggle, autoPlatonicUpgradesToggle, @@ -110,9 +124,14 @@ import { toggleChallenges, toggleShops, updateAutoChallenge, - updateRuneBlessingBuyAmount -} from './Toggles' -import type { OneToFive, Player, resetNames, ZeroToFour } from './types/Synergism' + updateRuneBlessingBuyAmount, +} from "./Toggles"; +import type { + OneToFive, + Player, + resetNames, + ZeroToFour, +} from "./types/Synergism"; import { Alert, buttoncolorchange, @@ -124,25 +143,30 @@ import { showCorruptionStatsLoadouts, updateAchievementBG, updateChallengeDisplay, - updateChallengeLevel -} from './UpdateHTML' + updateChallengeLevel, +} from "./UpdateHTML"; import { ascendBuildingDR, buyConstantUpgrades, categoryUpgrades, getConstUpgradeMetadata, - upgradeupdate -} from './Upgrades' + upgradeupdate, +} from "./Upgrades"; // import { LegacyShopUpgrades } from './types/LegacySynergism'; -import i18next from 'i18next' -import localforage from 'localforage' -import { BlueberryUpgrade, blueberryUpgradeData } from './BlueberryUpgrades' -import { DOMCacheGetOrSet } from './Cache/DOM' -import { checkVariablesOnLoad } from './CheckVariables' -import { lastUpdated, prod, testing, version } from './Config' -import { WowCubes, WowHypercubes, WowPlatonicCubes, WowTesseracts } from './CubeExperimental' -import { eventCheck } from './Event' +import i18next from "i18next"; +import localforage from "localforage"; +import { BlueberryUpgrade, blueberryUpgradeData } from "./BlueberryUpgrades"; +import { DOMCacheGetOrSet } from "./Cache/DOM"; +import { checkVariablesOnLoad } from "./CheckVariables"; +import { lastUpdated, prod, testing, version } from "./Config"; +import { + WowCubes, + WowHypercubes, + WowPlatonicCubes, + WowTesseracts, +} from "./CubeExperimental"; +import { eventCheck } from "./Event"; import { AbyssHepteract, AcceleratorBoostHepteract, @@ -153,210 +177,222 @@ import { HyperrealismHepteract, MultiplierHepteract, QuarkHepteract, - toggleAutoBuyOrbs -} from './Hepteracts' -import { disableHotkeys } from './Hotkeys' -import { init as i18nInit } from './i18n' -import { handleLogin } from './Login' -import { octeractData, OcteractUpgrade } from './Octeracts' -import { updatePlatonicUpgradeBG } from './Platonic' -import { QuarkHandler } from './Quark' -import { getFastForwardTotalMultiplier, singularityData, SingularityUpgrade } from './singularity' -import { SingularityChallenge, singularityChallengeData } from './SingularityChallenges' -import { AmbrosiaGenerationCache, AmbrosiaLuckCache, BlueberryInventoryCache, cacheReinitialize } from './StatCache' -import { changeSubTab, changeTab, Tabs } from './Tabs' -import { settingAnnotation, toggleIconSet, toggleTheme } from './Themes' -import { clearTimeout, clearTimers, setInterval, setTimeout } from './Timers' -import type { PlayerSave } from './types/LegacySynergism' + toggleAutoBuyOrbs, +} from "./Hepteracts"; +import { disableHotkeys } from "./Hotkeys"; +import { init as i18nInit } from "./i18n"; +import { handleLogin } from "./Login"; +import { octeractData, OcteractUpgrade } from "./Octeracts"; +import { updatePlatonicUpgradeBG } from "./Platonic"; +import { QuarkHandler } from "./Quark"; +import { + getFastForwardTotalMultiplier, + singularityData, + SingularityUpgrade, +} from "./singularity"; +import { + SingularityChallenge, + singularityChallengeData, +} from "./SingularityChallenges"; +import { + AmbrosiaGenerationCache, + AmbrosiaLuckCache, + BlueberryInventoryCache, + cacheReinitialize, +} from "./StatCache"; +import { changeSubTab, changeTab, Tabs } from "./Tabs"; +import { settingAnnotation, toggleIconSet, toggleTheme } from "./Themes"; +import { clearTimeout, clearTimers, setInterval, setTimeout } from "./Timers"; +import type { PlayerSave } from "./types/LegacySynergism"; export const player: Player = { firstPlayed: new Date().toISOString(), worlds: new QuarkHandler({ quarks: 0, bonus: 0 }), - coins: new Decimal('1e2'), - coinsThisPrestige: new Decimal('1e2'), - coinsThisTranscension: new Decimal('1e2'), - coinsThisReincarnation: new Decimal('1e2'), - coinsTotal: new Decimal('100'), + coins: new Decimal("1e2"), + coinsThisPrestige: new Decimal("1e2"), + coinsThisTranscension: new Decimal("1e2"), + coinsThisReincarnation: new Decimal("1e2"), + coinsTotal: new Decimal("100"), firstOwnedCoin: 0, - firstGeneratedCoin: new Decimal('0'), - firstCostCoin: new Decimal('100'), + firstGeneratedCoin: new Decimal("0"), + firstCostCoin: new Decimal("100"), firstProduceCoin: 0.25, secondOwnedCoin: 0, - secondGeneratedCoin: new Decimal('0'), - secondCostCoin: new Decimal('1e3'), + secondGeneratedCoin: new Decimal("0"), + secondCostCoin: new Decimal("1e3"), secondProduceCoin: 2.5, thirdOwnedCoin: 0, - thirdGeneratedCoin: new Decimal('0'), - thirdCostCoin: new Decimal('2e4'), + thirdGeneratedCoin: new Decimal("0"), + thirdCostCoin: new Decimal("2e4"), thirdProduceCoin: 25, fourthOwnedCoin: 0, - fourthGeneratedCoin: new Decimal('0'), - fourthCostCoin: new Decimal('4e5'), + fourthGeneratedCoin: new Decimal("0"), + fourthCostCoin: new Decimal("4e5"), fourthProduceCoin: 250, fifthOwnedCoin: 0, - fifthGeneratedCoin: new Decimal('0'), - fifthCostCoin: new Decimal('8e6'), + fifthGeneratedCoin: new Decimal("0"), + fifthCostCoin: new Decimal("8e6"), fifthProduceCoin: 2500, firstOwnedDiamonds: 0, - firstGeneratedDiamonds: new Decimal('0'), - firstCostDiamonds: new Decimal('100'), + firstGeneratedDiamonds: new Decimal("0"), + firstCostDiamonds: new Decimal("100"), firstProduceDiamonds: 0.05, secondOwnedDiamonds: 0, - secondGeneratedDiamonds: new Decimal('0'), - secondCostDiamonds: new Decimal('1e5'), + secondGeneratedDiamonds: new Decimal("0"), + secondCostDiamonds: new Decimal("1e5"), secondProduceDiamonds: 0.0005, thirdOwnedDiamonds: 0, - thirdGeneratedDiamonds: new Decimal('0'), - thirdCostDiamonds: new Decimal('1e15'), + thirdGeneratedDiamonds: new Decimal("0"), + thirdCostDiamonds: new Decimal("1e15"), thirdProduceDiamonds: 0.00005, fourthOwnedDiamonds: 0, - fourthGeneratedDiamonds: new Decimal('0'), - fourthCostDiamonds: new Decimal('1e40'), + fourthGeneratedDiamonds: new Decimal("0"), + fourthCostDiamonds: new Decimal("1e40"), fourthProduceDiamonds: 0.000005, fifthOwnedDiamonds: 0, - fifthGeneratedDiamonds: new Decimal('0'), - fifthCostDiamonds: new Decimal('1e100'), + fifthGeneratedDiamonds: new Decimal("0"), + fifthCostDiamonds: new Decimal("1e100"), fifthProduceDiamonds: 0.000005, firstOwnedMythos: 0, - firstGeneratedMythos: new Decimal('0'), - firstCostMythos: new Decimal('1'), + firstGeneratedMythos: new Decimal("0"), + firstCostMythos: new Decimal("1"), firstProduceMythos: 1, secondOwnedMythos: 0, - secondGeneratedMythos: new Decimal('0'), - secondCostMythos: new Decimal('100'), + secondGeneratedMythos: new Decimal("0"), + secondCostMythos: new Decimal("100"), secondProduceMythos: 0.01, thirdOwnedMythos: 0, - thirdGeneratedMythos: new Decimal('0'), - thirdCostMythos: new Decimal('1e4'), + thirdGeneratedMythos: new Decimal("0"), + thirdCostMythos: new Decimal("1e4"), thirdProduceMythos: 0.001, fourthOwnedMythos: 0, - fourthGeneratedMythos: new Decimal('0'), - fourthCostMythos: new Decimal('1e8'), + fourthGeneratedMythos: new Decimal("0"), + fourthCostMythos: new Decimal("1e8"), fourthProduceMythos: 0.0002, fifthOwnedMythos: 0, - fifthGeneratedMythos: new Decimal('0'), - fifthCostMythos: new Decimal('1e16'), + fifthGeneratedMythos: new Decimal("0"), + fifthCostMythos: new Decimal("1e16"), fifthProduceMythos: 0.00004, firstOwnedParticles: 0, - firstGeneratedParticles: new Decimal('0'), - firstCostParticles: new Decimal('1'), - firstProduceParticles: .25, + firstGeneratedParticles: new Decimal("0"), + firstCostParticles: new Decimal("1"), + firstProduceParticles: 0.25, secondOwnedParticles: 0, - secondGeneratedParticles: new Decimal('0'), - secondCostParticles: new Decimal('100'), - secondProduceParticles: .20, + secondGeneratedParticles: new Decimal("0"), + secondCostParticles: new Decimal("100"), + secondProduceParticles: 0.2, thirdOwnedParticles: 0, - thirdGeneratedParticles: new Decimal('0'), - thirdCostParticles: new Decimal('1e4'), - thirdProduceParticles: .15, + thirdGeneratedParticles: new Decimal("0"), + thirdCostParticles: new Decimal("1e4"), + thirdProduceParticles: 0.15, fourthOwnedParticles: 0, - fourthGeneratedParticles: new Decimal('0'), - fourthCostParticles: new Decimal('1e8'), - fourthProduceParticles: .10, + fourthGeneratedParticles: new Decimal("0"), + fourthCostParticles: new Decimal("1e8"), + fourthProduceParticles: 0.1, fifthOwnedParticles: 0, - fifthGeneratedParticles: new Decimal('0'), - fifthCostParticles: new Decimal('1e16'), - fifthProduceParticles: .5, + fifthGeneratedParticles: new Decimal("0"), + fifthCostParticles: new Decimal("1e16"), + fifthProduceParticles: 0.5, firstOwnedAnts: 0, - firstGeneratedAnts: new Decimal('0'), - firstCostAnts: new Decimal('1e700'), - firstProduceAnts: .0001, + firstGeneratedAnts: new Decimal("0"), + firstCostAnts: new Decimal("1e700"), + firstProduceAnts: 0.0001, secondOwnedAnts: 0, - secondGeneratedAnts: new Decimal('0'), - secondCostAnts: new Decimal('3'), - secondProduceAnts: .00005, + secondGeneratedAnts: new Decimal("0"), + secondCostAnts: new Decimal("3"), + secondProduceAnts: 0.00005, thirdOwnedAnts: 0, - thirdGeneratedAnts: new Decimal('0'), - thirdCostAnts: new Decimal('100'), - thirdProduceAnts: .00002, + thirdGeneratedAnts: new Decimal("0"), + thirdCostAnts: new Decimal("100"), + thirdProduceAnts: 0.00002, fourthOwnedAnts: 0, - fourthGeneratedAnts: new Decimal('0'), - fourthCostAnts: new Decimal('1e4'), - fourthProduceAnts: .00001, + fourthGeneratedAnts: new Decimal("0"), + fourthCostAnts: new Decimal("1e4"), + fourthProduceAnts: 0.00001, fifthOwnedAnts: 0, - fifthGeneratedAnts: new Decimal('0'), - fifthCostAnts: new Decimal('1e12'), - fifthProduceAnts: .000005, + fifthGeneratedAnts: new Decimal("0"), + fifthCostAnts: new Decimal("1e12"), + fifthProduceAnts: 0.000005, sixthOwnedAnts: 0, - sixthGeneratedAnts: new Decimal('0'), - sixthCostAnts: new Decimal('1e36'), - sixthProduceAnts: .000002, + sixthGeneratedAnts: new Decimal("0"), + sixthCostAnts: new Decimal("1e36"), + sixthProduceAnts: 0.000002, seventhOwnedAnts: 0, - seventhGeneratedAnts: new Decimal('0'), - seventhCostAnts: new Decimal('1e100'), - seventhProduceAnts: .000001, + seventhGeneratedAnts: new Decimal("0"), + seventhCostAnts: new Decimal("1e100"), + seventhProduceAnts: 0.000001, eighthOwnedAnts: 0, - eighthGeneratedAnts: new Decimal('0'), - eighthCostAnts: new Decimal('1e300'), - eighthProduceAnts: .00000001, + eighthGeneratedAnts: new Decimal("0"), + eighthCostAnts: new Decimal("1e300"), + eighthProduceAnts: 0.00000001, ascendBuilding1: { cost: 1, owned: 0, - generated: new Decimal('0'), - multiplier: 0.01 + generated: new Decimal("0"), + multiplier: 0.01, }, ascendBuilding2: { cost: 10, owned: 0, - generated: new Decimal('0'), - multiplier: 0.01 + generated: new Decimal("0"), + multiplier: 0.01, }, ascendBuilding3: { cost: 100, owned: 0, - generated: new Decimal('0'), - multiplier: 0.01 + generated: new Decimal("0"), + multiplier: 0.01, }, ascendBuilding4: { cost: 1000, owned: 0, - generated: new Decimal('0'), - multiplier: 0.01 + generated: new Decimal("0"), + multiplier: 0.01, }, ascendBuilding5: { cost: 10000, owned: 0, - generated: new Decimal('0'), - multiplier: 0.01 + generated: new Decimal("0"), + multiplier: 0.01, }, - multiplierCost: new Decimal('1e4'), + multiplierCost: new Decimal("1e4"), multiplierBought: 0, - acceleratorCost: new Decimal('500'), + acceleratorCost: new Decimal("500"), acceleratorBought: 0, acceleratorBoostBought: 0, - acceleratorBoostCost: new Decimal('1e3'), + acceleratorBoostCost: new Decimal("1e3"), upgrades: Array(141).fill(0) as number[], @@ -364,13 +400,13 @@ export const player: Player = { transcendCount: 0, reincarnationCount: 0, - prestigePoints: new Decimal('0'), - transcendPoints: new Decimal('0'), - reincarnationPoints: new Decimal('0'), + prestigePoints: new Decimal("0"), + transcendPoints: new Decimal("0"), + reincarnationPoints: new Decimal("0"), - prestigeShards: new Decimal('0'), - transcendShards: new Decimal('0'), - reincarnationShards: new Decimal('0'), + prestigeShards: new Decimal("0"), + transcendShards: new Decimal("0"), + reincarnationShards: new Decimal("0"), toggles: { 1: false, @@ -415,7 +451,7 @@ export const player: Player = { 40: true, 41: true, 42: false, - 43: false + 43: false, }, challengecompletions: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], @@ -427,7 +463,7 @@ export const player: Player = { currentChallenge: { transcension: 0, reincarnation: 0, - ascension: 0 + ascension: 0, }, researchPoints: 0, obtainiumtimer: 0, @@ -437,14 +473,15 @@ export const player: Player = { // Ignore the first index. The other 25 are shaped in a 5x5 grid similar to the production appearance // dprint-ignore researches: [ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, ], unlocks: { @@ -459,7 +496,7 @@ export const player: Player = { rrow1: false, rrow2: false, rrow3: false, - rrow4: false + rrow4: false, }, achievements: Array(281).fill(0) as number[], @@ -521,15 +558,13 @@ export const player: Player = { prestige: true, transcend: true, generators: true, - reincarnate: true + reincarnate: true, }, tabnumber: 1, subtabNumber: 0, // create a Map with keys defaulting to false - codes: new Map( - Array.from({ length: 46 }, (_, i) => [i + 1, false]) - ), + codes: new Map(Array.from({ length: 46 }, (_, i) => [i + 1, false])), loaded1009: true, loaded1009hotfix1: true, @@ -603,7 +638,7 @@ export const player: Player = { shopAmbrosiaLuck1: 0, shopAmbrosiaLuck2: 0, shopAmbrosiaLuck3: 0, - shopAmbrosiaLuck4: 0 + shopAmbrosiaLuck4: 0, }, shopBuyMaxToggle: false, shopHideToggle: false, @@ -617,14 +652,14 @@ export const player: Player = { autoEnhanceToggle: false, autoResearchToggle: false, researchBuyMaxToggle: false, - autoResearchMode: 'manual', + autoResearchMode: "manual", autoResearch: 0, autoSacrifice: 0, sacrificeTimer: 0, quarkstimer: 90000, goldenQuarksTimer: 90000, - antPoints: new Decimal('1'), + antPoints: new Decimal("1"), antUpgrades: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], antSacrificePoints: 0, antSacrificeTimer: 900, @@ -660,18 +695,84 @@ export const player: Player = { ascensionCounterRealReal: 0, // dprint-ignore cubeUpgrades: [ - null, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + null, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, ], cubeUpgradesBuyMaxToggle: false, autoCubeUpgradesToggle: false, autoPlatonicUpgradesToggle: false, - platonicUpgrades: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + platonicUpgrades: [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + ], wowCubes: new WowCubes(0), wowTesseracts: new WowTesseracts(0), wowHypercubes: new WowHypercubes(0), @@ -690,7 +791,7 @@ export const player: Player = { antSacrifice: 0, antELO: 0, talismanBonus: 0, - globalSpeed: 0 + globalSpeed: 0, }, tesseractBlessings: { accelerator: 0, @@ -702,7 +803,7 @@ export const player: Player = { antSacrifice: 0, antELO: 0, talismanBonus: 0, - globalSpeed: 0 + globalSpeed: 0, }, hypercubeBlessings: { accelerator: 0, @@ -714,7 +815,7 @@ export const player: Player = { antSacrifice: 0, antELO: 0, talismanBonus: 0, - globalSpeed: 0 + globalSpeed: 0, }, platonicBlessings: { cubes: 0, @@ -724,7 +825,7 @@ export const player: Player = { hypercubeBonus: 0, taxes: 0, scoreBonus: 0, - globalSpeed: 0 + globalSpeed: 0, }, hepteractCrafts: { @@ -735,12 +836,12 @@ export const player: Player = { abyss: AbyssHepteract, accelerator: AcceleratorHepteract, acceleratorBoost: AcceleratorBoostHepteract, - multiplier: MultiplierHepteract + multiplier: MultiplierHepteract, }, - ascendShards: new Decimal('0'), + ascendShards: new Decimal("0"), autoAscend: false, - autoAscendMode: 'c10Completions', + autoAscendMode: "c10Completions", autoAscendThreshold: 1, autoOpenCubes: false, openCubes: 0, @@ -751,18 +852,20 @@ export const player: Player = { autoOpenPlatonicsCubes: false, openPlatonicsCubes: 0, roombaResearchIndex: 0, - ascStatToggles: { // false here means show per second + ascStatToggles: { + // false here means show per second 1: false, 2: false, 3: false, 4: false, 5: false, - 6: false + 6: false, }, prototypeCorruptions: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], usedCorruptions: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - corruptionLoadouts: { // If you add loadouts don't forget to add loadout names! + corruptionLoadouts: { + // If you add loadouts don't forget to add loadout names! 1: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 2: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 3: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], @@ -770,17 +873,17 @@ export const player: Player = { 5: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 6: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 7: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - 8: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + 8: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], }, corruptionLoadoutNames: [ - 'Loadout 1', - 'Loadout 2', - 'Loadout 3', - 'Loadout 4', - 'Loadout 5', - 'Loadout 6', - 'Loadout 7', - 'Loadout 8' + "Loadout 1", + "Loadout 2", + "Loadout 3", + "Loadout 4", + "Loadout 5", + "Loadout 6", + "Loadout 7", + "Loadout 8", ], corruptionShowStats: true, @@ -806,13 +909,13 @@ export const player: Player = { false, false, false, - false + false, ], autoChallengeStartExponent: 10, autoChallengeTimer: { start: 10, exit: 2, - enter: 2 + enter: 2, }, runeBlessingLevels: [0, 0, 0, 0, 0, 0], @@ -822,7 +925,7 @@ export const player: Player = { autoTesseracts: [false, false, false, false, false, false], - saveString: 'Synergism-$VERSION$-$TIME$.txt', + saveString: "Synergism-$VERSION$-$TIME$.txt", exporttest: !testing, dayCheck: null, @@ -854,7 +957,7 @@ export const player: Player = { version, rngCode: 0, promoCodeTiming: { - time: 0 + time: 0, }, singularityCount: 0, highestSingularityCount: 0, @@ -863,150 +966,408 @@ export const player: Player = { quarksThisSingularity: 0, totalQuarksEver: 0, hotkeys: {}, - theme: 'Dark Mode', + theme: "Dark Mode", iconSet: 0, - notation: 'Default', + notation: "Default", singularityUpgrades: { - goldenQuarks1: new SingularityUpgrade(singularityData.goldenQuarks1, 'goldenQuarks1'), - goldenQuarks2: new SingularityUpgrade(singularityData.goldenQuarks2, 'goldenQuarks2'), - goldenQuarks3: new SingularityUpgrade(singularityData.goldenQuarks3, 'goldenQuarks3'), - starterPack: new SingularityUpgrade(singularityData.starterPack, 'starterPack'), - wowPass: new SingularityUpgrade(singularityData.wowPass, 'wowPass'), - cookies: new SingularityUpgrade(singularityData.cookies, 'cookies'), - cookies2: new SingularityUpgrade(singularityData.cookies2, 'cookies2'), - cookies3: new SingularityUpgrade(singularityData.cookies3, 'cookies3'), - cookies4: new SingularityUpgrade(singularityData.cookies4, 'cookies4'), - cookies5: new SingularityUpgrade(singularityData.cookies5, 'cookies5'), - ascensions: new SingularityUpgrade(singularityData.ascensions, 'ascensions'), - corruptionFourteen: new SingularityUpgrade(singularityData.corruptionFourteen, 'corruptionFourteen'), - corruptionFifteen: new SingularityUpgrade(singularityData.corruptionFifteen, 'corruptionFifteen'), - singOfferings1: new SingularityUpgrade(singularityData.singOfferings1, 'singOfferings1'), - singOfferings2: new SingularityUpgrade(singularityData.singOfferings2, 'singOfferings2'), - singOfferings3: new SingularityUpgrade(singularityData.singOfferings3, 'singOfferings3'), - singObtainium1: new SingularityUpgrade(singularityData.singObtainium1, 'singObtainium1'), - singObtainium2: new SingularityUpgrade(singularityData.singObtainium2, 'singObtainium2'), - singObtainium3: new SingularityUpgrade(singularityData.singObtainium3, 'singObtainium3'), - singCubes1: new SingularityUpgrade(singularityData.singCubes1, 'singCubes1'), - singCubes2: new SingularityUpgrade(singularityData.singCubes2, 'singCubes2'), - singCubes3: new SingularityUpgrade(singularityData.singCubes3, 'singCubes3'), - singCitadel: new SingularityUpgrade(singularityData.singCitadel, 'singCitadel'), - singCitadel2: new SingularityUpgrade(singularityData.singCitadel2, 'singCitadel2'), - octeractUnlock: new SingularityUpgrade(singularityData.octeractUnlock, 'octeractUnlock'), + goldenQuarks1: new SingularityUpgrade( + singularityData.goldenQuarks1, + "goldenQuarks1" + ), + goldenQuarks2: new SingularityUpgrade( + singularityData.goldenQuarks2, + "goldenQuarks2" + ), + goldenQuarks3: new SingularityUpgrade( + singularityData.goldenQuarks3, + "goldenQuarks3" + ), + starterPack: new SingularityUpgrade( + singularityData.starterPack, + "starterPack" + ), + wowPass: new SingularityUpgrade(singularityData.wowPass, "wowPass"), + cookies: new SingularityUpgrade(singularityData.cookies, "cookies"), + cookies2: new SingularityUpgrade(singularityData.cookies2, "cookies2"), + cookies3: new SingularityUpgrade(singularityData.cookies3, "cookies3"), + cookies4: new SingularityUpgrade(singularityData.cookies4, "cookies4"), + cookies5: new SingularityUpgrade(singularityData.cookies5, "cookies5"), + ascensions: new SingularityUpgrade( + singularityData.ascensions, + "ascensions" + ), + corruptionFourteen: new SingularityUpgrade( + singularityData.corruptionFourteen, + "corruptionFourteen" + ), + corruptionFifteen: new SingularityUpgrade( + singularityData.corruptionFifteen, + "corruptionFifteen" + ), + singOfferings1: new SingularityUpgrade( + singularityData.singOfferings1, + "singOfferings1" + ), + singOfferings2: new SingularityUpgrade( + singularityData.singOfferings2, + "singOfferings2" + ), + singOfferings3: new SingularityUpgrade( + singularityData.singOfferings3, + "singOfferings3" + ), + singObtainium1: new SingularityUpgrade( + singularityData.singObtainium1, + "singObtainium1" + ), + singObtainium2: new SingularityUpgrade( + singularityData.singObtainium2, + "singObtainium2" + ), + singObtainium3: new SingularityUpgrade( + singularityData.singObtainium3, + "singObtainium3" + ), + singCubes1: new SingularityUpgrade( + singularityData.singCubes1, + "singCubes1" + ), + singCubes2: new SingularityUpgrade( + singularityData.singCubes2, + "singCubes2" + ), + singCubes3: new SingularityUpgrade( + singularityData.singCubes3, + "singCubes3" + ), + singCitadel: new SingularityUpgrade( + singularityData.singCitadel, + "singCitadel" + ), + singCitadel2: new SingularityUpgrade( + singularityData.singCitadel2, + "singCitadel2" + ), + octeractUnlock: new SingularityUpgrade( + singularityData.octeractUnlock, + "octeractUnlock" + ), singOcteractPatreonBonus: new SingularityUpgrade( singularityData.singOcteractPatreonBonus, - 'singOcteractPatreonBonus' + "singOcteractPatreonBonus" + ), + intermediatePack: new SingularityUpgrade( + singularityData.intermediatePack, + "intermediatePack" + ), + advancedPack: new SingularityUpgrade( + singularityData.advancedPack, + "advancedPack" + ), + expertPack: new SingularityUpgrade( + singularityData.expertPack, + "expertPack" + ), + masterPack: new SingularityUpgrade( + singularityData.masterPack, + "masterPack" + ), + divinePack: new SingularityUpgrade( + singularityData.divinePack, + "divinePack" + ), + wowPass2: new SingularityUpgrade(singularityData.wowPass2, "wowPass2"), + potionBuff: new SingularityUpgrade( + singularityData.potionBuff, + "potionBuff" + ), + potionBuff2: new SingularityUpgrade( + singularityData.potionBuff2, + "potionBuff2" + ), + potionBuff3: new SingularityUpgrade( + singularityData.potionBuff3, + "potionBuff3" + ), + singChallengeExtension: new SingularityUpgrade( + singularityData.singChallengeExtension, + "singChallengeExtension" + ), + singChallengeExtension2: new SingularityUpgrade( + singularityData.singChallengeExtension2, + "singChallengeExtension2" + ), + singChallengeExtension3: new SingularityUpgrade( + singularityData.singChallengeExtension3, + "singChallengeExtension3" + ), + singQuarkImprover1: new SingularityUpgrade( + singularityData.singQuarkImprover1, + "singQuarkImprover1" + ), + singQuarkHepteract: new SingularityUpgrade( + singularityData.singQuarkHepteract, + "singQuarkHepteract" + ), + singQuarkHepteract2: new SingularityUpgrade( + singularityData.singQuarkHepteract2, + "singQuarkHepteract2" + ), + singQuarkHepteract3: new SingularityUpgrade( + singularityData.singQuarkHepteract3, + "singQuarkHepteract3" + ), + singOcteractGain: new SingularityUpgrade( + singularityData.singOcteractGain, + "singOcteractGain" + ), + singOcteractGain2: new SingularityUpgrade( + singularityData.singOcteractGain2, + "singOcteractGain2" + ), + singOcteractGain3: new SingularityUpgrade( + singularityData.singOcteractGain3, + "singOcteractGain3" + ), + singOcteractGain4: new SingularityUpgrade( + singularityData.singOcteractGain4, + "singOcteractGain4" + ), + singOcteractGain5: new SingularityUpgrade( + singularityData.singOcteractGain5, + "singOcteractGain5" + ), + wowPass3: new SingularityUpgrade(singularityData.wowPass3, "wowPass3"), + ultimatePen: new SingularityUpgrade( + singularityData.ultimatePen, + "ultimatePen" + ), + platonicTau: new SingularityUpgrade( + singularityData.platonicTau, + "platonicTau" + ), + platonicAlpha: new SingularityUpgrade( + singularityData.platonicAlpha, + "platonicAlpha" + ), + platonicDelta: new SingularityUpgrade( + singularityData.platonicDelta, + "platonicDelta" + ), + platonicPhi: new SingularityUpgrade( + singularityData.platonicPhi, + "platonicPhi" + ), + singFastForward: new SingularityUpgrade( + singularityData.singFastForward, + "singFastForward" + ), + singFastForward2: new SingularityUpgrade( + singularityData.singFastForward2, + "singFastForward2" + ), + singAscensionSpeed: new SingularityUpgrade( + singularityData.singAscensionSpeed, + "singAscensionSpeed" + ), + singAscensionSpeed2: new SingularityUpgrade( + singularityData.singAscensionSpeed2, + "singAscensionSpeed2" + ), + oneMind: new SingularityUpgrade(singularityData.oneMind, "oneMind"), + wowPass4: new SingularityUpgrade(singularityData.wowPass4, "wowPass4"), + offeringAutomatic: new SingularityUpgrade( + singularityData.offeringAutomatic, + "offeringAutomatic" + ), + blueberries: new SingularityUpgrade( + singularityData.blueberries, + "blueberries" + ), + singAmbrosiaLuck: new SingularityUpgrade( + singularityData.singAmbrosiaLuck, + "singAmbrosiaLuck" + ), + singAmbrosiaLuck2: new SingularityUpgrade( + singularityData.singAmbrosiaLuck2, + "singAmbrosiaLuck2" + ), + singAmbrosiaLuck3: new SingularityUpgrade( + singularityData.singAmbrosiaLuck3, + "singAmbrosiaLuck3" + ), + singAmbrosiaLuck4: new SingularityUpgrade( + singularityData.singAmbrosiaLuck4, + "singAmbrosiaLuck4" + ), + singAmbrosiaGeneration: new SingularityUpgrade( + singularityData.singAmbrosiaGeneration, + "singAmbrosiaGeneration" + ), + singAmbrosiaGeneration2: new SingularityUpgrade( + singularityData.singAmbrosiaGeneration2, + "singAmbrosiaGeneration2" + ), + singAmbrosiaGeneration3: new SingularityUpgrade( + singularityData.singAmbrosiaGeneration3, + "singAmbrosiaGeneration3" + ), + singAmbrosiaGeneration4: new SingularityUpgrade( + singularityData.singAmbrosiaGeneration4, + "singAmbrosiaGeneration4" ), - intermediatePack: new SingularityUpgrade(singularityData.intermediatePack, 'intermediatePack'), - advancedPack: new SingularityUpgrade(singularityData.advancedPack, 'advancedPack'), - expertPack: new SingularityUpgrade(singularityData.expertPack, 'expertPack'), - masterPack: new SingularityUpgrade(singularityData.masterPack, 'masterPack'), - divinePack: new SingularityUpgrade(singularityData.divinePack, 'divinePack'), - wowPass2: new SingularityUpgrade(singularityData.wowPass2, 'wowPass2'), - potionBuff: new SingularityUpgrade(singularityData.potionBuff, 'potionBuff'), - potionBuff2: new SingularityUpgrade(singularityData.potionBuff2, 'potionBuff2'), - potionBuff3: new SingularityUpgrade(singularityData.potionBuff3, 'potionBuff3'), - singChallengeExtension: new SingularityUpgrade(singularityData.singChallengeExtension, 'singChallengeExtension'), - singChallengeExtension2: new SingularityUpgrade(singularityData.singChallengeExtension2, 'singChallengeExtension2'), - singChallengeExtension3: new SingularityUpgrade(singularityData.singChallengeExtension3, 'singChallengeExtension3'), - singQuarkImprover1: new SingularityUpgrade(singularityData.singQuarkImprover1, 'singQuarkImprover1'), - singQuarkHepteract: new SingularityUpgrade(singularityData.singQuarkHepteract, 'singQuarkHepteract'), - singQuarkHepteract2: new SingularityUpgrade(singularityData.singQuarkHepteract2, 'singQuarkHepteract2'), - singQuarkHepteract3: new SingularityUpgrade(singularityData.singQuarkHepteract3, 'singQuarkHepteract3'), - singOcteractGain: new SingularityUpgrade(singularityData.singOcteractGain, 'singOcteractGain'), - singOcteractGain2: new SingularityUpgrade(singularityData.singOcteractGain2, 'singOcteractGain2'), - singOcteractGain3: new SingularityUpgrade(singularityData.singOcteractGain3, 'singOcteractGain3'), - singOcteractGain4: new SingularityUpgrade(singularityData.singOcteractGain4, 'singOcteractGain4'), - singOcteractGain5: new SingularityUpgrade(singularityData.singOcteractGain5, 'singOcteractGain5'), - wowPass3: new SingularityUpgrade(singularityData.wowPass3, 'wowPass3'), - ultimatePen: new SingularityUpgrade(singularityData.ultimatePen, 'ultimatePen'), - platonicTau: new SingularityUpgrade(singularityData.platonicTau, 'platonicTau'), - platonicAlpha: new SingularityUpgrade(singularityData.platonicAlpha, 'platonicAlpha'), - platonicDelta: new SingularityUpgrade(singularityData.platonicDelta, 'platonicDelta'), - platonicPhi: new SingularityUpgrade(singularityData.platonicPhi, 'platonicPhi'), - singFastForward: new SingularityUpgrade(singularityData.singFastForward, 'singFastForward'), - singFastForward2: new SingularityUpgrade(singularityData.singFastForward2, 'singFastForward2'), - singAscensionSpeed: new SingularityUpgrade(singularityData.singAscensionSpeed, 'singAscensionSpeed'), - singAscensionSpeed2: new SingularityUpgrade(singularityData.singAscensionSpeed2, 'singAscensionSpeed2'), - oneMind: new SingularityUpgrade(singularityData.oneMind, 'oneMind'), - wowPass4: new SingularityUpgrade(singularityData.wowPass4, 'wowPass4'), - offeringAutomatic: new SingularityUpgrade(singularityData.offeringAutomatic, 'offeringAutomatic'), - blueberries: new SingularityUpgrade(singularityData.blueberries, 'blueberries'), - singAmbrosiaLuck: new SingularityUpgrade(singularityData.singAmbrosiaLuck, 'singAmbrosiaLuck'), - singAmbrosiaLuck2: new SingularityUpgrade(singularityData.singAmbrosiaLuck2, 'singAmbrosiaLuck2'), - singAmbrosiaLuck3: new SingularityUpgrade(singularityData.singAmbrosiaLuck3, 'singAmbrosiaLuck3'), - singAmbrosiaLuck4: new SingularityUpgrade(singularityData.singAmbrosiaLuck4, 'singAmbrosiaLuck4'), - singAmbrosiaGeneration: new SingularityUpgrade(singularityData.singAmbrosiaGeneration, 'singAmbrosiaGeneration'), - singAmbrosiaGeneration2: new SingularityUpgrade(singularityData.singAmbrosiaGeneration2, 'singAmbrosiaGeneration2'), - singAmbrosiaGeneration3: new SingularityUpgrade(singularityData.singAmbrosiaGeneration3, 'singAmbrosiaGeneration3'), - singAmbrosiaGeneration4: new SingularityUpgrade(singularityData.singAmbrosiaGeneration4, 'singAmbrosiaGeneration4') }, octeractUpgrades: { - octeractStarter: new OcteractUpgrade(octeractData.octeractStarter, 'octeractStarter'), - octeractGain: new OcteractUpgrade(octeractData.octeractGain, 'octeractGain'), - octeractGain2: new OcteractUpgrade(octeractData.octeractGain2, 'octeractGain2'), - octeractQuarkGain: new OcteractUpgrade(octeractData.octeractQuarkGain, 'octeractQuarkGain'), - octeractQuarkGain2: new OcteractUpgrade(octeractData.octeractQuarkGain2, 'octeractQuarkGain2'), - octeractCorruption: new OcteractUpgrade(octeractData.octeractCorruption, 'octeractCorruption'), - octeractGQCostReduce: new OcteractUpgrade(octeractData.octeractGQCostReduce, 'octeractGQCostReduce'), - octeractExportQuarks: new OcteractUpgrade(octeractData.octeractExportQuarks, 'octeractExportQuarks'), - octeractImprovedDaily: new OcteractUpgrade(octeractData.octeractImprovedDaily, 'octeractImprovedDaily'), - octeractImprovedDaily2: new OcteractUpgrade(octeractData.octeractImprovedDaily2, 'octeractImprovedDaily2'), - octeractImprovedDaily3: new OcteractUpgrade(octeractData.octeractImprovedDaily3, 'octeractImprovedDaily3'), - octeractImprovedQuarkHept: new OcteractUpgrade(octeractData.octeractImprovedQuarkHept, 'octeractImprovedQuarkHept'), + octeractStarter: new OcteractUpgrade( + octeractData.octeractStarter, + "octeractStarter" + ), + octeractGain: new OcteractUpgrade( + octeractData.octeractGain, + "octeractGain" + ), + octeractGain2: new OcteractUpgrade( + octeractData.octeractGain2, + "octeractGain2" + ), + octeractQuarkGain: new OcteractUpgrade( + octeractData.octeractQuarkGain, + "octeractQuarkGain" + ), + octeractQuarkGain2: new OcteractUpgrade( + octeractData.octeractQuarkGain2, + "octeractQuarkGain2" + ), + octeractCorruption: new OcteractUpgrade( + octeractData.octeractCorruption, + "octeractCorruption" + ), + octeractGQCostReduce: new OcteractUpgrade( + octeractData.octeractGQCostReduce, + "octeractGQCostReduce" + ), + octeractExportQuarks: new OcteractUpgrade( + octeractData.octeractExportQuarks, + "octeractExportQuarks" + ), + octeractImprovedDaily: new OcteractUpgrade( + octeractData.octeractImprovedDaily, + "octeractImprovedDaily" + ), + octeractImprovedDaily2: new OcteractUpgrade( + octeractData.octeractImprovedDaily2, + "octeractImprovedDaily2" + ), + octeractImprovedDaily3: new OcteractUpgrade( + octeractData.octeractImprovedDaily3, + "octeractImprovedDaily3" + ), + octeractImprovedQuarkHept: new OcteractUpgrade( + octeractData.octeractImprovedQuarkHept, + "octeractImprovedQuarkHept" + ), octeractImprovedGlobalSpeed: new OcteractUpgrade( octeractData.octeractImprovedGlobalSpeed, - 'octeractImprovedGlobalSpeed' + "octeractImprovedGlobalSpeed" ), octeractImprovedAscensionSpeed: new OcteractUpgrade( octeractData.octeractImprovedAscensionSpeed, - 'octeractImprovedAscensionSpeed' + "octeractImprovedAscensionSpeed" ), octeractImprovedAscensionSpeed2: new OcteractUpgrade( octeractData.octeractImprovedAscensionSpeed2, - 'octeractImprovedAscensionSpeed2' + "octeractImprovedAscensionSpeed2" + ), + octeractImprovedFree: new OcteractUpgrade( + octeractData.octeractImprovedFree, + "octeractImprovedFree" + ), + octeractImprovedFree2: new OcteractUpgrade( + octeractData.octeractImprovedFree2, + "octeractImprovedFree2" + ), + octeractImprovedFree3: new OcteractUpgrade( + octeractData.octeractImprovedFree3, + "octeractImprovedFree3" + ), + octeractImprovedFree4: new OcteractUpgrade( + octeractData.octeractImprovedFree4, + "octeractImprovedFree4" + ), + octeractSingUpgradeCap: new OcteractUpgrade( + octeractData.octeractSingUpgradeCap, + "octeractSingUpgradeCap" + ), + octeractOfferings1: new OcteractUpgrade( + octeractData.octeractOfferings1, + "octeractOfferings1" + ), + octeractObtainium1: new OcteractUpgrade( + octeractData.octeractObtainium1, + "octeractObtainium1" + ), + octeractAscensions: new OcteractUpgrade( + octeractData.octeractAscensions, + "octeractAscensions" + ), + octeractAscensions2: new OcteractUpgrade( + octeractData.octeractAscensions2, + "octeractAscensions2" ), - octeractImprovedFree: new OcteractUpgrade(octeractData.octeractImprovedFree, 'octeractImprovedFree'), - octeractImprovedFree2: new OcteractUpgrade(octeractData.octeractImprovedFree2, 'octeractImprovedFree2'), - octeractImprovedFree3: new OcteractUpgrade(octeractData.octeractImprovedFree3, 'octeractImprovedFree3'), - octeractImprovedFree4: new OcteractUpgrade(octeractData.octeractImprovedFree4, 'octeractImprovedFree4'), - octeractSingUpgradeCap: new OcteractUpgrade(octeractData.octeractSingUpgradeCap, 'octeractSingUpgradeCap'), - octeractOfferings1: new OcteractUpgrade(octeractData.octeractOfferings1, 'octeractOfferings1'), - octeractObtainium1: new OcteractUpgrade(octeractData.octeractObtainium1, 'octeractObtainium1'), - octeractAscensions: new OcteractUpgrade(octeractData.octeractAscensions, 'octeractAscensions'), - octeractAscensions2: new OcteractUpgrade(octeractData.octeractAscensions2, 'octeractAscensions2'), octeractAscensionsOcteractGain: new OcteractUpgrade( octeractData.octeractAscensionsOcteractGain, - 'octeractAscensionsOcteractGain' + "octeractAscensionsOcteractGain" + ), + octeractFastForward: new OcteractUpgrade( + octeractData.octeractFastForward, + "octeractFastForward" + ), + octeractAutoPotionSpeed: new OcteractUpgrade( + octeractData.octeractAutoPotionSpeed, + "octeractAutoPotionSpeed" ), - octeractFastForward: new OcteractUpgrade(octeractData.octeractFastForward, 'octeractFastForward'), - octeractAutoPotionSpeed: new OcteractUpgrade(octeractData.octeractAutoPotionSpeed, 'octeractAutoPotionSpeed'), octeractAutoPotionEfficiency: new OcteractUpgrade( octeractData.octeractAutoPotionEfficiency, - 'octeractAutoPotionEfficiency' + "octeractAutoPotionEfficiency" + ), + octeractOneMindImprover: new OcteractUpgrade( + octeractData.octeractOneMindImprover, + "octeractOneMindImprover" + ), + octeractAmbrosiaLuck: new OcteractUpgrade( + octeractData.octeractAmbrosiaLuck, + "octeractAmbrosiaLuck" + ), + octeractAmbrosiaLuck2: new OcteractUpgrade( + octeractData.octeractAmbrosiaLuck2, + "octeractAmbrosiaLuck2" + ), + octeractAmbrosiaLuck3: new OcteractUpgrade( + octeractData.octeractAmbrosiaLuck3, + "octeractAmbrosiaLuck3" + ), + octeractAmbrosiaLuck4: new OcteractUpgrade( + octeractData.octeractAmbrosiaLuck4, + "octeractAmbrosiaLuck4" ), - octeractOneMindImprover: new OcteractUpgrade(octeractData.octeractOneMindImprover, 'octeractOneMindImprover'), - octeractAmbrosiaLuck: new OcteractUpgrade(octeractData.octeractAmbrosiaLuck, 'octeractAmbrosiaLuck'), - octeractAmbrosiaLuck2: new OcteractUpgrade(octeractData.octeractAmbrosiaLuck2, 'octeractAmbrosiaLuck2'), - octeractAmbrosiaLuck3: new OcteractUpgrade(octeractData.octeractAmbrosiaLuck3, 'octeractAmbrosiaLuck3'), - octeractAmbrosiaLuck4: new OcteractUpgrade(octeractData.octeractAmbrosiaLuck4, 'octeractAmbrosiaLuck4'), octeractAmbrosiaGeneration: new OcteractUpgrade( octeractData.octeractAmbrosiaGeneration, - 'octeractAmbrosiaGeneration' + "octeractAmbrosiaGeneration" ), octeractAmbrosiaGeneration2: new OcteractUpgrade( octeractData.octeractAmbrosiaGeneration2, - 'octeractAmbrosiaGeneration2' + "octeractAmbrosiaGeneration2" ), octeractAmbrosiaGeneration3: new OcteractUpgrade( octeractData.octeractAmbrosiaGeneration3, - 'octeractAmbrosiaGeneration3' + "octeractAmbrosiaGeneration3" ), octeractAmbrosiaGeneration4: new OcteractUpgrade( octeractData.octeractAmbrosiaGeneration4, - 'octeractAmbrosiaGeneration4' - ) + "octeractAmbrosiaGeneration4" + ), }, dailyCodeUsed: false, @@ -1017,11 +1378,20 @@ export const player: Player = { singularityChallenges: { noSingularityUpgrades: new SingularityChallenge( singularityChallengeData.noSingularityUpgrades, - 'noSingularityUpgrades' + "noSingularityUpgrades" + ), + oneChallengeCap: new SingularityChallenge( + singularityChallengeData.oneChallengeCap, + "oneChallengeCap" + ), + noOcteracts: new SingularityChallenge( + singularityChallengeData.noOcteracts, + "noOcteracts" + ), + limitedAscensions: new SingularityChallenge( + singularityChallengeData.limitedAscensions, + "limitedAscensions" ), - oneChallengeCap: new SingularityChallenge(singularityChallengeData.oneChallengeCap, 'oneChallengeCap'), - noOcteracts: new SingularityChallenge(singularityChallengeData.noOcteracts, 'noOcteracts'), - limitedAscensions: new SingularityChallenge(singularityChallengeData.limitedAscensions, 'limitedAscensions') }, ambrosia: 0, @@ -1031,20 +1401,74 @@ export const player: Player = { visitedAmbrosiaSubtab: false, spentBlueberries: 0, blueberryUpgrades: { - ambrosiaTutorial: new BlueberryUpgrade(blueberryUpgradeData.ambrosiaTutorial, 'ambrosiaTutorial'), - ambrosiaQuarks1: new BlueberryUpgrade(blueberryUpgradeData.ambrosiaQuarks1, 'ambrosiaQuarks1'), - ambrosiaCubes1: new BlueberryUpgrade(blueberryUpgradeData.ambrosiaCubes1, 'ambrosiaQuarks1'), - ambrosiaLuck1: new BlueberryUpgrade(blueberryUpgradeData.ambrosiaLuck1, 'ambrosiaLuck1'), - ambrosiaCubeQuark1: new BlueberryUpgrade(blueberryUpgradeData.ambrosiaCubeQuark1, 'ambrosiaCubeQuark1'), - ambrosiaLuckQuark1: new BlueberryUpgrade(blueberryUpgradeData.ambrosiaLuckQuark1, 'ambrosiaLuckQuark1'), - ambrosiaLuckCube1: new BlueberryUpgrade(blueberryUpgradeData.ambrosiaLuckCube1, 'ambrosiaLuckCube1'), - ambrosiaQuarkCube1: new BlueberryUpgrade(blueberryUpgradeData.ambrosiaQuarkCube1, 'ambrosiaQuarkCube1'), - ambrosiaCubeLuck1: new BlueberryUpgrade(blueberryUpgradeData.ambrosiaCubeLuck1, 'ambrosiaCubeLuck1'), - ambrosiaQuarkLuck1: new BlueberryUpgrade(blueberryUpgradeData.ambrosiaQuarkLuck1, 'ambrosiaQuarkLuck1'), - ambrosiaQuarks2: new BlueberryUpgrade(blueberryUpgradeData.ambrosiaQuarks2, 'ambrosiaQuarks2'), - ambrosiaCubes2: new BlueberryUpgrade(blueberryUpgradeData.ambrosiaCubes2, 'ambrosiaQuarks2'), - ambrosiaLuck2: new BlueberryUpgrade(blueberryUpgradeData.ambrosiaLuck2, 'ambrosiaLuck2'), - ambrosiaPatreon: new BlueberryUpgrade(blueberryUpgradeData.ambrosiaPatreon, 'ambrosiaPatreon') + ambrosiaTutorial: new BlueberryUpgrade( + blueberryUpgradeData.ambrosiaTutorial, + "ambrosiaTutorial" + ), + ambrosiaQuarks1: new BlueberryUpgrade( + blueberryUpgradeData.ambrosiaQuarks1, + "ambrosiaQuarks1" + ), + ambrosiaCubes1: new BlueberryUpgrade( + blueberryUpgradeData.ambrosiaCubes1, + "ambrosiaQuarks1" + ), + ambrosiaLuck1: new BlueberryUpgrade( + blueberryUpgradeData.ambrosiaLuck1, + "ambrosiaLuck1" + ), + ambrosiaCubeQuark1: new BlueberryUpgrade( + blueberryUpgradeData.ambrosiaCubeQuark1, + "ambrosiaCubeQuark1" + ), + ambrosiaLuckQuark1: new BlueberryUpgrade( + blueberryUpgradeData.ambrosiaLuckQuark1, + "ambrosiaLuckQuark1" + ), + ambrosiaLuckCube1: new BlueberryUpgrade( + blueberryUpgradeData.ambrosiaLuckCube1, + "ambrosiaLuckCube1" + ), + ambrosiaQuarkCube1: new BlueberryUpgrade( + blueberryUpgradeData.ambrosiaQuarkCube1, + "ambrosiaQuarkCube1" + ), + ambrosiaCubeLuck1: new BlueberryUpgrade( + blueberryUpgradeData.ambrosiaCubeLuck1, + "ambrosiaCubeLuck1" + ), + ambrosiaQuarkLuck1: new BlueberryUpgrade( + blueberryUpgradeData.ambrosiaQuarkLuck1, + "ambrosiaQuarkLuck1" + ), + ambrosiaQuarks2: new BlueberryUpgrade( + blueberryUpgradeData.ambrosiaQuarks2, + "ambrosiaQuarks2" + ), + ambrosiaCubes2: new BlueberryUpgrade( + blueberryUpgradeData.ambrosiaCubes2, + "ambrosiaQuarks2" + ), + ambrosiaLuck2: new BlueberryUpgrade( + blueberryUpgradeData.ambrosiaLuck2, + "ambrosiaLuck2" + ), + ambrosiaPatreon: new BlueberryUpgrade( + blueberryUpgradeData.ambrosiaPatreon, + "ambrosiaPatreon" + ), + ambrosiaObtainium1: new BlueberryUpgrade( + blueberryUpgradeData.ambrosiaObtainium1, + "ambrosiaObtainium1" + ), + ambrosiaOffering1: new BlueberryUpgrade( + blueberryUpgradeData.ambrosiaOffering1, + "ambrosiaOffering1" + ), + ambrosiaHyperflux: new BlueberryUpgrade( + blueberryUpgradeData.ambrosiaHyperflux, + "ambrosiaHyperflux" + ), }, blueberryLoadouts: { @@ -1055,33 +1479,33 @@ export const player: Player = { 5: {}, 6: {}, 7: {}, - 8: {} + 8: {}, }, - blueberryLoadoutMode: 'saveTree', + blueberryLoadoutMode: "saveTree", caches: { ambrosiaLuck: new AmbrosiaLuckCache(), ambrosiaGeneration: new AmbrosiaGenerationCache(), - blueberryInventory: new BlueberryInventoryCache() + blueberryInventory: new BlueberryInventoryCache(), }, - lastExportedSave: 0 -} + lastExportedSave: 0, +}; export const blankSave = Object.assign({}, player, { - codes: new Map(Array.from({ length: 44 }, (_, i) => [i + 1, false])) -}) + codes: new Map(Array.from({ length: 44 }, (_, i) => [i + 1, false])), +}); // The main cause of the double singularity bug was caused by a race condition // when the game was saving just as the user was entering a Singularity. To fix // this, hopefully, we disable saving the game when in the prompt or currently // entering a Singularity. -export const saveCheck = { canSave: true } +export const saveCheck = { canSave: true }; export const saveSynergy = async (button?: boolean): Promise => { - player.offlinetick = Date.now() - player.loaded1009 = true - player.loaded1009hotfix1 = true + player.offlinetick = Date.now(); + player.loaded1009 = true; + player.loaded1009hotfix1 = true; // shallow hold, doesn't modify OG object nor is affected by modifications to OG const p = Object.assign({}, player, { @@ -1093,171 +1517,203 @@ export const saveSynergy = async (button?: boolean): Promise => { wowPlatonicCubes: Number(player.wowPlatonicCubes), singularityUpgrades: Object.fromEntries( Object.entries(player.singularityUpgrades).map(([key, value]) => { - return [key, { - level: value.level, - goldenQuarksInvested: value.goldenQuarksInvested, - toggleBuy: value.toggleBuy, - freeLevels: value.freeLevels - }] + return [ + key, + { + level: value.level, + goldenQuarksInvested: value.goldenQuarksInvested, + toggleBuy: value.toggleBuy, + freeLevels: value.freeLevels, + }, + ]; }) ), octeractUpgrades: Object.fromEntries( Object.entries(player.octeractUpgrades).map(([key, value]) => { - return [key, { - level: value.level, - octeractsInvested: value.octeractsInvested, - toggleBuy: value.toggleBuy, - freeLevels: value.freeLevels - }] + return [ + key, + { + level: value.level, + octeractsInvested: value.octeractsInvested, + toggleBuy: value.toggleBuy, + freeLevels: value.freeLevels, + }, + ]; }) ), singularityChallenges: Object.fromEntries( Object.entries(player.singularityChallenges).map(([key, value]) => { - return [key, { - completions: value.completions, - highestSingularityCompleted: value.highestSingularityCompleted, - enabled: value.enabled - }] + return [ + key, + { + completions: value.completions, + highestSingularityCompleted: value.highestSingularityCompleted, + enabled: value.enabled, + }, + ]; }) ), blueberryUpgrades: Object.fromEntries( Object.entries(player.blueberryUpgrades).map(([key, value]) => { - return [key, { - level: value.level, - ambrosiaInvested: value.ambrosiaInvested, - blueberriesInvested: value.blueberriesInvested, - toggleBuy: value.toggleBuy, - freeLevels: value.freeLevels - }] + return [ + key, + { + level: value.level, + ambrosiaInvested: value.ambrosiaInvested, + blueberriesInvested: value.blueberriesInvested, + toggleBuy: value.toggleBuy, + freeLevels: value.freeLevels, + }, + ]; }) - ) - }) + ), + }); - const save = btoa(JSON.stringify(p)) + const save = btoa(JSON.stringify(p)); if (save !== null) { - const saveBlob = new Blob([save], { type: 'text/plain' }) + const saveBlob = new Blob([save], { type: "text/plain" }); // Should prevent overwritting of localforage that is currently used if (!saveCheck.canSave) { - return false + return false; } - localStorage.setItem('Synergysave2', save) - await localforage.setItem('Synergysave2', saveBlob) + localStorage.setItem("Synergysave2", save); + await localforage.setItem("Synergysave2", saveBlob); } else { - await Alert(i18next.t('testing.errorSaving')) - return false + await Alert(i18next.t("testing.errorSaving")); + return false; } if (button) { - const el = DOMCacheGetOrSet('saveinfo') - el.textContent = i18next.t('testing.gameSaved') - setTimeout(() => el.textContent = '', 4000) + const el = DOMCacheGetOrSet("saveinfo"); + el.textContent = i18next.t("testing.gameSaved"); + setTimeout(() => (el.textContent = ""), 4000); } - return true -} + return true; +}; /** * Map of properties on the Player object to adapt */ const toAdapt = new Map unknown>([ - ['worlds', (data) => new QuarkHandler({ quarks: Number(data.worlds) || 0, bonus: player.worlds.BONUS })], - ['wowCubes', (data) => new WowCubes(Number(data.wowCubes) || 0)], - ['wowTesseracts', (data) => new WowTesseracts(Number(data.wowTesseracts) || 0)], - ['wowHypercubes', (data) => new WowHypercubes(Number(data.wowHypercubes) || 0)], - ['wowPlatonicCubes', (data) => new WowPlatonicCubes(Number(data.wowPlatonicCubes) || 0)] -]) + [ + "worlds", + (data) => + new QuarkHandler({ + quarks: Number(data.worlds) || 0, + bonus: player.worlds.BONUS, + }), + ], + ["wowCubes", (data) => new WowCubes(Number(data.wowCubes) || 0)], + [ + "wowTesseracts", + (data) => new WowTesseracts(Number(data.wowTesseracts) || 0), + ], + [ + "wowHypercubes", + (data) => new WowHypercubes(Number(data.wowHypercubes) || 0), + ], + [ + "wowPlatonicCubes", + (data) => new WowPlatonicCubes(Number(data.wowPlatonicCubes) || 0), + ], +]); const loadSynergy = async () => { - const save = await localforage.getItem('Synergysave2') - ?? localStorage.getItem('Synergysave2') + const save = + (await localforage.getItem("Synergysave2")) ?? + localStorage.getItem("Synergysave2"); - const saveString = typeof save === 'string' ? save : await save?.text() + const saveString = typeof save === "string" ? save : await save?.text(); const data = saveString - ? JSON.parse(atob(saveString)) as PlayerSave & Record - : null + ? (JSON.parse(atob(saveString)) as PlayerSave & Record) + : null; if (testing || !prod) { Object.defineProperties(window, { player: { value: player }, G: { value: G }, Decimal: { value: Decimal }, - i18n: { value: i18next } - }) + i18n: { value: i18next }, + }); if (data && testing) { - data.exporttest = false + data.exporttest = false; } } - Object.assign(G, { ...blankGlobals }) + Object.assign(G, { ...blankGlobals }); if (data) { - if ( - (data.exporttest === false || data.exporttest === 'NO!') - && !testing - ) { - return Alert(i18next.t('testing.saveInLive2')) + if ((data.exporttest === false || data.exporttest === "NO!") && !testing) { + return Alert(i18next.t("testing.saveInLive2")); } const oldCodesUsed = Array.from( { length: 24 }, // old codes only went up to 24 - (_, i) => `offerpromo${(i + 1)}used` - ) + (_, i) => `offerpromo${i + 1}used` + ); // size before loading - const size = player.codes.size + const size = player.codes.size; - const oldPromoKeys = Object.keys(data).filter((k) => k.includes('offerpromo')) + const oldPromoKeys = Object.keys(data).filter((k) => + k.includes("offerpromo") + ); if (oldPromoKeys.length > 0) { oldPromoKeys.forEach((k) => { - const value = data[k] - const num = +k.replace(/[^\d]/g, '') - player.codes.set(num, Boolean(value)) - }) + const value = data[k]; + const num = +k.replace(/[^\d]/g, ""); + player.codes.set(num, Boolean(value)); + }); } Object.keys(data).forEach((stringProp) => { - const prop = stringProp as keyof Player + const prop = stringProp as keyof Player; if (!(prop in player)) { - return + return; } else if (toAdapt.has(prop)) { - return ((player[prop] as unknown) = toAdapt.get(prop)!(data)) + return ((player[prop] as unknown) = toAdapt.get(prop)!(data)); } else if (isDecimal(player[prop])) { - return ((player[prop] as Decimal) = new Decimal(data[prop] as DecimalSource)) - } else if (prop === 'codes') { - const codes = data[prop] + return ((player[prop] as Decimal) = new Decimal( + data[prop] as DecimalSource + )); + } else if (prop === "codes") { + const codes = data[prop]; if (codes != null) { - return (player.codes = new Map(codes)) + return (player.codes = new Map(codes)); } } else if (oldCodesUsed.includes(prop)) { - return + return; } else if (Array.isArray(data[prop])) { - const arr = data[prop] as unknown[] + const arr = data[prop] as unknown[]; // in old savefiles, some arrays may be 1-based instead of 0-based (newer) // so if the lengths of the savefile key is greater than that of the player obj // it means a key was removed; likely a 1-based index where array[0] was null // so we can get rid of it entirely. if ((player[prop] as unknown[]).length < arr.length) { - return (player[prop] as unknown[]) = arr.slice(arr.length - (player[prop] as unknown[]).length) + return ((player[prop] as unknown[]) = arr.slice( + arr.length - (player[prop] as unknown[]).length + )); } } - return ((player[prop] as unknown) = data[prop]) - }) + return ((player[prop] as unknown) = data[prop]); + }); - player.lastExportedSave = data.lastExportedSave ?? 0 + player.lastExportedSave = data.lastExportedSave ?? 0; if (data.offerpromo24used !== undefined) { - player.codes.set(25, false) + player.codes.set(25, false); } // sets all non-existent codes to default value false if (player.codes.size < size) { for (let i = player.codes.size + 1; i <= size; i++) { if (!player.codes.has(i)) { - player.codes.set(i, false) + player.codes.set(i, false); } } } @@ -1266,255 +1722,337 @@ const loadSynergy = async () => { if (player.codes.size < size) { for (let i = player.codes.size + 1; i <= size; i++) { if (!player.codes.has(i)) { - player.codes.set(i, false) + player.codes.set(i, false); } } } - if (!('rngCode' in data)) { - player.rngCode = 0 + if (!("rngCode" in data)) { + player.rngCode = 0; } if (data.loaded1009 === undefined || !data.loaded1009) { - player.loaded1009 = false + player.loaded1009 = false; } if (data.loaded1009hotfix1 === undefined || !data.loaded1009hotfix1) { - player.loaded1009hotfix1 = false + player.loaded1009hotfix1 = false; } if (data.loaded10091 === undefined) { - player.loaded10091 = false + player.loaded10091 = false; } if (data.loaded1010 === undefined) { - player.loaded1010 = false + player.loaded1010 = false; } if (data.loaded10101 === undefined) { - player.loaded10101 = false + player.loaded10101 = false; } // Fix dumb shop stuff // First, if shop isn't even defined we just define it as so if (data.shopUpgrades === undefined) { - player.shopUpgrades = Object.assign({}, blankSave.shopUpgrades) - } - - if (typeof player.researches[76] === 'undefined') { - player.codes.set(13, false) - player.researches.push(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) - player.achievements.push(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) - player.maxofferings = player.runeshards - player.maxobtainium = player.researchPoints - player.researchPoints += 51200 * player.researches[50] - player.researches[50] = 0 - } - - player.maxofferings = player.maxofferings || 0 - player.maxobtainium = player.maxobtainium || 0 - player.runeshards = player.runeshards || 0 - player.researchPoints = player.researchPoints || 0 - - if (!data.loaded1009 || data.loaded1009hotfix1 === null || data.shopUpgrades?.offeringPotion === undefined) { - player.firstOwnedParticles = 0 - player.secondOwnedParticles = 0 - player.thirdOwnedParticles = 0 - player.fourthOwnedParticles = 0 - player.fifthOwnedParticles = 0 - player.firstCostParticles = new Decimal('1') - player.secondCostParticles = new Decimal('1e2') - player.thirdCostParticles = new Decimal('1e4') - player.fourthCostParticles = new Decimal('1e8') - player.fifthCostParticles = new Decimal('1e16') - player.autoSacrificeToggle = false - player.autoResearchToggle = false - player.autoResearchMode = 'manual' - player.autoResearch = 0 - player.autoSacrifice = 0 - player.sacrificeTimer = 0 - player.loaded1009 = true - player.codes.set(18, false) + player.shopUpgrades = Object.assign({}, blankSave.shopUpgrades); + } + + if (typeof player.researches[76] === "undefined") { + player.codes.set(13, false); + player.researches.push( + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ); + player.achievements.push( + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ); + player.maxofferings = player.runeshards; + player.maxobtainium = player.researchPoints; + player.researchPoints += 51200 * player.researches[50]; + player.researches[50] = 0; + } + + player.maxofferings = player.maxofferings || 0; + player.maxobtainium = player.maxobtainium || 0; + player.runeshards = player.runeshards || 0; + player.researchPoints = player.researchPoints || 0; + + if ( + !data.loaded1009 || + data.loaded1009hotfix1 === null || + data.shopUpgrades?.offeringPotion === undefined + ) { + player.firstOwnedParticles = 0; + player.secondOwnedParticles = 0; + player.thirdOwnedParticles = 0; + player.fourthOwnedParticles = 0; + player.fifthOwnedParticles = 0; + player.firstCostParticles = new Decimal("1"); + player.secondCostParticles = new Decimal("1e2"); + player.thirdCostParticles = new Decimal("1e4"); + player.fourthCostParticles = new Decimal("1e8"); + player.fifthCostParticles = new Decimal("1e16"); + player.autoSacrificeToggle = false; + player.autoResearchToggle = false; + player.autoResearchMode = "manual"; + player.autoResearch = 0; + player.autoSacrifice = 0; + player.sacrificeTimer = 0; + player.loaded1009 = true; + player.codes.set(18, false); } if (!data.loaded1009hotfix1) { - player.loaded1009hotfix1 = true - player.codes.set(19, true) - player.firstOwnedParticles = 0 - player.secondOwnedParticles = 0 - player.thirdOwnedParticles = 0 - player.fourthOwnedParticles = 0 - player.fifthOwnedParticles = 0 - player.firstCostParticles = new Decimal('1') - player.secondCostParticles = new Decimal('1e2') - player.thirdCostParticles = new Decimal('1e4') - player.fourthCostParticles = new Decimal('1e8') - player.fifthCostParticles = new Decimal('1e16') + player.loaded1009hotfix1 = true; + player.codes.set(19, true); + player.firstOwnedParticles = 0; + player.secondOwnedParticles = 0; + player.thirdOwnedParticles = 0; + player.fourthOwnedParticles = 0; + player.fifthOwnedParticles = 0; + player.firstCostParticles = new Decimal("1"); + player.secondCostParticles = new Decimal("1e2"); + player.thirdCostParticles = new Decimal("1e4"); + player.fourthCostParticles = new Decimal("1e8"); + player.fifthCostParticles = new Decimal("1e16"); } if ( - data.loaded10091 === undefined || !data.loaded10091 || player.researches[86] > 100 || player.researches[87] > 100 - || player.researches[88] > 100 || player.researches[89] > 100 || player.researches[90] > 10 + data.loaded10091 === undefined || + !data.loaded10091 || + player.researches[86] > 100 || + player.researches[87] > 100 || + player.researches[88] > 100 || + player.researches[89] > 100 || + player.researches[90] > 10 ) { - player.loaded10091 = true - player.researchPoints += 7.5e8 * player.researches[82] - player.researchPoints += 2e8 * player.researches[83] - player.researchPoints += 4.5e9 * player.researches[84] - player.researchPoints += 2.5e7 * player.researches[86] - player.researchPoints += 7.5e7 * player.researches[87] - player.researchPoints += 3e8 * player.researches[88] - player.researchPoints += 1e9 * player.researches[89] - player.researchPoints += 2.5e7 * player.researches[90] - player.researchPoints += 1e8 * player.researches[91] - player.researchPoints += 2e9 * player.researches[92] - player.researchPoints += 9e9 * player.researches[93] - player.researchPoints += 7.25e10 * player.researches[94] - player.researches[86] = 0 - player.researches[87] = 0 - player.researches[88] = 0 - player.researches[89] = 0 - player.researches[90] = 0 - player.researches[91] = 0 - player.researches[92] = 0 + player.loaded10091 = true; + player.researchPoints += 7.5e8 * player.researches[82]; + player.researchPoints += 2e8 * player.researches[83]; + player.researchPoints += 4.5e9 * player.researches[84]; + player.researchPoints += 2.5e7 * player.researches[86]; + player.researchPoints += 7.5e7 * player.researches[87]; + player.researchPoints += 3e8 * player.researches[88]; + player.researchPoints += 1e9 * player.researches[89]; + player.researchPoints += 2.5e7 * player.researches[90]; + player.researchPoints += 1e8 * player.researches[91]; + player.researchPoints += 2e9 * player.researches[92]; + player.researchPoints += 9e9 * player.researches[93]; + player.researchPoints += 7.25e10 * player.researches[94]; + player.researches[86] = 0; + player.researches[87] = 0; + player.researches[88] = 0; + player.researches[89] = 0; + player.researches[90] = 0; + player.researches[91] = 0; + player.researches[92] = 0; } // const shop = data.shopUpgrades as LegacyShopUpgrades & Player['shopUpgrades']; if ( - data.achievements?.[169] === undefined - || typeof player.achievements[169] === 'undefined' + data.achievements?.[169] === undefined || + typeof player.achievements[169] === "undefined" || // (shop.antSpeed === undefined && shop.antSpeedLevel === undefined) || // (shop.antSpeed === undefined && typeof shop.antSpeedLevel === 'undefined') || - || data.loaded1010 === undefined - || data.loaded1010 === false + data.loaded1010 === undefined || + data.loaded1010 === false ) { - player.loaded1010 = true - player.codes.set(21, false) - - player.firstOwnedAnts = 0 - player.firstGeneratedAnts = new Decimal('0') - player.firstCostAnts = new Decimal('1e700') - player.firstProduceAnts = .0001 - - player.secondOwnedAnts = 0 - player.secondGeneratedAnts = new Decimal('0') - player.secondCostAnts = new Decimal('3') - player.secondProduceAnts = .00005 - - player.thirdOwnedAnts = 0 - player.thirdGeneratedAnts = new Decimal('0') - player.thirdCostAnts = new Decimal('100') - player.thirdProduceAnts = .00002 - - player.fourthOwnedAnts = 0 - player.fourthGeneratedAnts = new Decimal('0') - player.fourthCostAnts = new Decimal('1e4') - player.fourthProduceAnts = .00001 - - player.fifthOwnedAnts = 0 - player.fifthGeneratedAnts = new Decimal('0') - player.fifthCostAnts = new Decimal('1e12') - player.fifthProduceAnts = .000005 - - player.sixthOwnedAnts = 0 - player.sixthGeneratedAnts = new Decimal('0') - player.sixthCostAnts = new Decimal('1e36') - player.sixthProduceAnts = .000002 - - player.seventhOwnedAnts = 0 - player.seventhGeneratedAnts = new Decimal('0') - player.seventhCostAnts = new Decimal('1e100') - player.seventhProduceAnts = .000001 - - player.eighthOwnedAnts = 0 - player.eighthGeneratedAnts = new Decimal('0') - player.eighthCostAnts = new Decimal('1e300') - player.eighthProduceAnts = .00000001 - - player.achievements.push(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) - player.antPoints = new Decimal('1') - - player.upgrades[38] = 0 - player.upgrades[39] = 0 - player.upgrades[40] = 0 - - player.upgrades[76] = 0 - player.upgrades[77] = 0 - player.upgrades[78] = 0 - player.upgrades[79] = 0 - player.upgrades[80] = 0 + player.loaded1010 = true; + player.codes.set(21, false); + + player.firstOwnedAnts = 0; + player.firstGeneratedAnts = new Decimal("0"); + player.firstCostAnts = new Decimal("1e700"); + player.firstProduceAnts = 0.0001; + + player.secondOwnedAnts = 0; + player.secondGeneratedAnts = new Decimal("0"); + player.secondCostAnts = new Decimal("3"); + player.secondProduceAnts = 0.00005; + + player.thirdOwnedAnts = 0; + player.thirdGeneratedAnts = new Decimal("0"); + player.thirdCostAnts = new Decimal("100"); + player.thirdProduceAnts = 0.00002; + + player.fourthOwnedAnts = 0; + player.fourthGeneratedAnts = new Decimal("0"); + player.fourthCostAnts = new Decimal("1e4"); + player.fourthProduceAnts = 0.00001; + + player.fifthOwnedAnts = 0; + player.fifthGeneratedAnts = new Decimal("0"); + player.fifthCostAnts = new Decimal("1e12"); + player.fifthProduceAnts = 0.000005; + + player.sixthOwnedAnts = 0; + player.sixthGeneratedAnts = new Decimal("0"); + player.sixthCostAnts = new Decimal("1e36"); + player.sixthProduceAnts = 0.000002; + + player.seventhOwnedAnts = 0; + player.seventhGeneratedAnts = new Decimal("0"); + player.seventhCostAnts = new Decimal("1e100"); + player.seventhProduceAnts = 0.000001; + + player.eighthOwnedAnts = 0; + player.eighthGeneratedAnts = new Decimal("0"); + player.eighthCostAnts = new Decimal("1e300"); + player.eighthProduceAnts = 0.00000001; + + player.achievements.push(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + player.antPoints = new Decimal("1"); + + player.upgrades[38] = 0; + player.upgrades[39] = 0; + player.upgrades[40] = 0; + + player.upgrades[76] = 0; + player.upgrades[77] = 0; + player.upgrades[78] = 0; + player.upgrades[79] = 0; + player.upgrades[80] = 0; // player.shopUpgrades.antSpeed = 0; // player.shopUpgrades.shopTalisman = 0; - player.antUpgrades = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] - - player.unlocks.rrow4 = false - player.researchPoints += 3e7 * player.researches[50] - player.researchPoints += 2e9 * player.researches[96] - player.researchPoints += 5e9 * player.researches[97] - player.researchPoints += 3e10 * player.researches[98] - player.researches[50] = 0 - player.researches[96] = 0 - player.researches[97] = 0 - player.researches[98] = 0 - player.researches.push(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) - - player.talismanLevels = [0, 0, 0, 0, 0, 0, 0] - player.talismanRarity = [1, 1, 1, 1, 1, 1, 1] - - player.talismanShards = 0 - player.commonFragments = 0 - player.uncommonFragments = 0 - player.rareFragments = 0 - player.epicFragments = 0 - player.legendaryFragments = 0 - player.mythicalFragments = 0 - player.buyTalismanShardPercent = 10 - - player.talismanOne = [null, -1, 1, 1, 1, -1] - player.talismanTwo = [null, 1, 1, -1, -1, 1] - player.talismanThree = [null, 1, -1, 1, 1, -1] - player.talismanFour = [null, -1, -1, 1, 1, 1] - player.talismanFive = [null, 1, 1, -1, -1, 1] - player.talismanSix = [null, 1, 1, 1, -1, -1] - player.talismanSeven = [null, -1, 1, -1, 1, 1] - - player.antSacrificePoints = 0 - player.antSacrificeTimer = 0 - - player.obtainiumpersecond = 0 - player.maxobtainiumpersecond = 0 + player.antUpgrades = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; + + player.unlocks.rrow4 = false; + player.researchPoints += 3e7 * player.researches[50]; + player.researchPoints += 2e9 * player.researches[96]; + player.researchPoints += 5e9 * player.researches[97]; + player.researchPoints += 3e10 * player.researches[98]; + player.researches[50] = 0; + player.researches[96] = 0; + player.researches[97] = 0; + player.researches[98] = 0; + player.researches.push( + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ); + + player.talismanLevels = [0, 0, 0, 0, 0, 0, 0]; + player.talismanRarity = [1, 1, 1, 1, 1, 1, 1]; + + player.talismanShards = 0; + player.commonFragments = 0; + player.uncommonFragments = 0; + player.rareFragments = 0; + player.epicFragments = 0; + player.legendaryFragments = 0; + player.mythicalFragments = 0; + player.buyTalismanShardPercent = 10; + + player.talismanOne = [null, -1, 1, 1, 1, -1]; + player.talismanTwo = [null, 1, 1, -1, -1, 1]; + player.talismanThree = [null, 1, -1, 1, 1, -1]; + player.talismanFour = [null, -1, -1, 1, 1, 1]; + player.talismanFive = [null, 1, 1, -1, -1, 1]; + player.talismanSix = [null, 1, 1, 1, -1, -1]; + player.talismanSeven = [null, -1, 1, -1, 1, 1]; + + player.antSacrificePoints = 0; + player.antSacrificeTimer = 0; + + player.obtainiumpersecond = 0; + player.maxobtainiumpersecond = 0; } if (data.loaded10101 === undefined || data.loaded10101 === false) { - player.loaded10101 = true + player.loaded10101 = true; // dprint-ignore const refundThese = [ - 0, 31, 32, 61, 62, 63, 64, 76, 77, 78, 79, 80, - 81, 98, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 125 - ] + 0, 31, 32, 61, 62, 63, 64, 76, 77, 78, 79, 80, 81, 98, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 125, + ]; // dprint-ignore const refundReward = [ - 0, 2, 20, 5, 10, 80, 5e3, 1e7, 1e7, 2e7, 3e7, 4e7, - 2e8, 3e10, 1e11, 1e12, 2e11, 1e12, 2e10, - 2e11, 1e12, 2e13, 5e13, 1e14, 2e14, 5e14, 1e15, - 2e15, 1e16, 1e15, 1e16, 1e14, 1e15, 1e15, 1e20 - ] + 0, 2, 20, 5, 10, 80, 5e3, 1e7, 1e7, 2e7, 3e7, 4e7, 2e8, 3e10, 1e11, + 1e12, 2e11, 1e12, 2e10, 2e11, 1e12, 2e13, 5e13, 1e14, 2e14, 5e14, 1e15, + 2e15, 1e16, 1e15, 1e16, 1e14, 1e15, 1e15, 1e20, + ]; for (let i = 1; i < refundThese.length; i++) { - player.researchPoints += player.researches[refundThese[i]] * refundReward[i] - player.researches[refundThese[i]] = 0 + player.researchPoints += + player.researches[refundThese[i]] * refundReward[i]; + player.researches[refundThese[i]] = 0; } - player.autoAntSacrifice = false - player.antMax = false + player.autoAntSacrifice = false; + player.antMax = false; } - if (player.firstOwnedAnts < 1 && player.firstCostAnts.gte('1e1200')) { - player.firstCostAnts = new Decimal('1e700') - player.firstOwnedAnts = 0 + if (player.firstOwnedAnts < 1 && player.firstCostAnts.gte("1e1200")) { + player.firstCostAnts = new Decimal("1e700"); + player.firstOwnedAnts = 0; } - checkVariablesOnLoad(data) + checkVariablesOnLoad(data); if (data.ascensionCount === undefined || player.ascensionCount === 0) { - player.ascensionCount = 0 + player.ascensionCount = 0; if (player.ascensionCounter === 0 && player.prestigeCount > 0) { - player.ascensionCounter = 86400 * 90 + player.ascensionCounter = 86400 * 90; } /*player.cubeUpgrades = [null, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1525,12 +2063,12 @@ const loadSynergy = async () => { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,];*/ if (player.singularityCount === 0) { - player.cubeUpgrades = [...blankSave.cubeUpgrades] + player.cubeUpgrades = [...blankSave.cubeUpgrades]; } - player.wowCubes = new WowCubes(0) - player.wowTesseracts = new WowTesseracts(0) - player.wowHypercubes = new WowHypercubes(0) - player.wowPlatonicCubes = new WowPlatonicCubes(0) + player.wowCubes = new WowCubes(0); + player.wowTesseracts = new WowTesseracts(0); + player.wowHypercubes = new WowHypercubes(0); + player.wowPlatonicCubes = new WowPlatonicCubes(0); player.cubeBlessings = { accelerator: 0, multiplier: 0, @@ -1541,37 +2079,37 @@ const loadSynergy = async () => { antSacrifice: 0, antELO: 0, talismanBonus: 0, - globalSpeed: 0 - } + globalSpeed: 0, + }; } if (data.autoAntSacTimer == null) { - player.autoAntSacTimer = 900 + player.autoAntSacTimer = 900; } if (data.autoAntSacrificeMode === undefined) { - player.autoAntSacrificeMode = 0 + player.autoAntSacrificeMode = 0; } if (player.transcendCount < 0) { - player.transcendCount = 0 + player.transcendCount = 0; } if (player.reincarnationCount < 0) { - player.reincarnationCount = 0 + player.reincarnationCount = 0; } if (player.runeshards < 0) { - player.runeshards = 0 + player.runeshards = 0; } if (player.researchPoints < 0) { - player.researchPoints = 0 + player.researchPoints = 0; } if (player.resettoggle1 === 0) { - player.resettoggle1 = 1 - player.resettoggle2 = 1 - player.resettoggle3 = 1 - player.resettoggle4 = 1 + player.resettoggle1 = 1; + player.resettoggle2 = 1; + player.resettoggle3 = 1; + player.resettoggle4 = 1; } if (player.tesseractAutoBuyerToggle === 0) { - player.tesseractAutoBuyerToggle = 1 + player.tesseractAutoBuyerToggle = 1; } if (player.reincarnationCount < 0.5 && player.unlocks.rrow4) { player.unlocks = { @@ -1586,674 +2124,984 @@ const loadSynergy = async () => { rrow1: false, rrow2: false, rrow3: false, - rrow4: false - } + rrow4: false, + }; } if (data.history === undefined) { - player.history = { ants: [], ascend: [], reset: [], singularity: [] } + player.history = { ants: [], ascend: [], reset: [], singularity: [] }; } else { // See: https://discord.com/channels/677271830838640680/964168000360038481/964168002071330879 - const keys = Object.keys(blankSave.history) as (keyof typeof blankSave['history'])[] + const keys = Object.keys( + blankSave.history + ) as (keyof (typeof blankSave)["history"])[]; for (const historyKey of keys) { if (!(historyKey in player.history)) { - player.history[historyKey] = [] + player.history[historyKey] = []; } } } if (data.historyShowPerSecond === undefined) { - player.historyShowPerSecond = false + player.historyShowPerSecond = false; } if (!Number.isInteger(player.ascendBuilding1.cost)) { - player.ascendBuilding1.cost = 1 - player.ascendBuilding1.owned = 0 - player.ascendBuilding2.cost = 10 - player.ascendBuilding2.owned = 0 - player.ascendBuilding3.cost = 100 - player.ascendBuilding3.owned = 0 - player.ascendBuilding4.cost = 1000 - player.ascendBuilding4.owned = 0 - player.ascendBuilding5.cost = 10000 - player.ascendBuilding5.owned = 0 + player.ascendBuilding1.cost = 1; + player.ascendBuilding1.owned = 0; + player.ascendBuilding2.cost = 10; + player.ascendBuilding2.owned = 0; + player.ascendBuilding3.cost = 100; + player.ascendBuilding3.owned = 0; + player.ascendBuilding4.cost = 1000; + player.ascendBuilding4.owned = 0; + player.ascendBuilding5.cost = 10000; + player.ascendBuilding5.owned = 0; } if (!player.dayCheck) { - player.dayCheck = new Date() + player.dayCheck = new Date(); } - if (typeof player.dayCheck === 'string') { - player.dayCheck = new Date(player.dayCheck) + if (typeof player.dayCheck === "string") { + player.dayCheck = new Date(player.dayCheck); if (isNaN(player.dayCheck.getTime())) { - player.dayCheck = new Date() + player.dayCheck = new Date(); } } // Measures for people who play the past - let updatedLast = lastUpdated + let updatedLast = lastUpdated; if (!isNaN(updatedLast.getTime())) { - updatedLast = new Date(updatedLast.getFullYear(), updatedLast.getMonth(), updatedLast.getDate() - 1) + updatedLast = new Date( + updatedLast.getFullYear(), + updatedLast.getMonth(), + updatedLast.getDate() - 1 + ); if (player.dayCheck.getTime() < updatedLast.getTime()) { - player.dayCheck = updatedLast + player.dayCheck = updatedLast; } } else if (player.dayCheck.getTime() < 1654009200000) { - player.dayCheck = new Date('06/01/2022 00:00:00') + player.dayCheck = new Date("06/01/2022 00:00:00"); } // Calculate daily - player.dayCheck = new Date(player.dayCheck.getFullYear(), player.dayCheck.getMonth(), player.dayCheck.getDate()) - - const maxLevel = maxCorruptionLevel() - player.usedCorruptions = player.usedCorruptions.map((curr: number, index: number) => { - if (index >= 2 && index <= 9) { - return Math.min(maxLevel * (player.challengecompletions[corrChallengeMinimum(index)] > 0 ? 1 : 0), curr) + player.dayCheck = new Date( + player.dayCheck.getFullYear(), + player.dayCheck.getMonth(), + player.dayCheck.getDate() + ); + + const maxLevel = maxCorruptionLevel(); + player.usedCorruptions = player.usedCorruptions.map( + (curr: number, index: number) => { + if (index >= 2 && index <= 9) { + return Math.min( + maxLevel * + (player.challengecompletions[corrChallengeMinimum(index)] > 0 + ? 1 + : 0), + curr + ); + } + return curr; } - return curr - }) + ); for (let i = 1; i <= 5; i++) { - const ascendBuildingI = `ascendBuilding${i as OneToFive}` as const - player[ascendBuildingI].generated = new Decimal(player[ascendBuildingI].generated) + const ascendBuildingI = `ascendBuilding${i as OneToFive}` as const; + player[ascendBuildingI].generated = new Decimal( + player[ascendBuildingI].generated + ); } - while (typeof player.achievements[252] === 'undefined') { - player.achievements.push(0) + while (typeof player.achievements[252] === "undefined") { + player.achievements.push(0); } - while (typeof player.researches[200] === 'undefined') { - player.researches.push(0) + while (typeof player.researches[200] === "undefined") { + player.researches.push(0); } - while (typeof player.upgrades[140] === 'undefined') { - player.upgrades.push(0) + while (typeof player.upgrades[140] === "undefined") { + player.upgrades.push(0); } - if (player.saveString === '' || player.saveString === 'Synergism-v1011Test.txt') { - player.saveString = player.singularityCount === 0 - ? 'Synergism-$VERSION$-$TIME$.txt' - : 'Synergism-$VERSION$-$TIME$-$SING$.txt' + if ( + player.saveString === "" || + player.saveString === "Synergism-v1011Test.txt" + ) { + player.saveString = + player.singularityCount === 0 + ? "Synergism-$VERSION$-$TIME$.txt" + : "Synergism-$VERSION$-$TIME$-$SING$.txt"; } - ;(DOMCacheGetOrSet('saveStringInput') as HTMLInputElement).value = cleanString(player.saveString) + (DOMCacheGetOrSet("saveStringInput") as HTMLInputElement).value = + cleanString(player.saveString); for (let j = 1; j < 126; j++) { - upgradeupdate(j, true) + upgradeupdate(j, true); } - for (let j = 1; j <= (200); j++) { - updateResearchBG(j) + for (let j = 1; j <= 200; j++) { + updateResearchBG(j); } for (let j = 1; j < player.cubeUpgrades.length; j++) { - updateCubeUpgradeBG(j) + updateCubeUpgradeBG(j); } - const platUpg = document.querySelectorAll('img[id^="platUpg"]') + const platUpg = document.querySelectorAll('img[id^="platUpg"]'); for (let j = 1; j <= platUpg.length; j++) { - updatePlatonicUpgradeBG(j) + updatePlatonicUpgradeBG(j); } - const q = ['coin', 'crystal', 'mythos', 'particle', 'offering', 'tesseract'] as const + const q = [ + "coin", + "crystal", + "mythos", + "particle", + "offering", + "tesseract", + ] as const; if ( - player.coinbuyamount !== 1 && player.coinbuyamount !== 10 && player.coinbuyamount !== 100 - && player.coinbuyamount !== 1000 + player.coinbuyamount !== 1 && + player.coinbuyamount !== 10 && + player.coinbuyamount !== 100 && + player.coinbuyamount !== 1000 ) { - player.coinbuyamount = 1 + player.coinbuyamount = 1; } if ( - player.crystalbuyamount !== 1 && player.crystalbuyamount !== 10 && player.crystalbuyamount !== 100 - && player.crystalbuyamount !== 1000 + player.crystalbuyamount !== 1 && + player.crystalbuyamount !== 10 && + player.crystalbuyamount !== 100 && + player.crystalbuyamount !== 1000 ) { - player.crystalbuyamount = 1 + player.crystalbuyamount = 1; } if ( - player.mythosbuyamount !== 1 && player.mythosbuyamount !== 10 && player.mythosbuyamount !== 100 - && player.mythosbuyamount !== 1000 + player.mythosbuyamount !== 1 && + player.mythosbuyamount !== 10 && + player.mythosbuyamount !== 100 && + player.mythosbuyamount !== 1000 ) { - player.mythosbuyamount = 1 + player.mythosbuyamount = 1; } if ( - player.particlebuyamount !== 1 && player.particlebuyamount !== 10 && player.particlebuyamount !== 100 - && player.particlebuyamount !== 1000 + player.particlebuyamount !== 1 && + player.particlebuyamount !== 10 && + player.particlebuyamount !== 100 && + player.particlebuyamount !== 1000 ) { - player.particlebuyamount = 1 + player.particlebuyamount = 1; } if ( - player.offeringbuyamount !== 1 && player.offeringbuyamount !== 10 && player.offeringbuyamount !== 100 - && player.offeringbuyamount !== 1000 + player.offeringbuyamount !== 1 && + player.offeringbuyamount !== 10 && + player.offeringbuyamount !== 100 && + player.offeringbuyamount !== 1000 ) { - player.offeringbuyamount = 1 + player.offeringbuyamount = 1; } if ( - player.tesseractbuyamount !== 1 && player.tesseractbuyamount !== 10 && player.tesseractbuyamount !== 100 - && player.tesseractbuyamount !== 1000 + player.tesseractbuyamount !== 1 && + player.tesseractbuyamount !== 10 && + player.tesseractbuyamount !== 100 && + player.tesseractbuyamount !== 1000 ) { - player.tesseractbuyamount = 1 + player.tesseractbuyamount = 1; } for (let j = 0; j <= 5; j++) { for (let k = 0; k < 4; k++) { - let d = '' + let d = ""; if (k === 0) { - d = 'one' + d = "one"; } if (k === 1) { - d = 'ten' + d = "ten"; } if (k === 2) { - d = 'hundred' + d = "hundred"; } if (k === 3) { - d = 'thousand' + d = "thousand"; } - const e = `${q[j]}${d}` - DOMCacheGetOrSet(e).style.backgroundColor = '' + const e = `${q[j]}${d}`; + DOMCacheGetOrSet(e).style.backgroundColor = ""; } - let c = '' - const curBuyAmount = player[`${q[j]}buyamount` as const] + let c = ""; + const curBuyAmount = player[`${q[j]}buyamount` as const]; if (curBuyAmount === 1) { - c = 'one' + c = "one"; } if (curBuyAmount === 10) { - c = 'ten' + c = "ten"; } if (curBuyAmount === 100) { - c = 'hundred' + c = "hundred"; } if (curBuyAmount === 1000) { - c = 'thousand' + c = "thousand"; } - const b = `${q[j]}${c}` - DOMCacheGetOrSet(b).style.backgroundColor = 'green' + const b = `${q[j]}${c}`; + DOMCacheGetOrSet(b).style.backgroundColor = "green"; } - const testArray = [] + const testArray = []; // Creates a copy of research costs array for (let i = 0; i < G.researchBaseCosts.length; i++) { - testArray.push(G.researchBaseCosts[i]) + testArray.push(G.researchBaseCosts[i]); } // Sorts the above array, and returns the index order of sorted array - G.researchOrderByCost = sortWithIndices(testArray) - player.roombaResearchIndex = 0 + G.researchOrderByCost = sortWithIndices(testArray); + player.roombaResearchIndex = 0; // June 09, 2021: Updated toggleShops() and removed boilerplate - Platonic - toggleShops() - getChallengeConditions() - updateChallengeDisplay() - revealStuff() - toggleauto() + toggleShops(); + getChallengeConditions(); + updateChallengeDisplay(); + revealStuff(); + toggleauto(); // Challenge summary should be displayed if (player.currentChallenge.transcension > 0) { - challengeDisplay(player.currentChallenge.transcension) + challengeDisplay(player.currentChallenge.transcension); } else if (player.currentChallenge.reincarnation > 0) { - challengeDisplay(player.currentChallenge.reincarnation) + challengeDisplay(player.currentChallenge.reincarnation); } else if (player.currentChallenge.ascension > 0) { - challengeDisplay(player.currentChallenge.ascension) + challengeDisplay(player.currentChallenge.ascension); } else { - challengeDisplay(1) + challengeDisplay(1); } - corruptionStatsUpdate() - const corrs = Math.min(8, Object.keys(player.corruptionLoadouts).length) + 1 + corruptionStatsUpdate(); + const corrs = + Math.min(8, Object.keys(player.corruptionLoadouts).length) + 1; for (let i = 0; i < corrs; i++) { - corruptionLoadoutTableUpdate(i) + corruptionLoadoutTableUpdate(i); } - showCorruptionStatsLoadouts() - updateCorruptionLoadoutNames() + showCorruptionStatsLoadouts(); + updateCorruptionLoadoutNames(); - DOMCacheGetOrSet('researchrunebonus').textContent = i18next.t('runes.thanksResearches', { - percent: format(100 * G.effectiveLevelMult - 100, 4, true) - }) + DOMCacheGetOrSet("researchrunebonus").textContent = i18next.t( + "runes.thanksResearches", + { + percent: format(100 * G.effectiveLevelMult - 100, 4, true), + } + ); - DOMCacheGetOrSet('talismanlevelup').style.display = 'none' - DOMCacheGetOrSet('talismanrespec').style.display = 'none' + DOMCacheGetOrSet("talismanlevelup").style.display = "none"; + DOMCacheGetOrSet("talismanrespec").style.display = "none"; - DOMCacheGetOrSet('antSacrificeSummary').style.display = 'none' + DOMCacheGetOrSet("antSacrificeSummary").style.display = "none"; // This must be initialized at the beginning of the calculation - c15RewardUpdate() - - calculatePlatonicBlessings() - calculateHypercubeBlessings() - calculateTesseractBlessings() - calculateCubeBlessings() - updateTalismanAppearance(0) - updateTalismanAppearance(1) - updateTalismanAppearance(2) - updateTalismanAppearance(3) - updateTalismanAppearance(4) - updateTalismanAppearance(5) - updateTalismanAppearance(6) + c15RewardUpdate(); + + calculatePlatonicBlessings(); + calculateHypercubeBlessings(); + calculateTesseractBlessings(); + calculateCubeBlessings(); + updateTalismanAppearance(0); + updateTalismanAppearance(1); + updateTalismanAppearance(2); + updateTalismanAppearance(3); + updateTalismanAppearance(4); + updateTalismanAppearance(5); + updateTalismanAppearance(6); for (const id in player.ascStatToggles) { - toggleAscStatPerSecond(+id) // toggle each stat twice to make sure the displays are correct and match what they used to be - toggleAscStatPerSecond(+id) + toggleAscStatPerSecond(+id); // toggle each stat twice to make sure the displays are correct and match what they used to be + toggleAscStatPerSecond(+id); } // Strictly check the input and data with values other than numbers - const omit = /e\+/ - let inputd = player.autoChallengeTimer.start - let inpute = Number((DOMCacheGetOrSet('startAutoChallengeTimerInput') as HTMLInputElement).value) + const omit = /e\+/; + let inputd = player.autoChallengeTimer.start; + let inpute = Number( + (DOMCacheGetOrSet("startAutoChallengeTimerInput") as HTMLInputElement) + .value + ); if (inpute !== inputd || isNaN(inpute + inputd)) { - ;(DOMCacheGetOrSet('startAutoChallengeTimerInput') as HTMLInputElement).value = `${ + ( + DOMCacheGetOrSet("startAutoChallengeTimerInput") as HTMLInputElement + ).value = `${ player.autoChallengeTimer.start || blankSave.autoChallengeTimer.start - }`.replace(omit, 'e') - updateAutoChallenge(1) + }`.replace(omit, "e"); + updateAutoChallenge(1); } - DOMCacheGetOrSet('startTimerValue').innerHTML = i18next.t('challenges.timeStartSweep', { - time: format(player.autoChallengeTimer.start, 2, true) - }) + DOMCacheGetOrSet("startTimerValue").innerHTML = i18next.t( + "challenges.timeStartSweep", + { + time: format(player.autoChallengeTimer.start, 2, true), + } + ); - inputd = player.autoChallengeTimer.exit - inpute = Number((DOMCacheGetOrSet('exitAutoChallengeTimerInput') as HTMLInputElement).value) + inputd = player.autoChallengeTimer.exit; + inpute = Number( + (DOMCacheGetOrSet("exitAutoChallengeTimerInput") as HTMLInputElement) + .value + ); if (inpute !== inputd || isNaN(inpute + inputd)) { - ;(DOMCacheGetOrSet('exitAutoChallengeTimerInput') as HTMLInputElement).value = `${ + ( + DOMCacheGetOrSet("exitAutoChallengeTimerInput") as HTMLInputElement + ).value = `${ player.autoChallengeTimer.exit || blankSave.autoChallengeTimer.exit - }`.replace(omit, 'e') - updateAutoChallenge(2) + }`.replace(omit, "e"); + updateAutoChallenge(2); } - DOMCacheGetOrSet('exitTimerValue').innerHTML = i18next.t('challenges.timeExitChallenge', { - time: format(player.autoChallengeTimer.exit, 2, true) - }) + DOMCacheGetOrSet("exitTimerValue").innerHTML = i18next.t( + "challenges.timeExitChallenge", + { + time: format(player.autoChallengeTimer.exit, 2, true), + } + ); - inputd = player.autoChallengeTimer.enter - inpute = Number((DOMCacheGetOrSet('enterAutoChallengeTimerInput') as HTMLInputElement).value) + inputd = player.autoChallengeTimer.enter; + inpute = Number( + (DOMCacheGetOrSet("enterAutoChallengeTimerInput") as HTMLInputElement) + .value + ); if (inpute !== inputd || isNaN(inpute + inputd)) { - ;(DOMCacheGetOrSet('enterAutoChallengeTimerInput') as HTMLInputElement).value = `${ + ( + DOMCacheGetOrSet("enterAutoChallengeTimerInput") as HTMLInputElement + ).value = `${ player.autoChallengeTimer.enter || blankSave.autoChallengeTimer.enter - }`.replace(omit, 'e') - updateAutoChallenge(3) + }`.replace(omit, "e"); + updateAutoChallenge(3); } - DOMCacheGetOrSet('enterTimerValue').innerHTML = i18next.t('challenges.timeEnterChallenge', { - time: format(player.autoChallengeTimer.enter, 2, true) - }) + DOMCacheGetOrSet("enterTimerValue").innerHTML = i18next.t( + "challenges.timeEnterChallenge", + { + time: format(player.autoChallengeTimer.enter, 2, true), + } + ); - inputd = player.prestigeamount - inpute = Number((DOMCacheGetOrSet('prestigeamount') as HTMLInputElement).value) + inputd = player.prestigeamount; + inpute = Number( + (DOMCacheGetOrSet("prestigeamount") as HTMLInputElement).value + ); if (inpute !== inputd || isNaN(inpute + inputd)) { - ;(DOMCacheGetOrSet('prestigeamount') as HTMLInputElement).value = `${ + (DOMCacheGetOrSet("prestigeamount") as HTMLInputElement).value = `${ player.prestigeamount || blankSave.prestigeamount - }`.replace(omit, 'e') - updateAutoReset(1) + }`.replace(omit, "e"); + updateAutoReset(1); } - inputd = player.transcendamount - inpute = Number((DOMCacheGetOrSet('transcendamount') as HTMLInputElement).value) + inputd = player.transcendamount; + inpute = Number( + (DOMCacheGetOrSet("transcendamount") as HTMLInputElement).value + ); if (inpute !== inputd || isNaN(inpute + inputd)) { - ;(DOMCacheGetOrSet('transcendamount') as HTMLInputElement).value = `${ + (DOMCacheGetOrSet("transcendamount") as HTMLInputElement).value = `${ player.transcendamount || blankSave.transcendamount - }`.replace(omit, 'e') - updateAutoReset(2) + }`.replace(omit, "e"); + updateAutoReset(2); } - inputd = player.reincarnationamount - inpute = Number((DOMCacheGetOrSet('reincarnationamount') as HTMLInputElement).value) + inputd = player.reincarnationamount; + inpute = Number( + (DOMCacheGetOrSet("reincarnationamount") as HTMLInputElement).value + ); if (inpute !== inputd || isNaN(inpute + inputd)) { - ;(DOMCacheGetOrSet('reincarnationamount') as HTMLInputElement).value = `${ + (DOMCacheGetOrSet("reincarnationamount") as HTMLInputElement).value = `${ player.reincarnationamount || blankSave.reincarnationamount - }`.replace(omit, 'e') - updateAutoReset(3) + }`.replace(omit, "e"); + updateAutoReset(3); } - inputd = player.autoAscendThreshold - inpute = Number((DOMCacheGetOrSet('ascensionAmount') as HTMLInputElement).value) + inputd = player.autoAscendThreshold; + inpute = Number( + (DOMCacheGetOrSet("ascensionAmount") as HTMLInputElement).value + ); if (inpute !== inputd || isNaN(inpute + inputd)) { - ;(DOMCacheGetOrSet('ascensionAmount') as HTMLInputElement).value = `${ + (DOMCacheGetOrSet("ascensionAmount") as HTMLInputElement).value = `${ player.autoAscendThreshold || blankSave.autoAscendThreshold - }`.replace(omit, 'e') - updateAutoReset(4) + }`.replace(omit, "e"); + updateAutoReset(4); } - inputd = player.autoAntSacTimer - inpute = Number((DOMCacheGetOrSet('autoAntSacrificeAmount') as HTMLInputElement).value) + inputd = player.autoAntSacTimer; + inpute = Number( + (DOMCacheGetOrSet("autoAntSacrificeAmount") as HTMLInputElement).value + ); if (inpute !== inputd || isNaN(inpute + inputd)) { - ;(DOMCacheGetOrSet('autoAntSacrificeAmount') as HTMLInputElement).value = `${ - player.autoAntSacTimer || blankSave.autoAntSacTimer - }`.replace(omit, 'e') - updateAutoReset(5) - } - inputd = player.tesseractAutoBuyerAmount - inpute = Number((DOMCacheGetOrSet('tesseractAmount') as HTMLInputElement).value) + (DOMCacheGetOrSet("autoAntSacrificeAmount") as HTMLInputElement).value = + `${player.autoAntSacTimer || blankSave.autoAntSacTimer}`.replace( + omit, + "e" + ); + updateAutoReset(5); + } + inputd = player.tesseractAutoBuyerAmount; + inpute = Number( + (DOMCacheGetOrSet("tesseractAmount") as HTMLInputElement).value + ); if (inpute !== inputd || isNaN(inpute + inputd)) { - ;(DOMCacheGetOrSet('tesseractAmount') as HTMLInputElement).value = `${ + (DOMCacheGetOrSet("tesseractAmount") as HTMLInputElement).value = `${ player.tesseractAutoBuyerAmount || blankSave.tesseractAutoBuyerAmount - }`.replace(omit, 'e') - updateTesseractAutoBuyAmount() + }`.replace(omit, "e"); + updateTesseractAutoBuyAmount(); } - inputd = player.openCubes - inpute = Number((DOMCacheGetOrSet('cubeOpensInput') as HTMLInputElement).value) + inputd = player.openCubes; + inpute = Number( + (DOMCacheGetOrSet("cubeOpensInput") as HTMLInputElement).value + ); if (inpute !== inputd || isNaN(inpute + inputd)) { - ;(DOMCacheGetOrSet('cubeOpensInput') as HTMLInputElement).value = `${player.openCubes || blankSave.openCubes}` - .replace(omit, 'e') - updateAutoCubesOpens(1) - } - inputd = player.openTesseracts - inpute = Number((DOMCacheGetOrSet('tesseractsOpensInput') as HTMLInputElement).value) + (DOMCacheGetOrSet("cubeOpensInput") as HTMLInputElement).value = `${ + player.openCubes || blankSave.openCubes + }`.replace(omit, "e"); + updateAutoCubesOpens(1); + } + inputd = player.openTesseracts; + inpute = Number( + (DOMCacheGetOrSet("tesseractsOpensInput") as HTMLInputElement).value + ); if (inpute !== inputd || isNaN(inpute + inputd)) { - ;(DOMCacheGetOrSet('tesseractsOpensInput') as HTMLInputElement).value = `${ + (DOMCacheGetOrSet("tesseractsOpensInput") as HTMLInputElement).value = `${ player.openTesseracts || blankSave.openTesseracts - }`.replace(omit, 'e') - updateAutoCubesOpens(2) + }`.replace(omit, "e"); + updateAutoCubesOpens(2); } - inputd = player.openHypercubes - inpute = Number((DOMCacheGetOrSet('hypercubesOpensInput') as HTMLInputElement).value) + inputd = player.openHypercubes; + inpute = Number( + (DOMCacheGetOrSet("hypercubesOpensInput") as HTMLInputElement).value + ); if (inpute !== inputd || isNaN(inpute + inputd)) { - ;(DOMCacheGetOrSet('hypercubesOpensInput') as HTMLInputElement).value = `${ + (DOMCacheGetOrSet("hypercubesOpensInput") as HTMLInputElement).value = `${ player.openHypercubes || blankSave.openHypercubes - }`.replace(omit, 'e') - updateAutoCubesOpens(3) + }`.replace(omit, "e"); + updateAutoCubesOpens(3); } - inputd = player.openPlatonicsCubes - inpute = Number((DOMCacheGetOrSet('platonicCubeOpensInput') as HTMLInputElement).value) + inputd = player.openPlatonicsCubes; + inpute = Number( + (DOMCacheGetOrSet("platonicCubeOpensInput") as HTMLInputElement).value + ); if (inpute !== inputd || isNaN(inpute + inputd)) { - ;(DOMCacheGetOrSet('platonicCubeOpensInput') as HTMLInputElement).value = `${ - player.openPlatonicsCubes || blankSave.openPlatonicsCubes - }`.replace(omit, 'e') - updateAutoCubesOpens(4) - } - inputd = player.runeBlessingBuyAmount - inpute = Number((DOMCacheGetOrSet('buyRuneBlessingInput') as HTMLInputElement).value) + (DOMCacheGetOrSet("platonicCubeOpensInput") as HTMLInputElement).value = + `${player.openPlatonicsCubes || blankSave.openPlatonicsCubes}`.replace( + omit, + "e" + ); + updateAutoCubesOpens(4); + } + inputd = player.runeBlessingBuyAmount; + inpute = Number( + (DOMCacheGetOrSet("buyRuneBlessingInput") as HTMLInputElement).value + ); if (inpute !== inputd || isNaN(inpute + inputd)) { - ;(DOMCacheGetOrSet('buyRuneBlessingInput') as HTMLInputElement).value = `${ + (DOMCacheGetOrSet("buyRuneBlessingInput") as HTMLInputElement).value = `${ player.runeBlessingBuyAmount || blankSave.runeBlessingBuyAmount - }`.replace(omit, 'e') - updateRuneBlessingBuyAmount(1) + }`.replace(omit, "e"); + updateRuneBlessingBuyAmount(1); } - DOMCacheGetOrSet('buyRuneBlessingToggle').innerHTML = i18next.t('runes.blessings.buyUpTo', { - amount: format(player.runeBlessingBuyAmount) - }) + DOMCacheGetOrSet("buyRuneBlessingToggle").innerHTML = i18next.t( + "runes.blessings.buyUpTo", + { + amount: format(player.runeBlessingBuyAmount), + } + ); - inputd = player.runeSpiritBuyAmount - inpute = Number((DOMCacheGetOrSet('buyRuneSpiritInput') as HTMLInputElement).value) + inputd = player.runeSpiritBuyAmount; + inpute = Number( + (DOMCacheGetOrSet("buyRuneSpiritInput") as HTMLInputElement).value + ); if (inpute !== inputd || isNaN(inpute + inputd)) { - ;(DOMCacheGetOrSet('buyRuneSpiritInput') as HTMLInputElement).value = `${ + (DOMCacheGetOrSet("buyRuneSpiritInput") as HTMLInputElement).value = `${ player.runeSpiritBuyAmount || blankSave.runeSpiritBuyAmount - }`.replace(omit, 'e') - updateRuneBlessingBuyAmount(2) + }`.replace(omit, "e"); + updateRuneBlessingBuyAmount(2); } - DOMCacheGetOrSet('buyRuneSpiritToggleValue').innerHTML = i18next.t('runes.spirits.buyUpTo', { - amount: format(player.runeSpiritBuyAmount, 0, true) - }) + DOMCacheGetOrSet("buyRuneSpiritToggleValue").innerHTML = i18next.t( + "runes.spirits.buyUpTo", + { + amount: format(player.runeSpiritBuyAmount, 0, true), + } + ); if (player.resettoggle1 === 1) { - DOMCacheGetOrSet('prestigeautotoggle').textContent = i18next.t('toggles.modeAmount') + DOMCacheGetOrSet("prestigeautotoggle").textContent = + i18next.t("toggles.modeAmount"); } if (player.resettoggle2 === 1) { - DOMCacheGetOrSet('transcendautotoggle').textContent = i18next.t('toggles.modeAmount') + DOMCacheGetOrSet("transcendautotoggle").textContent = + i18next.t("toggles.modeAmount"); } if (player.resettoggle3 === 1) { - DOMCacheGetOrSet('reincarnateautotoggle').textContent = i18next.t('toggles.modeAmount') + DOMCacheGetOrSet("reincarnateautotoggle").textContent = + i18next.t("toggles.modeAmount"); } if (player.resettoggle4 === 1) { - DOMCacheGetOrSet('tesseractautobuymode').textContent = i18next.t('toggles.modeAmount') + DOMCacheGetOrSet("tesseractautobuymode").textContent = + i18next.t("toggles.modeAmount"); } if (player.resettoggle1 === 2) { - DOMCacheGetOrSet('prestigeautotoggle').textContent = i18next.t('toggles.modeTime') + DOMCacheGetOrSet("prestigeautotoggle").textContent = + i18next.t("toggles.modeTime"); } if (player.resettoggle2 === 2) { - DOMCacheGetOrSet('transcendautotoggle').textContent = i18next.t('toggles.modeTime') + DOMCacheGetOrSet("transcendautotoggle").textContent = + i18next.t("toggles.modeTime"); } if (player.resettoggle3 === 2) { - DOMCacheGetOrSet('reincarnateautotoggle').textContent = i18next.t('toggles.modeTime') + DOMCacheGetOrSet("reincarnateautotoggle").textContent = + i18next.t("toggles.modeTime"); } if (player.resettoggle4 === 2) { - DOMCacheGetOrSet('tesseractautobuymode').textContent = i18next.t('toggles.modePercentage') + DOMCacheGetOrSet("tesseractautobuymode").textContent = i18next.t( + "toggles.modePercentage" + ); } if (player.tesseractAutoBuyerToggle === 1) { - DOMCacheGetOrSet('tesseractautobuytoggle').textContent = i18next.t('runes.talismans.autoBuyOn') - DOMCacheGetOrSet('tesseractautobuytoggle').style.border = '2px solid green' + DOMCacheGetOrSet("tesseractautobuytoggle").textContent = i18next.t( + "runes.talismans.autoBuyOn" + ); + DOMCacheGetOrSet("tesseractautobuytoggle").style.border = + "2px solid green"; } if (player.tesseractAutoBuyerToggle === 2) { - DOMCacheGetOrSet('tesseractautobuytoggle').textContent = i18next.t('runes.talismans.autoBuyOff') - DOMCacheGetOrSet('tesseractautobuytoggle').style.border = '2px solid red' + DOMCacheGetOrSet("tesseractautobuytoggle").textContent = i18next.t( + "runes.talismans.autoBuyOff" + ); + DOMCacheGetOrSet("tesseractautobuytoggle").style.border = "2px solid red"; } if (player.autoOpenCubes) { - DOMCacheGetOrSet('openCubes').textContent = i18next.t('wowCubes.autoOn', { percent: format(player.openCubes, 0) }) - DOMCacheGetOrSet('openCubes').style.border = '1px solid green' - DOMCacheGetOrSet('cubeOpensInput').style.border = '1px solid green' + DOMCacheGetOrSet("openCubes").textContent = i18next.t("wowCubes.autoOn", { + percent: format(player.openCubes, 0), + }); + DOMCacheGetOrSet("openCubes").style.border = "1px solid green"; + DOMCacheGetOrSet("cubeOpensInput").style.border = "1px solid green"; } else { - DOMCacheGetOrSet('openCubes').textContent = i18next.t('wowCubes.autoOff') - DOMCacheGetOrSet('openCubes').style.border = '1px solid red' - DOMCacheGetOrSet('cubeOpensInput').style.border = '1px solid red' + DOMCacheGetOrSet("openCubes").textContent = i18next.t("wowCubes.autoOff"); + DOMCacheGetOrSet("openCubes").style.border = "1px solid red"; + DOMCacheGetOrSet("cubeOpensInput").style.border = "1px solid red"; } if (player.autoOpenTesseracts) { - DOMCacheGetOrSet('openTesseracts').textContent = i18next.t('wowCubes.autoOn', { - percent: format(player.openTesseracts, 0) - }) - DOMCacheGetOrSet('openTesseracts').style.border = '1px solid green' - DOMCacheGetOrSet('tesseractsOpensInput').style.border = '1px solid green' + DOMCacheGetOrSet("openTesseracts").textContent = i18next.t( + "wowCubes.autoOn", + { + percent: format(player.openTesseracts, 0), + } + ); + DOMCacheGetOrSet("openTesseracts").style.border = "1px solid green"; + DOMCacheGetOrSet("tesseractsOpensInput").style.border = "1px solid green"; } else { - DOMCacheGetOrSet('openTesseracts').textContent = i18next.t('wowCubes.autoOff') - DOMCacheGetOrSet('openTesseracts').style.border = '1px solid red' - DOMCacheGetOrSet('tesseractsOpensInput').style.border = '1px solid red' + DOMCacheGetOrSet("openTesseracts").textContent = + i18next.t("wowCubes.autoOff"); + DOMCacheGetOrSet("openTesseracts").style.border = "1px solid red"; + DOMCacheGetOrSet("tesseractsOpensInput").style.border = "1px solid red"; } if (player.autoOpenHypercubes) { - DOMCacheGetOrSet('openHypercubes').textContent = i18next.t('wowCubes.autoOn', { - percent: format(player.openHypercubes, 0) - }) - DOMCacheGetOrSet('openHypercubes').style.border = '1px solid green' - DOMCacheGetOrSet('hypercubesOpensInput').style.border = '1px solid green' + DOMCacheGetOrSet("openHypercubes").textContent = i18next.t( + "wowCubes.autoOn", + { + percent: format(player.openHypercubes, 0), + } + ); + DOMCacheGetOrSet("openHypercubes").style.border = "1px solid green"; + DOMCacheGetOrSet("hypercubesOpensInput").style.border = "1px solid green"; } else { - DOMCacheGetOrSet('openHypercubes').textContent = i18next.t('wowCubes.autoOff') - DOMCacheGetOrSet('openHypercubes').style.border = '1px solid red' - DOMCacheGetOrSet('hypercubesOpensInput').style.border = '1px solid red' + DOMCacheGetOrSet("openHypercubes").textContent = + i18next.t("wowCubes.autoOff"); + DOMCacheGetOrSet("openHypercubes").style.border = "1px solid red"; + DOMCacheGetOrSet("hypercubesOpensInput").style.border = "1px solid red"; } if (player.autoOpenPlatonicsCubes) { - DOMCacheGetOrSet('openPlatonicCube').textContent = i18next.t('wowCubes.autoOn', { - percent: format(player.openPlatonicsCubes, 0) - }) - DOMCacheGetOrSet('openPlatonicCube').style.border = '1px solid green' - DOMCacheGetOrSet('platonicCubeOpensInput').style.border = '1px solid green' + DOMCacheGetOrSet("openPlatonicCube").textContent = i18next.t( + "wowCubes.autoOn", + { + percent: format(player.openPlatonicsCubes, 0), + } + ); + DOMCacheGetOrSet("openPlatonicCube").style.border = "1px solid green"; + DOMCacheGetOrSet("platonicCubeOpensInput").style.border = + "1px solid green"; } else { - DOMCacheGetOrSet('openPlatonicCube').textContent = i18next.t('wowCubes.autoOff') - DOMCacheGetOrSet('openPlatonicCube').style.border = '1px solid red' - DOMCacheGetOrSet('platonicCubeOpensInput').style.border = '1px solid red' + DOMCacheGetOrSet("openPlatonicCube").textContent = + i18next.t("wowCubes.autoOff"); + DOMCacheGetOrSet("openPlatonicCube").style.border = "1px solid red"; + DOMCacheGetOrSet("platonicCubeOpensInput").style.border = "1px solid red"; } if (player.autoResearchToggle) { - DOMCacheGetOrSet('toggleautoresearch').textContent = i18next.t('researches.automaticOn') + DOMCacheGetOrSet("toggleautoresearch").textContent = i18next.t( + "researches.automaticOn" + ); } else { - DOMCacheGetOrSet('toggleautoresearch').textContent = i18next.t('researches.automaticOff') - } - if (player.autoResearchMode === 'cheapest') { - DOMCacheGetOrSet('toggleautoresearchmode').textContent = i18next.t('researches.autoModeCheapest') + DOMCacheGetOrSet("toggleautoresearch").textContent = i18next.t( + "researches.automaticOff" + ); + } + if (player.autoResearchMode === "cheapest") { + DOMCacheGetOrSet("toggleautoresearchmode").textContent = i18next.t( + "researches.autoModeCheapest" + ); } else { - DOMCacheGetOrSet('toggleautoresearchmode').textContent = i18next.t('researches.autoModeManual') + DOMCacheGetOrSet("toggleautoresearchmode").textContent = i18next.t( + "researches.autoModeManual" + ); } if (player.autoSacrificeToggle) { - DOMCacheGetOrSet('toggleautosacrifice').textContent = i18next.t('runes.blessings.autoRuneOn') - DOMCacheGetOrSet('toggleautosacrifice').style.border = '2px solid green' + DOMCacheGetOrSet("toggleautosacrifice").textContent = i18next.t( + "runes.blessings.autoRuneOn" + ); + DOMCacheGetOrSet("toggleautosacrifice").style.border = "2px solid green"; } else { - DOMCacheGetOrSet('toggleautosacrifice').textContent = i18next.t('runes.blessings.autoRuneOff') - DOMCacheGetOrSet('toggleautosacrifice').style.border = '2px solid red' + DOMCacheGetOrSet("toggleautosacrifice").textContent = i18next.t( + "runes.blessings.autoRuneOff" + ); + DOMCacheGetOrSet("toggleautosacrifice").style.border = "2px solid red"; } if (player.autoBuyFragment) { - DOMCacheGetOrSet('toggleautoBuyFragments').textContent = i18next.t('runes.talismans.autoBuyOn') - DOMCacheGetOrSet('toggleautoBuyFragments').style.border = '2px solid white' - DOMCacheGetOrSet('toggleautoBuyFragments').style.color = 'orange' + DOMCacheGetOrSet("toggleautoBuyFragments").textContent = i18next.t( + "runes.talismans.autoBuyOn" + ); + DOMCacheGetOrSet("toggleautoBuyFragments").style.border = + "2px solid white"; + DOMCacheGetOrSet("toggleautoBuyFragments").style.color = "orange"; } else { - DOMCacheGetOrSet('toggleautoBuyFragments').textContent = i18next.t('runes.talismans.autoBuyOff') - DOMCacheGetOrSet('toggleautoBuyFragments').style.border = '2px solid orange' - DOMCacheGetOrSet('toggleautoBuyFragments').style.color = 'white' + DOMCacheGetOrSet("toggleautoBuyFragments").textContent = i18next.t( + "runes.talismans.autoBuyOff" + ); + DOMCacheGetOrSet("toggleautoBuyFragments").style.border = + "2px solid orange"; + DOMCacheGetOrSet("toggleautoBuyFragments").style.color = "white"; } if (player.autoFortifyToggle) { - DOMCacheGetOrSet('toggleautofortify').textContent = i18next.t('runes.autoFortifyOn') - DOMCacheGetOrSet('toggleautofortify').style.border = '2px solid green' + DOMCacheGetOrSet("toggleautofortify").textContent = i18next.t( + "runes.autoFortifyOn" + ); + DOMCacheGetOrSet("toggleautofortify").style.border = "2px solid green"; } else { - DOMCacheGetOrSet('toggleautofortify').textContent = i18next.t('runes.autoFortifyOff') - DOMCacheGetOrSet('toggleautofortify').style.border = '2px solid red' + DOMCacheGetOrSet("toggleautofortify").textContent = i18next.t( + "runes.autoFortifyOff" + ); + DOMCacheGetOrSet("toggleautofortify").style.border = "2px solid red"; } if (player.autoEnhanceToggle) { - DOMCacheGetOrSet('toggleautoenhance').textContent = i18next.t('runes.autoEnhanceOn') - DOMCacheGetOrSet('toggleautoenhance').style.border = '2px solid green' + DOMCacheGetOrSet("toggleautoenhance").textContent = i18next.t( + "runes.autoEnhanceOn" + ); + DOMCacheGetOrSet("toggleautoenhance").style.border = "2px solid green"; } else { - DOMCacheGetOrSet('toggleautoenhance').textContent = i18next.t('runes.autoEnhanceOff') - DOMCacheGetOrSet('toggleautoenhance').style.border = '2px solid red' - } - player.saveOfferingToggle = false // Lint doesnt like it being inside if - DOMCacheGetOrSet('saveOffToggle').textContent = i18next.t('toggles.saveOfferingsOff') - DOMCacheGetOrSet('saveOffToggle').style.color = 'white' + DOMCacheGetOrSet("toggleautoenhance").textContent = i18next.t( + "runes.autoEnhanceOff" + ); + DOMCacheGetOrSet("toggleautoenhance").style.border = "2px solid red"; + } + player.saveOfferingToggle = false; // Lint doesnt like it being inside if + DOMCacheGetOrSet("saveOffToggle").textContent = i18next.t( + "toggles.saveOfferingsOff" + ); + DOMCacheGetOrSet("saveOffToggle").style.color = "white"; if (player.autoAscend) { - DOMCacheGetOrSet('ascensionAutoEnable').textContent = i18next.t('corruptions.autoAscend.on') - DOMCacheGetOrSet('ascensionAutoEnable').style.border = '2px solid green' + DOMCacheGetOrSet("ascensionAutoEnable").textContent = i18next.t( + "corruptions.autoAscend.on" + ); + DOMCacheGetOrSet("ascensionAutoEnable").style.border = "2px solid green"; } else { - DOMCacheGetOrSet('ascensionAutoEnable').textContent = i18next.t('corruptions.autoAscend.off') - DOMCacheGetOrSet('ascensionAutoEnable').style.border = '2px solid red' + DOMCacheGetOrSet("ascensionAutoEnable").textContent = i18next.t( + "corruptions.autoAscend.off" + ); + DOMCacheGetOrSet("ascensionAutoEnable").style.border = "2px solid red"; } if (player.shopConfirmationToggle) { - DOMCacheGetOrSet('toggleConfirmShop').textContent = i18next.t('shop.shopConfirmationOn') + DOMCacheGetOrSet("toggleConfirmShop").textContent = i18next.t( + "shop.shopConfirmationOn" + ); } else { - DOMCacheGetOrSet('toggleConfirmShop').textContent = i18next.t('shop.shopConfirmationOff') + DOMCacheGetOrSet("toggleConfirmShop").textContent = i18next.t( + "shop.shopConfirmationOff" + ); } switch (player.shopBuyMaxToggle) { case false: - DOMCacheGetOrSet('toggleBuyMaxShopText').textContent = i18next.t('shop.buy1') - break - case 'TEN': - DOMCacheGetOrSet('toggleBuyMaxShopText').textContent = i18next.t('shop.buy10') - break + DOMCacheGetOrSet("toggleBuyMaxShopText").textContent = + i18next.t("shop.buy1"); + break; + case "TEN": + DOMCacheGetOrSet("toggleBuyMaxShopText").textContent = + i18next.t("shop.buy10"); + break; case true: - DOMCacheGetOrSet('toggleBuyMaxShopText').textContent = i18next.t('shop.buyMax') - break - case 'ANY': - DOMCacheGetOrSet('toggleBuyMaxShopText').textContent = i18next.t('shop.buyAny') + DOMCacheGetOrSet("toggleBuyMaxShopText").textContent = + i18next.t("shop.buyMax"); + break; + case "ANY": + DOMCacheGetOrSet("toggleBuyMaxShopText").textContent = + i18next.t("shop.buyAny"); } if (player.shopHideToggle) { - DOMCacheGetOrSet('toggleHideShop').textContent = i18next.t('shop.hideMaxedOn') + DOMCacheGetOrSet("toggleHideShop").textContent = + i18next.t("shop.hideMaxedOn"); } else { - DOMCacheGetOrSet('toggleHideShop').textContent = i18next.t('shop.hideMaxedOff') + DOMCacheGetOrSet("toggleHideShop").textContent = + i18next.t("shop.hideMaxedOff"); } if (player.researchBuyMaxToggle) { - DOMCacheGetOrSet('toggleresearchbuy').textContent = i18next.t('researches.upgradeMax') + DOMCacheGetOrSet("toggleresearchbuy").textContent = i18next.t( + "researches.upgradeMax" + ); } else { - DOMCacheGetOrSet('toggleresearchbuy').textContent = i18next.t('researches.upgradeOne') + DOMCacheGetOrSet("toggleresearchbuy").textContent = i18next.t( + "researches.upgradeOne" + ); } if (player.cubeUpgradesBuyMaxToggle) { - DOMCacheGetOrSet('toggleCubeBuy').textContent = i18next.t('toggles.upgradeMaxIfPossible') + DOMCacheGetOrSet("toggleCubeBuy").textContent = i18next.t( + "toggles.upgradeMaxIfPossible" + ); } else { - DOMCacheGetOrSet('toggleCubeBuy').textContent = i18next.t('toggles.upgradeOneLevelWow') + DOMCacheGetOrSet("toggleCubeBuy").textContent = i18next.t( + "toggles.upgradeOneLevelWow" + ); } - autoCubeUpgradesToggle(false) - autoPlatonicUpgradesToggle(false) + autoCubeUpgradesToggle(false); + autoPlatonicUpgradesToggle(false); for (let i = 1; i <= 2; i++) { - toggleAntMaxBuy() - toggleAntAutoSacrifice(0) - toggleAntAutoSacrifice(1) + toggleAntMaxBuy(); + toggleAntAutoSacrifice(0); + toggleAntAutoSacrifice(1); } for (let i = 1; i <= 2; i++) { - toggleAutoAscend(0) - toggleAutoAscend(1) + toggleAutoAscend(0); + toggleAutoAscend(1); } - DOMCacheGetOrSet('historyTogglePerSecondButton').textContent = `Per second: ${ - player.historyShowPerSecond ? 'ON' : 'OFF' - }` - DOMCacheGetOrSet('historyTogglePerSecondButton').style.borderColor = player.historyShowPerSecond ? 'green' : 'red' + DOMCacheGetOrSet( + "historyTogglePerSecondButton" + ).textContent = `Per second: ${player.historyShowPerSecond ? "ON" : "OFF"}`; + DOMCacheGetOrSet("historyTogglePerSecondButton").style.borderColor = + player.historyShowPerSecond ? "green" : "red"; // If auto research is enabled and runing; Make sure there is something to try to research if possible - if (player.autoResearchToggle && autoResearchEnabled() && player.autoResearchMode === 'cheapest') { - player.autoResearch = G.researchOrderByCost[player.roombaResearchIndex] + if ( + player.autoResearchToggle && + autoResearchEnabled() && + player.autoResearchMode === "cheapest" + ) { + player.autoResearch = G.researchOrderByCost[player.roombaResearchIndex]; } - player.autoResearch = Math.min(200, player.autoResearch) - player.autoSacrifice = Math.min(5, player.autoSacrifice) + player.autoResearch = Math.min(200, player.autoResearch); + player.autoSacrifice = Math.min(5, player.autoSacrifice); if (player.researches[61] === 0) { - DOMCacheGetOrSet('automaticobtainium').textContent = i18next.t('main.buyResearch3x11') + DOMCacheGetOrSet("automaticobtainium").textContent = i18next.t( + "main.buyResearch3x11" + ); } if (player.autoSacrificeToggle && player.autoSacrifice > 0.5) { - DOMCacheGetOrSet(`rune${player.autoSacrifice}`).style.backgroundColor = 'orange' + DOMCacheGetOrSet(`rune${player.autoSacrifice}`).style.backgroundColor = + "orange"; } if (player.autoWarpCheck) { - DOMCacheGetOrSet('warpAuto').textContent = i18next.t('general.autoOnColon') - DOMCacheGetOrSet('warpAuto').style.border = '2px solid green' + DOMCacheGetOrSet("warpAuto").textContent = i18next.t( + "general.autoOnColon" + ); + DOMCacheGetOrSet("warpAuto").style.border = "2px solid green"; } else { - DOMCacheGetOrSet('warpAuto').textContent = i18next.t('general.autoOffColon') - DOMCacheGetOrSet('warpAuto').style.border = '2px solid red' - } - DOMCacheGetOrSet('autoHepteractPercentage').textContent = i18next.t('wowCubes.hepteractForge.autoSetting', { - x: `${player.hepteractAutoCraftPercentage}` - }) - DOMCacheGetOrSet('hepteractToQuarkTradeAuto').textContent = player.overfluxOrbsAutoBuy - ? i18next.t('general.autoOnColon') - : i18next.t('general.autoOffColon') - DOMCacheGetOrSet('hepteractToQuarkTradeAuto').style.border = `2px solid ${ - player.overfluxOrbsAutoBuy ? 'green' : 'red' - }` - toggleAutoBuyOrbs(true, true) - - DOMCacheGetOrSet('blueberryToggleMode').innerHTML = (player.blueberryLoadoutMode === 'saveTree') - ? i18next.t('ambrosia.loadouts.save') - : i18next.t('ambrosia.loadouts.load') - - toggleTalismanBuy(player.buyTalismanShardPercent) - updateTalismanInventory() - calculateObtainium() - calculateAnts() - calculateRuneLevels() - resetHistoryRenderAllTables() - updateSingularityAchievements() - updateSingularityGlobalPerks() - } - - updateAchievementBG() + DOMCacheGetOrSet("warpAuto").textContent = i18next.t( + "general.autoOffColon" + ); + DOMCacheGetOrSet("warpAuto").style.border = "2px solid red"; + } + DOMCacheGetOrSet("autoHepteractPercentage").textContent = i18next.t( + "wowCubes.hepteractForge.autoSetting", + { + x: `${player.hepteractAutoCraftPercentage}`, + } + ); + DOMCacheGetOrSet("hepteractToQuarkTradeAuto").textContent = + player.overfluxOrbsAutoBuy + ? i18next.t("general.autoOnColon") + : i18next.t("general.autoOffColon"); + DOMCacheGetOrSet("hepteractToQuarkTradeAuto").style.border = `2px solid ${ + player.overfluxOrbsAutoBuy ? "green" : "red" + }`; + toggleAutoBuyOrbs(true, true); + + DOMCacheGetOrSet("blueberryToggleMode").innerHTML = + player.blueberryLoadoutMode === "saveTree" + ? i18next.t("ambrosia.loadouts.save") + : i18next.t("ambrosia.loadouts.load"); + + toggleTalismanBuy(player.buyTalismanShardPercent); + updateTalismanInventory(); + calculateObtainium(); + calculateAnts(); + calculateRuneLevels(); + resetHistoryRenderAllTables(); + updateSingularityAchievements(); + updateSingularityGlobalPerks(); + } + + updateAchievementBG(); if (player.currentChallenge.reincarnation) { - resetrepeat('reincarnationChallenge') + resetrepeat("reincarnationChallenge"); } else if (player.currentChallenge.transcension) { - resetrepeat('transcensionChallenge') + resetrepeat("transcensionChallenge"); } - const d = new Date() - const h = d.getHours() - const m = d.getMinutes() - const s = d.getSeconds() - player.dayTimer = 60 * 60 * 24 - (s + 60 * m + 60 * 60 * h) -} + const d = new Date(); + const h = d.getHours(); + const m = d.getMinutes(); + const s = d.getSeconds(); + player.dayTimer = 60 * 60 * 24 - (s + 60 * m + 60 * 60 * h); +}; // dprint-ignore -const FormatList = ['', 'K', 'M', 'B', 'T', 'Qa', 'Qt', 'Sx', 'Sp', 'Oc', 'No', 'Dc', 'UDc', 'DDc', 'TDc', 'QaDc', 'QtDc', 'SxDc', 'SpDc', 'OcDc', 'NoDc', 'Vg', 'UVg', 'DVg', 'TVg', 'QaVg', 'QtVg', 'SxVg', 'SpVg', 'OcVg', 'NoVg', 'Tg', 'UTg', 'DTg', 'TTg', 'QaTg', 'QtTg', 'SxTg', 'SpTg', 'OTg', 'NTg', 'Qd', 'UQd', 'DQd', 'TQd', 'QaQd', 'QtQd', 'SxQd', 'SpQd', 'OcQd', 'NoQd', 'Qi', 'UQi', 'DQi', 'TQi', 'QaQi', 'QtQi', 'SxQi', 'SpQi', 'OQi', 'NQi', 'Se', 'USe', 'DSe', 'TSe', 'QaSe', 'QtSe', 'SxSe', 'SpSe', 'OcSe', 'NoSe', 'St', 'USt', 'DSt', 'TSt', 'QaSt', 'QtSt', 'SxSt', 'SpSt', 'OcSt', 'NoSt', 'Ocg', 'UOcg', 'DOcg', 'TOcg', 'QaOcg', 'QtOcg', 'SxOcg', 'SpOcg', 'OcOcg', 'NoOcg', 'Nono', 'UNono', 'DNono', 'TNono', 'QaNono', 'QtNono', 'SxNono', 'SpNono', 'OcNono', 'NoNono', 'Ce'] +const FormatList = [ + "", + "K", + "M", + "B", + "T", + "Qa", + "Qt", + "Sx", + "Sp", + "Oc", + "No", + "Dc", + "UDc", + "DDc", + "TDc", + "QaDc", + "QtDc", + "SxDc", + "SpDc", + "OcDc", + "NoDc", + "Vg", + "UVg", + "DVg", + "TVg", + "QaVg", + "QtVg", + "SxVg", + "SpVg", + "OcVg", + "NoVg", + "Tg", + "UTg", + "DTg", + "TTg", + "QaTg", + "QtTg", + "SxTg", + "SpTg", + "OTg", + "NTg", + "Qd", + "UQd", + "DQd", + "TQd", + "QaQd", + "QtQd", + "SxQd", + "SpQd", + "OcQd", + "NoQd", + "Qi", + "UQi", + "DQi", + "TQi", + "QaQi", + "QtQi", + "SxQi", + "SpQi", + "OQi", + "NQi", + "Se", + "USe", + "DSe", + "TSe", + "QaSe", + "QtSe", + "SxSe", + "SpSe", + "OcSe", + "NoSe", + "St", + "USt", + "DSt", + "TSt", + "QaSt", + "QtSt", + "SxSt", + "SpSt", + "OcSt", + "NoSt", + "Ocg", + "UOcg", + "DOcg", + "TOcg", + "QaOcg", + "QtOcg", + "SxOcg", + "SpOcg", + "OcOcg", + "NoOcg", + "Nono", + "UNono", + "DNono", + "TNono", + "QaNono", + "QtNono", + "SxNono", + "SpNono", + "OcNono", + "NoNono", + "Ce", +]; // Bad browsers (like Safari) only recently implemented this. -const supportsFormatToParts = typeof Intl.NumberFormat.prototype.formatToParts === 'function' +const supportsFormatToParts = + typeof Intl.NumberFormat.prototype.formatToParts === "function"; // In some browsers, this will return an empty-1 length array (?), causing a "TypeError: Cannot read property 'value' of undefined" // if we destructure it... To reproduce: ` const [ { value } ] = []; ` // https://discord.com/channels/677271830838640680/730669616870981674/830218436201283584 -const IntlFormatter = !supportsFormatToParts ? null : Intl.NumberFormat() - .formatToParts(1000.1) - .filter((part) => part.type === 'decimal' || part.type === 'group') +const IntlFormatter = !supportsFormatToParts + ? null + : Intl.NumberFormat() + .formatToParts(1000.1) + .filter((part) => part.type === "decimal" || part.type === "group"); // gets the system number delimiter and decimal values, defaults to en-US -const [{ value: group }, { value: dec }] = IntlFormatter?.length !== 2 - ? [{ value: ',' }, { value: '.' }] - : IntlFormatter +const [{ value: group }, { value: dec }] = + IntlFormatter?.length !== 2 + ? [{ value: "," }, { value: "." }] + : IntlFormatter; // Number.toLocaleString opts for 2 decimal places -const locOpts = { minimumFractionDigits: 2, maximumFractionDigits: 2 } +const locOpts = { minimumFractionDigits: 2, maximumFractionDigits: 2 }; const padEvery = (str: string, places = 3) => { - let step = 1 - let newStr = '' - const strParts = str.split('.') + let step = 1; + let newStr = ""; + const strParts = str.split("."); // don't take any decimal places for (let i = strParts[0].length - 1; i >= 0; i--) { // pad every [places] places if we aren't at the beginning of the string if (step++ === places && i !== 0) { - step = 1 - newStr = group + str[i] + newStr + step = 1; + newStr = group + str[i] + newStr; } else { - newStr = str[i] + newStr + newStr = str[i] + newStr; } } // re-add decimal places - if (typeof strParts[1] !== 'undefined') { - newStr += dec + strParts[1] + if (typeof strParts[1] !== "undefined") { + newStr += dec + strParts[1]; } // see https://www.npmjs.com/package/flatstr - ;(newStr as unknown as number) | 0 - return newStr -} + (newStr as unknown as number) | 0; + return newStr; +}; /** * This function displays the numbers such as 1,234 or 1.00e1234 or 1.00e1.234M. @@ -2264,722 +3112,904 @@ const padEvery = (str: string, places = 3) => { * @param long dictates whether or not a given number displays as scientific at 1,000,000. This auto defaults to short if input >= 1e7 */ export const format = ( - input: Decimal | number | { [Symbol.toPrimitive]: unknown } | null | undefined, + input: + | Decimal + | number + | { [Symbol.toPrimitive]: unknown } + | null + | undefined, accuracy = 0, long = false, truncate = true, fractional = false ): string => { if (input == null) { - return '0 [null]' + return "0 [null]"; } - if ( - typeof input === 'object' - && Symbol.toPrimitive in input - ) { - input = Number(input) + if (typeof input === "object" && Symbol.toPrimitive in input) { + input = Number(input); } if ( // invalid parameter - !(input instanceof Decimal) - && typeof input !== 'number' - || isNaN(input as number) + (!(input instanceof Decimal) && typeof input !== "number") || + isNaN(input as number) ) { - return isNaN(input as number) ? '0 [NaN]' : '0 [und.]' + return isNaN(input as number) ? "0 [NaN]" : "0 [und.]"; } else if ( // this case handles numbers less than 1e-6 and greater than 0 - typeof input === 'number' - && player.notation === 'Default' - && input < (!fractional ? 1e-3 : 1e-15) // arbitrary number, don't change 1e-3 - && input > 0 // don't handle negative numbers, probably could be removed + typeof input === "number" && + player.notation === "Default" && + input < (!fractional ? 1e-3 : 1e-15) && // arbitrary number, don't change 1e-3 + input > 0 // don't handle negative numbers, probably could be removed ) { - return input.toExponential(accuracy) + return input.toExponential(accuracy); } - let power!: number - let mantissa!: number + let power!: number; + let mantissa!: number; if (isDecimal(input)) { // Gets power and mantissa if input is of type decimal - power = input.e - mantissa = input.mantissa - } else if (typeof input === 'number') { + power = input.e; + mantissa = input.mantissa; + } else if (typeof input === "number") { if (input === 0) { - return '0' + return "0"; } // Gets power and mantissa if input is of type number and isn't 0 - power = Math.floor(Math.log10(Math.abs(input))) - mantissa = input / Math.pow(10, power) + power = Math.floor(Math.log10(Math.abs(input))); + mantissa = input / Math.pow(10, power); } // This prevents numbers from jittering between two different powers by rounding errors if (mantissa > 9.9999999) { - mantissa = 1 - ;++power + mantissa = 1; + ++power; } if (mantissa < 1 && mantissa > 0.9999999) { - mantissa = 1 + mantissa = 1; } // If the power is less than 15 it's effectively 0 if (power < -15) { - return '0' + return "0"; } - if (player.notation === 'Pure Engineering') { - const powerOver = (power % 3 < 0) ? (3 + power % 3) : (power % 3) - power = power - powerOver - mantissa = mantissa * Math.pow(10, powerOver) + if (player.notation === "Pure Engineering") { + const powerOver = power % 3 < 0 ? 3 + (power % 3) : power % 3; + power = power - powerOver; + mantissa = mantissa * Math.pow(10, powerOver); } - if (player.notation === 'Pure Scientific' || player.notation === 'Pure Engineering') { + if ( + player.notation === "Pure Scientific" || + player.notation === "Pure Engineering" + ) { if (power >= 1e6) { if (!Number.isFinite(power)) { - return 'Infinity' + return "Infinity"; } - return `E${format(power, 3)}` + return `E${format(power, 3)}`; } - accuracy = power === 2 && accuracy > 2 ? 2 : accuracy + accuracy = power === 2 && accuracy > 2 ? 2 : accuracy; if (power >= 6 || power < 0) { - accuracy = accuracy < 2 ? 2 : accuracy + accuracy = accuracy < 2 ? 2 : accuracy; // Makes the power group 3 with commas - const mantissaLook = (Math.floor(mantissa * Math.pow(10, accuracy)) / Math.pow(10, accuracy)).toLocaleString( - undefined, - locOpts - ) - const powerLook = padEvery(power.toString()) + const mantissaLook = ( + Math.floor(mantissa * Math.pow(10, accuracy)) / Math.pow(10, accuracy) + ).toLocaleString(undefined, locOpts); + const powerLook = padEvery(power.toString()); // returns format (1.23e456,789) - return `${mantissaLook}e${powerLook}` + return `${mantissaLook}e${powerLook}`; } - mantissa = mantissa * Math.pow(10, power) + mantissa = mantissa * Math.pow(10, power); if (mantissa - Math.floor(mantissa) > 0.9999999) { - mantissa = Math.ceil(mantissa) + mantissa = Math.ceil(mantissa); } - const mantissaLook = (Math.floor(mantissa * Math.pow(10, accuracy)) / Math.pow(10, accuracy)).toLocaleString( - undefined, - { - minimumFractionDigits: accuracy, - maximumFractionDigits: accuracy - } - ) - return `${mantissaLook}` + const mantissaLook = ( + Math.floor(mantissa * Math.pow(10, accuracy)) / Math.pow(10, accuracy) + ).toLocaleString(undefined, { + minimumFractionDigits: accuracy, + maximumFractionDigits: accuracy, + }); + return `${mantissaLook}`; } // If the power is negative, then we will want to address that separately. if (power < 0 && !isDecimal(input) && fractional) { if (power <= -15) { - return `${format(mantissa, accuracy, long)} / ${Math.pow(10, -power - 15)}Qa` + return `${format(mantissa, accuracy, long)} / ${Math.pow( + 10, + -power - 15 + )}Qa`; } if (power <= -12) { - return `${format(mantissa, accuracy, long)} / ${Math.pow(10, -power - 12)}T` + return `${format(mantissa, accuracy, long)} / ${Math.pow( + 10, + -power - 12 + )}T`; } if (power <= -9) { - return `${format(mantissa, accuracy, long)} / ${Math.pow(10, -power - 9)}B` + return `${format(mantissa, accuracy, long)} / ${Math.pow( + 10, + -power - 9 + )}B`; } if (power <= -6) { - return `${format(mantissa, accuracy, long)} / ${Math.pow(10, -power - 6)}M` + return `${format(mantissa, accuracy, long)} / ${Math.pow( + 10, + -power - 6 + )}M`; } if (power <= -3) { - return `${format(mantissa, accuracy, long)} / ${Math.pow(10, -power - 3)}K` + return `${format(mantissa, accuracy, long)} / ${Math.pow( + 10, + -power - 3 + )}K`; } - return `${format(mantissa, accuracy, long)} / ${Math.pow(10, -power)}` + return `${format(mantissa, accuracy, long)} / ${Math.pow(10, -power)}`; } else if (power < 6 || (long && power < 7)) { // If the power is less than 6 or format long and less than 7 use standard formatting (1,234,567) // Gets the standard representation of the number, safe as power is guaranteed to be > -12 and < 7 - let standard = mantissa * Math.pow(10, power) - let standardString: string + let standard = mantissa * Math.pow(10, power); + let standardString: string; // Rounds up if the number experiences a rounding error if (standard - Math.floor(standard) > 0.9999999) { - standard = Math.ceil(standard) + standard = Math.ceil(standard); } // If the power is less than 1 or format long and less than 3 apply toFixed(accuracy) to get decimal places if ((power < 2 || (long && power < 3)) && accuracy > 0) { - standardString = standard.toFixed(power === 2 && accuracy > 2 ? 2 : accuracy) + standardString = standard.toFixed( + power === 2 && accuracy > 2 ? 2 : accuracy + ); } else { // If it doesn't fit those criteria drop the decimal places - standard = Math.floor(standard) - standardString = standard.toString() + standard = Math.floor(standard); + standardString = standard.toString(); } // Split it on the decimal place - return padEvery(standardString) + return padEvery(standardString); } else if (power < 1e6) { // If the power is less than 1e6 then apply standard scientific notation // Makes mantissa be rounded down to 2 decimal places - const mantissaLook = (Math.floor(mantissa * 100) / 100).toLocaleString(undefined, locOpts) + const mantissaLook = (Math.floor(mantissa * 100) / 100).toLocaleString( + undefined, + locOpts + ); // Makes the power group 3 with commas - const powerLook = padEvery(power.toString()) + const powerLook = padEvery(power.toString()); // returns format (1.23e456,789) - return `${mantissaLook}e${powerLook}` + return `${mantissaLook}e${powerLook}`; } else if (power >= 1e6) { if (!Number.isFinite(power)) { - return 'Infinity' + return "Infinity"; } // if the power is greater than 1e6 apply notation scientific notation // Makes mantissa be rounded down to 2 decimal places - const mantissaLook = testing && truncate - ? '' - : (Math.floor(mantissa * 100) / 100).toLocaleString(undefined, locOpts) + const mantissaLook = + testing && truncate + ? "" + : (Math.floor(mantissa * 100) / 100).toLocaleString(undefined, locOpts); // Drops the power down to 4 digits total but never greater than 1000 in increments that equate to notations, (1234000 -> 1.234) ( 12340000 -> 12.34) (123400000 -> 123.4) (1234000000 -> 1.234) - const powerDigits = Math.ceil(Math.log10(power)) - let powerFront = ((powerDigits - 1) % 3) + 1 - let powerLook = power / Math.pow(10, powerDigits - powerFront) + const powerDigits = Math.ceil(Math.log10(power)); + let powerFront = ((powerDigits - 1) % 3) + 1; + let powerLook = power / Math.pow(10, powerDigits - powerFront); if (powerLook === 1000) { - powerLook = 1 - powerFront = 1 + powerLook = 1; + powerFront = 1; } const powerLookF = powerLook.toLocaleString(undefined, { minimumFractionDigits: 4 - powerFront, - maximumFractionDigits: 4 - powerFront - }) - const powerLodge = Math.floor(Math.log10(power) / 3) + maximumFractionDigits: 4 - powerFront, + }); + const powerLodge = Math.floor(Math.log10(power) / 3); // Return relevant notations alongside the "look" power based on what the power actually is - if (typeof FormatList[powerLodge] === 'string') { - return `${mantissaLook}e${powerLookF}${FormatList[powerLodge]}` + if (typeof FormatList[powerLodge] === "string") { + return `${mantissaLook}e${powerLookF}${FormatList[powerLodge]}`; } // If it doesn't fit a notation then default to mantissa e power - return `e${power.toExponential(2)}` + return `e${power.toExponential(2)}`; } else { - return '0 [und.]' + return "0 [und.]"; } -} +}; -export const formatTimeShort = (seconds: number, msMaxSeconds?: number): string => { - return ((seconds >= 86400) ? `${format(Math.floor(seconds / 86400))}d` : '') - + ((seconds >= 3600) ? `${format(Math.floor(seconds / 3600) % 24)}h` : '') - + ((seconds >= 60) ? `${format(Math.floor(seconds / 60) % 60)}m` : '') - + ((seconds >= 8640000) ? '' : `${ - format(Math.floor(seconds) % 60) + ((msMaxSeconds && seconds < msMaxSeconds) // Don't show seconds when you're over 100 days, like honestly - ? `.${Math.floor((seconds % 1) * 1000).toString().padStart(3, '0')}` - : '') - }s`) -} +export const formatTimeShort = ( + seconds: number, + msMaxSeconds?: number +): string => { + return ( + (seconds >= 86400 ? `${format(Math.floor(seconds / 86400))}d` : "") + + (seconds >= 3600 ? `${format(Math.floor(seconds / 3600) % 24)}h` : "") + + (seconds >= 60 ? `${format(Math.floor(seconds / 60) % 60)}m` : "") + + (seconds >= 8640000 + ? "" + : `${ + format(Math.floor(seconds) % 60) + + (msMaxSeconds && seconds < msMaxSeconds // Don't show seconds when you're over 100 days, like honestly + ? `.${Math.floor((seconds % 1) * 1000) + .toString() + .padStart(3, "0")}` + : "") + }s`) + ); +}; export const updateAllTick = (): void => { - let a = 0 + let a = 0; - G.totalAccelerator = player.acceleratorBought - G.costDivisor = 1 + G.totalAccelerator = player.acceleratorBought; + G.costDivisor = 1; if (player.upgrades[8] !== 0) { - a += Math.floor(player.multiplierBought / 7) + a += Math.floor(player.multiplierBought / 7); } if (player.upgrades[21] !== 0) { - a += 5 + a += 5; } if (player.upgrades[22] !== 0) { - a += 4 + a += 4; } if (player.upgrades[23] !== 0) { - a += 3 + a += 3; } if (player.upgrades[24] !== 0) { - a += 2 + a += 2; } if (player.upgrades[25] !== 0) { - a += 1 + a += 1; } if (player.upgrades[27] !== 0) { - a += Math.min(250, Math.floor(Decimal.log(player.coins.add(1), 1e3))) - + Math.min(1750, Math.max(0, Math.floor(Decimal.log(player.coins.add(1), 1e15)) - 50)) + a += + Math.min(250, Math.floor(Decimal.log(player.coins.add(1), 1e3))) + + Math.min( + 1750, + Math.max(0, Math.floor(Decimal.log(player.coins.add(1), 1e15)) - 50) + ); } if (player.upgrades[29] !== 0) { a += Math.floor( Math.min( 2000, - (player.firstOwnedCoin + player.secondOwnedCoin + player.thirdOwnedCoin + player.fourthOwnedCoin - + player.fifthOwnedCoin) / 80 + (player.firstOwnedCoin + + player.secondOwnedCoin + + player.thirdOwnedCoin + + player.fourthOwnedCoin + + player.fifthOwnedCoin) / + 80 ) - ) + ); } if (player.upgrades[32] !== 0) { - a += Math.min(500, Math.floor(Decimal.log(player.prestigePoints.add(1), 1e25))) + a += Math.min( + 500, + Math.floor(Decimal.log(player.prestigePoints.add(1), 1e25)) + ); } if (player.upgrades[45] !== 0) { - a += Math.min(2500, Math.floor(Decimal.log(player.transcendShards.add(1), 10))) + a += Math.min( + 2500, + Math.floor(Decimal.log(player.transcendShards.add(1), 10)) + ); } if (player.achievements[5] !== 0) { - a += Math.floor(player.firstOwnedCoin / 500) + a += Math.floor(player.firstOwnedCoin / 500); } if (player.achievements[12] !== 0) { - a += Math.floor(player.secondOwnedCoin / 500) + a += Math.floor(player.secondOwnedCoin / 500); } if (player.achievements[19] !== 0) { - a += Math.floor(player.thirdOwnedCoin / 500) + a += Math.floor(player.thirdOwnedCoin / 500); } if (player.achievements[26] !== 0) { - a += Math.floor(player.fourthOwnedCoin / 500) + a += Math.floor(player.fourthOwnedCoin / 500); } if (player.achievements[33] !== 0) { - a += Math.floor(player.fifthOwnedCoin / 500) + a += Math.floor(player.fifthOwnedCoin / 500); } if (player.achievements[60] !== 0) { - a += 2 + a += 2; } if (player.achievements[61] !== 0) { - a += 2 + a += 2; } if (player.achievements[62] !== 0) { - a += 2 - } - - a += 5 * CalcECC('transcend', player.challengecompletions[2]) - G.freeUpgradeAccelerator = a - a += G.totalAcceleratorBoost - * (4 + 2 * player.researches[18] + 2 * player.researches[19] + 3 * player.researches[20] + G.cubeBonusMultiplier[1]) + a += 2; + } + + a += 5 * CalcECC("transcend", player.challengecompletions[2]); + G.freeUpgradeAccelerator = a; + a += + G.totalAcceleratorBoost * + (4 + + 2 * player.researches[18] + + 2 * player.researches[19] + + 3 * player.researches[20] + + G.cubeBonusMultiplier[1]); if (player.unlocks.prestige) { - a += Math.floor(Math.pow(G.rune1level * G.effectiveLevelMult / 4, 1.25)) - a *= 1 + G.rune1level * 1 / 400 * G.effectiveLevelMult - } - - calculateAcceleratorMultiplier() - a *= G.acceleratorMultiplier - a = Math.pow(a, Math.min(1, (1 + player.platonicUpgrades[6] / 30) * G.viscosityPower[player.usedCorruptions[2]])) - a += 2000 * hepteractEffective('accelerator') - a *= G.challenge15Rewards.accelerator - a *= 1 + 3 / 10000 * hepteractEffective('accelerator') - a = Math.floor(Math.min(1e100, a)) + a += Math.floor(Math.pow((G.rune1level * G.effectiveLevelMult) / 4, 1.25)); + a *= 1 + ((G.rune1level * 1) / 400) * G.effectiveLevelMult; + } + + calculateAcceleratorMultiplier(); + a *= G.acceleratorMultiplier; + a = Math.pow( + a, + Math.min( + 1, + (1 + player.platonicUpgrades[6] / 30) * + G.viscosityPower[player.usedCorruptions[2]] + ) + ); + a += 2000 * hepteractEffective("accelerator"); + a *= G.challenge15Rewards.accelerator; + a *= 1 + (3 / 10000) * hepteractEffective("accelerator"); + a = Math.floor(Math.min(1e100, a)); if (player.usedCorruptions[2] >= 15) { - a = Math.pow(a, 0.2) + a = Math.pow(a, 0.2); } if (player.usedCorruptions[2] >= 16) { - a = 1 + a = 1; } - G.freeAccelerator = a - G.totalAccelerator += G.freeAccelerator + G.freeAccelerator = a; + G.totalAccelerator += G.freeAccelerator; - G.tuSevenMulti = 1 + G.tuSevenMulti = 1; if (player.upgrades[46] > 0.5) { - G.tuSevenMulti = 1.05 + G.tuSevenMulti = 1.05; } G.acceleratorPower = Math.pow( - 1.1 + G.tuSevenMulti - * (G.totalAcceleratorBoost / 100) - * (1 + CalcECC('transcend', player.challengecompletions[2]) / 20), - 1 + 0.04 * CalcECC('reincarnation', player.challengecompletions[7]) - ) - G.acceleratorPower += 1 / 200 * Math.floor(CalcECC('transcend', player.challengecompletions[2]) / 2) * 100 / 100 + 1.1 + + G.tuSevenMulti * + (G.totalAcceleratorBoost / 100) * + (1 + CalcECC("transcend", player.challengecompletions[2]) / 20), + 1 + 0.04 * CalcECC("reincarnation", player.challengecompletions[7]) + ); + G.acceleratorPower += + ((1 / 200) * + Math.floor(CalcECC("transcend", player.challengecompletions[2]) / 2) * + 100) / + 100; for (let i = 1; i <= 5; i++) { if (player.achievements[7 * i - 4] > 0) { - G.acceleratorPower += 0.0005 * i + G.acceleratorPower += 0.0005 * i; } } // No MA and Sadistic will always overwrite Transcend challenges starting in v2.0.0 - if (player.currentChallenge.reincarnation !== 7 && player.currentChallenge.reincarnation !== 10) { + if ( + player.currentChallenge.reincarnation !== 7 && + player.currentChallenge.reincarnation !== 10 + ) { if (player.currentChallenge.transcension === 1) { - G.acceleratorPower *= 25 / (50 + player.challengecompletions[1]) - G.acceleratorPower += 0.55 - G.acceleratorPower = Math.max(1, G.acceleratorPower) + G.acceleratorPower *= 25 / (50 + player.challengecompletions[1]); + G.acceleratorPower += 0.55; + G.acceleratorPower = Math.max(1, G.acceleratorPower); } if (player.currentChallenge.transcension === 2) { - G.acceleratorPower = 1 + G.acceleratorPower = 1; } if (player.currentChallenge.transcension === 3) { - G.acceleratorPower = 1.05 - + 2 * G.tuSevenMulti - * (G.totalAcceleratorBoost / 300) - * (1 + CalcECC('transcend', player.challengecompletions[2]) / 20) + G.acceleratorPower = + 1.05 + + 2 * + G.tuSevenMulti * + (G.totalAcceleratorBoost / 300) * + (1 + CalcECC("transcend", player.challengecompletions[2]) / 20); } } - G.acceleratorPower = Math.min(1e300, G.acceleratorPower) + G.acceleratorPower = Math.min(1e300, G.acceleratorPower); if (player.currentChallenge.reincarnation === 7) { - G.acceleratorPower = 1 + G.acceleratorPower = 1; } if (player.currentChallenge.reincarnation === 10) { - G.acceleratorPower = 1 + G.acceleratorPower = 1; } if (player.currentChallenge.transcension !== 1) { - G.acceleratorEffect = Decimal.pow(G.acceleratorPower, G.totalAccelerator) + G.acceleratorEffect = Decimal.pow(G.acceleratorPower, G.totalAccelerator); } if (player.currentChallenge.transcension === 1) { - G.acceleratorEffect = Decimal.pow(G.acceleratorPower, G.totalAccelerator + G.totalMultiplier) + G.acceleratorEffect = Decimal.pow( + G.acceleratorPower, + G.totalAccelerator + G.totalMultiplier + ); } - G.acceleratorEffectDisplay = new Decimal(G.acceleratorPower * 100 - 100) + G.acceleratorEffectDisplay = new Decimal(G.acceleratorPower * 100 - 100); if (player.currentChallenge.reincarnation === 10) { - G.acceleratorEffect = new Decimal(1) + G.acceleratorEffect = new Decimal(1); } - G.generatorPower = new Decimal(1) - if (player.upgrades[11] > 0.5 && player.currentChallenge.reincarnation !== 7) { - G.generatorPower = Decimal.pow(1.02, G.totalAccelerator) + G.generatorPower = new Decimal(1); + if ( + player.upgrades[11] > 0.5 && + player.currentChallenge.reincarnation !== 7 + ) { + G.generatorPower = Decimal.pow(1.02, G.totalAccelerator); } -} +}; export const updateAllMultiplier = (): void => { - let a = 0 + let a = 0; if (player.upgrades[7] > 0) { - a += Math.min(4, 1 + Math.floor(Decimal.log(player.fifthOwnedCoin + 1, 10))) + a += Math.min( + 4, + 1 + Math.floor(Decimal.log(player.fifthOwnedCoin + 1, 10)) + ); } if (player.upgrades[9] > 0) { - a += Math.floor(player.acceleratorBought / 10) + a += Math.floor(player.acceleratorBought / 10); } if (player.upgrades[21] > 0) { - a += 1 + a += 1; } if (player.upgrades[22] > 0) { - a += 1 + a += 1; } if (player.upgrades[23] > 0) { - a += 1 + a += 1; } if (player.upgrades[24] > 0) { - a += 1 + a += 1; } if (player.upgrades[25] > 0) { - a += 1 + a += 1; } if (player.upgrades[28] > 0) { a += Math.min( 1000, Math.floor( - (player.firstOwnedCoin + player.secondOwnedCoin + player.thirdOwnedCoin + player.fourthOwnedCoin - + player.fifthOwnedCoin) / 160 + (player.firstOwnedCoin + + player.secondOwnedCoin + + player.thirdOwnedCoin + + player.fourthOwnedCoin + + player.fifthOwnedCoin) / + 160 ) - ) + ); } if (player.upgrades[30] > 0) { - a += Math.min(75, Math.floor(Decimal.log(player.coins.add(1), 1e10))) - + Math.min(925, Math.floor(Decimal.log(player.coins.add(1), 1e30))) + a += + Math.min(75, Math.floor(Decimal.log(player.coins.add(1), 1e10))) + + Math.min(925, Math.floor(Decimal.log(player.coins.add(1), 1e30))); } if (player.upgrades[33] > 0) { - a += G.totalAcceleratorBoost + a += G.totalAcceleratorBoost; } if (player.upgrades[49] > 0) { - a += Math.min(50, Math.floor(Decimal.log(player.transcendPoints.add(1), 1e10))) + a += Math.min( + 50, + Math.floor(Decimal.log(player.transcendPoints.add(1), 1e10)) + ); } if (player.upgrades[68] > 0) { - a += Math.min(2500, Math.floor(Decimal.log(G.taxdivisor, 10) * 1 / 1000)) + a += Math.min(2500, Math.floor((Decimal.log(G.taxdivisor, 10) * 1) / 1000)); } if (player.challengecompletions[1] > 0) { - a += 1 + a += 1; } if (player.achievements[6] > 0.5) { - a += Math.floor(player.firstOwnedCoin / 1000) + a += Math.floor(player.firstOwnedCoin / 1000); } if (player.achievements[13] > 0.5) { - a += Math.floor(player.secondOwnedCoin / 1000) + a += Math.floor(player.secondOwnedCoin / 1000); } if (player.achievements[20] > 0.5) { - a += Math.floor(player.thirdOwnedCoin / 1000) + a += Math.floor(player.thirdOwnedCoin / 1000); } if (player.achievements[27] > 0.5) { - a += Math.floor(player.fourthOwnedCoin / 1000) + a += Math.floor(player.fourthOwnedCoin / 1000); } if (player.achievements[34] > 0.5) { - a += Math.floor(player.fifthOwnedCoin / 1000) + a += Math.floor(player.fifthOwnedCoin / 1000); } if (player.achievements[57] > 0.5) { - a += 1 + a += 1; } if (player.achievements[58] > 0.5) { - a += 1 + a += 1; } if (player.achievements[59] > 0.5) { - a += 1 - } - a += 20 * player.researches[94] * Math.floor( - (G.rune1level + G.rune2level + G.rune3level + G.rune4level + G.rune5level) / 8 - ) - - G.freeUpgradeMultiplier = Math.min(1e100, a) + a += 1; + } + a += + 20 * + player.researches[94] * + Math.floor( + (G.rune1level + + G.rune2level + + G.rune3level + + G.rune4level + + G.rune5level) / + 8 + ); + + G.freeUpgradeMultiplier = Math.min(1e100, a); if (player.achievements[38] > 0.5) { - a += Math.floor( - Math.floor( - G.rune2level / 10 * G.effectiveLevelMult - ) - * Math.floor(1 + G.rune2level / 10 * G.effectiveLevelMult) / 2 - ) * 100 / 100 + a += + (Math.floor( + (Math.floor((G.rune2level / 10) * G.effectiveLevelMult) * + Math.floor(1 + (G.rune2level / 10) * G.effectiveLevelMult)) / + 2 + ) * + 100) / + 100; } - a *= 1 + player.achievements[57] / 100 - a *= 1 + player.achievements[58] / 100 - a *= 1 + player.achievements[59] / 100 + a *= 1 + player.achievements[57] / 100; + a *= 1 + player.achievements[58] / 100; + a *= 1 + player.achievements[59] / 100; a *= Math.pow( 1.01, - player.upgrades[21] + player.upgrades[22] + player.upgrades[23] + player.upgrades[24] + player.upgrades[25] - ) - a *= 1 + 0.03 * player.upgrades[34] + 0.02 * player.upgrades[35] - a *= 1 + 1 / 5 * player.researches[2] * (1 + 1 / 2 * CalcECC('ascension', player.challengecompletions[14])) - a *= 1 + 1 / 20 * player.researches[11] + 1 / 25 * player.researches[12] + 1 / 40 * player.researches[13] - + 3 / 200 * player.researches[14] + 1 / 200 * player.researches[15] - a *= 1 + G.rune2level / 400 * G.effectiveLevelMult - a *= 1 + 1 / 20 * player.researches[87] - a *= 1 + 1 / 100 * player.researches[128] - a *= 1 + 0.8 / 100 * player.researches[143] - a *= 1 + 0.6 / 100 * player.researches[158] - a *= 1 + 0.4 / 100 * player.researches[173] - a *= 1 + 0.2 / 100 * player.researches[188] - a *= 1 + 0.01 / 100 * player.researches[200] - a *= 1 + 0.01 / 100 * player.cubeUpgrades[50] - a *= calculateSigmoidExponential(40, (player.antUpgrades[4]! + G.bonusant5) / 1000 * 40 / 39) - a *= G.cubeBonusMultiplier[2] + player.upgrades[21] + + player.upgrades[22] + + player.upgrades[23] + + player.upgrades[24] + + player.upgrades[25] + ); + a *= 1 + 0.03 * player.upgrades[34] + 0.02 * player.upgrades[35]; + a *= + 1 + + (1 / 5) * + player.researches[2] * + (1 + (1 / 2) * CalcECC("ascension", player.challengecompletions[14])); + a *= + 1 + + (1 / 20) * player.researches[11] + + (1 / 25) * player.researches[12] + + (1 / 40) * player.researches[13] + + (3 / 200) * player.researches[14] + + (1 / 200) * player.researches[15]; + a *= 1 + (G.rune2level / 400) * G.effectiveLevelMult; + a *= 1 + (1 / 20) * player.researches[87]; + a *= 1 + (1 / 100) * player.researches[128]; + a *= 1 + (0.8 / 100) * player.researches[143]; + a *= 1 + (0.6 / 100) * player.researches[158]; + a *= 1 + (0.4 / 100) * player.researches[173]; + a *= 1 + (0.2 / 100) * player.researches[188]; + a *= 1 + (0.01 / 100) * player.researches[200]; + a *= 1 + (0.01 / 100) * player.cubeUpgrades[50]; + a *= calculateSigmoidExponential( + 40, + (((player.antUpgrades[4]! + G.bonusant5) / 1000) * 40) / 39 + ); + a *= G.cubeBonusMultiplier[2]; if ( - (player.currentChallenge.transcension !== 0 || player.currentChallenge.reincarnation !== 0) - && player.upgrades[50] > 0.5 + (player.currentChallenge.transcension !== 0 || + player.currentChallenge.reincarnation !== 0) && + player.upgrades[50] > 0.5 ) { - a *= 1.25 - } - a = Math.pow(a, Math.min(1, (1 + player.platonicUpgrades[6] / 30) * G.viscosityPower[player.usedCorruptions[2]])) - a += 1000 * hepteractEffective('multiplier') - a *= G.challenge15Rewards.multiplier - a *= 1 + 3 / 10000 * hepteractEffective('multiplier') - a = Math.floor(Math.min(1e100, a)) + a *= 1.25; + } + a = Math.pow( + a, + Math.min( + 1, + (1 + player.platonicUpgrades[6] / 30) * + G.viscosityPower[player.usedCorruptions[2]] + ) + ); + a += 1000 * hepteractEffective("multiplier"); + a *= G.challenge15Rewards.multiplier; + a *= 1 + (3 / 10000) * hepteractEffective("multiplier"); + a = Math.floor(Math.min(1e100, a)); if (player.usedCorruptions[2] >= 15) { - a = Math.pow(a, 0.2) + a = Math.pow(a, 0.2); } if (player.usedCorruptions[2] >= 16) { - a = 1 + a = 1; } - G.freeMultiplier = a - G.totalMultiplier = G.freeMultiplier + player.multiplierBought + G.freeMultiplier = a; + G.totalMultiplier = G.freeMultiplier + player.multiplierBought; - G.challengeOneLog = 3 + G.challengeOneLog = 3; - let b = 0 - let c = 0 - b += Decimal.log(player.transcendShards.add(1), 3) - b *= 1 + 11 * player.researches[33] / 100 - b *= 1 + 11 * player.researches[34] / 100 - b *= 1 + 11 * player.researches[35] / 100 - b *= 1 + player.researches[89] / 5 - b *= 1 + 10 * G.effectiveRuneBlessingPower[2] + let b = 0; + let c = 0; + b += Decimal.log(player.transcendShards.add(1), 3); + b *= 1 + (11 * player.researches[33]) / 100; + b *= 1 + (11 * player.researches[34]) / 100; + b *= 1 + (11 * player.researches[35]) / 100; + b *= 1 + player.researches[89] / 5; + b *= 1 + 10 * G.effectiveRuneBlessingPower[2]; - c += Math.floor(0.1 * b * CalcECC('transcend', player.challengecompletions[1])) - c += CalcECC('transcend', player.challengecompletions[1]) * 10 - G.freeMultiplierBoost = c + c += Math.floor( + 0.1 * b * CalcECC("transcend", player.challengecompletions[1]) + ); + c += CalcECC("transcend", player.challengecompletions[1]) * 10; + G.freeMultiplierBoost = c; G.totalMultiplierBoost = Math.pow( Math.floor(b) + c, - 1 + CalcECC('reincarnation', player.challengecompletions[7]) * 0.04 - ) + 1 + CalcECC("reincarnation", player.challengecompletions[7]) * 0.04 + ); - let c7 = 1 + let c7 = 1; if (player.challengecompletions[7] > 0.5) { - c7 = 1.25 + c7 = 1.25; } - G.multiplierPower = 2 + 0.005 * G.totalMultiplierBoost * c7 + G.multiplierPower = 2 + 0.005 * G.totalMultiplierBoost * c7; // No MA and Sadistic will always override Transcend Challenges starting in v2.0.0 - if (player.currentChallenge.reincarnation !== 7 && player.currentChallenge.reincarnation !== 10) { + if ( + player.currentChallenge.reincarnation !== 7 && + player.currentChallenge.reincarnation !== 10 + ) { if (player.currentChallenge.transcension === 1) { - G.multiplierPower = 1 + G.multiplierPower = 1; } if (player.currentChallenge.transcension === 2) { - G.multiplierPower = 1.25 + 0.0012 * (b + c) * c7 + G.multiplierPower = 1.25 + 0.0012 * (b + c) * c7; } } - G.multiplierPower = Math.min(1e300, G.multiplierPower) + G.multiplierPower = Math.min(1e300, G.multiplierPower); if (player.currentChallenge.reincarnation === 7) { - G.multiplierPower = 1 + G.multiplierPower = 1; } if (player.currentChallenge.reincarnation === 10) { - G.multiplierPower = 1 + G.multiplierPower = 1; } - G.multiplierEffect = Decimal.pow(G.multiplierPower, G.totalMultiplier) -} + G.multiplierEffect = Decimal.pow(G.multiplierPower, G.totalMultiplier); +}; export const multipliers = (): void => { - let s = new Decimal(1) - let c = new Decimal(1) - let crystalExponent = 1 / 3 + let s = new Decimal(1); + let c = new Decimal(1); + let crystalExponent = 1 / 3; crystalExponent += Math.min( - 10 + 0.05 * player.researches[129] * Math.log(player.commonFragments + 1) / Math.log(4) - + 20 * calculateCorruptionPoints() / 400 * G.effectiveRuneSpiritPower[3], + 10 + + (0.05 * player.researches[129] * Math.log(player.commonFragments + 1)) / + Math.log(4) + + ((20 * calculateCorruptionPoints()) / 400) * + G.effectiveRuneSpiritPower[3], 0.05 * player.crystalUpgrades[3] - ) - crystalExponent += 0.04 * CalcECC('transcend', player.challengecompletions[3]) - crystalExponent += 0.08 * player.researches[28] - crystalExponent += 0.08 * player.researches[29] - crystalExponent += 0.04 * player.researches[30] - crystalExponent += 8 * player.cubeUpgrades[17] - G.prestigeMultiplier = Decimal.pow(player.prestigeShards, crystalExponent).add(1) - - let c7 = 1 + ); + crystalExponent += + 0.04 * CalcECC("transcend", player.challengecompletions[3]); + crystalExponent += 0.08 * player.researches[28]; + crystalExponent += 0.08 * player.researches[29]; + crystalExponent += 0.04 * player.researches[30]; + crystalExponent += 8 * player.cubeUpgrades[17]; + G.prestigeMultiplier = Decimal.pow( + player.prestigeShards, + crystalExponent + ).add(1); + + let c7 = 1; if (player.currentChallenge.reincarnation === 7) { - c7 = 0.05 + c7 = 0.05; } if (player.currentChallenge.reincarnation === 8) { - c7 = 0 - } - - G.buildingPower = 1 + (1 - Math.pow(2, -1 / 160)) * c7 * Decimal.log( - player.reincarnationShards.add(1), - 10 - ) - * (1 + 1 / 20 * player.researches[36] - + 1 / 40 * player.researches[37] + 1 / 40 - * player.researches[38]) - + (c7 + 0.2) * 0.25 / 1.2 - * CalcECC('reincarnation', player.challengecompletions[8]) - - G.buildingPower = Math.pow(G.buildingPower, 1 + player.cubeUpgrades[12] * 0.09) - G.buildingPower = Math.pow(G.buildingPower, 1 + player.cubeUpgrades[36] * 0.05) - G.reincarnationMultiplier = Decimal.pow(G.buildingPower, G.totalCoinOwned) - - G.antMultiplier = Decimal.pow(Decimal.max(1, player.antPoints), calculateCrumbToCoinExp()) - - s = s.times(G.multiplierEffect) - s = s.times(G.acceleratorEffect) - s = s.times(G.prestigeMultiplier) - s = s.times(G.reincarnationMultiplier) - s = s.times(G.antMultiplier) + c7 = 0; + } + + G.buildingPower = + 1 + + (1 - Math.pow(2, -1 / 160)) * + c7 * + Decimal.log(player.reincarnationShards.add(1), 10) * + (1 + + (1 / 20) * player.researches[36] + + (1 / 40) * player.researches[37] + + (1 / 40) * player.researches[38]) + + (((c7 + 0.2) * 0.25) / 1.2) * + CalcECC("reincarnation", player.challengecompletions[8]); + + G.buildingPower = Math.pow( + G.buildingPower, + 1 + player.cubeUpgrades[12] * 0.09 + ); + G.buildingPower = Math.pow( + G.buildingPower, + 1 + player.cubeUpgrades[36] * 0.05 + ); + G.reincarnationMultiplier = Decimal.pow(G.buildingPower, G.totalCoinOwned); + + G.antMultiplier = Decimal.pow( + Decimal.max(1, player.antPoints), + calculateCrumbToCoinExp() + ); + + s = s.times(G.multiplierEffect); + s = s.times(G.acceleratorEffect); + s = s.times(G.prestigeMultiplier); + s = s.times(G.reincarnationMultiplier); + s = s.times(G.antMultiplier); // PLAT - check - const first6CoinUp = new Decimal(G.totalCoinOwned + 1).times(Decimal.min(1e30, Decimal.pow(1.008, G.totalCoinOwned))) + const first6CoinUp = new Decimal(G.totalCoinOwned + 1).times( + Decimal.min(1e30, Decimal.pow(1.008, G.totalCoinOwned)) + ); if (player.highestSingularityCount > 0) { - s = s.times(Math.pow(player.goldenQuarks + 1, 1.5) * Math.pow(player.highestSingularityCount + 1, 2)) + s = s.times( + Math.pow(player.goldenQuarks + 1, 1.5) * + Math.pow(player.highestSingularityCount + 1, 2) + ); } if (player.upgrades[6] > 0.5) { - s = s.times(first6CoinUp) + s = s.times(first6CoinUp); } if (player.upgrades[12] > 0.5) { - s = s.times(Decimal.min(1e4, Decimal.pow(1.01, player.prestigeCount))) + s = s.times(Decimal.min(1e4, Decimal.pow(1.01, player.prestigeCount))); } if (player.upgrades[20] > 0.5) { // PLAT - check - s = s.times(Decimal.pow(G.totalCoinOwned / 4 + 1, 10)) + s = s.times(Decimal.pow(G.totalCoinOwned / 4 + 1, 10)); } if (player.upgrades[41] > 0.5) { - s = s.times(Decimal.min(1e30, Decimal.pow(player.transcendPoints.add(1), 1 / 2))) + s = s.times( + Decimal.min(1e30, Decimal.pow(player.transcendPoints.add(1), 1 / 2)) + ); } if (player.upgrades[43] > 0.5) { - s = s.times(Decimal.min(1e30, Decimal.pow(1.01, player.transcendCount))) + s = s.times(Decimal.min(1e30, Decimal.pow(1.01, player.transcendCount))); } if (player.upgrades[48] > 0.5) { - s = s.times(Decimal.pow(G.totalMultiplier * G.totalAccelerator / 1000 + 1, 8)) + s = s.times( + Decimal.pow((G.totalMultiplier * G.totalAccelerator) / 1000 + 1, 8) + ); } if (player.currentChallenge.reincarnation === 6) { - s = s.dividedBy(1e250) + s = s.dividedBy(1e250); } if (player.currentChallenge.reincarnation === 7) { - s = s.dividedBy('1e1250') + s = s.dividedBy("1e1250"); } if (player.currentChallenge.reincarnation === 9) { - s = s.dividedBy('1e2000000') + s = s.dividedBy("1e2000000"); } if (player.currentChallenge.reincarnation === 10) { - s = s.dividedBy('1e12500000') + s = s.dividedBy("1e12500000"); } - c = Decimal.pow(s, 1 + 0.001 * player.researches[17]) - let lol = Decimal.pow(c, 1 + 0.025 * player.upgrades[123]) - if (player.currentChallenge.ascension === 15 && player.platonicUpgrades[5] > 0) { - lol = Decimal.pow(lol, 1.1) + c = Decimal.pow(s, 1 + 0.001 * player.researches[17]); + let lol = Decimal.pow(c, 1 + 0.025 * player.upgrades[123]); + if ( + player.currentChallenge.ascension === 15 && + player.platonicUpgrades[5] > 0 + ) { + lol = Decimal.pow(lol, 1.1); } - if (player.currentChallenge.ascension === 15 && player.platonicUpgrades[14] > 0) { + if ( + player.currentChallenge.ascension === 15 && + player.platonicUpgrades[14] > 0 + ) { lol = Decimal.pow( lol, - 1 + 1 / 20 * player.usedCorruptions[9] * Decimal.log(player.coins.add(1), 10) - / (1e7 + Decimal.log(player.coins.add(1), 10)) - ) + 1 + + ((1 / 20) * + player.usedCorruptions[9] * + Decimal.log(player.coins.add(1), 10)) / + (1e7 + Decimal.log(player.coins.add(1), 10)) + ); } - if (player.currentChallenge.ascension === 15 && player.platonicUpgrades[15] > 0) { - lol = Decimal.pow(lol, 1.1) + if ( + player.currentChallenge.ascension === 15 && + player.platonicUpgrades[15] > 0 + ) { + lol = Decimal.pow(lol, 1.1); } - lol = Decimal.pow(lol, G.challenge15Rewards.coinExponent) - G.globalCoinMultiplier = lol - G.globalCoinMultiplier = Decimal.pow(G.globalCoinMultiplier, G.financialcollapsePower[player.usedCorruptions[9]]) + lol = Decimal.pow(lol, G.challenge15Rewards.coinExponent); + G.globalCoinMultiplier = lol; + G.globalCoinMultiplier = Decimal.pow( + G.globalCoinMultiplier, + G.financialcollapsePower[player.usedCorruptions[9]] + ); - G.coinOneMulti = new Decimal(1) + G.coinOneMulti = new Decimal(1); if (player.upgrades[1] > 0.5) { - G.coinOneMulti = G.coinOneMulti.times(first6CoinUp) + G.coinOneMulti = G.coinOneMulti.times(first6CoinUp); } if (player.upgrades[10] > 0.5) { - G.coinOneMulti = G.coinOneMulti.times(Decimal.pow(2, Math.min(50, player.secondOwnedCoin / 15))) + G.coinOneMulti = G.coinOneMulti.times( + Decimal.pow(2, Math.min(50, player.secondOwnedCoin / 15)) + ); } if (player.upgrades[56] > 0.5) { - G.coinOneMulti = G.coinOneMulti.times('1e5000') + G.coinOneMulti = G.coinOneMulti.times("1e5000"); } - G.coinTwoMulti = new Decimal(1) + G.coinTwoMulti = new Decimal(1); if (player.upgrades[2] > 0.5) { - G.coinTwoMulti = G.coinTwoMulti.times(first6CoinUp) + G.coinTwoMulti = G.coinTwoMulti.times(first6CoinUp); } if (player.upgrades[13] > 0.5) { G.coinTwoMulti = G.coinTwoMulti.times( - Decimal.min(1e50, Decimal.pow(player.firstGeneratedMythos.add(player.firstOwnedMythos).add(1), 4 / 3).times(1e10)) - ) + Decimal.min( + 1e50, + Decimal.pow( + player.firstGeneratedMythos.add(player.firstOwnedMythos).add(1), + 4 / 3 + ).times(1e10) + ) + ); } if (player.upgrades[19] > 0.5) { - G.coinTwoMulti = G.coinTwoMulti.times(Decimal.min(1e200, player.transcendPoints.times(1e30).add(1))) + G.coinTwoMulti = G.coinTwoMulti.times( + Decimal.min(1e200, player.transcendPoints.times(1e30).add(1)) + ); } if (player.upgrades[57] > 0.5) { - G.coinTwoMulti = G.coinTwoMulti.times('1e7500') + G.coinTwoMulti = G.coinTwoMulti.times("1e7500"); } - G.coinThreeMulti = new Decimal(1) + G.coinThreeMulti = new Decimal(1); if (player.upgrades[3] > 0.5) { - G.coinThreeMulti = G.coinThreeMulti.times(first6CoinUp) + G.coinThreeMulti = G.coinThreeMulti.times(first6CoinUp); } if (player.upgrades[18] > 0.5) { - G.coinThreeMulti = G.coinThreeMulti.times(Decimal.min(1e125, player.transcendShards.add(1))) + G.coinThreeMulti = G.coinThreeMulti.times( + Decimal.min(1e125, player.transcendShards.add(1)) + ); } if (player.upgrades[58] > 0.5) { - G.coinThreeMulti = G.coinThreeMulti.times('1e15000') + G.coinThreeMulti = G.coinThreeMulti.times("1e15000"); } - G.coinFourMulti = new Decimal(1) + G.coinFourMulti = new Decimal(1); if (player.upgrades[4] > 0.5) { - G.coinFourMulti = G.coinFourMulti.times(first6CoinUp) + G.coinFourMulti = G.coinFourMulti.times(first6CoinUp); } if (player.upgrades[17] > 0.5) { - G.coinFourMulti = G.coinFourMulti.times(1e100) + G.coinFourMulti = G.coinFourMulti.times(1e100); } if (player.upgrades[59] > 0.5) { - G.coinFourMulti = G.coinFourMulti.times('1e25000') + G.coinFourMulti = G.coinFourMulti.times("1e25000"); } - G.coinFiveMulti = new Decimal(1) + G.coinFiveMulti = new Decimal(1); if (player.upgrades[5] > 0.5) { - G.coinFiveMulti = G.coinFiveMulti.times(first6CoinUp) + G.coinFiveMulti = G.coinFiveMulti.times(first6CoinUp); } if (player.upgrades[60] > 0.5) { - G.coinFiveMulti = G.coinFiveMulti.times('1e35000') + G.coinFiveMulti = G.coinFiveMulti.times("1e35000"); } - G.globalCrystalMultiplier = new Decimal(1) + G.globalCrystalMultiplier = new Decimal(1); if (player.achievements[36] > 0.5) { - G.globalCrystalMultiplier = G.globalCrystalMultiplier.times(2) + G.globalCrystalMultiplier = G.globalCrystalMultiplier.times(2); } if (player.achievements[37] > 0.5 && player.prestigePoints.gte(10)) { - G.globalCrystalMultiplier = G.globalCrystalMultiplier.times(Decimal.log(player.prestigePoints.add(1), 10)) + G.globalCrystalMultiplier = G.globalCrystalMultiplier.times( + Decimal.log(player.prestigePoints.add(1), 10) + ); } if (player.achievements[44] > 0.5) { - G.globalCrystalMultiplier = G.globalCrystalMultiplier - .times( - Decimal.pow(G.rune3level / 2 * G.effectiveLevelMult, 2) - .times(Decimal.pow(2, G.rune3level * G.effectiveLevelMult / 2 - 8)) - .add(1) - ) + G.globalCrystalMultiplier = G.globalCrystalMultiplier.times( + Decimal.pow((G.rune3level / 2) * G.effectiveLevelMult, 2) + .times(Decimal.pow(2, (G.rune3level * G.effectiveLevelMult) / 2 - 8)) + .add(1) + ); } if (player.upgrades[36] > 0.5) { G.globalCrystalMultiplier = G.globalCrystalMultiplier.times( - Decimal.min('1e5000', Decimal.pow(player.prestigePoints, 1 / 500)) - ) + Decimal.min("1e5000", Decimal.pow(player.prestigePoints, 1 / 500)) + ); } if (player.upgrades[63] > 0.5) { G.globalCrystalMultiplier = G.globalCrystalMultiplier.times( - Decimal.min('1e6000', Decimal.pow(player.reincarnationPoints.add(1), 6)) - ) + Decimal.min("1e6000", Decimal.pow(player.reincarnationPoints.add(1), 6)) + ); } if (player.researches[39] > 0.5) { - G.globalCrystalMultiplier = G.globalCrystalMultiplier.times(Decimal.pow(G.reincarnationMultiplier, 1 / 50)) + G.globalCrystalMultiplier = G.globalCrystalMultiplier.times( + Decimal.pow(G.reincarnationMultiplier, 1 / 50) + ); } G.globalCrystalMultiplier = G.globalCrystalMultiplier.times( @@ -2987,1182 +4017,1652 @@ export const multipliers = (): void => { Decimal.pow(10, 50 + 2 * player.crystalUpgrades[0]), Decimal.pow(1.05, player.achievementPoints * player.crystalUpgrades[0]) ) - ) + ); G.globalCrystalMultiplier = G.globalCrystalMultiplier.times( Decimal.min( Decimal.pow(10, 100 + 5 * player.crystalUpgrades[1]), - Decimal.pow(Decimal.log(player.coins.add(1), 10), player.crystalUpgrades[1] / 3) + Decimal.pow( + Decimal.log(player.coins.add(1), 10), + player.crystalUpgrades[1] / 3 + ) ) - ) + ); G.globalCrystalMultiplier = G.globalCrystalMultiplier.times( Decimal.pow( - 1 - + Math.min( - 0.12 + 0.88 * player.upgrades[122] - + 0.001 * player.researches[129] * Math.log(player.commonFragments + 1) / Math.log(4), + 1 + + Math.min( + 0.12 + + 0.88 * player.upgrades[122] + + (0.001 * + player.researches[129] * + Math.log(player.commonFragments + 1)) / + Math.log(4), 0.001 * player.crystalUpgrades[2] ), - player.firstOwnedDiamonds + player.secondOwnedDiamonds + player.thirdOwnedDiamonds + player.fourthOwnedDiamonds - + player.fifthOwnedDiamonds + player.firstOwnedDiamonds + + player.secondOwnedDiamonds + + player.thirdOwnedDiamonds + + player.fourthOwnedDiamonds + + player.fifthOwnedDiamonds ) - ) + ); G.globalCrystalMultiplier = G.globalCrystalMultiplier.times( Decimal.pow( 1.01, - (player.challengecompletions[1] + player.challengecompletions[2] + player.challengecompletions[3] - + player.challengecompletions[4] + player.challengecompletions[5]) * player.crystalUpgrades[4] + (player.challengecompletions[1] + + player.challengecompletions[2] + + player.challengecompletions[3] + + player.challengecompletions[4] + + player.challengecompletions[5]) * + player.crystalUpgrades[4] + ) + ); + G.globalCrystalMultiplier = G.globalCrystalMultiplier.times( + Decimal.pow(10, CalcECC("transcend", player.challengecompletions[5])) + ); + G.globalCrystalMultiplier = G.globalCrystalMultiplier.times( + Decimal.pow( + 1e4, + player.researches[5] * + (1 + (1 / 2) * CalcECC("ascension", player.challengecompletions[14])) ) - ) + ); G.globalCrystalMultiplier = G.globalCrystalMultiplier.times( - Decimal.pow(10, CalcECC('transcend', player.challengecompletions[5])) - ) + Decimal.pow(2.5, player.researches[26]) + ); G.globalCrystalMultiplier = G.globalCrystalMultiplier.times( - Decimal.pow(1e4, player.researches[5] * (1 + 1 / 2 * CalcECC('ascension', player.challengecompletions[14]))) - ) - G.globalCrystalMultiplier = G.globalCrystalMultiplier.times(Decimal.pow(2.5, player.researches[26])) - G.globalCrystalMultiplier = G.globalCrystalMultiplier.times(Decimal.pow(2.5, player.researches[27])) + Decimal.pow(2.5, player.researches[27]) + ); - G.globalMythosMultiplier = new Decimal(1) + G.globalMythosMultiplier = new Decimal(1); if (player.upgrades[37] > 0.5) { G.globalMythosMultiplier = G.globalMythosMultiplier.times( Decimal.pow(Decimal.log(player.prestigePoints.add(10), 10), 2) - ) + ); } if (player.upgrades[42] > 0.5) { G.globalMythosMultiplier = G.globalMythosMultiplier.times( - Decimal.min(1e50, Decimal.pow(player.prestigePoints.add(1), 1 / 50).dividedBy(2.5).add(1)) - ) + Decimal.min( + 1e50, + Decimal.pow(player.prestigePoints.add(1), 1 / 50) + .dividedBy(2.5) + .add(1) + ) + ); } if (player.upgrades[47] > 0.5) { - G.globalMythosMultiplier = G.globalMythosMultiplier.times(Decimal.pow(1.05, player.achievementPoints)).times( - player.achievementPoints + 1 - ) + G.globalMythosMultiplier = G.globalMythosMultiplier + .times(Decimal.pow(1.05, player.achievementPoints)) + .times(player.achievementPoints + 1); } if (player.upgrades[51] > 0.5) { - G.globalMythosMultiplier = G.globalMythosMultiplier.times(Decimal.pow(G.totalAcceleratorBoost, 2)) + G.globalMythosMultiplier = G.globalMythosMultiplier.times( + Decimal.pow(G.totalAcceleratorBoost, 2) + ); } if (player.upgrades[52] > 0.5) { - G.globalMythosMultiplier = G.globalMythosMultiplier.times(Decimal.pow(G.globalMythosMultiplier, 0.025)) + G.globalMythosMultiplier = G.globalMythosMultiplier.times( + Decimal.pow(G.globalMythosMultiplier, 0.025) + ); } if (player.upgrades[64] > 0.5) { - G.globalMythosMultiplier = G.globalMythosMultiplier.times(Decimal.pow(player.reincarnationPoints.add(1), 2)) + G.globalMythosMultiplier = G.globalMythosMultiplier.times( + Decimal.pow(player.reincarnationPoints.add(1), 2) + ); } if (player.researches[40] > 0.5) { - G.globalMythosMultiplier = G.globalMythosMultiplier.times(Decimal.pow(G.reincarnationMultiplier, 1 / 250)) - } - G.grandmasterMultiplier = new Decimal(1) - G.totalMythosOwned = player.firstOwnedMythos + player.secondOwnedMythos + player.thirdOwnedMythos - + player.fourthOwnedMythos + player.fifthOwnedMythos - - G.mythosBuildingPower = 1 + (CalcECC('transcend', player.challengecompletions[3]) / 200) - G.challengeThreeMultiplier = Decimal.pow(G.mythosBuildingPower, G.totalMythosOwned) - - G.grandmasterMultiplier = G.grandmasterMultiplier.times(G.challengeThreeMultiplier) - - G.mythosupgrade13 = new Decimal(1) - G.mythosupgrade14 = new Decimal(1) - G.mythosupgrade15 = new Decimal(1) + G.globalMythosMultiplier = G.globalMythosMultiplier.times( + Decimal.pow(G.reincarnationMultiplier, 1 / 250) + ); + } + G.grandmasterMultiplier = new Decimal(1); + G.totalMythosOwned = + player.firstOwnedMythos + + player.secondOwnedMythos + + player.thirdOwnedMythos + + player.fourthOwnedMythos + + player.fifthOwnedMythos; + + G.mythosBuildingPower = + 1 + CalcECC("transcend", player.challengecompletions[3]) / 200; + G.challengeThreeMultiplier = Decimal.pow( + G.mythosBuildingPower, + G.totalMythosOwned + ); + + G.grandmasterMultiplier = G.grandmasterMultiplier.times( + G.challengeThreeMultiplier + ); + + G.mythosupgrade13 = new Decimal(1); + G.mythosupgrade14 = new Decimal(1); + G.mythosupgrade15 = new Decimal(1); if (player.upgrades[53] === 1) { - G.mythosupgrade13 = G.mythosupgrade13.times(Decimal.min('1e1250', Decimal.pow(G.acceleratorEffect, 1 / 125))) + G.mythosupgrade13 = G.mythosupgrade13.times( + Decimal.min("1e1250", Decimal.pow(G.acceleratorEffect, 1 / 125)) + ); } if (player.upgrades[54] === 1) { - G.mythosupgrade14 = G.mythosupgrade14.times(Decimal.min('1e2000', Decimal.pow(G.multiplierEffect, 1 / 180))) + G.mythosupgrade14 = G.mythosupgrade14.times( + Decimal.min("1e2000", Decimal.pow(G.multiplierEffect, 1 / 180)) + ); } if (player.upgrades[55] === 1) { - G.mythosupgrade15 = G.mythosupgrade15.times(Decimal.pow('1e1000', Math.min(1000, G.buildingPower - 1))) + G.mythosupgrade15 = G.mythosupgrade15.times( + Decimal.pow("1e1000", Math.min(1000, G.buildingPower - 1)) + ); } - G.globalConstantMult = new Decimal('1') + G.globalConstantMult = new Decimal("1"); G.globalConstantMult = G.globalConstantMult.times( Decimal.pow( - 1.05 + 0.01 * player.achievements[270] + 0.001 * player.platonicUpgrades[18], + 1.05 + + 0.01 * player.achievements[270] + + 0.001 * player.platonicUpgrades[18], player.constantUpgrades[1] ) - ) + ); G.globalConstantMult = G.globalConstantMult.times( Decimal.pow( - 1 - + 0.001 - * Math.min( - 100 + 10 * player.achievements[270] + 10 * player.shopUpgrades.constantEX - + 1000 * (G.challenge15Rewards.exponent - 1) + 3 * player.platonicUpgrades[18], + 1 + + 0.001 * + Math.min( + 100 + + 10 * player.achievements[270] + + 10 * player.shopUpgrades.constantEX + + 1000 * (G.challenge15Rewards.exponent - 1) + + 3 * player.platonicUpgrades[18], player.constantUpgrades[2] ), ascendBuildingDR() ) - ) - G.globalConstantMult = G.globalConstantMult.times(1 + 2 / 100 * player.researches[139]) - G.globalConstantMult = G.globalConstantMult.times(1 + 3 / 100 * player.researches[154]) - G.globalConstantMult = G.globalConstantMult.times(1 + 4 / 100 * player.researches[169]) - G.globalConstantMult = G.globalConstantMult.times(1 + 5 / 100 * player.researches[184]) - G.globalConstantMult = G.globalConstantMult.times(1 + 10 / 100 * player.researches[199]) - G.globalConstantMult = G.globalConstantMult.times(G.challenge15Rewards.constantBonus) + ); + G.globalConstantMult = G.globalConstantMult.times( + 1 + (2 / 100) * player.researches[139] + ); + G.globalConstantMult = G.globalConstantMult.times( + 1 + (3 / 100) * player.researches[154] + ); + G.globalConstantMult = G.globalConstantMult.times( + 1 + (4 / 100) * player.researches[169] + ); + G.globalConstantMult = G.globalConstantMult.times( + 1 + (5 / 100) * player.researches[184] + ); + G.globalConstantMult = G.globalConstantMult.times( + 1 + (10 / 100) * player.researches[199] + ); + G.globalConstantMult = G.globalConstantMult.times( + G.challenge15Rewards.constantBonus + ); if (player.platonicUpgrades[5] > 0) { - G.globalConstantMult = G.globalConstantMult.times(2) + G.globalConstantMult = G.globalConstantMult.times(2); } if (player.platonicUpgrades[10] > 0) { - G.globalConstantMult = G.globalConstantMult.times(10) + G.globalConstantMult = G.globalConstantMult.times(10); } if (player.platonicUpgrades[15] > 0) { - G.globalConstantMult = G.globalConstantMult.times(1e250) + G.globalConstantMult = G.globalConstantMult.times(1e250); } G.globalConstantMult = G.globalConstantMult.times( Decimal.pow(player.overfluxPowder + 1, 10 * player.platonicUpgrades[16]) - ) -} + ); +}; export const resourceGain = (dt: number): void => { - calculateTotalCoinOwned() - calculateTotalAcceleratorBoost() + calculateTotalCoinOwned(); + calculateTotalAcceleratorBoost(); - updateAllTick() - updateAllMultiplier() - multipliers() - calculatetax() + updateAllTick(); + updateAllMultiplier(); + multipliers(); + calculatetax(); if (G.produceTotal.gte(0.001)) { - const addcoin = (Decimal.min( + const addcoin = Decimal.min( G.produceTotal.dividedBy(G.taxdivisor), Decimal.pow(10, G.maxexponent - Decimal.log(G.taxdivisorcheck, 10)) - )).times(dt / 0.025) - player.coins = player.coins.add(addcoin) - player.coinsThisPrestige = player.coinsThisPrestige.add(addcoin) - player.coinsThisTranscension = player.coinsThisTranscension.add(addcoin) - player.coinsThisReincarnation = player.coinsThisReincarnation.add(addcoin) - player.coinsTotal = player.coinsTotal.add(addcoin) + ).times(dt / 0.025); + player.coins = player.coins.add(addcoin); + player.coinsThisPrestige = player.coinsThisPrestige.add(addcoin); + player.coinsThisTranscension = player.coinsThisTranscension.add(addcoin); + player.coinsThisReincarnation = player.coinsThisReincarnation.add(addcoin); + player.coinsTotal = player.coinsTotal.add(addcoin); } - resetCurrency() + resetCurrency(); if (player.upgrades[93] === 1 && player.coinsThisPrestige.gte(1e16)) { player.prestigePoints = player.prestigePoints.add( Decimal.floor(G.prestigePointGain.dividedBy(4000).times(dt / 0.025)) - ) + ); } if (player.upgrades[100] === 1 && player.coinsThisTranscension.gte(1e100)) { player.transcendPoints = player.transcendPoints.add( Decimal.floor(G.transcendPointGain.dividedBy(4000).times(dt / 0.025)) - ) + ); } if (player.cubeUpgrades[28] > 0 && player.transcendShards.gte(1e300)) { player.reincarnationPoints = player.reincarnationPoints.add( Decimal.floor(G.reincarnationPointGain.dividedBy(4000).times(dt / 0.025)) - ) + ); + } + G.produceFirstDiamonds = player.firstGeneratedDiamonds + .add(player.firstOwnedDiamonds) + .times(player.firstProduceDiamonds) + .times(G.globalCrystalMultiplier); + G.produceSecondDiamonds = player.secondGeneratedDiamonds + .add(player.secondOwnedDiamonds) + .times(player.secondProduceDiamonds) + .times(G.globalCrystalMultiplier); + G.produceThirdDiamonds = player.thirdGeneratedDiamonds + .add(player.thirdOwnedDiamonds) + .times(player.thirdProduceDiamonds) + .times(G.globalCrystalMultiplier); + G.produceFourthDiamonds = player.fourthGeneratedDiamonds + .add(player.fourthOwnedDiamonds) + .times(player.fourthProduceDiamonds) + .times(G.globalCrystalMultiplier); + G.produceFifthDiamonds = player.fifthGeneratedDiamonds + .add(player.fifthOwnedDiamonds) + .times(player.fifthProduceDiamonds) + .times(G.globalCrystalMultiplier); + + player.fourthGeneratedDiamonds = player.fourthGeneratedDiamonds.add( + G.produceFifthDiamonds.times(dt / 0.025) + ); + player.thirdGeneratedDiamonds = player.thirdGeneratedDiamonds.add( + G.produceFourthDiamonds.times(dt / 0.025) + ); + player.secondGeneratedDiamonds = player.secondGeneratedDiamonds.add( + G.produceThirdDiamonds.times(dt / 0.025) + ); + player.firstGeneratedDiamonds = player.firstGeneratedDiamonds.add( + G.produceSecondDiamonds.times(dt / 0.025) + ); + G.produceDiamonds = G.produceFirstDiamonds; + + if ( + player.currentChallenge.transcension !== 3 && + player.currentChallenge.reincarnation !== 10 + ) { + player.prestigeShards = player.prestigeShards.add( + G.produceDiamonds.times(dt / 0.025) + ); } - G.produceFirstDiamonds = player.firstGeneratedDiamonds.add(player.firstOwnedDiamonds).times( - player.firstProduceDiamonds - ).times(G.globalCrystalMultiplier) - G.produceSecondDiamonds = player.secondGeneratedDiamonds.add(player.secondOwnedDiamonds).times( - player.secondProduceDiamonds - ).times(G.globalCrystalMultiplier) - G.produceThirdDiamonds = player.thirdGeneratedDiamonds.add(player.thirdOwnedDiamonds).times( - player.thirdProduceDiamonds - ).times(G.globalCrystalMultiplier) - G.produceFourthDiamonds = player.fourthGeneratedDiamonds.add(player.fourthOwnedDiamonds).times( - player.fourthProduceDiamonds - ).times(G.globalCrystalMultiplier) - G.produceFifthDiamonds = player.fifthGeneratedDiamonds.add(player.fifthOwnedDiamonds).times( - player.fifthProduceDiamonds - ).times(G.globalCrystalMultiplier) - - player.fourthGeneratedDiamonds = player.fourthGeneratedDiamonds.add(G.produceFifthDiamonds.times(dt / 0.025)) - player.thirdGeneratedDiamonds = player.thirdGeneratedDiamonds.add(G.produceFourthDiamonds.times(dt / 0.025)) - player.secondGeneratedDiamonds = player.secondGeneratedDiamonds.add(G.produceThirdDiamonds.times(dt / 0.025)) - player.firstGeneratedDiamonds = player.firstGeneratedDiamonds.add(G.produceSecondDiamonds.times(dt / 0.025)) - G.produceDiamonds = G.produceFirstDiamonds - - if (player.currentChallenge.transcension !== 3 && player.currentChallenge.reincarnation !== 10) { - player.prestigeShards = player.prestigeShards.add(G.produceDiamonds.times(dt / 0.025)) - } - - G.produceFifthMythos = player.fifthGeneratedMythos.add(player.fifthOwnedMythos).times(player.fifthProduceMythos) + + G.produceFifthMythos = player.fifthGeneratedMythos + .add(player.fifthOwnedMythos) + .times(player.fifthProduceMythos) .times(G.globalMythosMultiplier) .times(G.grandmasterMultiplier) - .times(G.mythosupgrade15) - G.produceFourthMythos = player.fourthGeneratedMythos.add(player.fourthOwnedMythos).times(player.fourthProduceMythos) - .times(G.globalMythosMultiplier) - G.produceThirdMythos = player.thirdGeneratedMythos.add(player.thirdOwnedMythos).times(player.thirdProduceMythos) + .times(G.mythosupgrade15); + G.produceFourthMythos = player.fourthGeneratedMythos + .add(player.fourthOwnedMythos) + .times(player.fourthProduceMythos) + .times(G.globalMythosMultiplier); + G.produceThirdMythos = player.thirdGeneratedMythos + .add(player.thirdOwnedMythos) + .times(player.thirdProduceMythos) .times(G.globalMythosMultiplier) - .times(G.mythosupgrade14) - G.produceSecondMythos = player.secondGeneratedMythos.add(player.secondOwnedMythos).times(player.secondProduceMythos) + .times(G.mythosupgrade14); + G.produceSecondMythos = player.secondGeneratedMythos + .add(player.secondOwnedMythos) + .times(player.secondProduceMythos) + .times(G.globalMythosMultiplier); + G.produceFirstMythos = player.firstGeneratedMythos + .add(player.firstOwnedMythos) + .times(player.firstProduceMythos) .times(G.globalMythosMultiplier) - G.produceFirstMythos = player.firstGeneratedMythos.add(player.firstOwnedMythos).times(player.firstProduceMythos) + .times(G.mythosupgrade13); + player.fourthGeneratedMythos = player.fourthGeneratedMythos.add( + G.produceFifthMythos.times(dt / 0.025) + ); + player.thirdGeneratedMythos = player.thirdGeneratedMythos.add( + G.produceFourthMythos.times(dt / 0.025) + ); + player.secondGeneratedMythos = player.secondGeneratedMythos.add( + G.produceThirdMythos.times(dt / 0.025) + ); + player.firstGeneratedMythos = player.firstGeneratedMythos.add( + G.produceSecondMythos.times(dt / 0.025) + ); + + G.produceMythos = new Decimal("0"); + G.produceMythos = player.firstGeneratedMythos + .add(player.firstOwnedMythos) + .times(player.firstProduceMythos) .times(G.globalMythosMultiplier) - .times(G.mythosupgrade13) - player.fourthGeneratedMythos = player.fourthGeneratedMythos.add(G.produceFifthMythos.times(dt / 0.025)) - player.thirdGeneratedMythos = player.thirdGeneratedMythos.add(G.produceFourthMythos.times(dt / 0.025)) - player.secondGeneratedMythos = player.secondGeneratedMythos.add(G.produceThirdMythos.times(dt / 0.025)) - player.firstGeneratedMythos = player.firstGeneratedMythos.add(G.produceSecondMythos.times(dt / 0.025)) - - G.produceMythos = new Decimal('0') - G.produceMythos = (player.firstGeneratedMythos.add(player.firstOwnedMythos)).times(player.firstProduceMythos).times( - G.globalMythosMultiplier - ) - .times(G.mythosupgrade13) - G.producePerSecondMythos = G.produceMythos.times(40) - - let pm = new Decimal('1') + .times(G.mythosupgrade13); + G.producePerSecondMythos = G.produceMythos.times(40); + + let pm = new Decimal("1"); if (player.upgrades[67] > 0.5) { pm = pm.times( Decimal.pow( 1.03, - player.firstOwnedParticles + player.secondOwnedParticles + player.thirdOwnedParticles - + player.fourthOwnedParticles + player.fifthOwnedParticles + player.firstOwnedParticles + + player.secondOwnedParticles + + player.thirdOwnedParticles + + player.fourthOwnedParticles + + player.fifthOwnedParticles ) - ) - } - G.produceFifthParticles = player.fifthGeneratedParticles.add(player.fifthOwnedParticles).times( - player.fifthProduceParticles - ) - G.produceFourthParticles = player.fourthGeneratedParticles.add(player.fourthOwnedParticles).times( - player.fourthProduceParticles - ) - G.produceThirdParticles = player.thirdGeneratedParticles.add(player.thirdOwnedParticles).times( - player.thirdProduceParticles - ) - G.produceSecondParticles = player.secondGeneratedParticles.add(player.secondOwnedParticles).times( - player.secondProduceParticles - ) - G.produceFirstParticles = player.firstGeneratedParticles.add(player.firstOwnedParticles).times( - player.firstProduceParticles - ).times(pm) - player.fourthGeneratedParticles = player.fourthGeneratedParticles.add(G.produceFifthParticles.times(dt / 0.025)) - player.thirdGeneratedParticles = player.thirdGeneratedParticles.add(G.produceFourthParticles.times(dt / 0.025)) - player.secondGeneratedParticles = player.secondGeneratedParticles.add(G.produceThirdParticles.times(dt / 0.025)) - player.firstGeneratedParticles = player.firstGeneratedParticles.add(G.produceSecondParticles.times(dt / 0.025)) - - G.produceParticles = new Decimal('0') - G.produceParticles = (player.firstGeneratedParticles.add(player.firstOwnedParticles)).times( - player.firstProduceParticles - ).times(pm) - G.producePerSecondParticles = G.produceParticles.times(40) - - if (player.currentChallenge.transcension !== 3 && player.currentChallenge.reincarnation !== 10) { - player.transcendShards = player.transcendShards.add(G.produceMythos.times(dt / 0.025)) + ); + } + G.produceFifthParticles = player.fifthGeneratedParticles + .add(player.fifthOwnedParticles) + .times(player.fifthProduceParticles); + G.produceFourthParticles = player.fourthGeneratedParticles + .add(player.fourthOwnedParticles) + .times(player.fourthProduceParticles); + G.produceThirdParticles = player.thirdGeneratedParticles + .add(player.thirdOwnedParticles) + .times(player.thirdProduceParticles); + G.produceSecondParticles = player.secondGeneratedParticles + .add(player.secondOwnedParticles) + .times(player.secondProduceParticles); + G.produceFirstParticles = player.firstGeneratedParticles + .add(player.firstOwnedParticles) + .times(player.firstProduceParticles) + .times(pm); + player.fourthGeneratedParticles = player.fourthGeneratedParticles.add( + G.produceFifthParticles.times(dt / 0.025) + ); + player.thirdGeneratedParticles = player.thirdGeneratedParticles.add( + G.produceFourthParticles.times(dt / 0.025) + ); + player.secondGeneratedParticles = player.secondGeneratedParticles.add( + G.produceThirdParticles.times(dt / 0.025) + ); + player.firstGeneratedParticles = player.firstGeneratedParticles.add( + G.produceSecondParticles.times(dt / 0.025) + ); + + G.produceParticles = new Decimal("0"); + G.produceParticles = player.firstGeneratedParticles + .add(player.firstOwnedParticles) + .times(player.firstProduceParticles) + .times(pm); + G.producePerSecondParticles = G.produceParticles.times(40); + + if ( + player.currentChallenge.transcension !== 3 && + player.currentChallenge.reincarnation !== 10 + ) { + player.transcendShards = player.transcendShards.add( + G.produceMythos.times(dt / 0.025) + ); } if (player.currentChallenge.reincarnation !== 10) { - player.reincarnationShards = player.reincarnationShards.add(G.produceParticles.times(dt / 0.025)) + player.reincarnationShards = player.reincarnationShards.add( + G.produceParticles.times(dt / 0.025) + ); } - createAnts(dt) + createAnts(dt); for (let i = 1; i <= 5; i++) { - G.ascendBuildingProduction[G.ordinals[5 - i as ZeroToFour]] = player[`ascendBuilding${6 - i as OneToFive}` as const] - .generated.add(player[`ascendBuilding${6 - i as OneToFive}` as const].owned).times( - player[`ascendBuilding${i as OneToFive}` as const].multiplier - ).times(G.globalConstantMult) + G.ascendBuildingProduction[G.ordinals[(5 - i) as ZeroToFour]] = player[ + `ascendBuilding${(6 - i) as OneToFive}` as const + ].generated + .add(player[`ascendBuilding${(6 - i) as OneToFive}` as const].owned) + .times(player[`ascendBuilding${i as OneToFive}` as const].multiplier) + .times(G.globalConstantMult); if (i !== 5) { - const fiveMinusI = 5 - i as 1 | 2 | 3 | 4 - player[`ascendBuilding${fiveMinusI}` as const].generated = player[`ascendBuilding${fiveMinusI}` as const] - .generated - .add(G.ascendBuildingProduction[G.ordinals[fiveMinusI]].times(dt)) + const fiveMinusI = (5 - i) as 1 | 2 | 3 | 4; + player[`ascendBuilding${fiveMinusI}` as const].generated = player[ + `ascendBuilding${fiveMinusI}` as const + ].generated.add( + G.ascendBuildingProduction[G.ordinals[fiveMinusI]].times(dt) + ); } } - player.ascendShards = player.ascendShards.add(G.ascendBuildingProduction.first.times(dt)) + player.ascendShards = player.ascendShards.add( + G.ascendBuildingProduction.first.times(dt) + ); if (player.ascensionCount > 0) { - ascensionAchievementCheck(2) + ascensionAchievementCheck(2); } if ( - player.researches[71] > 0.5 - && player.challengecompletions[1] - < (Math.min(player.highestchallengecompletions[1], 25 + 5 * player.researches[66] + 925 * player.researches[105])) - && player.coins.gte( - Decimal.pow(10, 1.25 * G.challengeBaseRequirements[0] * Math.pow(1 + player.challengecompletions[1], 2)) + player.researches[71] > 0.5 && + player.challengecompletions[1] < + Math.min( + player.highestchallengecompletions[1], + 25 + 5 * player.researches[66] + 925 * player.researches[105] + ) && + player.coins.gte( + Decimal.pow( + 10, + 1.25 * + G.challengeBaseRequirements[0] * + Math.pow(1 + player.challengecompletions[1], 2) + ) ) ) { - player.challengecompletions[1] += 1 - challengeachievementcheck(1, true) - updateChallengeLevel(1) + player.challengecompletions[1] += 1; + challengeachievementcheck(1, true); + updateChallengeLevel(1); } if ( - player.researches[72] > 0.5 - && player.challengecompletions[2] - < (Math.min(player.highestchallengecompletions[2], 25 + 5 * player.researches[67] + 925 * player.researches[105])) - && player.coins.gte( - Decimal.pow(10, 1.6 * G.challengeBaseRequirements[1] * Math.pow(1 + player.challengecompletions[2], 2)) + player.researches[72] > 0.5 && + player.challengecompletions[2] < + Math.min( + player.highestchallengecompletions[2], + 25 + 5 * player.researches[67] + 925 * player.researches[105] + ) && + player.coins.gte( + Decimal.pow( + 10, + 1.6 * + G.challengeBaseRequirements[1] * + Math.pow(1 + player.challengecompletions[2], 2) + ) ) ) { - player.challengecompletions[2] += 1 - challengeachievementcheck(2, true) - updateChallengeLevel(2) + player.challengecompletions[2] += 1; + challengeachievementcheck(2, true); + updateChallengeLevel(2); } if ( - player.researches[73] > 0.5 - && player.challengecompletions[3] - < (Math.min(player.highestchallengecompletions[3], 25 + 5 * player.researches[68] + 925 * player.researches[105])) - && player.coins.gte( - Decimal.pow(10, 1.7 * G.challengeBaseRequirements[2] * Math.pow(1 + player.challengecompletions[3], 2)) + player.researches[73] > 0.5 && + player.challengecompletions[3] < + Math.min( + player.highestchallengecompletions[3], + 25 + 5 * player.researches[68] + 925 * player.researches[105] + ) && + player.coins.gte( + Decimal.pow( + 10, + 1.7 * + G.challengeBaseRequirements[2] * + Math.pow(1 + player.challengecompletions[3], 2) + ) ) ) { - player.challengecompletions[3] += 1 - challengeachievementcheck(3, true) - updateChallengeLevel(3) + player.challengecompletions[3] += 1; + challengeachievementcheck(3, true); + updateChallengeLevel(3); } if ( - player.researches[74] > 0.5 - && player.challengecompletions[4] - < (Math.min(player.highestchallengecompletions[4], 25 + 5 * player.researches[69] + 925 * player.researches[105])) - && player.coins.gte( - Decimal.pow(10, 1.45 * G.challengeBaseRequirements[3] * Math.pow(1 + player.challengecompletions[4], 2)) + player.researches[74] > 0.5 && + player.challengecompletions[4] < + Math.min( + player.highestchallengecompletions[4], + 25 + 5 * player.researches[69] + 925 * player.researches[105] + ) && + player.coins.gte( + Decimal.pow( + 10, + 1.45 * + G.challengeBaseRequirements[3] * + Math.pow(1 + player.challengecompletions[4], 2) + ) ) ) { - player.challengecompletions[4] += 1 - challengeachievementcheck(4, true) - updateChallengeLevel(4) + player.challengecompletions[4] += 1; + challengeachievementcheck(4, true); + updateChallengeLevel(4); } if ( - player.researches[75] > 0.5 - && player.challengecompletions[5] - < (Math.min(player.highestchallengecompletions[5], 25 + 5 * player.researches[70] + 925 * player.researches[105])) - && player.coins.gte( - Decimal.pow(10, 2 * G.challengeBaseRequirements[4] * Math.pow(1 + player.challengecompletions[5], 2)) + player.researches[75] > 0.5 && + player.challengecompletions[5] < + Math.min( + player.highestchallengecompletions[5], + 25 + 5 * player.researches[70] + 925 * player.researches[105] + ) && + player.coins.gte( + Decimal.pow( + 10, + 2 * + G.challengeBaseRequirements[4] * + Math.pow(1 + player.challengecompletions[5], 2) + ) ) ) { - player.challengecompletions[5] += 1 - challengeachievementcheck(5, true) - updateChallengeLevel(5) + player.challengecompletions[5] += 1; + challengeachievementcheck(5, true); + updateChallengeLevel(5); } - const chal = player.currentChallenge.transcension - const reinchal = player.currentChallenge.reincarnation - const ascendchal = player.currentChallenge.ascension + const chal = player.currentChallenge.transcension; + const reinchal = player.currentChallenge.reincarnation; + const ascendchal = player.currentChallenge.ascension; if (chal !== 0) { - if (player.coinsThisTranscension.gte(challengeRequirement(chal, player.challengecompletions[chal], chal))) { - void resetCheck('transcensionChallenge', false) - G.autoChallengeTimerIncrement = 0 + if ( + player.coinsThisTranscension.gte( + challengeRequirement(chal, player.challengecompletions[chal], chal) + ) + ) { + void resetCheck("transcensionChallenge", false); + G.autoChallengeTimerIncrement = 0; } } if (reinchal < 9 && reinchal !== 0) { - if (player.transcendShards.gte(challengeRequirement(reinchal, player.challengecompletions[reinchal], reinchal))) { - void resetCheck('reincarnationChallenge', false) - G.autoChallengeTimerIncrement = 0 + if ( + player.transcendShards.gte( + challengeRequirement( + reinchal, + player.challengecompletions[reinchal], + reinchal + ) + ) + ) { + void resetCheck("reincarnationChallenge", false); + G.autoChallengeTimerIncrement = 0; } } if (reinchal >= 9) { - if (player.coins.gte(challengeRequirement(reinchal, player.challengecompletions[reinchal], reinchal))) { - void resetCheck('reincarnationChallenge', false) - G.autoChallengeTimerIncrement = 0 + if ( + player.coins.gte( + challengeRequirement( + reinchal, + player.challengecompletions[reinchal], + reinchal + ) + ) + ) { + void resetCheck("reincarnationChallenge", false); + G.autoChallengeTimerIncrement = 0; } } if (ascendchal !== 0 && ascendchal < 15) { if ( - player.challengecompletions[10] - >= (challengeRequirement(ascendchal, player.challengecompletions[ascendchal], ascendchal) as number) + player.challengecompletions[10] >= + (challengeRequirement( + ascendchal, + player.challengecompletions[ascendchal], + ascendchal + ) as number) ) { - void resetCheck('ascensionChallenge', false) - challengeachievementcheck(ascendchal, true) + void resetCheck("ascensionChallenge", false); + challengeachievementcheck(ascendchal, true); } } if (ascendchal === 15) { - if (player.coins.gte(challengeRequirement(ascendchal, player.challengecompletions[ascendchal], ascendchal))) { - void resetCheck('ascensionChallenge', false) + if ( + player.coins.gte( + challengeRequirement( + ascendchal, + player.challengecompletions[ascendchal], + ascendchal + ) + ) + ) { + void resetCheck("ascensionChallenge", false); } } -} +}; export const updateAntMultipliers = (): void => { // Update 2.5.0: Updated to have a base of 10 instead of 1x - G.globalAntMult = new Decimal(10) + G.globalAntMult = new Decimal(10); // Update 2.9.0: Updated to give a 5x multiplier no matter what - G.globalAntMult = G.globalAntMult.times(5) + G.globalAntMult = G.globalAntMult.times(5); G.globalAntMult = G.globalAntMult.times( - 1 - + 1 / 2500 - * Math.pow( - G.rune5level * G.effectiveLevelMult - * (1 - + player.researches[84] / 200 - * (1 + 1 * G.effectiveRuneSpiritPower[5] * calculateCorruptionPoints() / 400)), + 1 + + (1 / 2500) * + Math.pow( + G.rune5level * + G.effectiveLevelMult * + (1 + + (player.researches[84] / 200) * + (1 + + (1 * + G.effectiveRuneSpiritPower[5] * + calculateCorruptionPoints()) / + 400)), 2 ) - ) + ); if (player.upgrades[76] === 1) { - G.globalAntMult = G.globalAntMult.times(5) + G.globalAntMult = G.globalAntMult.times(5); } G.globalAntMult = G.globalAntMult.times( Decimal.pow( - 1 + player.upgrades[77] / 250 + player.researches[96] / 5000 + player.cubeUpgrades[65] / 250, - player.firstOwnedAnts + player.secondOwnedAnts + player.thirdOwnedAnts + player.fourthOwnedAnts - + player.fifthOwnedAnts + player.sixthOwnedAnts + player.seventhOwnedAnts + player.eighthOwnedAnts + 1 + + player.upgrades[77] / 250 + + player.researches[96] / 5000 + + player.cubeUpgrades[65] / 250, + player.firstOwnedAnts + + player.secondOwnedAnts + + player.thirdOwnedAnts + + player.fourthOwnedAnts + + player.fifthOwnedAnts + + player.sixthOwnedAnts + + player.seventhOwnedAnts + + player.eighthOwnedAnts ) - ) + ); G.globalAntMult = G.globalAntMult.times( - 1 + player.upgrades[78] * 0.005 * Math.pow(Math.log10(player.maxofferings + 1), 2) - ) + 1 + + player.upgrades[78] * + 0.005 * + Math.pow(Math.log10(player.maxofferings + 1), 2) + ); G.globalAntMult = G.globalAntMult.times( Decimal.pow( 1.11 + player.researches[101] / 1000 + player.researches[162] / 10000, player.antUpgrades[0]! + G.bonusant1 ) - ) - G.globalAntMult = G.globalAntMult.times(antSacrificePointsToMultiplier(player.antSacrificePoints)) + ); + G.globalAntMult = G.globalAntMult.times( + antSacrificePointsToMultiplier(player.antSacrificePoints) + ); + G.globalAntMult = G.globalAntMult.times( + Decimal.pow( + Math.max(1, player.researchPoints), + G.effectiveRuneBlessingPower[5] + ) + ); + G.globalAntMult = G.globalAntMult.times( + Decimal.pow(1 + G.runeSum / 100, G.talisman6Power) + ); G.globalAntMult = G.globalAntMult.times( - Decimal.pow(Math.max(1, player.researchPoints), G.effectiveRuneBlessingPower[5]) - ) - G.globalAntMult = G.globalAntMult.times(Decimal.pow(1 + G.runeSum / 100, G.talisman6Power)) - G.globalAntMult = G.globalAntMult.times(Decimal.pow(1.1, CalcECC('reincarnation', player.challengecompletions[9]))) - G.globalAntMult = G.globalAntMult.times(G.cubeBonusMultiplier[6]) + Decimal.pow(1.1, CalcECC("reincarnation", player.challengecompletions[9])) + ); + G.globalAntMult = G.globalAntMult.times(G.cubeBonusMultiplier[6]); if (player.achievements[169] === 1) { - G.globalAntMult = G.globalAntMult.times(Decimal.log(player.antPoints.add(10), 10)) + G.globalAntMult = G.globalAntMult.times( + Decimal.log(player.antPoints.add(10), 10) + ); } if (player.achievements[171] === 1) { - G.globalAntMult = G.globalAntMult.times(1.16666) + G.globalAntMult = G.globalAntMult.times(1.16666); } if (player.achievements[172] === 1) { - G.globalAntMult = G.globalAntMult.times(1 + 2 * (1 - Math.pow(2, -Math.min(1, player.reincarnationcounter / 7200)))) + G.globalAntMult = G.globalAntMult.times( + 1 + + 2 * (1 - Math.pow(2, -Math.min(1, player.reincarnationcounter / 7200))) + ); } if (player.upgrades[39] === 1) { - G.globalAntMult = G.globalAntMult.times(1.60) + G.globalAntMult = G.globalAntMult.times(1.6); } G.globalAntMult = G.globalAntMult.times( - Decimal.pow(1 + 0.1 * Decimal.log(player.ascendShards.add(1), 10), player.constantUpgrades[5]) - ) - G.globalAntMult = G.globalAntMult.times(Decimal.pow(1e5, CalcECC('ascension', player.challengecompletions[11]))) + Decimal.pow( + 1 + 0.1 * Decimal.log(player.ascendShards.add(1), 10), + player.constantUpgrades[5] + ) + ); + G.globalAntMult = G.globalAntMult.times( + Decimal.pow(1e5, CalcECC("ascension", player.challengecompletions[11])) + ); if (player.researches[147] > 0) { - G.globalAntMult = G.globalAntMult.times(Decimal.log(player.antPoints.add(10), 10)) + G.globalAntMult = G.globalAntMult.times( + Decimal.log(player.antPoints.add(10), 10) + ); } if (player.researches[177] > 0) { G.globalAntMult = G.globalAntMult.times( - Decimal.pow(Decimal.log(player.antPoints.add(10), 10), player.researches[177]) - ) + Decimal.pow( + Decimal.log(player.antPoints.add(10), 10), + player.researches[177] + ) + ); } if (player.currentChallenge.ascension === 12) { - G.globalAntMult = Decimal.pow(G.globalAntMult, 0.5) + G.globalAntMult = Decimal.pow(G.globalAntMult, 0.5); } if (player.currentChallenge.ascension === 13) { - G.globalAntMult = Decimal.pow(G.globalAntMult, 0.23) + G.globalAntMult = Decimal.pow(G.globalAntMult, 0.23); } if (player.currentChallenge.ascension === 14) { - G.globalAntMult = Decimal.pow(G.globalAntMult, 0.2) + G.globalAntMult = Decimal.pow(G.globalAntMult, 0.2); } if (player.currentChallenge.ascension !== 15) { - G.globalAntMult = Decimal.pow(G.globalAntMult, 1 - 0.9 / 90 * Math.min(99, sumContents(player.usedCorruptions))) - } else { // C15 used to have 9 corruptions set to 11, which above would provide a power of 0.01. Now it's hardcoded this way. - G.globalAntMult = Decimal.pow(G.globalAntMult, 0.01) + G.globalAntMult = Decimal.pow( + G.globalAntMult, + 1 - (0.9 / 90) * Math.min(99, sumContents(player.usedCorruptions)) + ); + } else { + // C15 used to have 9 corruptions set to 11, which above would provide a power of 0.01. Now it's hardcoded this way. + G.globalAntMult = Decimal.pow(G.globalAntMult, 0.01); } - G.globalAntMult = Decimal.pow(G.globalAntMult, G.extinctionMultiplier[player.usedCorruptions[7]]) - G.globalAntMult = G.globalAntMult.times(G.challenge15Rewards.antSpeed) + G.globalAntMult = Decimal.pow( + G.globalAntMult, + G.extinctionMultiplier[player.usedCorruptions[7]] + ); + G.globalAntMult = G.globalAntMult.times(G.challenge15Rewards.antSpeed); // V2.5.0: Moved ant shop upgrade as 'uncorruptable' - G.globalAntMult = G.globalAntMult.times(Decimal.pow(1.2, player.shopUpgrades.antSpeed)) + G.globalAntMult = G.globalAntMult.times( + Decimal.pow(1.2, player.shopUpgrades.antSpeed) + ); if (player.platonicUpgrades[12] > 0) { G.globalAntMult = G.globalAntMult.times( - Decimal.pow(1 + 1 / 100 * player.platonicUpgrades[12], sumContents(player.highestchallengecompletions)) - ) + Decimal.pow( + 1 + (1 / 100) * player.platonicUpgrades[12], + sumContents(player.highestchallengecompletions) + ) + ); } - if (player.currentChallenge.ascension === 15 && player.platonicUpgrades[10] > 0) { - G.globalAntMult = Decimal.pow(G.globalAntMult, 1.25) + if ( + player.currentChallenge.ascension === 15 && + player.platonicUpgrades[10] > 0 + ) { + G.globalAntMult = Decimal.pow(G.globalAntMult, 1.25); } if (player.achievements[274] > 0) { - G.globalAntMult = G.globalAntMult.times(4.44) + G.globalAntMult = G.globalAntMult.times(4.44); } if (player.usedCorruptions[7] >= 14) { - G.globalAntMult = Decimal.pow(G.globalAntMult, 0.02) + G.globalAntMult = Decimal.pow(G.globalAntMult, 0.02); } if (player.usedCorruptions[7] >= 15) { - G.globalAntMult = Decimal.pow(G.globalAntMult, 0.02) + G.globalAntMult = Decimal.pow(G.globalAntMult, 0.02); } if (player.usedCorruptions[7] >= 16) { - G.globalAntMult = Decimal.pow(G.globalAntMult, 0.02) + G.globalAntMult = Decimal.pow(G.globalAntMult, 0.02); } if (player.octeractUpgrades.octeractStarter.getEffect().bonus) { - G.globalAntMult = G.globalAntMult.times(100000) + G.globalAntMult = G.globalAntMult.times(100000); } if (player.highestSingularityCount >= 30) { - G.globalAntMult = G.globalAntMult.times(1000) + G.globalAntMult = G.globalAntMult.times(1000); } if (player.highestSingularityCount >= 70) { - G.globalAntMult = G.globalAntMult.times(1000) + G.globalAntMult = G.globalAntMult.times(1000); } if (player.highestSingularityCount >= 100) { - G.globalAntMult = G.globalAntMult.times(1e6) + G.globalAntMult = G.globalAntMult.times(1e6); } -} +}; export const createAnts = (dt: number): void => { - updateAntMultipliers() - G.antEightProduce = player.eighthGeneratedAnts.add(player.eighthOwnedAnts).times(player.eighthProduceAnts).times( - G.globalAntMult - ) - G.antSevenProduce = player.seventhGeneratedAnts.add(player.seventhOwnedAnts).times(player.seventhProduceAnts).times( - G.globalAntMult - ) - G.antSixProduce = player.sixthGeneratedAnts.add(player.sixthOwnedAnts).times(player.sixthProduceAnts).times( - G.globalAntMult - ) - G.antFiveProduce = player.fifthGeneratedAnts.add(player.fifthOwnedAnts).times(player.fifthProduceAnts).times( - G.globalAntMult - ) - G.antFourProduce = player.fourthGeneratedAnts.add(player.fourthOwnedAnts).times(player.fourthProduceAnts).times( - G.globalAntMult - ) - G.antThreeProduce = player.thirdGeneratedAnts.add(player.thirdOwnedAnts).times(player.thirdProduceAnts).times( - G.globalAntMult - ) - G.antTwoProduce = player.secondGeneratedAnts.add(player.secondOwnedAnts).times(player.secondProduceAnts).times( - G.globalAntMult - ) - G.antOneProduce = player.firstGeneratedAnts.add(player.firstOwnedAnts).times(player.firstProduceAnts).times( - G.globalAntMult - ) - player.seventhGeneratedAnts = player.seventhGeneratedAnts.add(G.antEightProduce.times(dt / 1)) - player.sixthGeneratedAnts = player.sixthGeneratedAnts.add(G.antSevenProduce.times(dt / 1)) - player.fifthGeneratedAnts = player.fifthGeneratedAnts.add(G.antSixProduce.times(dt / 1)) - player.fourthGeneratedAnts = player.fourthGeneratedAnts.add(G.antFiveProduce.times(dt / 1)) - player.thirdGeneratedAnts = player.thirdGeneratedAnts.add(G.antFourProduce.times(dt / 1)) - player.secondGeneratedAnts = player.secondGeneratedAnts.add(G.antThreeProduce.times(dt / 1)) - player.firstGeneratedAnts = player.firstGeneratedAnts.add(G.antTwoProduce.times(dt / 1)) - - player.antPoints = player.antPoints.add(G.antOneProduce.times(dt / 1)) -} + updateAntMultipliers(); + G.antEightProduce = player.eighthGeneratedAnts + .add(player.eighthOwnedAnts) + .times(player.eighthProduceAnts) + .times(G.globalAntMult); + G.antSevenProduce = player.seventhGeneratedAnts + .add(player.seventhOwnedAnts) + .times(player.seventhProduceAnts) + .times(G.globalAntMult); + G.antSixProduce = player.sixthGeneratedAnts + .add(player.sixthOwnedAnts) + .times(player.sixthProduceAnts) + .times(G.globalAntMult); + G.antFiveProduce = player.fifthGeneratedAnts + .add(player.fifthOwnedAnts) + .times(player.fifthProduceAnts) + .times(G.globalAntMult); + G.antFourProduce = player.fourthGeneratedAnts + .add(player.fourthOwnedAnts) + .times(player.fourthProduceAnts) + .times(G.globalAntMult); + G.antThreeProduce = player.thirdGeneratedAnts + .add(player.thirdOwnedAnts) + .times(player.thirdProduceAnts) + .times(G.globalAntMult); + G.antTwoProduce = player.secondGeneratedAnts + .add(player.secondOwnedAnts) + .times(player.secondProduceAnts) + .times(G.globalAntMult); + G.antOneProduce = player.firstGeneratedAnts + .add(player.firstOwnedAnts) + .times(player.firstProduceAnts) + .times(G.globalAntMult); + player.seventhGeneratedAnts = player.seventhGeneratedAnts.add( + G.antEightProduce.times(dt / 1) + ); + player.sixthGeneratedAnts = player.sixthGeneratedAnts.add( + G.antSevenProduce.times(dt / 1) + ); + player.fifthGeneratedAnts = player.fifthGeneratedAnts.add( + G.antSixProduce.times(dt / 1) + ); + player.fourthGeneratedAnts = player.fourthGeneratedAnts.add( + G.antFiveProduce.times(dt / 1) + ); + player.thirdGeneratedAnts = player.thirdGeneratedAnts.add( + G.antFourProduce.times(dt / 1) + ); + player.secondGeneratedAnts = player.secondGeneratedAnts.add( + G.antThreeProduce.times(dt / 1) + ); + player.firstGeneratedAnts = player.firstGeneratedAnts.add( + G.antTwoProduce.times(dt / 1) + ); + + player.antPoints = player.antPoints.add(G.antOneProduce.times(dt / 1)); +}; export const resetCurrency = (): void => { - let prestigePow = 0.5 + CalcECC('transcend', player.challengecompletions[5]) / 100 - let transcendPow = 0.03 + let prestigePow = + 0.5 + CalcECC("transcend", player.challengecompletions[5]) / 100; + let transcendPow = 0.03; // Calculates the conversion exponent for resets (Challenges 5 and 10 reduce the exponent accordingly). if (player.currentChallenge.transcension === 5) { - prestigePow = 0.01 / (1 + player.challengecompletions[5]) - transcendPow = 0.001 + prestigePow = 0.01 / (1 + player.challengecompletions[5]); + transcendPow = 0.001; } if (player.currentChallenge.reincarnation === 10) { - prestigePow = (1e-4) / (1 + player.challengecompletions[10]) - transcendPow = 0.001 + prestigePow = 1e-4 / (1 + player.challengecompletions[10]); + transcendPow = 0.001; } - prestigePow *= G.deflationMultiplier[player.usedCorruptions[6]] + prestigePow *= G.deflationMultiplier[player.usedCorruptions[6]]; // Prestige Point Formulae - G.prestigePointGain = Decimal.floor(Decimal.pow(player.coinsThisPrestige.dividedBy(1e12), prestigePow)) + G.prestigePointGain = Decimal.floor( + Decimal.pow(player.coinsThisPrestige.dividedBy(1e12), prestigePow) + ); if ( - player.upgrades[16] > 0.5 && player.currentChallenge.transcension !== 5 - && player.currentChallenge.reincarnation !== 10 + player.upgrades[16] > 0.5 && + player.currentChallenge.transcension !== 5 && + player.currentChallenge.reincarnation !== 10 ) { G.prestigePointGain = G.prestigePointGain.times( Decimal.min( Decimal.pow(10, 1e33), - Decimal.pow(G.acceleratorEffect, 1 / 3 * G.deflationMultiplier[player.usedCorruptions[6]]) + Decimal.pow( + G.acceleratorEffect, + (1 / 3) * G.deflationMultiplier[player.usedCorruptions[6]] + ) ) - ) + ); } // Transcend Point Formulae - G.transcendPointGain = Decimal.floor(Decimal.pow(player.coinsThisTranscension.dividedBy(1e100), transcendPow)) + G.transcendPointGain = Decimal.floor( + Decimal.pow(player.coinsThisTranscension.dividedBy(1e100), transcendPow) + ); if ( - player.upgrades[44] > 0.5 && player.currentChallenge.transcension !== 5 - && player.currentChallenge.reincarnation !== 10 + player.upgrades[44] > 0.5 && + player.currentChallenge.transcension !== 5 && + player.currentChallenge.reincarnation !== 10 ) { - G.transcendPointGain = G.transcendPointGain.times(Decimal.min(1e6, Decimal.pow(1.01, player.transcendCount))) + G.transcendPointGain = G.transcendPointGain.times( + Decimal.min(1e6, Decimal.pow(1.01, player.transcendCount)) + ); } // Reincarnation Point Formulae - G.reincarnationPointGain = Decimal.floor(Decimal.pow(player.transcendShards.dividedBy(1e300), 0.01)) + G.reincarnationPointGain = Decimal.floor( + Decimal.pow(player.transcendShards.dividedBy(1e300), 0.01) + ); if (player.currentChallenge.reincarnation !== 0) { - G.reincarnationPointGain = Decimal.pow(G.reincarnationPointGain, 0.01) + G.reincarnationPointGain = Decimal.pow(G.reincarnationPointGain, 0.01); } if (player.achievements[50] === 1) { - G.reincarnationPointGain = G.reincarnationPointGain.times(2) + G.reincarnationPointGain = G.reincarnationPointGain.times(2); } if (player.upgrades[65] > 0.5) { - G.reincarnationPointGain = G.reincarnationPointGain.times(5) + G.reincarnationPointGain = G.reincarnationPointGain.times(5); } if (player.currentChallenge.ascension === 12) { - G.reincarnationPointGain = new Decimal('0') + G.reincarnationPointGain = new Decimal("0"); } -} +}; -export const resetCheck = async (i: resetNames, manual = true, leaving = false): Promise => { - if (i === 'prestige') { +export const resetCheck = async ( + i: resetNames, + manual = true, + leaving = false +): Promise => { + if (i === "prestige") { if (player.coinsThisPrestige.gte(1e16) || G.prestigePointGain.gte(100)) { if (manual) { - void resetConfirmation('prestige') + void resetConfirmation("prestige"); } else { - resetachievementcheck(1) - reset('prestige') + resetachievementcheck(1); + reset("prestige"); } } } - if (i === 'transcension') { + if (i === "transcension") { if ( - (player.coinsThisTranscension.gte(1e100) || G.transcendPointGain.gte(0.5)) - && player.currentChallenge.transcension === 0 + (player.coinsThisTranscension.gte(1e100) || + G.transcendPointGain.gte(0.5)) && + player.currentChallenge.transcension === 0 ) { if (manual) { - void resetConfirmation('transcend') + void resetConfirmation("transcend"); } if (!manual) { - resetachievementcheck(2) - reset('transcension') + resetachievementcheck(2); + reset("transcension"); } } } - if (i === 'transcensionChallenge' && player.currentChallenge.transcension !== 0) { - const q = player.currentChallenge.transcension - const maxCompletions = getMaxChallenges(q) - const reqCheck = (comp: number) => player.coinsThisTranscension.gte(challengeRequirement(q, comp, q)) - if (reqCheck(player.challengecompletions[q]) && player.challengecompletions[q] < maxCompletions) { - let maxInc = 1 + if ( + i === "transcensionChallenge" && + player.currentChallenge.transcension !== 0 + ) { + const q = player.currentChallenge.transcension; + const maxCompletions = getMaxChallenges(q); + const reqCheck = (comp: number) => + player.coinsThisTranscension.gte(challengeRequirement(q, comp, q)); + if ( + reqCheck(player.challengecompletions[q]) && + player.challengecompletions[q] < maxCompletions + ) { + let maxInc = 1; if (player.shopUpgrades.instantChallenge > 0) { - maxInc = 10 + maxInc = 10; } if (player.shopUpgrades.instantChallenge2 > 0) { - maxInc += player.highestSingularityCount + maxInc += player.highestSingularityCount; } if (player.currentChallenge.ascension === 13) { - maxInc = 1 + maxInc = 1; } - let counter = 0 - let comp = player.challengecompletions[q] + let counter = 0; + let comp = player.challengecompletions[q]; while (counter < maxInc) { if (reqCheck(comp) && comp < maxCompletions) { - comp++ + comp++; } - counter++ + counter++; } - player.challengecompletions[q] = comp - challengeDisplay(q, false) - updateChallengeLevel(q) - } - if (player.challengecompletions[q] > player.highestchallengecompletions[q]) { - while (player.challengecompletions[q] > player.highestchallengecompletions[q]) { - player.highestchallengecompletions[q] += 1 - highestChallengeRewards(q, player.highestchallengecompletions[q]) + player.challengecompletions[q] = comp; + challengeDisplay(q, false); + updateChallengeLevel(q); + } + if ( + player.challengecompletions[q] > player.highestchallengecompletions[q] + ) { + while ( + player.challengecompletions[q] > player.highestchallengecompletions[q] + ) { + player.highestchallengecompletions[q] += 1; + highestChallengeRewards(q, player.highestchallengecompletions[q]); } - calculateCubeBlessings() + calculateCubeBlessings(); } - challengeachievementcheck(q) + challengeachievementcheck(q); if ( - !player.retrychallenges || manual - || (player.autoChallengeRunning && player.challengecompletions[q] >= maxCompletions) + !player.retrychallenges || + manual || + (player.autoChallengeRunning && + player.challengecompletions[q] >= maxCompletions) ) { - toggleAutoChallengeModeText('ENTER') - player.currentChallenge.transcension = 0 - updateChallengeDisplay() + toggleAutoChallengeModeText("ENTER"); + player.currentChallenge.transcension = 0; + updateChallengeDisplay(); } if (player.shopUpgrades.instantChallenge === 0 || leaving) { - reset('transcensionChallenge', false, 'leaveChallenge') - player.transcendCount -= 1 + reset("transcensionChallenge", false, "leaveChallenge"); + player.transcendCount -= 1; } } - if (i === 'reincarnation') { + if (i === "reincarnation") { if ( - G.reincarnationPointGain.gt(0.5) && player.currentChallenge.transcension === 0 - && player.currentChallenge.reincarnation === 0 + G.reincarnationPointGain.gt(0.5) && + player.currentChallenge.transcension === 0 && + player.currentChallenge.reincarnation === 0 ) { if (manual) { - void resetConfirmation('reincarnate') + void resetConfirmation("reincarnate"); } if (!manual) { - resetachievementcheck(3) - reset('reincarnation') + resetachievementcheck(3); + reset("reincarnation"); } } } - if (i === 'reincarnationChallenge' && player.currentChallenge.reincarnation !== 0) { - const q = player.currentChallenge.reincarnation - const maxCompletions = getMaxChallenges(q) + if ( + i === "reincarnationChallenge" && + player.currentChallenge.reincarnation !== 0 + ) { + const q = player.currentChallenge.reincarnation; + const maxCompletions = getMaxChallenges(q); const reqCheck = (comp: number) => { if (q <= 8) { - return player.transcendShards.gte(challengeRequirement(q, comp, q)) - } else { // challenges 9 and 10 - return player.coins.gte(challengeRequirement(q, comp, q)) + return player.transcendShards.gte(challengeRequirement(q, comp, q)); + } else { + // challenges 9 and 10 + return player.coins.gte(challengeRequirement(q, comp, q)); } - } - if (reqCheck(player.challengecompletions[q]) && player.challengecompletions[q] < maxCompletions) { - let maxInc = 1 + }; + if ( + reqCheck(player.challengecompletions[q]) && + player.challengecompletions[q] < maxCompletions + ) { + let maxInc = 1; if (player.shopUpgrades.instantChallenge > 0) { - maxInc = 10 + maxInc = 10; } if (player.shopUpgrades.instantChallenge2 > 0) { - maxInc += player.highestSingularityCount + maxInc += player.highestSingularityCount; } if (player.currentChallenge.ascension === 13) { - maxInc = 1 + maxInc = 1; } - let counter = 0 - let comp = player.challengecompletions[q] + let counter = 0; + let comp = player.challengecompletions[q]; while (counter < maxInc) { if (reqCheck(comp) && comp < maxCompletions) { - comp++ + comp++; } - counter++ + counter++; } - player.challengecompletions[q] = comp - challengeDisplay(q, false) - updateChallengeLevel(q) - } - if (player.challengecompletions[q] > player.highestchallengecompletions[q]) { - while (player.challengecompletions[q] > player.highestchallengecompletions[q]) { - player.highestchallengecompletions[q] += 1 - highestChallengeRewards(q, player.highestchallengecompletions[q]) + player.challengecompletions[q] = comp; + challengeDisplay(q, false); + updateChallengeLevel(q); + } + if ( + player.challengecompletions[q] > player.highestchallengecompletions[q] + ) { + while ( + player.challengecompletions[q] > player.highestchallengecompletions[q] + ) { + player.highestchallengecompletions[q] += 1; + highestChallengeRewards(q, player.highestchallengecompletions[q]); } - calculateHypercubeBlessings() - calculateTesseractBlessings() - calculateCubeBlessings() + calculateHypercubeBlessings(); + calculateTesseractBlessings(); + calculateCubeBlessings(); } - challengeachievementcheck(q) + challengeachievementcheck(q); if ( - !player.retrychallenges || manual - || (player.autoChallengeRunning && player.challengecompletions[q] >= maxCompletions) + !player.retrychallenges || + manual || + (player.autoChallengeRunning && + player.challengecompletions[q] >= maxCompletions) ) { - toggleAutoChallengeModeText('ENTER') - player.currentChallenge.reincarnation = 0 + toggleAutoChallengeModeText("ENTER"); + player.currentChallenge.reincarnation = 0; if (player.shopUpgrades.instantChallenge > 0) { for (let i = 1; i <= 5; i++) { - player.challengecompletions[i] = player.highestchallengecompletions[i] + player.challengecompletions[i] = + player.highestchallengecompletions[i]; } } - updateChallengeDisplay() - calculateRuneLevels() - calculateAnts() + updateChallengeDisplay(); + calculateRuneLevels(); + calculateAnts(); } if (player.shopUpgrades.instantChallenge === 0 || leaving) { - reset('reincarnationChallenge', false, 'leaveChallenge') - player.reincarnationCount -= 1 + reset("reincarnationChallenge", false, "leaveChallenge"); + player.reincarnationCount -= 1; } } - if (i === 'ascension') { - if (player.achievements[141] > 0 && (!player.toggles[31] || player.challengecompletions[10] > 0)) { + if (i === "ascension") { + if ( + player.achievements[141] > 0 && + (!player.toggles[31] || player.challengecompletions[10] > 0) + ) { if (manual) { - void resetConfirmation('ascend') + void resetConfirmation("ascend"); } } } - if (i === 'ascensionChallenge' && player.currentChallenge.ascension !== 0) { - let conf = true + if (i === "ascensionChallenge" && player.currentChallenge.ascension !== 0) { + let conf = true; if (manual) { if (player.challengecompletions[11] === 0 || player.toggles[31]) { - conf = await Confirm(i18next.t('main.exitAscensionChallenge')) + conf = await Confirm(i18next.t("main.exitAscensionChallenge")); } } if (!conf) { - return + return; } - const a = player.currentChallenge.ascension - const maxCompletions = getMaxChallenges(a) + const a = player.currentChallenge.ascension; + const maxCompletions = getMaxChallenges(a); if (a !== 0 && a < 15) { if ( - player.challengecompletions[10] >= (challengeRequirement(a, player.challengecompletions[a], a) as number) - && player.challengecompletions[a] < maxCompletions + player.challengecompletions[10] >= + (challengeRequirement( + a, + player.challengecompletions[a], + a + ) as number) && + player.challengecompletions[a] < maxCompletions ) { - player.challengecompletions[a] += 1 - updateChallengeLevel(a) - challengeDisplay(a, false) + player.challengecompletions[a] += 1; + updateChallengeLevel(a); + challengeDisplay(a, false); } - challengeachievementcheck(a, true) + challengeachievementcheck(a, true); } if (a === 15) { - const c15SM = challenge15ScoreMultiplier() + const c15SM = challenge15ScoreMultiplier(); if ( - player.coins.gte(challengeRequirement(a, player.challengecompletions[a], a)) - && player.challengecompletions[a] < maxCompletions + player.coins.gte( + challengeRequirement(a, player.challengecompletions[a], a) + ) && + player.challengecompletions[a] < maxCompletions ) { - player.challengecompletions[a] += 1 - updateChallengeLevel(a) - challengeDisplay(a, false) + player.challengecompletions[a] += 1; + updateChallengeLevel(a); + challengeDisplay(a, false); } if ( - (manual || leaving || player.shopUpgrades.challenge15Auto > 0) - && player.usedCorruptions.slice(2, 10).every((a) => a === 11) + (manual || leaving || player.shopUpgrades.challenge15Auto > 0) && + player.usedCorruptions.slice(2, 10).every((a) => a === 11) ) { - if (player.coins.gte(Decimal.pow(10, player.challenge15Exponent / c15SM))) { - player.challenge15Exponent = Decimal.log(player.coins.add(1), 10) * c15SM - c15RewardUpdate() + if ( + player.coins.gte(Decimal.pow(10, player.challenge15Exponent / c15SM)) + ) { + player.challenge15Exponent = + Decimal.log(player.coins.add(1), 10) * c15SM; + c15RewardUpdate(); } } } - if (player.challengecompletions[a] > player.highestchallengecompletions[a]) { - player.highestchallengecompletions[a] += 1 - player.wowHypercubes.add(1) + if ( + player.challengecompletions[a] > player.highestchallengecompletions[a] + ) { + player.highestchallengecompletions[a] += 1; + player.wowHypercubes.add(1); if (player.highestchallengecompletions[a] >= maxCompletions) { - leaving = true + leaving = true; } } if (!player.retrychallenges || manual || leaving) { if ( - !(!manual && (autoAscensionChallengeSweepUnlock() || !player.autoChallengeRunning) // If not autochallenge, don't reset - && player.autoAscend && player.challengecompletions[11] > 0 - && player.cubeUpgrades[10] > 0) + !( + !manual && + (autoAscensionChallengeSweepUnlock() || + !player.autoChallengeRunning) && // If not autochallenge, don't reset + player.autoAscend && + player.challengecompletions[11] > 0 && + player.cubeUpgrades[10] > 0 + ) ) { - player.currentChallenge.ascension = 0 - updateChallengeDisplay() + player.currentChallenge.ascension = 0; + updateChallengeDisplay(); } } if ((player.shopUpgrades.instantChallenge2 === 0 && a !== 15) || manual) { - reset('ascensionChallenge', false) + reset("ascensionChallenge", false); } } - if (i === 'singularity') { + if (i === "singularity") { if (player.runelevels[6] === 0) { - return Alert(i18next.t('main.noAntiquity')) + return Alert(i18next.t("main.noAntiquity")); } - const thankSing = 300 + const thankSing = 300; if (player.insideSingularityChallenge) { - return Alert(i18next.t('main.insideSingularityChallenge')) + return Alert(i18next.t("main.insideSingularityChallenge")); } if (player.singularityCount >= thankSing) { - return Alert(i18next.t('main.gameBeat')) + return Alert(i18next.t("main.gameBeat")); } - let confirmed = false - const nextSingularityNumber = player.singularityCount + 1 + getFastForwardTotalMultiplier() + let confirmed = false; + const nextSingularityNumber = + player.singularityCount + 1 + getFastForwardTotalMultiplier(); if (!player.toggles[33] && player.singularityCount > 0) { - confirmed = await Confirm(i18next.t('main.singularityConfirm0', { - x: format(nextSingularityNumber), - y: format(calculateGoldenQuarkGain(), 2, true) - })) + confirmed = await Confirm( + i18next.t("main.singularityConfirm0", { + x: format(nextSingularityNumber), + y: format(calculateGoldenQuarkGain(), 2, true), + }) + ); } else { - await Alert(i18next.t('main.singularityMessage1', { x: format(player.singularityCount) })) - await Alert(i18next.t('main.singularityMessage2')) - await Alert(i18next.t('main.singularityMessage3')) - await Alert(i18next.t('main.singularityMessage4', { - x: format(nextSingularityNumber), - y: format(calculateGoldenQuarkGain(), 2, true), - z: format(player.worlds.BONUS) - })) - await Alert(i18next.t('main.singularityMessage5')) - - confirmed = await Confirm(i18next.t('main.singularityConfirm1')) + await Alert( + i18next.t("main.singularityMessage1", { + x: format(player.singularityCount), + }) + ); + await Alert(i18next.t("main.singularityMessage2")); + await Alert(i18next.t("main.singularityMessage3")); + await Alert( + i18next.t("main.singularityMessage4", { + x: format(nextSingularityNumber), + y: format(calculateGoldenQuarkGain(), 2, true), + z: format(player.worlds.BONUS), + }) + ); + await Alert(i18next.t("main.singularityMessage5")); + + confirmed = await Confirm(i18next.t("main.singularityConfirm1")); if (confirmed) { - confirmed = await Confirm(i18next.t('main.singularityConfirm2')) + confirmed = await Confirm(i18next.t("main.singularityConfirm2")); } if (confirmed) { - confirmed = await Confirm(i18next.t('main.singularityConfirm3')) + confirmed = await Confirm(i18next.t("main.singularityConfirm3")); } } if (!confirmed) { - return Alert(i18next.t('main.singularityCancelled')) + return Alert(i18next.t("main.singularityCancelled")); } else { - await singularity() - await saveSynergy() - return Alert(i18next.t('main.welcomeToSingularity', { x: format(player.singularityCount) })) + await singularity(); + await saveSynergy(); + return Alert( + i18next.t("main.welcomeToSingularity", { + x: format(player.singularityCount), + }) + ); } } -} +}; export const resetConfirmation = async (i: string): Promise => { - if (i === 'prestige') { + if (i === "prestige") { if (player.toggles[28]) { - const r = await Confirm(i18next.t('main.prestigePrompt')) + const r = await Confirm(i18next.t("main.prestigePrompt")); if (r) { - resetachievementcheck(1) - reset('prestige') + resetachievementcheck(1); + reset("prestige"); } } else { - resetachievementcheck(1) - reset('prestige') + resetachievementcheck(1); + reset("prestige"); } } - if (i === 'transcend') { + if (i === "transcend") { if (player.toggles[29]) { - const z = await Confirm(i18next.t('main.transcendPrompt')) + const z = await Confirm(i18next.t("main.transcendPrompt")); if (z) { - resetachievementcheck(2) - reset('transcension') + resetachievementcheck(2); + reset("transcension"); } } else { - resetachievementcheck(2) - reset('transcension') + resetachievementcheck(2); + reset("transcension"); } } - if (i === 'reincarnate') { + if (i === "reincarnate") { if (player.currentChallenge.ascension !== 12) { if (player.toggles[30]) { - const z = await Confirm(i18next.t('main.reincarnatePrompt')) + const z = await Confirm(i18next.t("main.reincarnatePrompt")); if (z) { - resetachievementcheck(3) - reset('reincarnation') + resetachievementcheck(3); + reset("reincarnation"); } } else { - resetachievementcheck(3) - reset('reincarnation') + resetachievementcheck(3); + reset("reincarnation"); } } } - if (i === 'ascend') { - const z = !player.toggles[31] - || await Confirm(i18next.t('main.ascendPrompt')) + if (i === "ascend") { + const z = + !player.toggles[31] || (await Confirm(i18next.t("main.ascendPrompt"))); if (z) { - reset('ascension') + reset("ascension"); } } -} +}; export const updateEffectiveLevelMult = (): void => { - G.effectiveLevelMult = 1 - G.effectiveLevelMult *= 1 - + player.researches[4] / 10 * (1 + 1 / 2 * CalcECC('ascension', player.challengecompletions[14])) // Research 1x4 - G.effectiveLevelMult *= 1 + player.researches[21] / 100 // Research 2x6 - G.effectiveLevelMult *= 1 + player.researches[90] / 100 // Research 4x15 - G.effectiveLevelMult *= 1 + player.researches[131] / 200 // Research 6x6 - G.effectiveLevelMult *= 1 + player.researches[161] / 200 * 3 / 5 // Research 7x11 - G.effectiveLevelMult *= 1 + player.researches[176] / 200 * 2 / 5 // Research 8x1 - G.effectiveLevelMult *= 1 + player.researches[191] / 200 * 1 / 5 // Research 8x16 - G.effectiveLevelMult *= 1 + player.researches[146] / 200 * 4 / 5 // Research 6x21 - G.effectiveLevelMult *= 1 - + 0.01 * Math.log(player.talismanShards + 1) / Math.log(4) * Math.min(1, player.constantUpgrades[9]) - G.effectiveLevelMult *= G.challenge15Rewards.runeBonus -} + G.effectiveLevelMult = 1; + G.effectiveLevelMult *= + 1 + + (player.researches[4] / 10) * + (1 + (1 / 2) * CalcECC("ascension", player.challengecompletions[14])); // Research 1x4 + G.effectiveLevelMult *= 1 + player.researches[21] / 100; // Research 2x6 + G.effectiveLevelMult *= 1 + player.researches[90] / 100; // Research 4x15 + G.effectiveLevelMult *= 1 + player.researches[131] / 200; // Research 6x6 + G.effectiveLevelMult *= 1 + ((player.researches[161] / 200) * 3) / 5; // Research 7x11 + G.effectiveLevelMult *= 1 + ((player.researches[176] / 200) * 2) / 5; // Research 8x1 + G.effectiveLevelMult *= 1 + ((player.researches[191] / 200) * 1) / 5; // Research 8x16 + G.effectiveLevelMult *= 1 + ((player.researches[146] / 200) * 4) / 5; // Research 6x21 + G.effectiveLevelMult *= + 1 + + ((0.01 * Math.log(player.talismanShards + 1)) / Math.log(4)) * + Math.min(1, player.constantUpgrades[9]); + G.effectiveLevelMult *= G.challenge15Rewards.runeBonus; +}; export const updateAll = (): void => { - G.uFourteenMulti = new Decimal(1) - G.uFifteenMulti = new Decimal(1) + G.uFourteenMulti = new Decimal(1); + G.uFifteenMulti = new Decimal(1); if (player.upgrades[14] > 0.5) { - G.uFourteenMulti = Decimal.pow(1.15, G.freeAccelerator) + G.uFourteenMulti = Decimal.pow(1.15, G.freeAccelerator); } if (player.upgrades[15] > 0.5) { - G.uFifteenMulti = Decimal.pow(1.15, G.freeAccelerator) + G.uFifteenMulti = Decimal.pow(1.15, G.freeAccelerator); } if (!player.unlocks.coinone && player.coins.gte(500)) { - player.unlocks.coinone = true - revealStuff() + player.unlocks.coinone = true; + revealStuff(); } if (!player.unlocks.cointwo && player.coins.gte(10000)) { - player.unlocks.cointwo = true - revealStuff() + player.unlocks.cointwo = true; + revealStuff(); } if (!player.unlocks.cointhree && player.coins.gte(100000)) { - player.unlocks.cointhree = true - revealStuff() + player.unlocks.cointhree = true; + revealStuff(); } if (!player.unlocks.coinfour && player.coins.gte(4e6)) { - player.unlocks.coinfour = true - revealStuff() + player.unlocks.coinfour = true; + revealStuff(); } if (player.achievements[169] === 0 && player.antPoints.gte(3)) { - achievementaward(169) + achievementaward(169); } if (player.achievements[170] === 0 && player.antPoints.gte(1e5)) { - achievementaward(170) + achievementaward(170); } if (player.achievements[171] === 0 && player.antPoints.gte(666666666)) { - achievementaward(171) + achievementaward(171); } if (player.achievements[172] === 0 && player.antPoints.gte(1e20)) { - achievementaward(172) + achievementaward(172); } if (player.achievements[173] === 0 && player.antPoints.gte(1e40)) { - achievementaward(173) + achievementaward(173); } - if (player.achievements[174] === 0 && player.antPoints.gte('1e500')) { - achievementaward(174) + if (player.achievements[174] === 0 && player.antPoints.gte("1e500")) { + achievementaward(174); } - if (player.achievements[175] === 0 && player.antPoints.gte('1e2500')) { - achievementaward(175) + if (player.achievements[175] === 0 && player.antPoints.gte("1e2500")) { + achievementaward(175); } if (player.researches[200] >= 1e5 && player.achievements[250] < 1) { - achievementaward(250) + achievementaward(250); } if (player.cubeUpgrades[50] >= 1e5 && player.achievements[251] < 1) { - achievementaward(251) + achievementaward(251); } // Autobuy "Upgrades" Tab - autoUpgrades() + autoUpgrades(); // Autobuy "Building" Tab - if (player.toggles[1] && player.upgrades[81] === 1 && player.coins.gte(player.firstCostCoin)) { - buyMax(1, 'Coin') + if ( + player.toggles[1] && + player.upgrades[81] === 1 && + player.coins.gte(player.firstCostCoin) + ) { + buyMax(1, "Coin"); } - if (player.toggles[2] && player.upgrades[82] === 1 && player.coins.gte(player.secondCostCoin)) { - buyMax(2, 'Coin') + if ( + player.toggles[2] && + player.upgrades[82] === 1 && + player.coins.gte(player.secondCostCoin) + ) { + buyMax(2, "Coin"); } - if (player.toggles[3] && player.upgrades[83] === 1 && player.coins.gte(player.thirdCostCoin)) { - buyMax(3, 'Coin') + if ( + player.toggles[3] && + player.upgrades[83] === 1 && + player.coins.gte(player.thirdCostCoin) + ) { + buyMax(3, "Coin"); } - if (player.toggles[4] && player.upgrades[84] === 1 && player.coins.gte(player.fourthCostCoin)) { - buyMax(4, 'Coin') + if ( + player.toggles[4] && + player.upgrades[84] === 1 && + player.coins.gte(player.fourthCostCoin) + ) { + buyMax(4, "Coin"); } - if (player.toggles[5] && player.upgrades[85] === 1 && player.coins.gte(player.fifthCostCoin)) { - buyMax(5, 'Coin') + if ( + player.toggles[5] && + player.upgrades[85] === 1 && + player.coins.gte(player.fifthCostCoin) + ) { + buyMax(5, "Coin"); } - if (player.toggles[6] && player.upgrades[86] === 1 && player.coins.gte(player.acceleratorCost)) { - buyAccelerator(true) + if ( + player.toggles[6] && + player.upgrades[86] === 1 && + player.coins.gte(player.acceleratorCost) + ) { + buyAccelerator(true); } - if (player.toggles[7] && player.upgrades[87] === 1 && player.coins.gte(player.multiplierCost)) { - buyMultiplier(true) + if ( + player.toggles[7] && + player.upgrades[87] === 1 && + player.coins.gte(player.multiplierCost) + ) { + buyMultiplier(true); } - if (player.toggles[8] && player.upgrades[88] === 1 && player.prestigePoints.gte(player.acceleratorBoostCost)) { - boostAccelerator(true) + if ( + player.toggles[8] && + player.upgrades[88] === 1 && + player.prestigePoints.gte(player.acceleratorBoostCost) + ) { + boostAccelerator(true); } // Autobuy "Prestige" Tab - if (player.toggles[10] && player.achievements[78] === 1 && player.prestigePoints.gte(player.firstCostDiamonds)) { - buyMax(1, 'Diamonds') + if ( + player.toggles[10] && + player.achievements[78] === 1 && + player.prestigePoints.gte(player.firstCostDiamonds) + ) { + buyMax(1, "Diamonds"); } - if (player.toggles[11] && player.achievements[85] === 1 && player.prestigePoints.gte(player.secondCostDiamonds)) { - buyMax(2, 'Diamonds') + if ( + player.toggles[11] && + player.achievements[85] === 1 && + player.prestigePoints.gte(player.secondCostDiamonds) + ) { + buyMax(2, "Diamonds"); } - if (player.toggles[12] && player.achievements[92] === 1 && player.prestigePoints.gte(player.thirdCostDiamonds)) { - buyMax(3, 'Diamonds') + if ( + player.toggles[12] && + player.achievements[92] === 1 && + player.prestigePoints.gte(player.thirdCostDiamonds) + ) { + buyMax(3, "Diamonds"); } - if (player.toggles[13] && player.achievements[99] === 1 && player.prestigePoints.gte(player.fourthCostDiamonds)) { - buyMax(4, 'Diamonds') + if ( + player.toggles[13] && + player.achievements[99] === 1 && + player.prestigePoints.gte(player.fourthCostDiamonds) + ) { + buyMax(4, "Diamonds"); } - if (player.toggles[14] && player.achievements[106] === 1 && player.prestigePoints.gte(player.fifthCostDiamonds)) { - buyMax(5, 'Diamonds') + if ( + player.toggles[14] && + player.achievements[106] === 1 && + player.prestigePoints.gte(player.fifthCostDiamonds) + ) { + buyMax(5, "Diamonds"); } - updateEffectiveLevelMult() // update before prism rune, fixes c15 bug + updateEffectiveLevelMult(); // update before prism rune, fixes c15 bug - let c = 0 - c += Math.floor(G.rune3level / 16 * G.effectiveLevelMult) * 100 / 100 - if (player.upgrades[73] > 0.5 && player.currentChallenge.reincarnation !== 0) { - c += 10 + let c = 0; + c += (Math.floor((G.rune3level / 16) * G.effectiveLevelMult) * 100) / 100; + if ( + player.upgrades[73] > 0.5 && + player.currentChallenge.reincarnation !== 0 + ) { + c += 10; } if ( - player.achievements[79] > 0.5 - && player.prestigeShards.gte( + player.achievements[79] > 0.5 && + player.prestigeShards.gte( Decimal.pow( 10, - G.crystalUpgradesCost[0] - + G.crystalUpgradeCostIncrement[0] * Math.floor(Math.pow(player.crystalUpgrades[0] - 0.5 - c, 2) / 2) + G.crystalUpgradesCost[0] + + G.crystalUpgradeCostIncrement[0] * + Math.floor(Math.pow(player.crystalUpgrades[0] - 0.5 - c, 2) / 2) ) ) ) { - buyCrystalUpgrades(1, true) + buyCrystalUpgrades(1, true); } if ( - player.achievements[86] > 0.5 - && player.prestigeShards.gte( + player.achievements[86] > 0.5 && + player.prestigeShards.gte( Decimal.pow( 10, - G.crystalUpgradesCost[1] - + G.crystalUpgradeCostIncrement[1] * Math.floor(Math.pow(player.crystalUpgrades[1] - 0.5 - c, 2) / 2) + G.crystalUpgradesCost[1] + + G.crystalUpgradeCostIncrement[1] * + Math.floor(Math.pow(player.crystalUpgrades[1] - 0.5 - c, 2) / 2) ) ) ) { - buyCrystalUpgrades(2, true) + buyCrystalUpgrades(2, true); } if ( - player.achievements[93] > 0.5 - && player.prestigeShards.gte( + player.achievements[93] > 0.5 && + player.prestigeShards.gte( Decimal.pow( 10, - G.crystalUpgradesCost[2] - + G.crystalUpgradeCostIncrement[2] * Math.floor(Math.pow(player.crystalUpgrades[2] - 0.5 - c, 2) / 2) + G.crystalUpgradesCost[2] + + G.crystalUpgradeCostIncrement[2] * + Math.floor(Math.pow(player.crystalUpgrades[2] - 0.5 - c, 2) / 2) ) ) ) { - buyCrystalUpgrades(3, true) + buyCrystalUpgrades(3, true); } if ( - player.achievements[100] > 0.5 - && player.prestigeShards.gte( + player.achievements[100] > 0.5 && + player.prestigeShards.gte( Decimal.pow( 10, - G.crystalUpgradesCost[3] - + G.crystalUpgradeCostIncrement[3] * Math.floor(Math.pow(player.crystalUpgrades[3] - 0.5 - c, 2) / 2) + G.crystalUpgradesCost[3] + + G.crystalUpgradeCostIncrement[3] * + Math.floor(Math.pow(player.crystalUpgrades[3] - 0.5 - c, 2) / 2) ) ) ) { - buyCrystalUpgrades(4, true) + buyCrystalUpgrades(4, true); } if ( - player.achievements[107] > 0.5 - && player.prestigeShards.gte( + player.achievements[107] > 0.5 && + player.prestigeShards.gte( Decimal.pow( 10, - G.crystalUpgradesCost[4] - + G.crystalUpgradeCostIncrement[4] * Math.floor(Math.pow(player.crystalUpgrades[4] - 0.5 - c, 2) / 2) + G.crystalUpgradesCost[4] + + G.crystalUpgradeCostIncrement[4] * + Math.floor(Math.pow(player.crystalUpgrades[4] - 0.5 - c, 2) / 2) ) ) ) { - buyCrystalUpgrades(5, true) + buyCrystalUpgrades(5, true); } // Autobuy "Transcension" Tab - if (player.toggles[16] && player.upgrades[94] === 1 && player.transcendPoints.gte(player.firstCostMythos)) { - buyMax(1, 'Mythos') + if ( + player.toggles[16] && + player.upgrades[94] === 1 && + player.transcendPoints.gte(player.firstCostMythos) + ) { + buyMax(1, "Mythos"); } - if (player.toggles[17] && player.upgrades[95] === 1 && player.transcendPoints.gte(player.secondCostMythos)) { - buyMax(2, 'Mythos') + if ( + player.toggles[17] && + player.upgrades[95] === 1 && + player.transcendPoints.gte(player.secondCostMythos) + ) { + buyMax(2, "Mythos"); } - if (player.toggles[18] && player.upgrades[96] === 1 && player.transcendPoints.gte(player.thirdCostMythos)) { - buyMax(3, 'Mythos') + if ( + player.toggles[18] && + player.upgrades[96] === 1 && + player.transcendPoints.gte(player.thirdCostMythos) + ) { + buyMax(3, "Mythos"); } - if (player.toggles[19] && player.upgrades[97] === 1 && player.transcendPoints.gte(player.fourthCostMythos)) { - buyMax(4, 'Mythos') + if ( + player.toggles[19] && + player.upgrades[97] === 1 && + player.transcendPoints.gte(player.fourthCostMythos) + ) { + buyMax(4, "Mythos"); } - if (player.toggles[20] && player.upgrades[98] === 1 && player.transcendPoints.gte(player.fifthCostMythos)) { - buyMax(5, 'Mythos') + if ( + player.toggles[20] && + player.upgrades[98] === 1 && + player.transcendPoints.gte(player.fifthCostMythos) + ) { + buyMax(5, "Mythos"); } // Autobuy "Reincarnation" Tab - if (player.toggles[22] && player.cubeUpgrades[7] === 1 && player.reincarnationPoints.gte(player.firstCostParticles)) { - buyParticleBuilding(1, true) + if ( + player.toggles[22] && + player.cubeUpgrades[7] === 1 && + player.reincarnationPoints.gte(player.firstCostParticles) + ) { + buyParticleBuilding(1, true); } if ( - player.toggles[23] && player.cubeUpgrades[7] === 1 && player.reincarnationPoints.gte(player.secondCostParticles) + player.toggles[23] && + player.cubeUpgrades[7] === 1 && + player.reincarnationPoints.gte(player.secondCostParticles) ) { - buyParticleBuilding(2, true) + buyParticleBuilding(2, true); } - if (player.toggles[24] && player.cubeUpgrades[7] === 1 && player.reincarnationPoints.gte(player.thirdCostParticles)) { - buyParticleBuilding(3, true) + if ( + player.toggles[24] && + player.cubeUpgrades[7] === 1 && + player.reincarnationPoints.gte(player.thirdCostParticles) + ) { + buyParticleBuilding(3, true); } if ( - player.toggles[25] && player.cubeUpgrades[7] === 1 && player.reincarnationPoints.gte(player.fourthCostParticles) + player.toggles[25] && + player.cubeUpgrades[7] === 1 && + player.reincarnationPoints.gte(player.fourthCostParticles) ) { - buyParticleBuilding(4, true) + buyParticleBuilding(4, true); } - if (player.toggles[26] && player.cubeUpgrades[7] === 1 && player.reincarnationPoints.gte(player.fifthCostParticles)) { - buyParticleBuilding(5, true) + if ( + player.toggles[26] && + player.cubeUpgrades[7] === 1 && + player.reincarnationPoints.gte(player.fifthCostParticles) + ) { + buyParticleBuilding(5, true); } // Autobuy "ascension" tab if (player.researches[175] > 0) { for (let i = 1; i <= 10; i++) { if (player.ascendShards.gte(getConstUpgradeMetadata(i).pop()!)) { - buyConstantUpgrades(i, true) + buyConstantUpgrades(i, true); } } } // Autobuy tesseract buildings (Mode: AMOUNT) - if (player.researches[190] > 0 && player.tesseractAutoBuyerToggle === 1 && player.resettoggle4 < 2) { - const ownedBuildings: TesseractBuildings = [null, null, null, null, null] + if ( + player.researches[190] > 0 && + player.tesseractAutoBuyerToggle === 1 && + player.resettoggle4 < 2 + ) { + const ownedBuildings: TesseractBuildings = [null, null, null, null, null]; for (let i = 1; i <= 5; i++) { if (player.autoTesseracts[i]) { - ownedBuildings[i - 1] = player[`ascendBuilding${i as OneToFive}` as const].owned + ownedBuildings[i - 1] = + player[`ascendBuilding${i as OneToFive}` as const].owned; } } - const budget = Number(player.wowTesseracts) - player.tesseractAutoBuyerAmount - const buyToBuildings = calculateTessBuildingsInBudget(ownedBuildings, budget) + const budget = + Number(player.wowTesseracts) - player.tesseractAutoBuyerAmount; + const buyToBuildings = calculateTessBuildingsInBudget( + ownedBuildings, + budget + ); // Prioritise buying buildings from highest tier to lowest, // in case there are any off-by-ones or floating point errors. for (let i = 5; i >= 1; i--) { - const buyFrom = ownedBuildings[i - 1] - const buyTo = buyToBuildings[i - 1] + const buyFrom = ownedBuildings[i - 1]; + const buyTo = buyToBuildings[i - 1]; if (buyFrom !== null && buyTo !== null && buyTo !== buyFrom) { - buyTesseractBuilding(i as OneToFive, buyTo - buyFrom) + buyTesseractBuilding(i as OneToFive, buyTo - buyFrom); } } } @@ -4176,9 +5676,9 @@ export const updateAll = (): void => { player.achievements[140] > 0, player.achievements[147] > 0, player.antUpgrades[11]! > 0 || player.ascensionCount > 0, - player.shopUpgrades.shopTalisman > 0 - ] - let upgradedTalisman = false + player.shopUpgrades.shopTalisman > 0, + ]; + let upgradedTalisman = false; // First, we need to enhance all of the talismans. Then, we can fortify all of the talismans. // If we were to do this in one loop, the players resources would be drained on individual expensive levels @@ -4187,760 +5687,854 @@ export const updateAll = (): void => { if (player.autoEnhanceToggle && player.researches[135] > 0) { for (let i = 0; i < talismansUnlocked.length; ++i) { if (talismansUnlocked[i] && player.talismanRarity[i] < 6) { - upgradedTalisman = buyTalismanEnhance(i, true) || upgradedTalisman + upgradedTalisman = buyTalismanEnhance(i, true) || upgradedTalisman; } } } if (player.autoFortifyToggle && player.researches[130] > 0) { for (let i = 0; i < talismansUnlocked.length; ++i) { - const maxTalismanLevel = calculateMaxTalismanLevel(i) - if (talismansUnlocked[i] && player.talismanLevels[i] < maxTalismanLevel) { - upgradedTalisman = buyTalismanLevels(i, true) || upgradedTalisman + const maxTalismanLevel = calculateMaxTalismanLevel(i); + if ( + talismansUnlocked[i] && + player.talismanLevels[i] < maxTalismanLevel + ) { + upgradedTalisman = buyTalismanLevels(i, true) || upgradedTalisman; } } } // Recalculate talisman-related upgrades and display on success if (upgradedTalisman) { - updateTalismanInventory() - calculateRuneLevels() + updateTalismanInventory(); + calculateRuneLevels(); } } // Generation if (player.upgrades[101] > 0.5) { player.fourthGeneratedCoin = player.fourthGeneratedCoin.add( - (player.fifthGeneratedCoin.add(player.fifthOwnedCoin)).times(G.uFifteenMulti).times(G.generatorPower) - ) + player.fifthGeneratedCoin + .add(player.fifthOwnedCoin) + .times(G.uFifteenMulti) + .times(G.generatorPower) + ); } if (player.upgrades[102] > 0.5) { player.thirdGeneratedCoin = player.thirdGeneratedCoin.add( - (player.fourthGeneratedCoin.add(player.fourthOwnedCoin)).times(G.uFourteenMulti).times(G.generatorPower) - ) + player.fourthGeneratedCoin + .add(player.fourthOwnedCoin) + .times(G.uFourteenMulti) + .times(G.generatorPower) + ); } if (player.upgrades[103] > 0.5) { player.secondGeneratedCoin = player.secondGeneratedCoin.add( - (player.thirdGeneratedCoin.add(player.thirdOwnedCoin)).times(G.generatorPower) - ) + player.thirdGeneratedCoin + .add(player.thirdOwnedCoin) + .times(G.generatorPower) + ); } if (player.upgrades[104] > 0.5) { player.firstGeneratedCoin = player.firstGeneratedCoin.add( - (player.secondGeneratedCoin.add(player.secondOwnedCoin)).times(G.generatorPower) - ) + player.secondGeneratedCoin + .add(player.secondOwnedCoin) + .times(G.generatorPower) + ); } if (player.upgrades[105] > 0.5) { - player.fifthGeneratedCoin = player.fifthGeneratedCoin.add(player.firstOwnedCoin) - } - let p = 1 - p += 1 / 100 - * (player.achievements[71] + player.achievements[72] + player.achievements[73] + player.achievements[74] - + player.achievements[75] + player.achievements[76] + player.achievements[77]) - - let a = 0 + player.fifthGeneratedCoin = player.fifthGeneratedCoin.add( + player.firstOwnedCoin + ); + } + let p = 1; + p += + (1 / 100) * + (player.achievements[71] + + player.achievements[72] + + player.achievements[73] + + player.achievements[74] + + player.achievements[75] + + player.achievements[76] + + player.achievements[77]); + + let a = 0; if (player.upgrades[106] > 0.5) { - a += 0.10 + a += 0.1; } if (player.upgrades[107] > 0.5) { - a += 0.15 + a += 0.15; } if (player.upgrades[108] > 0.5) { - a += 0.25 + a += 0.25; } if (player.upgrades[109] > 0.5) { - a += 0.25 + a += 0.25; } if (player.upgrades[110] > 0.5) { - a += 0.25 + a += 0.25; } - a *= p + a *= p; - let b = 0 + let b = 0; if (player.upgrades[111] > 0.5) { - b += 0.08 + b += 0.08; } if (player.upgrades[112] > 0.5) { - b += 0.08 + b += 0.08; } if (player.upgrades[113] > 0.5) { - b += 0.08 + b += 0.08; } if (player.upgrades[114] > 0.5) { - b += 0.08 + b += 0.08; } if (player.upgrades[115] > 0.5) { - b += 0.08 + b += 0.08; } - b *= p + b *= p; - c = 0 + c = 0; if (player.upgrades[116] > 0.5) { - c += 0.05 + c += 0.05; } if (player.upgrades[117] > 0.5) { - c += 0.05 + c += 0.05; } if (player.upgrades[118] > 0.5) { - c += 0.05 + c += 0.05; } if (player.upgrades[119] > 0.5) { - c += 0.05 + c += 0.05; } if (player.upgrades[120] > 0.5) { - c += 0.05 + c += 0.05; } - c *= p + c *= p; if (a !== 0) { player.fifthGeneratedCoin = player.fifthGeneratedCoin.add( - Decimal.pow(player.firstGeneratedDiamonds.add(player.firstOwnedDiamonds).add(1), a) - ) + Decimal.pow( + player.firstGeneratedDiamonds.add(player.firstOwnedDiamonds).add(1), + a + ) + ); } if (b !== 0) { player.fifthGeneratedDiamonds = player.fifthGeneratedDiamonds.add( - Decimal.pow(player.firstGeneratedMythos.add(player.firstOwnedMythos).add(1), b) - ) + Decimal.pow( + player.firstGeneratedMythos.add(player.firstOwnedMythos).add(1), + b + ) + ); } if (c !== 0) { player.fifthGeneratedMythos = player.fifthGeneratedMythos.add( - Decimal.pow(player.firstGeneratedParticles.add(player.firstOwnedParticles).add(1), c) - ) + Decimal.pow( + player.firstGeneratedParticles.add(player.firstOwnedParticles).add(1), + c + ) + ); } if (player.runeshards > player.maxofferings) { - player.maxofferings = player.runeshards + player.maxofferings = player.runeshards; } if (player.researchPoints > player.maxobtainium) { - player.maxobtainium = player.researchPoints + player.maxobtainium = player.researchPoints; } if (isNaN(player.runeshards)) { - player.runeshards = 0 + player.runeshards = 0; } if (player.runeshards > 1e300) { - player.runeshards = 1e300 + player.runeshards = 1e300; } if (isNaN(player.researchPoints)) { - player.researchPoints = 0 + player.researchPoints = 0; } if (player.researchPoints > 1e300) { - player.researchPoints = 1e300 + player.researchPoints = 1e300; } - G.optimalOfferingTimer = 600 + 30 * player.researches[85] + 0.4 * G.rune5level + 120 * player.shopUpgrades.offeringEX - G.optimalObtainiumTimer = 3600 + 120 * player.shopUpgrades.obtainiumEX - autoBuyAnts() + G.optimalOfferingTimer = + 600 + + 30 * player.researches[85] + + 0.4 * G.rune5level + + 120 * player.shopUpgrades.offeringEX; + G.optimalObtainiumTimer = 3600 + 120 * player.shopUpgrades.obtainiumEX; + autoBuyAnts(); if ( - player.autoAscend && player.challengecompletions[11] > 0 && player.cubeUpgrades[10] > 0 - && player.currentChallenge.reincarnation !== 10 + player.autoAscend && + player.challengecompletions[11] > 0 && + player.cubeUpgrades[10] > 0 && + player.currentChallenge.reincarnation !== 10 ) { - let ascension = false + let ascension = false; if ( - player.autoAscendMode === 'c10Completions' - && player.challengecompletions[10] >= Math.max(1, player.autoAscendThreshold) + player.autoAscendMode === "c10Completions" && + player.challengecompletions[10] >= Math.max(1, player.autoAscendThreshold) ) { - ascension = true + ascension = true; } if ( - player.autoAscendMode === 'realAscensionTime' - && player.ascensionCounterRealReal >= Math.max(0.1, player.autoAscendThreshold) + player.autoAscendMode === "realAscensionTime" && + player.ascensionCounterRealReal >= + Math.max(0.1, player.autoAscendThreshold) ) { - ascension = true + ascension = true; } if (ascension && player.challengecompletions[10] > 0) { // Auto Ascension and Auto Challenge Sweep enables rotation of the Ascension Challenge if ( - autoAscensionChallengeSweepUnlock() && player.currentChallenge.ascension !== 0 && player.retrychallenges - && player.researches[150] === 1 && player.autoChallengeRunning + autoAscensionChallengeSweepUnlock() && + player.currentChallenge.ascension !== 0 && + player.retrychallenges && + player.researches[150] === 1 && + player.autoChallengeRunning ) { - let nextChallenge = getNextChallenge(player.currentChallenge.ascension + 1, false, 11, 15) - if (nextChallenge <= 15 && player.currentChallenge.ascension !== nextChallenge) { - void resetCheck('ascensionChallenge', false, true) - player.currentChallenge.ascension = nextChallenge - reset('ascensionChallenge', false) + let nextChallenge = getNextChallenge( + player.currentChallenge.ascension + 1, + false, + 11, + 15 + ); + if ( + nextChallenge <= 15 && + player.currentChallenge.ascension !== nextChallenge + ) { + void resetCheck("ascensionChallenge", false, true); + player.currentChallenge.ascension = nextChallenge; + reset("ascensionChallenge", false); } else { - nextChallenge = getNextChallenge(player.currentChallenge.ascension + 1, true, 11, 15) - void resetCheck('ascensionChallenge', false, true) - player.currentChallenge.ascension = nextChallenge <= 15 ? nextChallenge : 0 - reset('ascensionChallenge', false) + nextChallenge = getNextChallenge( + player.currentChallenge.ascension + 1, + true, + 11, + 15 + ); + void resetCheck("ascensionChallenge", false, true); + player.currentChallenge.ascension = + nextChallenge <= 15 ? nextChallenge : 0; + reset("ascensionChallenge", false); } } else { if (player.currentChallenge.ascension !== 0) { - void resetCheck('ascensionChallenge', false, true) - reset('ascensionChallenge', false) + void resetCheck("ascensionChallenge", false, true); + reset("ascensionChallenge", false); } else { - reset('ascension', false) + reset("ascension", false); } } } } - let metaData = null + let metaData = null; if (player.researches[175] > 0) { for (let i = 1; i <= 10; i++) { - metaData = getConstUpgradeMetadata(i) + metaData = getConstUpgradeMetadata(i); if (player.ascendShards.gte(metaData[1])) { - buyConstantUpgrades(i, true) + buyConstantUpgrades(i, true); } } } - const reductionValue = getReductionValue() + const reductionValue = getReductionValue(); if (reductionValue !== G.prevReductionValue) { - G.prevReductionValue = reductionValue - const resources = ['Coin', 'Diamonds', 'Mythos'] as const + G.prevReductionValue = reductionValue; + const resources = ["Coin", "Diamonds", "Mythos"] as const; for (let res = 0; res < resources.length; ++res) { - const resource = resources[res] + const resource = resources[res]; for (let ord = 0; ord < 5; ++ord) { - const num = G.ordinals[ord as ZeroToFour] + const num = G.ordinals[ord as ZeroToFour]; player[`${num}Cost${resource}` as const] = getCost( - ord + 1 as OneToFive, + (ord + 1) as OneToFive, resource, player[`${num}Owned${resource}` as const] + 1, reductionValue - ) + ); } } for (let i = 0; i <= 4; i++) { - const particleOriginalCost = [1, 1e2, 1e4, 1e8, 1e16] - const num = G.ordinals[i as ZeroToFour] - const buyTo = player[`${num}OwnedParticles` as const] + 1 + const particleOriginalCost = [1, 1e2, 1e4, 1e8, 1e16]; + const num = G.ordinals[i as ZeroToFour]; + const buyTo = player[`${num}OwnedParticles` as const] + 1; player[`${num}CostParticles` as const] = new Decimal( Decimal.pow(2, buyTo - 1).times( - Decimal.pow(1.001, Math.max(0, buyTo - 325000) * Math.max(0, (buyTo - 325000) + 1) / 2) + Decimal.pow( + 1.001, + (Math.max(0, buyTo - 325000) * Math.max(0, buyTo - 325000 + 1)) / 2 + ) ) - ).times(particleOriginalCost[i]) + ).times(particleOriginalCost[i]); } } // Challenge 15 autoupdate if ( - player.shopUpgrades.challenge15Auto > 0 && player.currentChallenge.ascension === 15 - && player.usedCorruptions.slice(2, 10).every((a) => a === 11) + player.shopUpgrades.challenge15Auto > 0 && + player.currentChallenge.ascension === 15 && + player.usedCorruptions.slice(2, 10).every((a) => a === 11) ) { - const c15SM = challenge15ScoreMultiplier() + const c15SM = challenge15ScoreMultiplier(); if (player.coins.gte(Decimal.pow(10, player.challenge15Exponent / c15SM))) { - player.challenge15Exponent = Decimal.log(player.coins.add(1), 10) * c15SM - c15RewardUpdate() + player.challenge15Exponent = Decimal.log(player.coins.add(1), 10) * c15SM; + c15RewardUpdate(); } } -} +}; export const fastUpdates = (): void => { - updateAll() - htmlInserts() -} + updateAll(); + htmlInserts(); +}; export const slowUpdates = (): void => { - buttoncolorchange() - buildingAchievementCheck() -} + buttoncolorchange(); + buildingAchievementCheck(); +}; export const constantIntervals = (): void => { - setInterval(saveSynergy, 5000) - setInterval(slowUpdates, 200) - setInterval(fastUpdates, 50) + setInterval(saveSynergy, 5000); + setInterval(slowUpdates, 200); + setInterval(fastUpdates, 50); if (!G.timeWarp) { - exitOffline() + exitOffline(); } -} +}; -let lastUpdate = 0 +let lastUpdate = 0; export const createTimer = (): void => { - lastUpdate = performance.now() - setInterval(tick, 5) -} + lastUpdate = performance.now(); + setInterval(tick, 5); +}; -const dt = 5 -const filterStrength = 20 -let deltaMean = 0 +const dt = 5; +const filterStrength = 20; +let deltaMean = 0; -const loadingDate = new Date() -const loadingBasePerfTick = performance.now() +const loadingDate = new Date(); +const loadingBasePerfTick = performance.now(); // performance.now() doesn't always reset on reload, so we capture a "base value" // to keep things stable // The returned time is pinned to when the page itself was loaded to remain // resilient against changed system clocks export const getTimePinnedToLoadDate = () => { - return loadingDate.getTime() + (performance.now() - loadingBasePerfTick) -} + return loadingDate.getTime() + (performance.now() - loadingBasePerfTick); +}; const tick = () => { - const now = performance.now() - let delta = now - lastUpdate + const now = performance.now(); + let delta = now - lastUpdate; // compute pseudo-average delta cf. https://stackoverflow.com/a/5111475/343834 - deltaMean += (delta - deltaMean) / filterStrength - let dtEffective: number + deltaMean += (delta - deltaMean) / filterStrength; + let dtEffective: number; while (delta > 5) { // tack will compute dtEffective milliseconds of game time - dtEffective = dt + dtEffective = dt; // If the mean lag (deltaMean) is more than a whole frame (16ms), compensate by computing deltaMean - dt ms, up to 1 hour - dtEffective += deltaMean > 16 ? Math.min(3600 * 1000, deltaMean - dt) : 0 + dtEffective += deltaMean > 16 ? Math.min(3600 * 1000, deltaMean - dt) : 0; // compute at max delta ms to avoid negative delta - dtEffective = Math.min(delta, dtEffective) + dtEffective = Math.min(delta, dtEffective); // run tack and record timings - tack(dtEffective / 1000) - lastUpdate += dtEffective - delta -= dtEffective + tack(dtEffective / 1000); + lastUpdate += dtEffective; + delta -= dtEffective; } -} +}; const tack = (dt: number) => { if (!G.timeWarp) { // Adds Resources (coins, ants, etc) - const timeMult = calculateTimeAcceleration().mult - resourceGain(dt * timeMult) + const timeMult = calculateTimeAcceleration().mult; + resourceGain(dt * timeMult); // Adds time (in milliseconds) to all reset functions, and quarks timer. - addTimers('prestige', dt) - addTimers('transcension', dt) - addTimers('reincarnation', dt) - addTimers('ascension', dt) - addTimers('quarks', dt) - addTimers('goldenQuarks', dt) - addTimers('octeracts', dt) - addTimers('singularity', dt) - addTimers('autoPotion', dt) - addTimers('ambrosia', dt) + addTimers("prestige", dt); + addTimers("transcension", dt); + addTimers("reincarnation", dt); + addTimers("ascension", dt); + addTimers("quarks", dt); + addTimers("goldenQuarks", dt); + addTimers("octeracts", dt); + addTimers("singularity", dt); + addTimers("autoPotion", dt); + addTimers("ambrosia", dt); // Triggers automatic rune sacrifice (adds milliseconds to payload timer) if (player.shopUpgrades.offeringAuto > 0 && player.autoSacrificeToggle) { - automaticTools('runeSacrifice', dt) + automaticTools("runeSacrifice", dt); } // Triggers automatic ant sacrifice (adds milliseonds to payload timers) if (player.achievements[173] === 1) { - automaticTools('antSacrifice', dt) + automaticTools("antSacrifice", dt); } /*Triggers automatic obtainium gain if research [2x11] is unlocked, Otherwise it just calculates obtainium multiplier values. */ if (player.researches[61] === 1) { - automaticTools('addObtainium', dt) + automaticTools("addObtainium", dt); } else { - calculateObtainium() + calculateObtainium(); } // Automatically tries and buys researches lol if ( - player.autoResearchToggle && player.autoResearch > 0 && player.autoResearch <= maxRoombaResearchIndex(player) - && (autoResearchEnabled() || player.autoResearchMode === 'manual') + player.autoResearchToggle && + player.autoResearch > 0 && + player.autoResearch <= maxRoombaResearchIndex(player) && + (autoResearchEnabled() || player.autoResearchMode === "manual") ) { // buyResearch() probably shouldn't even be called if player.autoResearch exceeds the highest unlocked research - let counter = 0 - const maxCount = 1 + player.challengecompletions[14] + let counter = 0; + const maxCount = 1 + player.challengecompletions[14]; while (counter < maxCount) { if (player.autoResearch > 0) { - const linGrowth = (player.autoResearch === 200) ? 0.01 : 0 + const linGrowth = player.autoResearch === 200 ? 0.01 : 0; if (!buyResearch(player.autoResearch, true, linGrowth)) { - break + break; } } else { - break + break; } - counter++ + counter++; } } } // Adds an offering every 2 seconds if (player.highestchallengecompletions[3] > 0) { - automaticTools('addOfferings', dt / 2) + automaticTools("addOfferings", dt / 2); } // Adds an offering every 1/(cube upgrade 1x2) seconds. It shares a timer with the one above. if (player.cubeUpgrades[2] > 0) { - automaticTools('addOfferings', dt * player.cubeUpgrades[2]) + automaticTools("addOfferings", dt * player.cubeUpgrades[2]); } - runChallengeSweep(dt) + runChallengeSweep(dt); // Check for automatic resets // Auto Prestige. === 1 indicates amount, === 2 indicates time. if (player.resettoggle1 === 1 || player.resettoggle1 === 0) { if ( - player.toggles[15] && player.achievements[43] === 1 - && G.prestigePointGain.gte(player.prestigePoints.times(Decimal.pow(10, player.prestigeamount))) - && player.coinsThisPrestige.gte(1e16) + player.toggles[15] && + player.achievements[43] === 1 && + G.prestigePointGain.gte( + player.prestigePoints.times(Decimal.pow(10, player.prestigeamount)) + ) && + player.coinsThisPrestige.gte(1e16) ) { - resetachievementcheck(1) - reset('prestige', true) + resetachievementcheck(1); + reset("prestige", true); } } if (player.resettoggle1 === 2) { - G.autoResetTimers.prestige += dt - const time = Math.max(0.01, player.prestigeamount) + G.autoResetTimers.prestige += dt; + const time = Math.max(0.01, player.prestigeamount); if ( - player.toggles[15] && player.achievements[43] === 1 && G.autoResetTimers.prestige >= time - && player.coinsThisPrestige.gte(1e16) + player.toggles[15] && + player.achievements[43] === 1 && + G.autoResetTimers.prestige >= time && + player.coinsThisPrestige.gte(1e16) ) { - resetachievementcheck(1) - reset('prestige', true) + resetachievementcheck(1); + reset("prestige", true); } } if (player.resettoggle2 === 1 || player.resettoggle2 === 0) { if ( - player.toggles[21] && player.upgrades[89] === 1 - && G.transcendPointGain.gte(player.transcendPoints.times(Decimal.pow(10, player.transcendamount))) - && player.coinsThisTranscension.gte(1e100) && player.currentChallenge.transcension === 0 + player.toggles[21] && + player.upgrades[89] === 1 && + G.transcendPointGain.gte( + player.transcendPoints.times(Decimal.pow(10, player.transcendamount)) + ) && + player.coinsThisTranscension.gte(1e100) && + player.currentChallenge.transcension === 0 ) { - resetachievementcheck(2) - reset('transcension', true) + resetachievementcheck(2); + reset("transcension", true); } } if (player.resettoggle2 === 2) { - G.autoResetTimers.transcension += dt - const time = Math.max(0.01, player.transcendamount) + G.autoResetTimers.transcension += dt; + const time = Math.max(0.01, player.transcendamount); if ( - player.toggles[21] && player.upgrades[89] === 1 && G.autoResetTimers.transcension >= time - && player.coinsThisTranscension.gte(1e100) && player.currentChallenge.transcension === 0 + player.toggles[21] && + player.upgrades[89] === 1 && + G.autoResetTimers.transcension >= time && + player.coinsThisTranscension.gte(1e100) && + player.currentChallenge.transcension === 0 ) { - resetachievementcheck(2) - reset('transcension', true) + resetachievementcheck(2); + reset("transcension", true); } } if (player.currentChallenge.ascension !== 12) { - G.autoResetTimers.reincarnation += dt + G.autoResetTimers.reincarnation += dt; if (player.resettoggle3 === 2) { - const time = Math.max(0.01, player.reincarnationamount) + const time = Math.max(0.01, player.reincarnationamount); if ( - player.toggles[27] && player.researches[46] > 0.5 && player.transcendShards.gte('1e300') - && G.autoResetTimers.reincarnation >= time && player.currentChallenge.transcension === 0 - && player.currentChallenge.reincarnation === 0 + player.toggles[27] && + player.researches[46] > 0.5 && + player.transcendShards.gte("1e300") && + G.autoResetTimers.reincarnation >= time && + player.currentChallenge.transcension === 0 && + player.currentChallenge.reincarnation === 0 ) { - resetachievementcheck(3) - reset('reincarnation', true) + resetachievementcheck(3); + reset("reincarnation", true); } } if (player.resettoggle3 === 1 || player.resettoggle3 === 0) { if ( - player.toggles[27] && player.researches[46] > 0.5 - && G.reincarnationPointGain.gte( - player.reincarnationPoints.add(1).times(Decimal.pow(10, player.reincarnationamount)) - ) && player.transcendShards.gte(1e300) && player.currentChallenge.transcension === 0 - && player.currentChallenge.reincarnation === 0 + player.toggles[27] && + player.researches[46] > 0.5 && + G.reincarnationPointGain.gte( + player.reincarnationPoints + .add(1) + .times(Decimal.pow(10, player.reincarnationamount)) + ) && + player.transcendShards.gte(1e300) && + player.currentChallenge.transcension === 0 && + player.currentChallenge.reincarnation === 0 ) { - resetachievementcheck(3) - reset('reincarnation', true) + resetachievementcheck(3); + reset("reincarnation", true); } } } - calculateOfferings('reincarnation') -} + calculateOfferings("reincarnation"); +}; export const synergismHotkeys = (event: KeyboardEvent, key: string): void => { if (!player.toggles[40]) { - return + return; } const types = { - coin: 'Coin', - diamond: 'Diamonds', - mythos: 'Mythos', - particle: 'Particles', - tesseract: 'Tesseracts' - } as const + coin: "Coin", + diamond: "Diamonds", + mythos: "Mythos", + particle: "Particles", + tesseract: "Tesseracts", + } as const; - const type = types[G.buildingSubTab] + const type = types[G.buildingSubTab]; if (event.shiftKey) { - let num = Number(key) - 1 - if (key === 'BACKQUOTE') { - num = -1 + let num = Number(key) - 1; + if (key === "BACKQUOTE") { + num = -1; } if (player.challengecompletions[11] > 0 && !isNaN(num)) { if (num >= 0 && num < player.corruptionLoadoutNames.length) { if (player.toggles[41]) { void Notification( - i18next.t('main.corruptionLoadoutApplied', { + i18next.t("main.corruptionLoadoutApplied", { x: num + 1, - y: player.corruptionLoadoutNames[num] + y: player.corruptionLoadoutNames[num], }), 5000 - ) + ); } - corruptionLoadoutSaveLoad(false, num + 1) + corruptionLoadoutSaveLoad(false, num + 1); } else { if (player.toggles[41]) { - void Notification(i18next.t('main.allCorruptionsZero'), 5000) + void Notification(i18next.t("main.allCorruptionsZero"), 5000); } - corruptionLoadoutSaveLoad(false, 0) + corruptionLoadoutSaveLoad(false, 0); } - event.preventDefault() + event.preventDefault(); } - return + return; } switch (key) { - case '1': - case '2': - case '3': - case '4': - case '5': { - const num = Number(key) as OneToFive + case "1": + case "2": + case "3": + case "4": + case "5": { + const num = Number(key) as OneToFive; if (G.currentTab === Tabs.Buildings) { - if (type === 'Particles') { - buyParticleBuilding(num) - } else if (type === 'Tesseracts') { - buyTesseractBuilding(num) + if (type === "Particles") { + buyParticleBuilding(num); + } else if (type === "Tesseracts") { + buyTesseractBuilding(num); } else { - buyMax(num, type) + buyMax(num, type); } } if (G.currentTab === Tabs.Upgrades) { - categoryUpgrades(num, false) + categoryUpgrades(num, false); } if (G.currentTab === Tabs.Runes) { - if (G.runescreen === 'runes') { - redeemShards(num) + if (G.runescreen === "runes") { + redeemShards(num); } - if (G.runescreen === 'blessings') { - buyRuneBonusLevels('Blessings', num) + if (G.runescreen === "blessings") { + buyRuneBonusLevels("Blessings", num); } - if (G.runescreen === 'spirits') { - buyRuneBonusLevels('Spirits', num) + if (G.runescreen === "spirits") { + buyRuneBonusLevels("Spirits", num); } } if (G.currentTab === Tabs.Challenges) { - toggleChallenges(num) - challengeDisplay(num) + toggleChallenges(num); + challengeDisplay(num); } - break + break; } - case '6': + case "6": if (G.currentTab === Tabs.Upgrades) { - categoryUpgrades(6, false) + categoryUpgrades(6, false); } - if (G.currentTab === Tabs.Buildings && G.buildingSubTab === 'diamond') { - buyCrystalUpgrades(1) + if (G.currentTab === Tabs.Buildings && G.buildingSubTab === "diamond") { + buyCrystalUpgrades(1); } if (G.currentTab === Tabs.Challenges && player.reincarnationCount > 0) { - toggleChallenges(6) - challengeDisplay(6) + toggleChallenges(6); + challengeDisplay(6); } - break - case '7': - if (G.currentTab === Tabs.Buildings && G.buildingSubTab === 'diamond') { - buyCrystalUpgrades(2) + break; + case "7": + if (G.currentTab === Tabs.Buildings && G.buildingSubTab === "diamond") { + buyCrystalUpgrades(2); } if (G.currentTab === Tabs.Challenges && player.achievements[113] === 1) { - toggleChallenges(7) - challengeDisplay(7) + toggleChallenges(7); + challengeDisplay(7); } - break - case '8': - if (G.currentTab === Tabs.Buildings && G.buildingSubTab === 'diamond') { - buyCrystalUpgrades(3) + break; + case "8": + if (G.currentTab === Tabs.Buildings && G.buildingSubTab === "diamond") { + buyCrystalUpgrades(3); } if (G.currentTab === Tabs.Challenges && player.achievements[120] === 1) { - toggleChallenges(8) - challengeDisplay(8) + toggleChallenges(8); + challengeDisplay(8); } - break - case '9': - if (G.currentTab === Tabs.Buildings && G.buildingSubTab === 'diamond') { - buyCrystalUpgrades(4) + break; + case "9": + if (G.currentTab === Tabs.Buildings && G.buildingSubTab === "diamond") { + buyCrystalUpgrades(4); } if (G.currentTab === Tabs.Challenges && player.achievements[127] === 1) { - toggleChallenges(9) - challengeDisplay(9) + toggleChallenges(9); + challengeDisplay(9); } - break - case '0': - if (G.currentTab === Tabs.Buildings && G.buildingSubTab === 'diamond') { - buyCrystalUpgrades(5) + break; + case "0": + if (G.currentTab === Tabs.Buildings && G.buildingSubTab === "diamond") { + buyCrystalUpgrades(5); } if (G.currentTab === Tabs.Challenges && player.achievements[134] === 1) { - toggleChallenges(10) - challengeDisplay(10) + toggleChallenges(10); + challengeDisplay(10); } - break + break; } -} +}; export const showExitOffline = () => { - const el = DOMCacheGetOrSet('exitOffline') - el.style.visibility = 'visible' - setTimeout(() => el.focus(), 100) -} + const el = DOMCacheGetOrSet("exitOffline"); + el.style.visibility = "visible"; + setTimeout(() => el.focus(), 100); +}; /** * Reloads shit. * @param reset if this param is passed, offline progression will not be calculated. */ export const reloadShit = async (reset = false) => { - clearTimers() + clearTimers(); // Shows a reset button when page loading seems to stop or cause an error - const preloadDeleteGame = setTimeout(() => DOMCacheGetOrSet('preloadDeleteGame').style.display = 'block', 10000) + const preloadDeleteGame = setTimeout( + () => (DOMCacheGetOrSet("preloadDeleteGame").style.display = "block"), + 10000 + ); - disableHotkeys() + disableHotkeys(); // Wait a tick to continue. This is a (likely futile) attempt to see if this solves save corrupting. // This ensures all queued tasks are executed before continuing on. await new Promise((res) => { - setTimeout(res, 0) - }) + setTimeout(res, 0); + }); - const save = await localforage.getItem('Synergysave2') - ?? localStorage.getItem('Synergysave2') + const save = + (await localforage.getItem("Synergysave2")) ?? + localStorage.getItem("Synergysave2"); - const saveObject = typeof save === 'string' ? save : await save?.text() + const saveObject = typeof save === "string" ? save : await save?.text(); if (saveObject) { - const dec = LZString.decompressFromBase64(saveObject) - const isLZString = dec !== '' + const dec = LZString.decompressFromBase64(saveObject); + const isLZString = dec !== ""; if (isLZString) { if (!dec) { - return Alert(i18next.t('save.loadFailed')) + return Alert(i18next.t("save.loadFailed")); } - const saveString = btoa(dec) + const saveString = btoa(dec); if (saveString === null) { - return Alert(i18next.t('save.loadFailed')) + return Alert(i18next.t("save.loadFailed")); } - localStorage.clear() - const blob = new Blob([saveString], { type: 'text/plain' }) - localStorage.setItem('Synergysave2', saveString) - await localforage.setItem('Synergysave2', blob) - await Alert(i18next.t('main.transferredFromLZ')) + localStorage.clear(); + const blob = new Blob([saveString], { type: "text/plain" }); + localStorage.setItem("Synergysave2", saveString); + await localforage.setItem("Synergysave2", blob); + await Alert(i18next.t("main.transferredFromLZ")); } - await loadSynergy() + await loadSynergy(); } if (!reset) { - await calculateOffline() + await calculateOffline(); } else { - player.worlds.reset() + player.worlds.reset(); // saving is disabled during a singularity event to prevent bug // early return here if the save fails can keep game state from properly resetting after a singularity if (saveCheck.canSave) { - const saved = await saveSynergy() + const saved = await saveSynergy(); if (!saved) { - return + return; } } } - toggleTheme(true) - settingAnnotation() - toggleIconSet() - toggleauto() - htmlInserts() - createTimer() + toggleTheme(true); + settingAnnotation(); + toggleIconSet(); + toggleauto(); + htmlInserts(); + createTimer(); // Reset Displays if (!playerNeedsReminderToExport()) { - changeTab(Tabs.Buildings) + changeTab(Tabs.Buildings); } else { - changeTab(Tabs.Settings) + changeTab(Tabs.Settings); - void Alert(i18next.t('general.exportYourGame')) + void Alert(i18next.t("general.exportYourGame")); } - changeSubTab(Tabs.Buildings, { page: 0 }) - changeSubTab(Tabs.Runes, { page: 0 }) // Set 'runes' subtab back to 'runes' tab - changeSubTab(Tabs.WowCubes, { page: 0 }) // Set 'cube tribues' subtab back to 'cubes' tab - changeSubTab(Tabs.Corruption, { page: 0 }) // set 'corruption main' - changeSubTab(Tabs.Singularity, { page: 0 }) // set 'singularity main' - changeSubTab(Tabs.Settings, { page: 0 }) // set 'statistics main' + changeSubTab(Tabs.Buildings, { page: 0 }); + changeSubTab(Tabs.Runes, { page: 0 }); // Set 'runes' subtab back to 'runes' tab + changeSubTab(Tabs.WowCubes, { page: 0 }); // Set 'cube tribues' subtab back to 'cubes' tab + changeSubTab(Tabs.Corruption, { page: 0 }); // set 'corruption main' + changeSubTab(Tabs.Singularity, { page: 0 }); // set 'singularity main' + changeSubTab(Tabs.Settings, { page: 0 }); // set 'statistics main' - dailyResetCheck() - setInterval(dailyResetCheck, 30000) + dailyResetCheck(); + setInterval(dailyResetCheck, 30000); - constantIntervals() - changeTabColor() + constantIntervals(); + changeTabColor(); - eventCheck().catch(() => {}).finally(() => { - setInterval(() => - eventCheck().catch((error: Error) => { - console.error(error) - }), 15_000) - }) - showExitOffline() - clearTimeout(preloadDeleteGame) + eventCheck() + .catch(() => {}) + .finally(() => { + setInterval( + () => + eventCheck().catch((error: Error) => { + console.error(error); + }), + 15_000 + ); + }); + showExitOffline(); + clearTimeout(preloadDeleteGame); - setInterval(cacheReinitialize, 15000) + setInterval(cacheReinitialize, 15000); - if (localStorage.getItem('pleaseStar') === null) { - void Alert(i18next.t('main.starRepo')) - localStorage.setItem('pleaseStar', '') + if (localStorage.getItem("pleaseStar") === null) { + void Alert(i18next.t("main.starRepo")); + localStorage.setItem("pleaseStar", ""); } // All versions of Chrome and Firefox supported by the game have this API, // but not all versions of Edge and Safari do. if ( - typeof navigator.storage?.persist === 'function' - && typeof navigator.storage?.persisted === 'function' + typeof navigator.storage?.persist === "function" && + typeof navigator.storage?.persisted === "function" ) { - const persistent = await navigator.storage.persisted() + const persistent = await navigator.storage.persisted(); if (!persistent) { - const isPersistentNow = await navigator.storage.persist() + const isPersistentNow = await navigator.storage.persist(); if (isPersistentNow) { - void Alert(i18next.t('main.dataPersistent')) + void Alert(i18next.t("main.dataPersistent")); } } else { - console.log(`Storage is persistent! (persistent = ${persistent})`) + console.log(`Storage is persistent! (persistent = ${persistent})`); } } - const saveType = DOMCacheGetOrSet('saveType') as HTMLInputElement - saveType.checked = localStorage.getItem('copyToClipboard') !== null -} + const saveType = DOMCacheGetOrSet("saveType") as HTMLInputElement; + saveType.checked = localStorage.getItem("copyToClipboard") !== null; +}; -function playerNeedsReminderToExport () { - const day = 1000 * 60 * 60 * 24 +function playerNeedsReminderToExport() { + const day = 1000 * 60 * 60 * 24; - return Date.now() - player.lastExportedSave > day * 3 + return Date.now() - player.lastExportedSave > day * 3; } -window.addEventListener('load', async () => { - await i18nInit() +window.addEventListener("load", async () => { + await i18nInit(); - const ver = DOMCacheGetOrSet('versionnumber') - const addZero = (n: number) => `${n}`.padStart(2, '0') + const ver = DOMCacheGetOrSet("versionnumber"); + const addZero = (n: number) => `${n}`.padStart(2, "0"); if (ver instanceof HTMLElement) { const textUpdate = !isNaN(lastUpdated.getTime()) - ? ` [Last Update: ${addZero(lastUpdated.getHours())}:${addZero(lastUpdated.getMinutes())} UTC ${ - addZero(lastUpdated.getDate()) - }-${lastUpdated.toLocaleString('en-us', { month: 'short' })}-${lastUpdated.getFullYear()}].` - : '' - ver.textContent = `You're ${testing ? 'testing' : 'playing'} v${version} - The Alternate Reality${textUpdate} ${ - testing ? i18next.t('testing.saveInLive') : '' - }` + ? ` [Last Update: ${addZero(lastUpdated.getHours())}:${addZero( + lastUpdated.getMinutes() + )} UTC ${addZero(lastUpdated.getDate())}-${lastUpdated.toLocaleString( + "en-us", + { month: "short" } + )}-${lastUpdated.getFullYear()}].` + : ""; + ver.textContent = `You're ${ + testing ? "testing" : "playing" + } v${version} - The Alternate Reality${textUpdate} ${ + testing ? i18next.t("testing.saveInLive") : "" + }`; } - document.title = `Synergism v${version}` + document.title = `Synergism v${version}`; - generateEventHandlers() + generateEventHandlers(); - void reloadShit() + void reloadShit(); - corruptionButtonsAdd() - corruptionLoadoutTableCreate() + corruptionButtonsAdd(); + corruptionLoadoutTableCreate(); - handleLogin().catch(console.error) -}) + handleLogin().catch(console.error); +}); -window.addEventListener('unload', () => { +window.addEventListener("unload", () => { // This fixes a bug in Chrome (who would have guessed?) that // wouldn't properly load elements if the user scrolled down // and reloaded a page. Why is this a bug, Chrome? Why would // a page that is reloaded be affected by what the user did // beforehand? How does anyone use this buggy browser??????? - window.scrollTo(0, 0) -}) + window.scrollTo(0, 0); +}); diff --git a/src/singularity.ts b/src/singularity.ts index 0d4fdb79d..d270bd317 100644 --- a/src/singularity.ts +++ b/src/singularity.ts @@ -1,93 +1,129 @@ -import i18next from 'i18next' -import { DOMCacheGetOrSet } from './Cache/DOM' -import type { IUpgradeData } from './DynamicUpgrade' -import { DynamicUpgrade } from './DynamicUpgrade' -import { format, player } from './Synergism' -import type { Player } from './types/Synergism' -import { Alert, Prompt, revealStuff } from './UpdateHTML' -import { toOrdinal } from './Utility' +import i18next from "i18next"; +import { DOMCacheGetOrSet } from "./Cache/DOM"; +import type { IUpgradeData } from "./DynamicUpgrade"; +import { DynamicUpgrade } from "./DynamicUpgrade"; +import { format, player } from "./Synergism"; +import type { Player } from "./types/Synergism"; +import { Alert, Prompt, revealStuff } from "./UpdateHTML"; +import { toOrdinal } from "./Utility"; export const updateSingularityPenalties = (): void => { - const singularityCount = player.singularityCount - const platonic = (singularityCount > 36) - ? i18next.t('singularity.penalties.platonicCosts', { - multiplier: format(calculateSingularityDebuff('Platonic Costs', singularityCount), 2, true) - }) - : '???????? ??????? ????? ??? ?????????? ?? ??? (37)' - const hepteract = (singularityCount > 50) - ? i18next.t('singularity.penalties.hepteractCosts', { - multiplier: format(calculateSingularityDebuff('Hepteract Costs', singularityCount), 2, true) - }) - : '????????? ????? ????? ??? ?????????? ?? ??? (51)' - const str = `${getSingularityOridnalText(singularityCount)}
${ - i18next.t('singularity.penalties.globalSpeed', { - divisor: format(calculateSingularityDebuff('Global Speed', singularityCount), 2, true) - }) - } - ${ - i18next.t('singularity.penalties.ascensionSpeed', { - divisor: format(calculateSingularityDebuff('Ascension Speed', singularityCount), 2, true) - }) - } - ${ - i18next.t('singularity.penalties.offeringGain', { - divisor: format(calculateSingularityDebuff('Offering', singularityCount), 2, true) - }) - } - ${ - i18next.t('singularity.penalties.obtainiumGain', { - divisor: format(calculateSingularityDebuff('Obtainium', singularityCount), 2, true) - }) - } - ${ - i18next.t('singularity.penalties.cubeGain', { - divisor: format(calculateSingularityDebuff('Cubes', singularityCount), 2, true) - }) - } - ${ - i18next.t('singularity.penalties.researchCosts', { - multiplier: format(calculateSingularityDebuff('Researches', singularityCount), 2, true) - }) - } - ${ - i18next.t('singularity.penalties.cubeUpgradeCosts', { - multiplier: format(calculateSingularityDebuff('Cube Upgrades', singularityCount), 2, true) - }) - } + const singularityCount = player.singularityCount; + const platonic = + singularityCount > 36 + ? i18next.t("singularity.penalties.platonicCosts", { + multiplier: format( + calculateSingularityDebuff("Platonic Costs", singularityCount), + 2, + true + ), + }) + : '???????? ??????? ????? ??? ?????????? ?? ??? (37)'; + const hepteract = + singularityCount > 50 + ? i18next.t("singularity.penalties.hepteractCosts", { + multiplier: format( + calculateSingularityDebuff("Hepteract Costs", singularityCount), + 2, + true + ), + }) + : '????????? ????? ????? ??? ?????????? ?? ??? (51)'; + const str = `${getSingularityOridnalText(singularityCount)}
${i18next.t( + "singularity.penalties.globalSpeed", + { + divisor: format( + calculateSingularityDebuff("Global Speed", singularityCount), + 2, + true + ), + } + )} + ${i18next.t("singularity.penalties.ascensionSpeed", { + divisor: format( + calculateSingularityDebuff("Ascension Speed", singularityCount), + 2, + true + ), + })} + ${i18next.t("singularity.penalties.offeringGain", { + divisor: format( + calculateSingularityDebuff("Offering", singularityCount), + 2, + true + ), + })} + ${i18next.t("singularity.penalties.obtainiumGain", { + divisor: format( + calculateSingularityDebuff("Obtainium", singularityCount), + 2, + true + ), + })} + ${i18next.t("singularity.penalties.cubeGain", { + divisor: format( + calculateSingularityDebuff("Cubes", singularityCount), + 2, + true + ), + })} + ${i18next.t("singularity.penalties.researchCosts", { + multiplier: format( + calculateSingularityDebuff("Researches", singularityCount), + 2, + true + ), + })} + ${i18next.t("singularity.penalties.cubeUpgradeCosts", { + multiplier: format( + calculateSingularityDebuff("Cube Upgrades", singularityCount), + 2, + true + ), + })} ${platonic} ${hepteract} ${ - (singularityCount >= 230) - ? i18next.t('singularity.penalties.penaltySmooth') - : i18next.t('singularity.penalties.penaltyRough', { - num: format(calculateNextSpike(player.singularityCount), 0, true) - }) - } + singularityCount >= 230 + ? i18next.t("singularity.penalties.penaltySmooth") + : i18next.t("singularity.penalties.penaltyRough", { + num: format( + calculateNextSpike(player.singularityCount), + 0, + true + ), + }) + } ${ - (player.runelevels[6] > 0) - ? i18next.t('singularity.penalties.antiquitiesBought') - : i18next.t('singularity.penalties.antiquitiesNotBought') - }` - - DOMCacheGetOrSet('singularityPenaltiesMultiline').innerHTML = str -} - -function getSingularityOridnalText (singularityCount: number): string { - return i18next.t('general.youAreInThe', { - number: toOrdinal(singularityCount) - }) + player.runelevels[6] > 0 + ? i18next.t("singularity.penalties.antiquitiesBought") + : i18next.t("singularity.penalties.antiquitiesNotBought") + }`; + + DOMCacheGetOrSet("singularityPenaltiesMultiline").innerHTML = str; +}; + +function getSingularityOridnalText(singularityCount: number): string { + return i18next.t("general.youAreInThe", { + number: toOrdinal(singularityCount), + }); } // Need a better way of handling the ones without a special formulae than 'Default' variant -type SingularitySpecialCostFormulae = 'Default' | 'Quadratic' | 'Cubic' | 'Exponential2' - -export interface ISingularityData extends Omit { - goldenQuarksInvested?: number - minimumSingularity?: number - canExceedCap?: boolean - specialCostForm?: SingularitySpecialCostFormulae - qualityOfLife?: boolean - cacheUpdates?: (() => void)[] // TODO: Improve this type signature -Plat +type SingularitySpecialCostFormulae = + | "Default" + | "Quadratic" + | "Cubic" + | "Exponential2"; + +export interface ISingularityData + extends Omit { + goldenQuarksInvested?: number; + minimumSingularity?: number; + canExceedCap?: boolean; + specialCostForm?: SingularitySpecialCostFormulae; + qualityOfLife?: boolean; + cacheUpdates?: (() => void)[]; // TODO: Improve this type signature -Plat } /** @@ -96,96 +132,124 @@ export interface ISingularityData extends Omit void)[] | undefined - - public constructor (data: ISingularityData, key: string) { - const name = i18next.t(`singularity.data.${key}.name`) - const description = i18next.t(`singularity.data.${key}.description`) - - super({ ...data, name, description }) - this.goldenQuarksInvested = data.goldenQuarksInvested ?? 0 - this.minimumSingularity = data.minimumSingularity ?? 0 - this.canExceedCap = data.canExceedCap ?? false - this.specialCostForm = data.specialCostForm ?? 'Default' - this.qualityOfLife = data.qualityOfLife ?? false - this.cacheUpdates = data.cacheUpdates ?? undefined + public goldenQuarksInvested = 0; + public minimumSingularity: number; + public canExceedCap: boolean; + public specialCostForm: SingularitySpecialCostFormulae; + public qualityOfLife: boolean; + readonly cacheUpdates: (() => void)[] | undefined; + + public constructor(data: ISingularityData, key: string) { + const name = i18next.t(`singularity.data.${key}.name`); + const description = i18next.t(`singularity.data.${key}.description`); + + super({ ...data, name, description }); + this.goldenQuarksInvested = data.goldenQuarksInvested ?? 0; + this.minimumSingularity = data.minimumSingularity ?? 0; + this.canExceedCap = data.canExceedCap ?? false; + this.specialCostForm = data.specialCostForm ?? "Default"; + this.qualityOfLife = data.qualityOfLife ?? false; + this.cacheUpdates = data.cacheUpdates ?? undefined; } /** * Given an upgrade, give a concise information regarding its data. * @returns A string that details the name, description, level statistic, and next level cost. */ - toString (): string { - const costNextLevel = this.getCostTNL() - const maxLevel = this.maxLevel === -1 - ? '' - : `/${format(this.computeMaxLevel(), 0, true)}` - const color = this.computeMaxLevel() === this.level ? 'plum' : 'white' - const minReqColor = player.highestSingularityCount < this.minimumSingularity - ? 'var(--crimson-text-color)' - : 'var(--green-text-color)' - const minimumSingularity = this.minimumSingularity > 0 - ? `${i18next.t('general.minimum')} Singularity: ${this.minimumSingularity}` - : i18next.t('singularity.toString.noMinimum') - - let freeLevelInfo = this.freeLevels > 0 - ? ` [+${format(this.freeLevels, 2, true)}]` - : '' + toString(): string { + const costNextLevel = this.getCostTNL(); + const maxLevel = + this.maxLevel === -1 ? "" : `/${format(this.computeMaxLevel(), 0, true)}`; + const color = this.computeMaxLevel() === this.level ? "plum" : "white"; + const minReqColor = + player.highestSingularityCount < this.minimumSingularity + ? "var(--crimson-text-color)" + : "var(--green-text-color)"; + const minimumSingularity = + this.minimumSingularity > 0 + ? `${i18next.t("general.minimum")} Singularity: ${ + this.minimumSingularity + }` + : i18next.t("singularity.toString.noMinimum"); + + let freeLevelInfo = + this.freeLevels > 0 + ? ` [+${format( + this.freeLevels, + 2, + true + )}]` + : ""; if (this.freeLevels > this.level) { - freeLevelInfo = `${freeLevelInfo} ${ - i18next.t('general.softCapped') - }` + freeLevelInfo = `${freeLevelInfo} ${i18next.t( + "general.softCapped" + )}`; } return `${this.name} ${this.description} ${minimumSingularity} - ${i18next.t('general.level')} ${ - format(this.level, 0, true) - }${maxLevel}${freeLevelInfo} + ${i18next.t( + "general.level" + )} ${format(this.level, 0, true)}${maxLevel}${freeLevelInfo} ${this.getEffect().desc} - ${i18next.t('singularity.toString.costNextLevel')}: ${format(costNextLevel, 0, true)} Golden Quarks. - ${i18next.t('general.spent')} Quarks: ${format(this.goldenQuarksInvested, 0, true)}` + ${i18next.t("singularity.toString.costNextLevel")}: ${format( + costNextLevel, + 0, + true + )} Golden Quarks. + ${i18next.t("general.spent")} Quarks: ${format( + this.goldenQuarksInvested, + 0, + true + )}`; } - public updateUpgradeHTML (): void { - DOMCacheGetOrSet('testingMultiline').innerHTML = this.toString() + public updateUpgradeHTML(): void { + DOMCacheGetOrSet("testingMultiline").innerHTML = this.toString(); } /** * Retrieves the cost for upgrading the singularity upgrade once. Return 0 if maxed. * @returns A number representing how many Golden Quarks a player must have to upgrade once. */ - getCostTNL (): number { - let costMultiplier = 1 + getCostTNL(): number { + let costMultiplier = 1; if (this.computeMaxLevel() > this.maxLevel && this.level >= this.maxLevel) { - costMultiplier *= Math.pow(4, this.level - this.maxLevel + 1) + costMultiplier *= Math.pow(4, this.level - this.maxLevel + 1); } - if (this.specialCostForm === 'Exponential2') { - return this.costPerLevel * Math.sqrt(costMultiplier) * Math.pow(2, this.level) + if (this.specialCostForm === "Exponential2") { + return ( + this.costPerLevel * Math.sqrt(costMultiplier) * Math.pow(2, this.level) + ); } - if (this.specialCostForm === 'Cubic') { - return this.costPerLevel * costMultiplier * (Math.pow(this.level + 1, 3) - Math.pow(this.level, 3)) + if (this.specialCostForm === "Cubic") { + return ( + this.costPerLevel * + costMultiplier * + (Math.pow(this.level + 1, 3) - Math.pow(this.level, 3)) + ); } - if (this.specialCostForm === 'Quadratic') { - return this.costPerLevel * costMultiplier * (Math.pow(this.level + 1, 2) - Math.pow(this.level, 2)) + if (this.specialCostForm === "Quadratic") { + return ( + this.costPerLevel * + costMultiplier * + (Math.pow(this.level + 1, 2) - Math.pow(this.level, 2)) + ); } - costMultiplier *= (this.maxLevel === -1 && this.level >= 100) ? this.level / 50 : 1 - costMultiplier *= (this.maxLevel === -1 && this.level >= 400) ? this.level / 100 : 1 + costMultiplier *= + this.maxLevel === -1 && this.level >= 100 ? this.level / 50 : 1; + costMultiplier *= + this.maxLevel === -1 && this.level >= 400 ? this.level / 100 : 1; - return (this.computeMaxLevel() === this.level) + return this.computeMaxLevel() === this.level ? 0 - : Math.ceil(this.costPerLevel * (1 + this.level) * costMultiplier) + : Math.ceil(this.costPerLevel * (1 + this.level) * costMultiplier); } /** @@ -193,167 +257,192 @@ export class SingularityUpgrade extends DynamicUpgrade { * @returns An alert indicating cannot afford, already maxed or purchased with how many * levels purchased */ - public async buyLevel (event: MouseEvent): Promise { - let purchased = 0 - let maxPurchasable = 1 - let GQBudget = player.goldenQuarks + public async buyLevel(event: MouseEvent): Promise { + let purchased = 0; + let maxPurchasable = 1; + let GQBudget = player.goldenQuarks; if (event.shiftKey) { - maxPurchasable = 100000 + maxPurchasable = 100000; const buy = Number( - await Prompt(i18next.t('singularity.goldenQuarks.spendPrompt', { - gq: format(player.goldenQuarks, 0, true) - })) - ) + await Prompt( + i18next.t("singularity.goldenQuarks.spendPrompt", { + gq: format(player.goldenQuarks, 0, true), + }) + ) + ); - if (isNaN(buy) || !isFinite(buy) || !Number.isInteger(buy)) { // nan + Infinity checks - return Alert(i18next.t('general.validation.finite')) + if (isNaN(buy) || !isFinite(buy) || !Number.isInteger(buy)) { + // nan + Infinity checks + return Alert(i18next.t("general.validation.finite")); } if (buy === -1) { - GQBudget = player.goldenQuarks + GQBudget = player.goldenQuarks; } else if (buy <= 0) { - return Alert(i18next.t('general.validation.zeroOrLess')) + return Alert(i18next.t("general.validation.zeroOrLess")); } else { - GQBudget = buy + GQBudget = buy; } - GQBudget = Math.min(player.goldenQuarks, GQBudget) + GQBudget = Math.min(player.goldenQuarks, GQBudget); } if (this.maxLevel > 0) { - maxPurchasable = Math.min(maxPurchasable, this.computeMaxLevel() - this.level) + maxPurchasable = Math.min( + maxPurchasable, + this.computeMaxLevel() - this.level + ); } if (maxPurchasable === 0) { - return Alert(i18next.t('singularity.goldenQuarks.hasUpgrade')) + return Alert(i18next.t("singularity.goldenQuarks.hasUpgrade")); } if (player.highestSingularityCount < this.minimumSingularity) { - return Alert(i18next.t('singularity.goldenQuarks.notHighEnoughLevel')) + return Alert(i18next.t("singularity.goldenQuarks.notHighEnoughLevel")); } while (maxPurchasable > 0) { - const cost = this.getCostTNL() + const cost = this.getCostTNL(); if (player.goldenQuarks < cost || GQBudget < cost) { - break + break; } else { - player.goldenQuarks -= cost - GQBudget -= cost - this.goldenQuarksInvested += cost - this.level += 1 - purchased += 1 - maxPurchasable -= 1 + player.goldenQuarks -= cost; + GQBudget -= cost; + this.goldenQuarksInvested += cost; + this.level += 1; + purchased += 1; + maxPurchasable -= 1; } if (this.name === player.singularityUpgrades.oneMind.name) { - player.ascensionCounter = 0 - player.ascensionCounterReal = 0 - player.ascensionCounterRealReal = 0 - void Alert(i18next.t('singularity.goldenQuarks.ascensionReset')) + player.ascensionCounter = 0; + player.ascensionCounterReal = 0; + player.ascensionCounterRealReal = 0; + void Alert(i18next.t("singularity.goldenQuarks.ascensionReset")); } if (this.name === player.singularityUpgrades.singCitadel2.name) { - player.singularityUpgrades.singCitadel.freeLevels = player.singularityUpgrades.singCitadel2.level + player.singularityUpgrades.singCitadel.freeLevels = + player.singularityUpgrades.singCitadel2.level; } if (this.name === player.singularityUpgrades.blueberries.name) { - player.caches.ambrosiaGeneration.updateVal('SingularityBerries') + player.caches.ambrosiaGeneration.updateVal("SingularityBerries"); } } if (purchased === 0) { - return Alert(i18next.t('general.validation.moreThanPlayerHas')) + return Alert(i18next.t("general.validation.moreThanPlayerHas")); } if (purchased > 1) { - void Alert(i18next.t('singularity.goldenQuarks.multiBuyPurchased', { levels: format(purchased) })) + void Alert( + i18next.t("singularity.goldenQuarks.multiBuyPurchased", { + levels: format(purchased), + }) + ); } - this.updateUpgradeHTML() - this.updateCaches() - updateSingularityPenalties() - updateSingularityPerks() - revealStuff() + this.updateUpgradeHTML(); + this.updateCaches(); + updateSingularityPenalties(); + updateSingularityPerks(); + revealStuff(); } - public computeFreeLevelSoftcap (): number { - return Math.min(this.level, this.freeLevels) + Math.sqrt(Math.max(0, this.freeLevels - this.level)) + public computeFreeLevelSoftcap(): number { + return ( + Math.min(this.level, this.freeLevels) + + Math.sqrt(Math.max(0, this.freeLevels - this.level)) + ); } - public computeMaxLevel (): number { + public computeMaxLevel(): number { if (!this.canExceedCap) { - return this.maxLevel + return this.maxLevel; } else { - let cap = this.maxLevel - const overclockPerks = [50, 60, 75, 100, 125, 150, 175, 200, 225, 250] + let cap = this.maxLevel; + const overclockPerks = [50, 60, 75, 100, 125, 150, 175, 200, 225, 250]; for (const perk of overclockPerks) { if (player.highestSingularityCount >= perk) { - cap += 1 + cap += 1; } else { - break + break; } } - cap += +player.octeractUpgrades.octeractSingUpgradeCap.getEffect().bonus - return cap + cap += +player.octeractUpgrades.octeractSingUpgradeCap.getEffect().bonus; + return cap; } } - public actualTotalLevels (): number { - if (player.singularityChallenges.noSingularityUpgrades.enabled && !this.qualityOfLife) { - return 0 + public actualTotalLevels(): number { + if ( + player.singularityChallenges.noSingularityUpgrades.enabled && + !this.qualityOfLife + ) { + return 0; } if ( - player.singularityChallenges.limitedAscensions.enabled - && this.name === player.singularityUpgrades.platonicDelta.name + player.singularityChallenges.limitedAscensions.enabled && + this.name === player.singularityUpgrades.platonicDelta.name ) { - return 0 + return 0; } - const actualFreeLevels = this.computeFreeLevelSoftcap() - const linearLevels = this.level + actualFreeLevels - let polynomialLevels = 0 + const actualFreeLevels = this.computeFreeLevelSoftcap(); + const linearLevels = this.level + actualFreeLevels; + let polynomialLevels = 0; if (player.octeractUpgrades.octeractImprovedFree.getEffect().bonus) { - let exponent = 0.6 - exponent += +player.octeractUpgrades.octeractImprovedFree2.getEffect().bonus - exponent += +player.octeractUpgrades.octeractImprovedFree3.getEffect().bonus - exponent += +player.octeractUpgrades.octeractImprovedFree4.getEffect().bonus - polynomialLevels = Math.pow(this.level * actualFreeLevels, exponent) + let exponent = 0.6; + exponent += + +player.octeractUpgrades.octeractImprovedFree2.getEffect().bonus; + exponent += + +player.octeractUpgrades.octeractImprovedFree3.getEffect().bonus; + exponent += + +player.octeractUpgrades.octeractImprovedFree4.getEffect().bonus; + polynomialLevels = Math.pow(this.level * actualFreeLevels, exponent); } - return Math.max(linearLevels, polynomialLevels) + return Math.max(linearLevels, polynomialLevels); } - public getEffect (): { bonus: number | boolean; desc: string } { - return this.effect(this.actualTotalLevels()) + public getEffect(): { bonus: number | boolean; desc: string } { + return this.effect(this.actualTotalLevels()); } - updateCaches (): void { + updateCaches(): void { if (this.cacheUpdates !== undefined) { for (const cache of this.cacheUpdates) { - cache() + cache(); } } } - public refund (): void { - player.goldenQuarks += this.goldenQuarksInvested - this.level = 0 - this.goldenQuarksInvested = 0 + public refund(): void { + player.goldenQuarks += this.goldenQuarksInvested; + this.level = 0; + this.goldenQuarksInvested = 0; } } -export const singularityData: Record = { +export const singularityData: Record< + keyof Player["singularityUpgrades"], + ISingularityData +> = { goldenQuarks1: { maxLevel: 15, costPerLevel: 12, canExceedCap: true, effect: (n: number) => { return { - bonus: 1 + 0.10 * n, - get desc () { - return i18next.t('singularity.data.goldenQuarks1.effect', { n: format(10 * n, 0, true) }) - } - } + bonus: 1 + 0.1 * n, + get desc() { + return i18next.t("singularity.data.goldenQuarks1.effect", { + n: format(10 * n, 0, true), + }); + }, + }; }, - qualityOfLife: true + qualityOfLife: true, }, goldenQuarks2: { maxLevel: 75, @@ -361,104 +450,121 @@ export const singularityData: Record { return { - bonus: (n > 250) ? 1 / Math.log2(n / 62.5) : 1 - Math.min(0.5, n / 500), - get desc () { - return i18next.t('singularity.data.goldenQuarks2.effect', { - n: n > 250 ? format(100 - 100 / Math.log2(n / 62.5), 2, true) : format(Math.min(50, n / 5), 2, true) - }) - } - } + bonus: n > 250 ? 1 / Math.log2(n / 62.5) : 1 - Math.min(0.5, n / 500), + get desc() { + return i18next.t("singularity.data.goldenQuarks2.effect", { + n: + n > 250 + ? format(100 - 100 / Math.log2(n / 62.5), 2, true) + : format(Math.min(50, n / 5), 2, true), + }); + }, + }; }, - qualityOfLife: true + qualityOfLife: true, }, goldenQuarks3: { maxLevel: 1000, costPerLevel: 1000, effect: (n: number) => { return { - bonus: n * (n + 1) / 2, - get desc () { - return i18next.t('singularity.data.goldenQuarks3.effect', { n: format(n * (n + 1) / 2) }) - } - } - } + bonus: (n * (n + 1)) / 2, + get desc() { + return i18next.t("singularity.data.goldenQuarks3.effect", { + n: format((n * (n + 1)) / 2), + }); + }, + }; + }, }, starterPack: { maxLevel: 1, costPerLevel: 10, effect: (n: number) => { return { - bonus: (n > 0), - get desc () { - return i18next.t(`singularity.data.starterPack.effect${n > 0 ? 'Have' : 'HaveNot'}`) - } - } - } + bonus: n > 0, + get desc() { + return i18next.t( + `singularity.data.starterPack.effect${n > 0 ? "Have" : "HaveNot"}` + ); + }, + }; + }, }, wowPass: { maxLevel: 1, costPerLevel: 350, effect: (n: number) => { return { - bonus: (n > 0), - get desc () { - return i18next.t(`singularity.data.wowPass.effect${n > 0 ? 'Have' : 'HaveNot'}`) - } - } + bonus: n > 0, + get desc() { + return i18next.t( + `singularity.data.wowPass.effect${n > 0 ? "Have" : "HaveNot"}` + ); + }, + }; }, - qualityOfLife: true + qualityOfLife: true, }, cookies: { maxLevel: 1, costPerLevel: 100, effect: (n: number) => { return { - bonus: (n > 0), - get desc () { - return i18next.t(`singularity.data.cookies.effect${n > 0 ? 'Have' : 'HaveNot'}`) - } - } + bonus: n > 0, + get desc() { + return i18next.t( + `singularity.data.cookies.effect${n > 0 ? "Have" : "HaveNot"}` + ); + }, + }; }, - qualityOfLife: true + qualityOfLife: true, }, cookies2: { maxLevel: 1, costPerLevel: 500, effect: (n: number) => { return { - bonus: (n > 0), - get desc () { - return i18next.t(`singularity.data.cookies2.effect${n > 0 ? 'Have' : 'HaveNot'}`) - } - } + bonus: n > 0, + get desc() { + return i18next.t( + `singularity.data.cookies2.effect${n > 0 ? "Have" : "HaveNot"}` + ); + }, + }; }, - qualityOfLife: true + qualityOfLife: true, }, cookies3: { maxLevel: 1, costPerLevel: 24999, effect: (n: number) => { return { - bonus: (n > 0), - get desc () { - return i18next.t(`singularity.data.cookies3.effect${n > 0 ? 'Have' : 'HaveNot'}`) - } - } + bonus: n > 0, + get desc() { + return i18next.t( + `singularity.data.cookies3.effect${n > 0 ? "Have" : "HaveNot"}` + ); + }, + }; }, - qualityOfLife: true + qualityOfLife: true, }, cookies4: { maxLevel: 1, costPerLevel: 499999, effect: (n: number) => { return { - bonus: (n > 0), - get desc () { - return i18next.t(`singularity.data.cookies4.effect${n > 0 ? 'Have' : 'HaveNot'}`) - } - } + bonus: n > 0, + get desc() { + return i18next.t( + `singularity.data.cookies4.effect${n > 0 ? "Have" : "HaveNot"}` + ); + }, + }; }, - qualityOfLife: true + qualityOfLife: true, }, cookies5: { maxLevel: 1, @@ -466,55 +572,71 @@ export const singularityData: Record { return { - bonus: (n > 0), - get desc () { - return i18next.t(`singularity.data.cookies5.effect${n > 0 ? 'Have' : 'HaveNot'}`) - } - } + bonus: n > 0, + get desc() { + return i18next.t( + `singularity.data.cookies5.effect${n > 0 ? "Have" : "HaveNot"}` + ); + }, + }; }, - qualityOfLife: true + qualityOfLife: true, }, ascensions: { maxLevel: -1, costPerLevel: 5, effect: (n: number) => { return { - bonus: (1 + 2 * n / 100) * (1 + Math.floor(n / 10) / 100), - get desc () { - return i18next.t('singularity.data.ascensions.effect', { - n: format((100 + 2 * n) * (1 + Math.floor(n / 10) / 100) - 100, 1, true) - }) - } - } - } + bonus: (1 + (2 * n) / 100) * (1 + Math.floor(n / 10) / 100), + get desc() { + return i18next.t("singularity.data.ascensions.effect", { + n: format( + (100 + 2 * n) * (1 + Math.floor(n / 10) / 100) - 100, + 1, + true + ), + }); + }, + }; + }, }, corruptionFourteen: { maxLevel: 1, costPerLevel: 1000, effect: (n: number) => { return { - bonus: (n > 0), - get desc () { - return i18next.t(`singularity.data.corruptionFourteen.effect${n > 0 ? 'Have' : 'HaveNot'}`, { - m: n > 0 ? ':)' : ':(' - }) - } - } - } + bonus: n > 0, + get desc() { + return i18next.t( + `singularity.data.corruptionFourteen.effect${ + n > 0 ? "Have" : "HaveNot" + }`, + { + m: n > 0 ? ":)" : ":(", + } + ); + }, + }; + }, }, corruptionFifteen: { maxLevel: 1, costPerLevel: 40000, effect: (n: number) => { return { - bonus: (n > 0), - get desc () { - return i18next.t(`singularity.data.corruptionFifteen.effect${n > 0 ? 'Have' : 'HaveNot'}`, { - m: n > 0 ? ':)' : ':(' - }) - } - } - } + bonus: n > 0, + get desc() { + return i18next.t( + `singularity.data.corruptionFifteen.effect${ + n > 0 ? "Have" : "HaveNot" + }`, + { + m: n > 0 ? ":)" : ":(", + } + ); + }, + }; + }, }, singOfferings1: { maxLevel: -1, @@ -522,11 +644,13 @@ export const singularityData: Record { return { bonus: 1 + 0.02 * n, - get desc () { - return i18next.t('singularity.data.singOfferings1.effect', { n: format(2 * n, 0, true) }) - } - } - } + get desc() { + return i18next.t("singularity.data.singOfferings1.effect", { + n: format(2 * n, 0, true), + }); + }, + }; + }, }, singOfferings2: { maxLevel: 25, @@ -535,11 +659,13 @@ export const singularityData: Record { return { bonus: 1 + 0.08 * n, - get desc () { - return i18next.t('singularity.data.singOfferings2.effect', { n: format(8 * n, 0, true) }) - } - } - } + get desc() { + return i18next.t("singularity.data.singOfferings2.effect", { + n: format(8 * n, 0, true), + }); + }, + }; + }, }, singOfferings3: { maxLevel: 40, @@ -548,11 +674,13 @@ export const singularityData: Record { return { bonus: 1 + 0.04 * n, - get desc () { - return i18next.t('singularity.data.singOfferings3.effect', { n: format(4 * n, 0, true) }) - } - } - } + get desc() { + return i18next.t("singularity.data.singOfferings3.effect", { + n: format(4 * n, 0, true), + }); + }, + }; + }, }, singObtainium1: { maxLevel: -1, @@ -560,11 +688,13 @@ export const singularityData: Record { return { bonus: 1 + 0.02 * n, - get desc () { - return i18next.t('singularity.data.singObtainium1.effect', { n: format(2 * n, 0, true) }) - } - } - } + get desc() { + return i18next.t("singularity.data.singObtainium1.effect", { + n: format(2 * n, 0, true), + }); + }, + }; + }, }, singObtainium2: { maxLevel: 25, @@ -573,11 +703,13 @@ export const singularityData: Record { return { bonus: 1 + 0.08 * n, - get desc () { - return i18next.t('singularity.data.singObtainium2.effect', { n: format(8 * n, 0, true) }) - } - } - } + get desc() { + return i18next.t("singularity.data.singObtainium2.effect", { + n: format(8 * n, 0, true), + }); + }, + }; + }, }, singObtainium3: { maxLevel: 40, @@ -586,11 +718,13 @@ export const singularityData: Record { return { bonus: 1 + 0.04 * n, - get desc () { - return i18next.t('singularity.data.singObtainium3.effect', { n: format(4 * n, 0, true) }) - } - } - } + get desc() { + return i18next.t("singularity.data.singObtainium3.effect", { + n: format(4 * n, 0, true), + }); + }, + }; + }, }, singCubes1: { maxLevel: -1, @@ -598,11 +732,13 @@ export const singularityData: Record { return { bonus: 1 + 0.01 * n, - get desc () { - return i18next.t('singularity.data.singCubes1.effect', { n: format(1 * n, 0, true) }) - } - } - } + get desc() { + return i18next.t("singularity.data.singCubes1.effect", { + n: format(1 * n, 0, true), + }); + }, + }; + }, }, singCubes2: { maxLevel: 25, @@ -611,11 +747,13 @@ export const singularityData: Record { return { bonus: 1 + 0.08 * n, - get desc () { - return i18next.t('singularity.data.singCubes2.effect', { n: format(8 * n, 0, true) }) - } - } - } + get desc() { + return i18next.t("singularity.data.singCubes2.effect", { + n: format(8 * n, 0, true), + }); + }, + }; + }, }, singCubes3: { maxLevel: 40, @@ -624,11 +762,13 @@ export const singularityData: Record { return { bonus: 1 + 0.04 * n, - get desc () { - return i18next.t('singularity.data.singCubes3.effect', { n: format(4 * n, 0, true) }) - } - } - } + get desc() { + return i18next.t("singularity.data.singCubes3.effect", { + n: format(4 * n, 0, true), + }); + }, + }; + }, }, singCitadel: { maxLevel: -1, @@ -637,29 +777,33 @@ export const singularityData: Record { return { bonus: (1 + 0.02 * n) * (1 + Math.floor(n / 10) / 100), - get desc () { - return i18next.t('singularity.data.singCubes2.effect', { - n: format(100 * ((1 + 0.02 * n) * (1 + Math.floor(n / 10) / 100) - 1)) - }) - } - } - } + get desc() { + return i18next.t("singularity.data.singCubes2.effect", { + n: format( + 100 * ((1 + 0.02 * n) * (1 + Math.floor(n / 10) / 100) - 1) + ), + }); + }, + }; + }, }, singCitadel2: { maxLevel: 100, costPerLevel: 1e14, minimumSingularity: 204, - specialCostForm: 'Quadratic', + specialCostForm: "Quadratic", effect: (n: number) => { return { bonus: (1 + 0.02 * n) * (1 + Math.floor(n / 10) / 100), - get desc () { - return i18next.t('singularity.data.singCubes3.effect', { - n: format(100 * ((1 + 0.02 * n) * (1 + Math.floor(n / 10) / 100) - 1)) - }) - } - } - } + get desc() { + return i18next.t("singularity.data.singCubes3.effect", { + n: format( + 100 * ((1 + 0.02 * n) * (1 + Math.floor(n / 10) / 100) - 1) + ), + }); + }, + }; + }, }, octeractUnlock: { maxLevel: 1, @@ -667,13 +811,17 @@ export const singularityData: Record { return { - bonus: (n > 0), - get desc () { - return i18next.t(`singularity.data.octeractUnlock.effect${n > 0 ? 'Have' : 'HaveNot'}`) - } - } + bonus: n > 0, + get desc() { + return i18next.t( + `singularity.data.octeractUnlock.effect${ + n > 0 ? "Have" : "HaveNot" + }` + ); + }, + }; }, - qualityOfLife: true + qualityOfLife: true, }, singOcteractPatreonBonus: { maxLevel: 1, @@ -681,12 +829,14 @@ export const singularityData: Record { return { - bonus: (n > 0), - get desc () { - return i18next.t('singularity.data.singOcteractPatreonBonus.effect', { n }) - } - } - } + bonus: n > 0, + get desc() { + return i18next.t("singularity.data.singOcteractPatreonBonus.effect", { + n, + }); + }, + }; + }, }, offeringAutomatic: { maxLevel: -1, @@ -695,11 +845,11 @@ export const singularityData: Record { return { bonus: n, - get desc () { - return i18next.t('singularity.data.offeringAutomatic.effect', { n }) - } - } - } + get desc() { + return i18next.t("singularity.data.offeringAutomatic.effect", { n }); + }, + }; + }, }, intermediatePack: { maxLevel: 1, @@ -707,12 +857,16 @@ export const singularityData: Record { return { - bonus: (n > 0), - get desc () { - return i18next.t(`singularity.data.intermediatePack.effect${n > 0 ? 'Have' : 'HaveNot'}`) - } - } - } + bonus: n > 0, + get desc() { + return i18next.t( + `singularity.data.intermediatePack.effect${ + n > 0 ? "Have" : "HaveNot" + }` + ); + }, + }; + }, }, advancedPack: { maxLevel: 1, @@ -720,12 +874,14 @@ export const singularityData: Record { return { - bonus: (n > 0), - get desc () { - return i18next.t(`singularity.data.advancedPack.effect${n > 0 ? 'Have' : 'HaveNot'}`) - } - } - } + bonus: n > 0, + get desc() { + return i18next.t( + `singularity.data.advancedPack.effect${n > 0 ? "Have" : "HaveNot"}` + ); + }, + }; + }, }, expertPack: { maxLevel: 1, @@ -733,12 +889,14 @@ export const singularityData: Record { return { - bonus: (n > 0), - get desc () { - return i18next.t(`singularity.data.expertPack.effect${n > 0 ? 'Have' : 'HaveNot'}`) - } - } - } + bonus: n > 0, + get desc() { + return i18next.t( + `singularity.data.expertPack.effect${n > 0 ? "Have" : "HaveNot"}` + ); + }, + }; + }, }, masterPack: { maxLevel: 1, @@ -746,12 +904,14 @@ export const singularityData: Record { return { - bonus: (n > 0), - get desc () { - return i18next.t(`singularity.data.masterPack.effect${n > 0 ? 'Have' : 'HaveNot'}`) - } - } - } + bonus: n > 0, + get desc() { + return i18next.t( + `singularity.data.masterPack.effect${n > 0 ? "Have" : "HaveNot"}` + ); + }, + }; + }, }, divinePack: { maxLevel: 1, @@ -759,12 +919,14 @@ export const singularityData: Record { return { - bonus: (n > 0), - get desc () { - return i18next.t(`singularity.data.divinePack.effect${n > 0 ? 'Have' : 'HaveNot'}`) - } - } - } + bonus: n > 0, + get desc() { + return i18next.t( + `singularity.data.divinePack.effect${n > 0 ? "Have" : "HaveNot"}` + ); + }, + }; + }, }, wowPass2: { maxLevel: 1, @@ -772,13 +934,15 @@ export const singularityData: Record { return { - bonus: (n > 0), - get desc () { - return i18next.t(`singularity.data.wowPass2.effect${n > 0 ? 'Have' : 'HaveNot'}`) - } - } + bonus: n > 0, + get desc() { + return i18next.t( + `singularity.data.wowPass2.effect${n > 0 ? "Have" : "HaveNot"}` + ); + }, + }; }, - qualityOfLife: true + qualityOfLife: true, }, wowPass3: { maxLevel: 1, @@ -786,13 +950,15 @@ export const singularityData: Record { return { - bonus: (n > 0), - get desc () { - return i18next.t(`singularity.data.wowPass3.effect${n > 0 ? 'Have' : 'HaveNot'}`) - } - } + bonus: n > 0, + get desc() { + return i18next.t( + `singularity.data.wowPass3.effect${n > 0 ? "Have" : "HaveNot"}` + ); + }, + }; }, - qualityOfLife: true + qualityOfLife: true, }, potionBuff: { maxLevel: 10, @@ -802,13 +968,13 @@ export const singularityData: Record { return { bonus: Math.max(1, 10 * Math.pow(n, 2)), - get desc () { - return i18next.t('singularity.data.potionBuff.effect', { - n: format(Math.max(1, 10 * Math.pow(n, 2)), 0, true) - }) - } - } - } + get desc() { + return i18next.t("singularity.data.potionBuff.effect", { + n: format(Math.max(1, 10 * Math.pow(n, 2)), 0, true), + }); + }, + }; + }, }, potionBuff2: { maxLevel: 10, @@ -818,11 +984,13 @@ export const singularityData: Record { return { bonus: Math.max(1, 2 * n), - get desc () { - return i18next.t('singularity.data.potionBuff2.effect', { n: format(Math.max(1, 2 * n), 0, true) }) - } - } - } + get desc() { + return i18next.t("singularity.data.potionBuff2.effect", { + n: format(Math.max(1, 2 * n), 0, true), + }); + }, + }; + }, }, potionBuff3: { maxLevel: 10, @@ -832,11 +1000,13 @@ export const singularityData: Record { return { bonus: Math.max(1, 1 + 0.5 * n), - get desc () { - return i18next.t('singularity.data.potionBuff3.effect', { n: format(Math.max(1, 1 + 0.5 * n), 2, true) }) - } - } - } + get desc() { + return i18next.t("singularity.data.potionBuff3.effect", { + n: format(Math.max(1, 1 + 0.5 * n), 2, true), + }); + }, + }; + }, }, singChallengeExtension: { maxLevel: 4, @@ -845,11 +1015,14 @@ export const singularityData: Record { return { bonus: n, - get desc () { - return i18next.t('singularity.data.singChallengeExtension.effect', { n: 2 * n, m: n }) - } - } - } + get desc() { + return i18next.t("singularity.data.singChallengeExtension.effect", { + n: 2 * n, + m: n, + }); + }, + }; + }, }, singChallengeExtension2: { maxLevel: 3, @@ -858,11 +1031,14 @@ export const singularityData: Record { return { bonus: n, - get desc () { - return i18next.t('singularity.data.singChallengeExtension2.effect', { n: 2 * n, m: n }) - } - } - } + get desc() { + return i18next.t("singularity.data.singChallengeExtension2.effect", { + n: 2 * n, + m: n, + }); + }, + }; + }, }, singChallengeExtension3: { maxLevel: 3, @@ -871,27 +1047,32 @@ export const singularityData: Record { return { bonus: n, - get desc () { - return i18next.t('singularity.data.singChallengeExtension3.effect', { n: 2 * n, m: n }) - } - } - } + get desc() { + return i18next.t("singularity.data.singChallengeExtension3.effect", { + n: 2 * n, + m: n, + }); + }, + }; + }, }, singQuarkImprover1: { maxLevel: 30, costPerLevel: 1, minimumSingularity: 173, canExceedCap: true, - specialCostForm: 'Exponential2', + specialCostForm: "Exponential2", effect: (n: number) => { return { bonus: n / 200, - get desc () { - return i18next.t('singularity.data.singQuarkImprover1.effect', { n: format(n / 2, 2, true) }) - } - } + get desc() { + return i18next.t("singularity.data.singQuarkImprover1.effect", { + n: format(n / 2, 2, true), + }); + }, + }; }, - qualityOfLife: true + qualityOfLife: true, }, singQuarkHepteract: { maxLevel: 1, @@ -900,12 +1081,14 @@ export const singularityData: Record { return { bonus: n / 100, - get desc () { - return i18next.t('singularity.data.singQuarkHepteract.effect', { n: format(2 * n, 2, true) }) - } - } + get desc() { + return i18next.t("singularity.data.singQuarkHepteract.effect", { + n: format(2 * n, 2, true), + }); + }, + }; }, - qualityOfLife: true + qualityOfLife: true, }, singQuarkHepteract2: { maxLevel: 1, @@ -914,12 +1097,14 @@ export const singularityData: Record { return { bonus: n / 100, - get desc () { - return i18next.t('singularity.data.singQuarkHepteract2.effect', { n: format(2 * n, 2, true) }) - } - } + get desc() { + return i18next.t("singularity.data.singQuarkHepteract2.effect", { + n: format(2 * n, 2, true), + }); + }, + }; }, - qualityOfLife: true + qualityOfLife: true, }, singQuarkHepteract3: { maxLevel: 1, @@ -928,12 +1113,14 @@ export const singularityData: Record { return { bonus: n / 100, - get desc () { - return i18next.t('singularity.data.singQuarkHepteract3.effect', { n: format(2 * n, 2, true) }) - } - } + get desc() { + return i18next.t("singularity.data.singQuarkHepteract3.effect", { + n: format(2 * n, 2, true), + }); + }, + }; }, - qualityOfLife: true + qualityOfLife: true, }, singOcteractGain: { maxLevel: -1, @@ -942,11 +1129,13 @@ export const singularityData: Record { return { bonus: 1 + 0.0125 * n, - get desc () { - return i18next.t('singularity.data.singOcteractGain.effect', { n: format(1.25 * n, 2, true) }) - } - } - } + get desc() { + return i18next.t("singularity.data.singOcteractGain.effect", { + n: format(1.25 * n, 2, true), + }); + }, + }; + }, }, singOcteractGain2: { maxLevel: 25, @@ -956,11 +1145,13 @@ export const singularityData: Record { return { bonus: 1 + 0.05 * n, - get desc () { - return i18next.t('singularity.data.singOcteractGain2.effect', { n: format(5 * n, 0, true) }) - } - } - } + get desc() { + return i18next.t("singularity.data.singOcteractGain2.effect", { + n: format(5 * n, 0, true), + }); + }, + }; + }, }, singOcteractGain3: { maxLevel: 50, @@ -970,11 +1161,13 @@ export const singularityData: Record { return { bonus: 1 + 0.025 * n, - get desc () { - return i18next.t('singularity.data.singOcteractGain3.effect', { n: format(2.5 * n, 0, true) }) - } - } - } + get desc() { + return i18next.t("singularity.data.singOcteractGain3.effect", { + n: format(2.5 * n, 0, true), + }); + }, + }; + }, }, singOcteractGain4: { maxLevel: 100, @@ -984,11 +1177,13 @@ export const singularityData: Record { return { bonus: 1 + 0.02 * n, - get desc () { - return i18next.t('singularity.data.singOcteractGain4.effect', { n: format(2 * n, 0, true) }) - } - } - } + get desc() { + return i18next.t("singularity.data.singOcteractGain4.effect", { + n: format(2 * n, 0, true), + }); + }, + }; + }, }, singOcteractGain5: { maxLevel: 200, @@ -998,11 +1193,13 @@ export const singularityData: Record { return { bonus: 1 + 0.01 * n, - get desc () { - return i18next.t('singularity.data.singOcteractGain5.effect', { n: format(n, 0, true) }) - } - } - } + get desc() { + return i18next.t("singularity.data.singOcteractGain5.effect", { + n: format(n, 0, true), + }); + }, + }; + }, }, platonicTau: { maxLevel: 1, @@ -1011,12 +1208,14 @@ export const singularityData: Record { return { bonus: n > 0, - get desc () { - return i18next.t(`singularity.data.platonicTau.effect${n ? 'Have' : 'HaveNot'}`) - } - } + get desc() { + return i18next.t( + `singularity.data.platonicTau.effect${n ? "Have" : "HaveNot"}` + ); + }, + }; }, - qualityOfLife: true + qualityOfLife: true, }, platonicAlpha: { maxLevel: 1, @@ -1025,12 +1224,14 @@ export const singularityData: Record { return { bonus: n > 0, - get desc () { - return i18next.t(`singularity.data.platonicAlpha.effect${n ? 'Have' : 'HaveNot'}`) - } - } + get desc() { + return i18next.t( + `singularity.data.platonicAlpha.effect${n ? "Have" : "HaveNot"}` + ); + }, + }; }, - qualityOfLife: true + qualityOfLife: true, }, platonicDelta: { maxLevel: 1, @@ -1039,11 +1240,13 @@ export const singularityData: Record { return { bonus: n > 0, - get desc () { - return i18next.t(`singularity.data.platonicDelta.effect${n ? 'Have' : 'HaveNot'}`) - } - } - } + get desc() { + return i18next.t( + `singularity.data.platonicDelta.effect${n ? "Have" : "HaveNot"}` + ); + }, + }; + }, }, platonicPhi: { maxLevel: 1, @@ -1052,12 +1255,14 @@ export const singularityData: Record { return { bonus: n > 0, - get desc () { - return i18next.t(`singularity.data.platonicPhi.effect${n ? 'Have' : 'HaveNot'}`) - } - } + get desc() { + return i18next.t( + `singularity.data.platonicPhi.effect${n ? "Have" : "HaveNot"}` + ); + }, + }; }, - qualityOfLife: true + qualityOfLife: true, }, singFastForward: { maxLevel: 1, @@ -1066,12 +1271,14 @@ export const singularityData: Record { return { bonus: n > 0, - get desc () { - return i18next.t(`singularity.data.singFastForward.effect${n ? 'Have' : 'HaveNot'}`) - } - } + get desc() { + return i18next.t( + `singularity.data.singFastForward.effect${n ? "Have" : "HaveNot"}` + ); + }, + }; }, - qualityOfLife: true + qualityOfLife: true, }, singFastForward2: { maxLevel: 1, @@ -1080,12 +1287,14 @@ export const singularityData: Record { return { bonus: n > 0, - get desc () { - return i18next.t(`singularity.data.singFastForward2.effect${n ? 'Have' : 'HaveNot'}`) - } - } + get desc() { + return i18next.t( + `singularity.data.singFastForward2.effect${n ? "Have" : "HaveNot"}` + ); + }, + }; }, - qualityOfLife: true + qualityOfLife: true, }, singAscensionSpeed: { maxLevel: 1, @@ -1094,14 +1303,14 @@ export const singularityData: Record { return { bonus: n, - get desc () { - return i18next.t('singularity.data.singAscensionSpeed.effect', { + get desc() { + return i18next.t("singularity.data.singAscensionSpeed.effect", { n: format(1 + 0.03 * n, 2, true), - m: format(1 - 0.03 * n, 2, true) - }) - } - } - } + m: format(1 - 0.03 * n, 2, true), + }); + }, + }; + }, }, singAscensionSpeed2: { maxLevel: 1, @@ -1110,11 +1319,11 @@ export const singularityData: Record { return { bonus: n, - get desc () { - return i18next.t('singularity.data.singAscensionSpeed2.effect') - } - } - } + get desc() { + return i18next.t("singularity.data.singAscensionSpeed2.effect"); + }, + }; + }, }, WIP: { maxLevel: 100, @@ -1123,11 +1332,11 @@ export const singularityData: Record { return { bonus: n, - get desc () { - return i18next.t('singularity.data.WIP.effect') - } - } - } + get desc() { + return i18next.t("singularity.data.WIP.effect"); + }, + }; + }, }, ultimatePen: { maxLevel: 1, @@ -1136,14 +1345,17 @@ export const singularityData: Record { return { bonus: n > 0, - get desc () { - return i18next.t('singularity.data.ultimatePen.effect', { - n: n ? '' : 'NOT', - m: n > 0 ? ' However, the pen just ran out of ink. How will you get more?' : '' - }) - } - } - } + get desc() { + return i18next.t("singularity.data.ultimatePen.effect", { + n: n ? "" : "NOT", + m: + n > 0 + ? " However, the pen just ran out of ink. How will you get more?" + : "", + }); + }, + }; + }, }, oneMind: { maxLevel: 1, @@ -1152,12 +1364,14 @@ export const singularityData: Record { return { bonus: n > 0, - get desc () { - return i18next.t(`singularity.data.oneMind.effect${n ? 'Have' : 'HaveNot'}`) - } - } + get desc() { + return i18next.t( + `singularity.data.oneMind.effect${n ? "Have" : "HaveNot"}` + ); + }, + }; }, - qualityOfLife: true + qualityOfLife: true, }, wowPass4: { maxLevel: 1, @@ -1166,12 +1380,14 @@ export const singularityData: Record { return { bonus: n > 0, - get desc () { - return i18next.t(`singularity.data.wowPass4.effect${n ? 'Have' : 'HaveNot'}`) - } - } + get desc() { + return i18next.t( + `singularity.data.wowPass4.effect${n ? "Have" : "HaveNot"}` + ); + }, + }; }, - qualityOfLife: true + qualityOfLife: true, }, blueberries: { maxLevel: 10, @@ -1180,14 +1396,16 @@ export const singularityData: Record { return { bonus: n, - get desc () { - return i18next.t('singularity.data.blueberries.effect', { n }) - } - } + get desc() { + return i18next.t("singularity.data.blueberries.effect", { n }); + }, + }; }, - specialCostForm: 'Exponential2', + specialCostForm: "Exponential2", qualityOfLife: true, - cacheUpdates: [() => player.caches.blueberryInventory.updateVal('SingularityUpgrade')] + cacheUpdates: [ + () => player.caches.blueberryInventory.updateVal("SingularityUpgrade"), + ], }, singAmbrosiaLuck: { maxLevel: -1, @@ -1196,14 +1414,18 @@ export const singularityData: Record { return { bonus: 4 * n, - get desc () { - return i18next.t('singularity.data.singAmbrosiaLuck.effect', { n: format(4 * n) }) - } - } - }, - specialCostForm: 'Exponential2', + get desc() { + return i18next.t("singularity.data.singAmbrosiaLuck.effect", { + n: format(4 * n), + }); + }, + }; + }, + specialCostForm: "Exponential2", qualityOfLife: true, - cacheUpdates: [() => player.caches.ambrosiaLuck.updateVal('SingularityBerries')] + cacheUpdates: [ + () => player.caches.ambrosiaLuck.updateVal("SingularityBerries"), + ], }, singAmbrosiaLuck2: { maxLevel: 30, @@ -1212,13 +1434,17 @@ export const singularityData: Record { return { bonus: 2 * n, - get desc () { - return i18next.t('singularity.data.singAmbrosiaLuck2.effect', { n: format(2 * n) }) - } - } + get desc() { + return i18next.t("singularity.data.singAmbrosiaLuck2.effect", { + n: format(2 * n), + }); + }, + }; }, qualityOfLife: true, - cacheUpdates: [() => player.caches.ambrosiaLuck.updateVal('SingularityBerries')] + cacheUpdates: [ + () => player.caches.ambrosiaLuck.updateVal("SingularityBerries"), + ], }, singAmbrosiaLuck3: { maxLevel: 30, @@ -1227,13 +1453,17 @@ export const singularityData: Record { return { bonus: 3 * n, - get desc () { - return i18next.t('singularity.data.singAmbrosiaLuck3.effect', { n: format(3 * n) }) - } - } + get desc() { + return i18next.t("singularity.data.singAmbrosiaLuck3.effect", { + n: format(3 * n), + }); + }, + }; }, qualityOfLife: true, - cacheUpdates: [() => player.caches.ambrosiaLuck.updateVal('SingularityBerries')] + cacheUpdates: [ + () => player.caches.ambrosiaLuck.updateVal("SingularityBerries"), + ], }, singAmbrosiaLuck4: { maxLevel: 50, @@ -1242,13 +1472,17 @@ export const singularityData: Record { return { bonus: 5 * n, - get desc () { - return i18next.t('singularity.data.singAmbrosiaLuck4.effect', { n: format(5 * n) }) - } - } + get desc() { + return i18next.t("singularity.data.singAmbrosiaLuck4.effect", { + n: format(5 * n), + }); + }, + }; }, qualityOfLife: true, - cacheUpdates: [() => player.caches.ambrosiaLuck.updateVal('SingularityBerries')] + cacheUpdates: [ + () => player.caches.ambrosiaLuck.updateVal("SingularityBerries"), + ], }, singAmbrosiaGeneration: { maxLevel: -1, @@ -1257,14 +1491,18 @@ export const singularityData: Record { return { bonus: 1 + n / 100, - get desc () { - return i18next.t('singularity.data.singAmbrosiaGeneration.effect', { n: format(n) }) - } - } - }, - specialCostForm: 'Exponential2', + get desc() { + return i18next.t("singularity.data.singAmbrosiaGeneration.effect", { + n: format(n), + }); + }, + }; + }, + specialCostForm: "Exponential2", qualityOfLife: true, - cacheUpdates: [() => player.caches.ambrosiaGeneration.updateVal('SingularityBerries')] + cacheUpdates: [ + () => player.caches.ambrosiaGeneration.updateVal("SingularityBerries"), + ], }, singAmbrosiaGeneration2: { maxLevel: 20, @@ -1273,13 +1511,17 @@ export const singularityData: Record { return { bonus: 1 + n / 100, - get desc () { - return i18next.t('singularity.data.singAmbrosiaGeneration2.effect', { n: format(n) }) - } - } + get desc() { + return i18next.t("singularity.data.singAmbrosiaGeneration2.effect", { + n: format(n), + }); + }, + }; }, qualityOfLife: true, - cacheUpdates: [() => player.caches.ambrosiaGeneration.updateVal('SingularityBerries')] + cacheUpdates: [ + () => player.caches.ambrosiaGeneration.updateVal("SingularityBerries"), + ], }, singAmbrosiaGeneration3: { maxLevel: 35, @@ -1288,13 +1530,17 @@ export const singularityData: Record { return { bonus: 1 + n / 100, - get desc () { - return i18next.t('singularity.data.singAmbrosiaGeneration3.effect', { n: format(n) }) - } - } + get desc() { + return i18next.t("singularity.data.singAmbrosiaGeneration3.effect", { + n: format(n), + }); + }, + }; }, qualityOfLife: true, - cacheUpdates: [() => player.caches.ambrosiaGeneration.updateVal('SingularityBerries')] + cacheUpdates: [ + () => player.caches.ambrosiaGeneration.updateVal("SingularityBerries"), + ], }, singAmbrosiaGeneration4: { maxLevel: 50, @@ -1302,32 +1548,36 @@ export const singularityData: Record { return { - bonus: 1 + 2 * n / 100, - get desc () { - return i18next.t('singularity.data.singAmbrosiaGeneration4.effect', { n: format(2 * n) }) - } - } + bonus: 1 + (2 * n) / 100, + get desc() { + return i18next.t("singularity.data.singAmbrosiaGeneration4.effect", { + n: format(2 * n), + }); + }, + }; }, qualityOfLife: true, - cacheUpdates: [() => player.caches.ambrosiaGeneration.updateVal('SingularityBerries')] - } -} + cacheUpdates: [ + () => player.caches.ambrosiaGeneration.updateVal("SingularityBerries"), + ], + }, +}; /** * Singularity Perks are automatically obtained and upgraded, based on player.singularityCount * They can have one or several levels with a description for each level */ export class SingularityPerk { - public readonly name: () => string - public readonly levels: number[] - public readonly description: (n: number, levels: number[]) => string - public readonly ID: string - - public constructor (perk: SingularityPerk) { - this.name = perk.name - this.levels = perk.levels - this.description = perk.description - this.ID = perk.ID + public readonly name: () => string; + public readonly levels: number[]; + public readonly description: (n: number, levels: number[]) => string; + public readonly ID: string; + + public constructor(perk: SingularityPerk) { + this.name = perk.name; + this.levels = perk.levels; + this.description = perk.description; + this.ID = perk.ID; } } @@ -1336,55 +1586,61 @@ export class SingularityPerk { export const singularityPerks: SingularityPerk[] = [ { name: () => { - return i18next.t('singularity.perkNames.welcometoSingularity') + return i18next.t("singularity.perkNames.welcometoSingularity"); }, levels: [1], description: () => { - return i18next.t('singularity.perks.welcometoSingularity') + return i18next.t("singularity.perks.welcometoSingularity"); }, - ID: 'welcometoSingularity' + ID: "welcometoSingularity", }, { name: () => { - return i18next.t('singularity.perkNames.unlimitedGrowth') + return i18next.t("singularity.perkNames.unlimitedGrowth"); }, levels: [1], description: () => { - return i18next.t('singularity.perks.unlimitedGrowth', { amount: format(10 * player.singularityCount) }) + return i18next.t("singularity.perks.unlimitedGrowth", { + amount: format(10 * player.singularityCount), + }); }, - ID: 'unlimitedGrowth' + ID: "unlimitedGrowth", }, { name: () => { - return i18next.t('singularity.perkNames.goldenCoins') + return i18next.t("singularity.perkNames.goldenCoins"); }, levels: [1], description: () => { - return i18next.t('singularity.perks.goldenCoins', { - amount: format(Math.pow(player.goldenQuarks + 1, 1.5) * Math.pow(player.highestSingularityCount + 1, 2), 2) - }) + return i18next.t("singularity.perks.goldenCoins", { + amount: format( + Math.pow(player.goldenQuarks + 1, 1.5) * + Math.pow(player.highestSingularityCount + 1, 2), + 2 + ), + }); }, - ID: 'goldenCoins' + ID: "goldenCoins", }, { name: () => { - return i18next.t('singularity.perkNames.xyz') + return i18next.t("singularity.perkNames.xyz"); }, levels: [1, 20, 200], description: (n: number, levels: number[]) => { if (n >= levels[2]) { - return i18next.t('singularity.perks.xyz.hasLevel2') + return i18next.t("singularity.perks.xyz.hasLevel2"); } else if (n >= levels[1]) { - return i18next.t('singularity.perks.xyz.hasLevel1') + return i18next.t("singularity.perks.xyz.hasLevel1"); } else { - return i18next.t('singularity.perks.xyz.default') + return i18next.t("singularity.perks.xyz.default"); } }, - ID: 'xyz' + ID: "xyz", }, { name: () => { - return i18next.t('singularity.perkNames.generousOrbs') + return i18next.t("singularity.perkNames.generousOrbs"); }, levels: [1, 2, 5, 10, 15, 20, 25, 30, 35], description: (n: number, levels: number[]) => { @@ -1396,530 +1652,558 @@ export const singularityPerks: SingularityPerk[] = [ 4: 315, 3: 280, 2: 255, - 1: 230 - } + 1: 230, + }; for (let i = 8; i > 0; i--) { if (n >= levels[i]) { - return i18next.t('singularity.perks.generousOrbs', { amount: overfluxBonus[i] }) + return i18next.t("singularity.perks.generousOrbs", { + amount: overfluxBonus[i], + }); } } - return i18next.t('singularity.perks.generousOrbs', { amount: '215' }) + return i18next.t("singularity.perks.generousOrbs", { amount: "215" }); }, - ID: 'generousOrbs' + ID: "generousOrbs", }, { name: () => { - return i18next.t('singularity.perkNames.researchDummies') + return i18next.t("singularity.perkNames.researchDummies"); }, levels: [1, 11], description: (n: number, levels: number[]) => { if (n >= levels[1]) { - return i18next.t('singularity.perks.researchDummies.hasLevel1') + return i18next.t("singularity.perks.researchDummies.hasLevel1"); } else { - return i18next.t('singularity.perks.researchDummies.otherwise') + return i18next.t("singularity.perks.researchDummies.otherwise"); } }, - ID: 'researchDummies' + ID: "researchDummies", }, { name: () => { - return i18next.t('singularity.perkNames.eternalAscensions') + return i18next.t("singularity.perkNames.eternalAscensions"); }, levels: [1, 25], description: (n: number, levels: number[]) => { - const amount = format(1 + player.singularityCount / 10, 1) + const amount = format(1 + player.singularityCount / 10, 1); if (n >= levels[1]) { - return i18next.t('singularity.perks.eternalAscensions.hasLevel1', { amount }) + return i18next.t("singularity.perks.eternalAscensions.hasLevel1", { + amount, + }); } else { - return i18next.t('singularity.perks.eternalAscensions.default', { amount }) + return i18next.t("singularity.perks.eternalAscensions.default", { + amount, + }); } }, - ID: 'eternalAscensions' + ID: "eternalAscensions", }, { name: () => { - return i18next.t('singularity.perkNames.antGodsCornucopia') + return i18next.t("singularity.perkNames.antGodsCornucopia"); }, levels: [1, 30, 70, 100], description: (n: number, levels: number[]) => { if (n >= levels[3]) { - return i18next.t('singularity.perks.antGodsCornucopia.hasLevel3') + return i18next.t("singularity.perks.antGodsCornucopia.hasLevel3"); } else if (n >= levels[2]) { - return i18next.t('singularity.perks.antGodsCornucopia.hasLevel2') + return i18next.t("singularity.perks.antGodsCornucopia.hasLevel2"); } else if (n >= levels[1]) { - return i18next.t('singularity.perks.antGodsCornucopia.hasLevel1') + return i18next.t("singularity.perks.antGodsCornucopia.hasLevel1"); } else { - return i18next.t('singularity.perks.antGodsCornucopia.default') + return i18next.t("singularity.perks.antGodsCornucopia.default"); } }, - ID: 'antGodsCornucopia' + ID: "antGodsCornucopia", }, { name: () => { - return i18next.t('singularity.perkNames.sweepomatic') + return i18next.t("singularity.perkNames.sweepomatic"); }, levels: [2, 101], description: (n: number, levels: number[]) => { if (n >= levels[1]) { - return i18next.t('singularity.perks.sweepomatic.hasLevel1') + return i18next.t("singularity.perks.sweepomatic.hasLevel1"); } else { - return i18next.t('singularity.perks.sweepomatic.otherwise') + return i18next.t("singularity.perks.sweepomatic.otherwise"); } }, - ID: 'sweepomatic' + ID: "sweepomatic", }, { name: () => { - return i18next.t('singularity.perkNames.superStart') + return i18next.t("singularity.perkNames.superStart"); }, levels: [2, 3, 4, 7, 15], description: (n: number, levels: number[]) => { if (n >= levels[4]) { - return i18next.t('singularity.perks.superStart.hasLevel4') + return i18next.t("singularity.perks.superStart.hasLevel4"); } else if (n >= levels[3]) { - return i18next.t('singularity.perks.superStart.hasLevel3') + return i18next.t("singularity.perks.superStart.hasLevel3"); } else if (n >= levels[2]) { - return i18next.t('singularity.perks.superStart.hasLevel2') + return i18next.t("singularity.perks.superStart.hasLevel2"); } else if (n >= levels[1]) { - return i18next.t('singularity.perks.superStart.hasLevel1') + return i18next.t("singularity.perks.superStart.hasLevel1"); } else { - return i18next.t('singularity.perks.superStart.default') + return i18next.t("singularity.perks.superStart.default"); } }, - ID: 'superStart' + ID: "superStart", }, { name: () => { - return i18next.t('singularity.perkNames.notSoChallenging') + return i18next.t("singularity.perkNames.notSoChallenging"); }, levels: [4, 7, 10, 15, 20], description: (n: number, levels: number[]) => { if (n >= levels[4]) { - return i18next.t('singularity.perks.notSoChallenging.hasLevel4') + return i18next.t("singularity.perks.notSoChallenging.hasLevel4"); } else if (n >= levels[3]) { - return i18next.t('singularity.perks.notSoChallenging.hasLevel3') + return i18next.t("singularity.perks.notSoChallenging.hasLevel3"); } else if (n >= levels[2]) { - return i18next.t('singularity.perks.notSoChallenging.hasLevel2') + return i18next.t("singularity.perks.notSoChallenging.hasLevel2"); } else if (n >= levels[1]) { - return i18next.t('singularity.perks.notSoChallenging.hasLevel1') + return i18next.t("singularity.perks.notSoChallenging.hasLevel1"); } else { - return i18next.t('singularity.perks.notSoChallenging.default') + return i18next.t("singularity.perks.notSoChallenging.default"); } }, - ID: 'notSoChallenging' + ID: "notSoChallenging", }, { name: () => { - return i18next.t('singularity.perkNames.automationUpgrades') + return i18next.t("singularity.perkNames.automationUpgrades"); }, levels: [5, 10, 15, 25, 30, 100], description: (n: number, levels: number[]) => { if (n >= levels[5]) { - return i18next.t('singularity.perks.automationUpgrades.hasLevel5') + return i18next.t("singularity.perks.automationUpgrades.hasLevel5"); } else if (n >= levels[4]) { - return i18next.t('singularity.perks.automationUpgrades.hasLevel4') + return i18next.t("singularity.perks.automationUpgrades.hasLevel4"); } else if (n >= levels[3]) { - return i18next.t('singularity.perks.automationUpgrades.hasLevel3') + return i18next.t("singularity.perks.automationUpgrades.hasLevel3"); } else if (n >= levels[2]) { - return i18next.t('singularity.perks.automationUpgrades.hasLevel2') + return i18next.t("singularity.perks.automationUpgrades.hasLevel2"); } else if (n >= levels[1]) { - return i18next.t('singularity.perks.automationUpgrades.hasLevel1') + return i18next.t("singularity.perks.automationUpgrades.hasLevel1"); } else { - return i18next.t('singularity.perks.automationUpgrades.default') + return i18next.t("singularity.perks.automationUpgrades.default"); } }, - ID: 'automationUpgrades' + ID: "automationUpgrades", }, { name: () => { - return i18next.t('singularity.perkNames.evenMoreQuarks') + return i18next.t("singularity.perkNames.evenMoreQuarks"); }, // dprint-ignore - levels: [5, 20, 35, 50, 65, 80, 90, 100, 121, 144, 150, 160, 166, 169, 170, 175, 180, 190, 196, 200, 200, 201, 202, 203, 204, 205, 210, 212, 214, 216, 218, 220, 225, 250], + levels: [ + 5, 7, 10, 20, 35, 50, 65, 80, 90, 100, 121, 144, 150, 160, 166, 169, 170, + 175, 180, 190, 196, 200, 201, 202, 203, 204, 205, 210, 212, 214, 216, 218, + 220, 225, 250, 255, 260, 261, 262, + ], description: (n: number, levels: number[]) => { for (let i = levels.length - 1; i >= 0; i--) { if (n >= levels[i]) { - return i18next.t('singularity.perks.evenMoreQuarks.m', { + return i18next.t("singularity.perks.evenMoreQuarks.m", { stack: i + 1, - inc: format(100 * (Math.pow(1.05, i + 1) - 1), 2) - }) + inc: format(100 * (Math.pow(1.05, i + 1) - 1), 2), + }); } } - return i18next.t('singularity.perks.evenMoreQuarks.bug') + return i18next.t("singularity.perks.evenMoreQuarks.bug"); }, - ID: 'evenMoreQuarks' + ID: "evenMoreQuarks", }, { name: () => { - return i18next.t('singularity.perkNames.shopSpecialOffer') + return i18next.t("singularity.perkNames.shopSpecialOffer"); }, levels: [5, 20, 51], description: (n: number, levels: number[]) => { if (n >= levels[2]) { - return i18next.t('singularity.perks.shopSpecialOffer.hasLevel2') + return i18next.t("singularity.perks.shopSpecialOffer.hasLevel2"); } else if (n >= levels[1]) { - return i18next.t('singularity.perks.shopSpecialOffer.hasLevel1') + return i18next.t("singularity.perks.shopSpecialOffer.hasLevel1"); } else { - return i18next.t('singularity.perks.shopSpecialOffer.default') + return i18next.t("singularity.perks.shopSpecialOffer.default"); } }, - ID: 'shopSpecialOffer' + ID: "shopSpecialOffer", }, { name: () => { - return i18next.t('singularity.perkNames.potionAutogenerator') + return i18next.t("singularity.perkNames.potionAutogenerator"); }, levels: [6], description: () => { - return i18next.t('singularity.perks.potionAutogenerator') + return i18next.t("singularity.perks.potionAutogenerator"); }, - ID: 'potionAutogenerator' + ID: "potionAutogenerator", }, { name: () => { - return i18next.t('singularity.perkNames.respecBeGone') + return i18next.t("singularity.perkNames.respecBeGone"); }, levels: [7], description: () => { - return i18next.t('singularity.perks.respecBeGone') + return i18next.t("singularity.perks.respecBeGone"); }, - ID: 'respecBeGone' + ID: "respecBeGone", }, { name: () => { - return i18next.t('singularity.perkNames.forTheLoveOfTheAntGod') + return i18next.t("singularity.perkNames.forTheLoveOfTheAntGod"); }, levels: [10, 15, 25], description: (n: number, levels: number[]) => { if (n >= levels[2]) { - return i18next.t('singularity.perks.forTheLoveOfTheAntGod.hasLevel2') + return i18next.t("singularity.perks.forTheLoveOfTheAntGod.hasLevel2"); } else if (n >= levels[1]) { - return i18next.t('singularity.perks.forTheLoveOfTheAntGod.hasLevel1') + return i18next.t("singularity.perks.forTheLoveOfTheAntGod.hasLevel1"); } else { - return i18next.t('singularity.perks.forTheLoveOfTheAntGod.default') + return i18next.t("singularity.perks.forTheLoveOfTheAntGod.default"); } }, - ID: 'forTheLoveOfTheAntGod' + ID: "forTheLoveOfTheAntGod", }, { name: () => { - return i18next.t('singularity.perkNames.itAllAddsUp') + return i18next.t("singularity.perkNames.itAllAddsUp"); }, - levels: [10, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 235, 240], + levels: [ + 10, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 235, 240, + ], description: (n: number, levels: number[]) => { for (let i = levels.length - 1; i >= 0; i--) { if (n >= levels[i]) { - return i18next.t('singularity.perks.itAllAddsUp', { + return i18next.t("singularity.perks.itAllAddsUp", { div: format(1 + (i + 1) / 5, 2, true), div2: format(1 + (i + 1) / 5, 2, true), - cap: format(1 + (i + 1) / 5, 2, true) - }) + cap: format(1 + (i + 1) / 5, 2, true), + }); } } - return i18next.t('singularity.perks.evenMoreQuarks.bug') + return i18next.t("singularity.perks.evenMoreQuarks.bug"); }, - ID: 'itAllAddsUp' + ID: "itAllAddsUp", }, { name: () => { - return i18next.t('singularity.perkNames.automagicalRunes') + return i18next.t("singularity.perkNames.automagicalRunes"); }, levels: [15, 30, 40, 50], description: (n: number, levels: number[]) => { if (n >= levels[3]) { - return i18next.t('singularity.perks.automagicalRunes.hasLevel3') + return i18next.t("singularity.perks.automagicalRunes.hasLevel3"); } else if (n >= levels[2]) { - return i18next.t('singularity.perks.automagicalRunes.hasLevel2') + return i18next.t("singularity.perks.automagicalRunes.hasLevel2"); } else if (n >= levels[1]) { - return i18next.t('singularity.perks.automagicalRunes.hasLevel1') + return i18next.t("singularity.perks.automagicalRunes.hasLevel1"); } else { - return i18next.t('singularity.perks.automagicalRunes.default') + return i18next.t("singularity.perks.automagicalRunes.default"); } }, - ID: 'automagicalRunes' + ID: "automagicalRunes", }, { name: () => { - return i18next.t('singularity.perkNames.derpSmithsCornucopia') + return i18next.t("singularity.perkNames.derpSmithsCornucopia"); }, - levels: [18, 38, 58, 78, 88, 98, 118, 148, 178, 188, 198, 208, 218, 228, 238, 248], + levels: [ + 18, 38, 58, 78, 88, 98, 118, 148, 178, 188, 198, 208, 218, 228, 238, 248, + ], description: (n: number, levels: number[]) => { for (let i = levels.length - 1; i >= 0; i--) { if (n >= levels[i]) { - return i18next.t('singularity.perks.derpSmithsCornucopia', { - counter: i + 1 - }) + return i18next.t("singularity.perks.derpSmithsCornucopia", { + counter: i + 1, + }); } } - return i18next.t('singularity.perks.evenMoreQuarks.bug') + return i18next.t("singularity.perks.evenMoreQuarks.bug"); }, - ID: 'derpSmithsCornucopia' + ID: "derpSmithsCornucopia", }, { name: () => { - return i18next.t('singularity.perkNames.exaltedAchievements') + return i18next.t("singularity.perkNames.exaltedAchievements"); }, levels: [25], description: () => { - return i18next.t('singularity.perks.exaltedAchievements') + return i18next.t("singularity.perks.exaltedAchievements"); }, - ID: 'exaltedAchievements' + ID: "exaltedAchievements", }, { name: () => { - return i18next.t('singularity.perkNames.coolQOLCubes') + return i18next.t("singularity.perkNames.coolQOLCubes"); }, levels: [25, 35], description: (n: number, levels: number[]) => { if (n >= levels[1]) { - return i18next.t('singularity.perks.coolQOLCubes.hasLevel1') + return i18next.t("singularity.perks.coolQOLCubes.hasLevel1"); } else { - return i18next.t('singularity.perks.coolQOLCubes.default') + return i18next.t("singularity.perks.coolQOLCubes.default"); } }, - ID: 'coolQOLCubes' + ID: "coolQOLCubes", }, { name: () => { - return i18next.t('singularity.perkNames.irishAnt') + return i18next.t("singularity.perkNames.irishAnt"); }, levels: [35, 42, 49, 56, 63, 70, 77], description: (n: number, levels: number[]) => { for (let i = levels.length - 1; i >= 0; i--) { if (n >= levels[i]) { - return i18next.t('singularity.perks.irishAnt', { i: 5 * (i + 1) }) + return i18next.t("singularity.perks.irishAnt", { i: 5 * (i + 1) }); } } - return i18next.t('singularity.perks.evenMoreQuarks.bug') + return i18next.t("singularity.perks.evenMoreQuarks.bug"); }, - ID: 'irishAnt' + ID: "irishAnt", }, { name: () => { - return i18next.t('singularity.perkNames.overclocked') + return i18next.t("singularity.perkNames.overclocked"); }, levels: [50, 60, 75, 100, 125, 150, 175, 200, 225, 250], description: (n: number, levels: number[]) => { for (let i = levels.length - 1; i >= 0; i--) { if (n >= levels[i]) { - return i18next.t('singularity.perks.overclocked', { i: i + 1 }) + return i18next.t("singularity.perks.overclocked", { i: i + 1 }); } } - return i18next.t('singularity.perks.evenMoreQuarks.bug') + return i18next.t("singularity.perks.evenMoreQuarks.bug"); }, - ID: 'overclocked' + ID: "overclocked", }, { name: () => { - return i18next.t('singularity.perkNames.wowCubeAutomatedShipping') + return i18next.t("singularity.perkNames.wowCubeAutomatedShipping"); }, levels: [50, 150], description: (n: number, levels: number[]) => { if (n >= levels[1]) { - return i18next.t('singularity.perks.wowCubeAutomatedShipping.hasLevel1') + return i18next.t( + "singularity.perks.wowCubeAutomatedShipping.hasLevel1" + ); } else { - return i18next.t('singularity.perks.wowCubeAutomatedShipping.default') + return i18next.t("singularity.perks.wowCubeAutomatedShipping.default"); } }, - ID: 'wowCubeAutomatedShipping' + ID: "wowCubeAutomatedShipping", }, { name: () => { - return i18next.t('singularity.perkNames.congealedblueberries') + return i18next.t("singularity.perkNames.congealedblueberries"); }, levels: [66, 132, 198, 264], - description (n, levels) { + description(n, levels) { for (let i = levels.length - 1; i >= 0; i--) { if (n >= levels[i]) { - return i18next.t('singularity.perks.congealedblueberries', { i: i + 1 }) + return i18next.t("singularity.perks.congealedblueberries", { + i: i + 1, + }); } } - return i18next.t('singularity.perks.evenMoreQuarks.bug') + return i18next.t("singularity.perks.evenMoreQuarks.bug"); }, - ID: 'congealedblueberries' + ID: "congealedblueberries", }, { name: () => { - return i18next.t('singularity.perkNames.goldenRevolution') + return i18next.t("singularity.perkNames.goldenRevolution"); }, levels: [100], description: () => { - return i18next.t('singularity.perks.goldenRevolution', { - current: format(Math.min(100, 0.4 * player.singularityCount), 1) - }) + return i18next.t("singularity.perks.goldenRevolution", { + current: format(Math.min(100, 0.4 * player.singularityCount), 1), + }); }, - ID: 'goldenRevolution' + ID: "goldenRevolution", }, { name: () => { - return i18next.t('singularity.perkNames.goldenRevolutionII') + return i18next.t("singularity.perkNames.goldenRevolutionII"); }, levels: [100], description: () => { - return i18next.t('singularity.perks.goldenRevolutionII', { - current: format(Math.min(50, 0.2 * player.singularityCount), 1) - }) + return i18next.t("singularity.perks.goldenRevolutionII", { + current: format(Math.min(50, 0.2 * player.singularityCount), 1), + }); }, - ID: 'goldenRevolution2' + ID: "goldenRevolution2", }, { name: () => { - return i18next.t('singularity.perkNames.goldenRevolutionIII') + return i18next.t("singularity.perkNames.goldenRevolutionIII"); }, levels: [100], description: () => { - return i18next.t('singularity.perks.goldenRevolutionIII', { - current: format(Math.min(500, 2 * player.singularityCount)) - }) + return i18next.t("singularity.perks.goldenRevolutionIII", { + current: format(Math.min(500, 2 * player.singularityCount)), + }); }, - ID: 'goldenRevolution3' + ID: "goldenRevolution3", }, { name: () => { - return i18next.t('singularity.perkNames.platonicClones') + return i18next.t("singularity.perkNames.platonicClones"); }, levels: [100, 200], description: (n: number, levels: number[]) => { if (n >= levels[1]) { - return i18next.t('singularity.perks.platonicClones.hasLevel1') + return i18next.t("singularity.perks.platonicClones.hasLevel1"); } else { - return i18next.t('singularity.perks.platonicClones.default') + return i18next.t("singularity.perks.platonicClones.default"); } }, - ID: 'platonicClones' + ID: "platonicClones", }, { name: () => { - return i18next.t('singularity.perkNames.platSigma') + return i18next.t("singularity.perkNames.platSigma"); }, levels: [125, 200], description: (n: number, levels: number[]) => { - let counter = 0 + let counter = 0; for (const singCount of levels) { if (n >= singCount) { - counter += 0.125 + counter += 0.125; } } - return i18next.t('singularity.perks.platSigma', { + return i18next.t("singularity.perks.platSigma", { counter, - current: format(Math.min(60, counter * player.singularityCount), 1) - }) + current: format(Math.min(60, counter * player.singularityCount), 1), + }); }, - ID: 'platSigma' + ID: "platSigma", }, { name: () => { - return i18next.t('singularity.perkNames.irishAnt2') + return i18next.t("singularity.perkNames.irishAnt2"); }, levels: [135, 142, 149, 156, 163, 170, 177], description: (n: number, levels: number[]) => { for (let i = levels.length - 1; i >= 0; i--) { if (n >= levels[i]) { - return i18next.t('singularity.perks.irishAnt2', { i: 6 * (i + 1) }) + return i18next.t("singularity.perks.irishAnt2", { i: 6 * (i + 1) }); } } - return i18next.t('singularity.perks.evenMoreQuarks.bug') + return i18next.t("singularity.perks.evenMoreQuarks.bug"); }, - ID: 'irishAnt2' + ID: "irishAnt2", }, { name: () => { - return i18next.t('singularity.perkNames.midasMilleniumAgedGold') + return i18next.t("singularity.perkNames.midasMilleniumAgedGold"); }, levels: [150], description: () => { - return i18next.t('singularity.perks.midasMilleniumAgedGold') + return i18next.t("singularity.perks.midasMilleniumAgedGold"); }, - ID: 'midasMilleniumAgedGold' + ID: "midasMilleniumAgedGold", }, { name: () => { - return i18next.t('singularity.perkNames.goldenRevolution4') + return i18next.t("singularity.perkNames.goldenRevolution4"); }, levels: [160, 173, 185, 194, 204, 210, 219, 229, 240, 249], description: (n: number, levels: number[]) => { - const perSecond = 1000000 - let divisor = 0 + const perSecond = 1000000; + let divisor = 0; for (const singCount of levels) { if (n >= singCount) { - divisor += 1 + divisor += 1; } } - return i18next.t('singularity.perks.goldenRevolution4', { gq: format(perSecond / divisor, 0, true) }) + return i18next.t("singularity.perks.goldenRevolution4", { + gq: format(perSecond / divisor, 0, true), + }); }, - ID: 'goldenRevolution4' + ID: "goldenRevolution4", }, { name: () => { - return i18next.t('singularity.perkNames.octeractMetagenesis') + return i18next.t("singularity.perkNames.octeractMetagenesis"); }, levels: [200, 205], description: (n: number, levels: number[]) => { if (n >= levels[1]) { - return i18next.t('singularity.perks.octeractMetagenesis.hasLevel1') + return i18next.t("singularity.perks.octeractMetagenesis.hasLevel1"); } else { - return i18next.t('singularity.perks.octeractMetagenesis.default') + return i18next.t("singularity.perks.octeractMetagenesis.default"); } }, - ID: 'octeractMetagenesis' + ID: "octeractMetagenesis", }, { name: () => { - return i18next.t('singularity.perkNames.immaculateAlchemy') + return i18next.t("singularity.perkNames.immaculateAlchemy"); }, levels: [200, 208, 221], description: (n: number, levels: number[]) => { if (n >= levels[2]) { - return i18next.t('singularity.perks.immaculateAlchemy.hasLevel2') + return i18next.t("singularity.perks.immaculateAlchemy.hasLevel2"); } else if (n >= levels[1]) { - return i18next.t('singularity.perks.immaculateAlchemy.hasLevel1') + return i18next.t("singularity.perks.immaculateAlchemy.hasLevel1"); } else { - return i18next.t('singularity.perks.immaculateAlchemy.default') + return i18next.t("singularity.perks.immaculateAlchemy.default"); } }, - ID: 'immaculateAlchemy' + ID: "immaculateAlchemy", }, { name: () => { - return i18next.t('singularity.perkNames.skrauQ') + return i18next.t("singularity.perkNames.skrauQ"); }, levels: [200], description: () => { - const amt = format(Math.pow((player.singularityCount - 179) / 20, 2), 4) - return i18next.t('singularity.perks.skrauQ', { amt }) + const amt = format(Math.pow((player.singularityCount - 179) / 20, 2), 4); + return i18next.t("singularity.perks.skrauQ", { amt }); }, - ID: 'skrauQ' - } -] + ID: "skrauQ", + }, +]; // Placeholder text for Perk Info that is seen upon first load, check Line 645 EventListeners.ts for actual Perk Info code. export const updateSingularityPerks = (): void => { - const singularityCount = player.highestSingularityCount - DOMCacheGetOrSet('singularityPerksHeader').innerHTML = i18next.t('singularity.perks.header', { - ord: toOrdinal(singularityCount) - }) - DOMCacheGetOrSet('singularityPerksText').innerHTML = i18next.t('singularity.perks.levelInfo', { - level: '#', - singularity: '#' - }) - DOMCacheGetOrSet('singularityPerksDesc').innerHTML = i18next.t('singularity.perks.description') - handlePerks(singularityCount) -} + const singularityCount = player.highestSingularityCount; + DOMCacheGetOrSet("singularityPerksHeader").innerHTML = i18next.t( + "singularity.perks.header", + { + ord: toOrdinal(singularityCount), + } + ); + DOMCacheGetOrSet("singularityPerksText").innerHTML = i18next.t( + "singularity.perks.levelInfo", + { + level: "#", + singularity: "#", + } + ); + DOMCacheGetOrSet("singularityPerksDesc").innerHTML = i18next.t( + "singularity.perks.description" + ); + handlePerks(singularityCount); +}; export interface ISingularityPerkDisplayInfo { - name: string - lastUpgraded: number - acquired: number - htmlID: string + name: string; + lastUpgraded: number; + acquired: number; + htmlID: string; } /* @@ -1934,304 +2218,361 @@ export const getLastUpgradeInfo = ( return { level: i + 1, singularity: perk.levels[i], - next: i < perk.levels.length - 1 ? perk.levels[i + 1] : null - } + next: i < perk.levels.length - 1 ? perk.levels[i + 1] : null, + }; } } - return { level: 0, singularity: perk.levels[0], next: perk.levels[0] } -} + return { level: 0, singularity: perk.levels[0], next: perk.levels[0] }; +}; const handlePerks = (singularityCount: number) => { - const availablePerks: ISingularityPerkDisplayInfo[] = [] - let singularityCountForNextPerk: number | null = null - let singularityCountForNextPerkUpgrade = Infinity + const availablePerks: ISingularityPerkDisplayInfo[] = []; + let singularityCountForNextPerk: number | null = null; + let singularityCountForNextPerkUpgrade = Infinity; for (const perk of singularityPerks) { - const upgradeInfo = getLastUpgradeInfo(perk, singularityCount) + const upgradeInfo = getLastUpgradeInfo(perk, singularityCount); if (upgradeInfo.level > 0) { availablePerks.push({ name: perk.name(), lastUpgraded: upgradeInfo.singularity, acquired: perk.levels[0], - htmlID: perk.ID - }) + htmlID: perk.ID, + }); if (upgradeInfo.next) { - singularityCountForNextPerkUpgrade = Math.min(singularityCountForNextPerkUpgrade, upgradeInfo.next) + singularityCountForNextPerkUpgrade = Math.min( + singularityCountForNextPerkUpgrade, + upgradeInfo.next + ); } } else { if (singularityCountForNextPerk === null) { - singularityCountForNextPerk = upgradeInfo.singularity + singularityCountForNextPerk = upgradeInfo.singularity; } - DOMCacheGetOrSet(perk.ID).style.display = 'none' + DOMCacheGetOrSet(perk.ID).style.display = "none"; } } // We want to sort the perks so that the most recently upgraded or lastUpgraded are listed first availablePerks.sort((p1, p2) => { if (p1.acquired === p2.acquired && p1.lastUpgraded === p2.lastUpgraded) { - return 0 + return 0; } if (p1.lastUpgraded > p2.lastUpgraded) { - return -1 - } else if (p1.lastUpgraded === p2.lastUpgraded && p1.acquired > p2.acquired) { - return -1 + return -1; + } else if ( + p1.lastUpgraded === p2.lastUpgraded && + p1.acquired > p2.acquired + ) { + return -1; } - return 1 - }) + return 1; + }); for (const availablePerk of availablePerks) { - const singTolerance = getFastForwardTotalMultiplier() - const perkId = DOMCacheGetOrSet(availablePerk.htmlID) - perkId.style.display = '' - DOMCacheGetOrSet('singularityPerksGrid').append(perkId) + const singTolerance = getFastForwardTotalMultiplier(); + const perkId = DOMCacheGetOrSet(availablePerk.htmlID); + perkId.style.display = ""; + DOMCacheGetOrSet("singularityPerksGrid").append(perkId); singularityCount - availablePerk.lastUpgraded <= singTolerance // Is new? - ? perkId.classList.replace('oldPerk', 'newPerk') - : perkId.classList.replace('newPerk', 'oldPerk') + ? perkId.classList.replace("oldPerk", "newPerk") + : perkId.classList.replace("newPerk", "oldPerk"); } - const nextUnlockedId = DOMCacheGetOrSet('singualrityUnlockNext') + const nextUnlockedId = DOMCacheGetOrSet("singualrityUnlockNext"); if (singularityCountForNextPerk) { - nextUnlockedId.style.display = '' - nextUnlockedId.textContent = i18next.t('singularity.perks.unlockedIn', { sing: singularityCountForNextPerk }) + nextUnlockedId.style.display = ""; + nextUnlockedId.textContent = i18next.t("singularity.perks.unlockedIn", { + sing: singularityCountForNextPerk, + }); } else { - nextUnlockedId.style.display = 'none' + nextUnlockedId.style.display = "none"; } - const countNext = DOMCacheGetOrSet('singualrityImproveNext') + const countNext = DOMCacheGetOrSet("singualrityImproveNext"); if (singularityCountForNextPerkUpgrade < Infinity) { - countNext.style.display = '' - countNext.textContent = i18next.t('singularity.perks.improvedIn', { sing: singularityCountForNextPerkUpgrade }) + countNext.style.display = ""; + countNext.textContent = i18next.t("singularity.perks.improvedIn", { + sing: singularityCountForNextPerkUpgrade, + }); } else { - countNext.style.display = 'none' + countNext.style.display = "none"; } -} +}; // Indicates the number of extra Singularity count gained on Singularity reset export const getFastForwardTotalMultiplier = (): number => { - let fastForward = 0 - fastForward += +player.singularityUpgrades.singFastForward.getEffect().bonus - fastForward += +player.singularityUpgrades.singFastForward2.getEffect().bonus - fastForward += +player.octeractUpgrades.octeractFastForward.getEffect().bonus + let fastForward = 0; + fastForward += +player.singularityUpgrades.singFastForward.getEffect().bonus; + fastForward += +player.singularityUpgrades.singFastForward2.getEffect().bonus; + fastForward += +player.octeractUpgrades.octeractFastForward.getEffect().bonus; // Stop at sing 200 even if you include fast forward - fastForward = Math.max(0, Math.min(fastForward, 200 - player.singularityCount - 1)) + fastForward = Math.max( + 0, + Math.min(fastForward, 200 - player.singularityCount - 1) + ); // Please for the love of god don't allow FF during a challenge if (player.insideSingularityChallenge) { - return 0 + return 0; } // If the next singularityCount is greater than the highestSingularityCount, fast forward to be equal to the highestSingularityCount if ( - player.highestSingularityCount !== player.singularityCount - && player.singularityCount + fastForward + 1 >= player.highestSingularityCount + player.highestSingularityCount !== player.singularityCount && + player.singularityCount + fastForward + 1 >= player.highestSingularityCount ) { - return Math.max(0, Math.min(fastForward, player.highestSingularityCount - player.singularityCount - 1)) + return Math.max( + 0, + Math.min( + fastForward, + player.highestSingularityCount - player.singularityCount - 1 + ) + ); } - return fastForward -} + return fastForward; +}; export const getGoldenQuarkCost = (): { - cost: number - costReduction: number + cost: number; + costReduction: number; } => { - const baseCost = 10000 + const baseCost = 10000; - let costReduction = 10000 // We will construct our cost reduction by subtracting 10000 - this value. + let costReduction = 10000; // We will construct our cost reduction by subtracting 10000 - this value. - costReduction *= 1 - 0.10 * Math.min(1, player.achievementPoints / 10000) - costReduction *= 1 - 0.3 * player.cubeUpgrades[60] / 10000 - costReduction *= +player.singularityUpgrades.goldenQuarks2.getEffect().bonus - costReduction *= +player.octeractUpgrades.octeractGQCostReduce.getEffect().bonus - costReduction *= player.highestSingularityCount >= 100 ? 1 - 0.5 * player.highestSingularityCount / 250 : 1 + costReduction *= 1 - 0.1 * Math.min(1, player.achievementPoints / 10000); + costReduction *= 1 - (0.3 * player.cubeUpgrades[60]) / 10000; + costReduction *= +player.singularityUpgrades.goldenQuarks2.getEffect().bonus; + costReduction *= + +player.octeractUpgrades.octeractGQCostReduce.getEffect().bonus; + costReduction *= + player.highestSingularityCount >= 100 + ? 1 - (0.5 * player.highestSingularityCount) / 250 + : 1; - let perkDivisor = 1 + let perkDivisor = 1; if (player.highestSingularityCount >= 200) { - perkDivisor = 3 + perkDivisor = 3; } if (player.highestSingularityCount >= 208) { - perkDivisor = 5 + perkDivisor = 5; } if (player.highestSingularityCount >= 221) { - perkDivisor = 8 + perkDivisor = 8; } - costReduction /= perkDivisor + costReduction /= perkDivisor; - costReduction = 10000 - costReduction + costReduction = 10000 - costReduction; return { cost: baseCost - costReduction, - costReduction - } -} + costReduction, + }; +}; -export async function buyGoldenQuarks (): Promise { - const goldenQuarkCost = getGoldenQuarkCost() - const maxBuy = Math.floor(+player.worlds / goldenQuarkCost.cost) - let buyAmount = null +export async function buyGoldenQuarks(): Promise { + const goldenQuarkCost = getGoldenQuarkCost(); + const maxBuy = Math.floor(+player.worlds / goldenQuarkCost.cost); + let buyAmount = null; if (maxBuy === 0) { - return Alert(i18next.t('singularity.goldenQuarks.poor')) + return Alert(i18next.t("singularity.goldenQuarks.poor")); } - const buyPrompt = await Prompt(i18next.t('singularity.goldenQuarks.buyPrompt', { - cost: format(goldenQuarkCost.cost, 0, true), - discount: format(goldenQuarkCost.costReduction, 0, true), - max: format(maxBuy, 0, true) - })) + const buyPrompt = await Prompt( + i18next.t("singularity.goldenQuarks.buyPrompt", { + cost: format(goldenQuarkCost.cost, 0, true), + discount: format(goldenQuarkCost.costReduction, 0, true), + max: format(maxBuy, 0, true), + }) + ); if (buyPrompt === null) { // Number(null) is 0. Yeah.. - return Alert(i18next.t('general.cancelled')) + return Alert(i18next.t("general.cancelled")); } - buyAmount = Number(buyPrompt) + buyAmount = Number(buyPrompt); // Check these lol if (Number.isNaN(buyAmount) || !Number.isFinite(buyAmount)) { // nan + Infinity checks - return Alert(i18next.t('general.validation.finite')) + return Alert(i18next.t("general.validation.finite")); } else if (buyAmount <= 0 && buyAmount !== -1) { // 0 or less selected - return Alert(i18next.t('general.validation.zeroOrLess')) + return Alert(i18next.t("general.validation.zeroOrLess")); } else if (buyAmount > maxBuy) { - return Alert(i18next.t('general.validation.goldenQuarksTooMany')) + return Alert(i18next.t("general.validation.goldenQuarksTooMany")); } else if (!Number.isInteger(buyAmount)) { // non integer - return Alert(i18next.t('general.validation.fraction')) + return Alert(i18next.t("general.validation.fraction")); } - let cost: number + let cost: number; if (buyAmount === -1) { - cost = maxBuy * goldenQuarkCost.cost - player.worlds.sub(cost) - player.goldenQuarks += maxBuy + cost = maxBuy * goldenQuarkCost.cost; + player.worlds.sub(cost); + player.goldenQuarks += maxBuy; } else { - cost = buyAmount * goldenQuarkCost.cost - player.worlds.sub(cost) - player.goldenQuarks += buyAmount + cost = buyAmount * goldenQuarkCost.cost; + player.worlds.sub(cost); + player.goldenQuarks += buyAmount; } - return Alert(i18next.t('singularity.goldenQuarks.transaction', { - spent: format(maxBuy, 0, true), - cost: format(cost, 0, true) - })) + return Alert( + i18next.t("singularity.goldenQuarks.transaction", { + spent: format(maxBuy, 0, true), + cost: format(cost, 0, true), + }) + ); } export type SingularityDebuffs = - | 'Offering' - | 'Obtainium' - | 'Global Speed' - | 'Researches' - | 'Ascension Speed' - | 'Cubes' - | 'Cube Upgrades' - | 'Platonic Costs' - | 'Hepteract Costs' - -export const calculateEffectiveSingularities = (singularityCount: number = player.singularityCount): number => { - let effectiveSingularities = singularityCount - effectiveSingularities *= Math.min(4.75, 0.75 * singularityCount / 10 + 1) + | "Offering" + | "Obtainium" + | "Global Speed" + | "Researches" + | "Ascension Speed" + | "Cubes" + | "Cube Upgrades" + | "Platonic Costs" + | "Hepteract Costs"; + +export const calculateEffectiveSingularities = ( + singularityCount: number = player.singularityCount +): number => { + let effectiveSingularities = singularityCount; + effectiveSingularities *= Math.min(4.75, (0.75 * singularityCount) / 10 + 1); if (player.insideSingularityChallenge) { if (player.singularityChallenges.noOcteracts.enabled) { - effectiveSingularities *= Math.pow(player.singularityChallenges.noOcteracts.completions + 1, 3) + effectiveSingularities *= Math.pow( + player.singularityChallenges.noOcteracts.completions + 1, + 3 + ); } } if (singularityCount > 10) { - effectiveSingularities *= 1.5 - effectiveSingularities *= Math.min(4, 1.25 * singularityCount / 10 - 0.25) + effectiveSingularities *= 1.5; + effectiveSingularities *= Math.min( + 4, + (1.25 * singularityCount) / 10 - 0.25 + ); } if (singularityCount > 25) { - effectiveSingularities *= 2.5 - effectiveSingularities *= Math.min(6, 1.5 * singularityCount / 25 - 0.5) + effectiveSingularities *= 2.5; + effectiveSingularities *= Math.min(6, (1.5 * singularityCount) / 25 - 0.5); } if (singularityCount > 36) { - effectiveSingularities *= 4 - effectiveSingularities *= Math.min(5, singularityCount / 18 - 1) - effectiveSingularities *= Math.pow(1.1, Math.min(singularityCount - 36, 64)) + effectiveSingularities *= 4; + effectiveSingularities *= Math.min(5, singularityCount / 18 - 1); + effectiveSingularities *= Math.pow( + 1.1, + Math.min(singularityCount - 36, 64) + ); } if (singularityCount > 50) { - effectiveSingularities *= 5 - effectiveSingularities *= Math.min(8, 2 * singularityCount / 50 - 1) - effectiveSingularities *= Math.pow(1.1, Math.min(singularityCount - 50, 50)) + effectiveSingularities *= 5; + effectiveSingularities *= Math.min(8, (2 * singularityCount) / 50 - 1); + effectiveSingularities *= Math.pow( + 1.1, + Math.min(singularityCount - 50, 50) + ); } if (singularityCount > 100) { - effectiveSingularities *= 2 - effectiveSingularities *= singularityCount / 25 - effectiveSingularities *= Math.pow(1.1, singularityCount - 100) + effectiveSingularities *= 2; + effectiveSingularities *= singularityCount / 25; + effectiveSingularities *= Math.pow(1.1, singularityCount - 100); } if (singularityCount > 150) { - effectiveSingularities *= 2 - effectiveSingularities *= Math.pow(1.05, singularityCount - 150) + effectiveSingularities *= 2; + effectiveSingularities *= Math.pow(1.05, singularityCount - 150); } if (singularityCount > 200) { - effectiveSingularities *= 1.5 - effectiveSingularities *= Math.pow(1.275, singularityCount - 200) + effectiveSingularities *= 1.5; + effectiveSingularities *= Math.pow(1.275, singularityCount - 200); } if (singularityCount > 215) { - effectiveSingularities *= 1.25 - effectiveSingularities *= Math.pow(1.2, singularityCount - 215) + effectiveSingularities *= 1.25; + effectiveSingularities *= Math.pow(1.2, singularityCount - 215); } if (singularityCount > 230) { - effectiveSingularities *= 2 + effectiveSingularities *= 2; } - return effectiveSingularities -} + return effectiveSingularities; +}; -export const calculateNextSpike = (singularityCount: number = player.singularityCount): number => { - const singularityPenaltyThreshold = [11, 26, 37, 51, 101, 151, 201, 216, 230] - let penaltyDebuff = 0 - penaltyDebuff += player.shopUpgrades.shopSingularityPenaltyDebuff +export const calculateNextSpike = ( + singularityCount: number = player.singularityCount +): number => { + const singularityPenaltyThreshold = [11, 26, 37, 51, 101, 151, 201, 216, 230]; + let penaltyDebuff = 0; + penaltyDebuff += player.shopUpgrades.shopSingularityPenaltyDebuff; for (const sing of singularityPenaltyThreshold) { if (sing + penaltyDebuff > singularityCount) { - return (sing + penaltyDebuff) + return sing + penaltyDebuff; } } - return -1 -} + return -1; +}; export const calculateSingularityDebuff = ( debuff: SingularityDebuffs, singularityCount: number = player.singularityCount ) => { if (singularityCount === 0) { - return 1 + return 1; } if (player.runelevels[6] > 0) { - return 1 + return 1; } - let constitutiveSingularityCount = singularityCount - constitutiveSingularityCount -= player.shopUpgrades.shopSingularityPenaltyDebuff + let constitutiveSingularityCount = singularityCount; + constitutiveSingularityCount -= + player.shopUpgrades.shopSingularityPenaltyDebuff; if (constitutiveSingularityCount < 1) { - return 1 + return 1; } - const effectiveSingularities = calculateEffectiveSingularities(constitutiveSingularityCount) - - if (debuff === 'Offering') { - return Math.sqrt(Math.min(effectiveSingularities, calculateEffectiveSingularities(150)) + 1) - } else if (debuff === 'Global Speed') { - return 1 + Math.sqrt(effectiveSingularities) / 4 - } else if (debuff === 'Obtainium') { - return Math.sqrt(Math.min(effectiveSingularities, calculateEffectiveSingularities(150)) + 1) - } else if (debuff === 'Researches') { - return 1 + Math.sqrt(effectiveSingularities) / 2 - } else if (debuff === 'Ascension Speed') { - return (singularityCount < 150) + const effectiveSingularities = calculateEffectiveSingularities( + constitutiveSingularityCount + ); + + if (debuff === "Offering") { + return Math.sqrt( + Math.min(effectiveSingularities, calculateEffectiveSingularities(150)) + 1 + ); + } else if (debuff === "Global Speed") { + return 1 + Math.sqrt(effectiveSingularities) / 4; + } else if (debuff === "Obtainium") { + return Math.sqrt( + Math.min(effectiveSingularities, calculateEffectiveSingularities(150)) + 1 + ); + } else if (debuff === "Researches") { + return 1 + Math.sqrt(effectiveSingularities) / 2; + } else if (debuff === "Ascension Speed") { + return singularityCount < 150 ? 1 + Math.sqrt(effectiveSingularities) / 5 - : 1 + Math.pow(effectiveSingularities, 0.75) / 10000 - } else if (debuff === 'Cubes') { - const extraMult = (player.singularityCount > 100) ? Math.pow(1.02, player.singularityCount - 100) : 1 - return (player.singularityCount < 150) - ? 1 + Math.sqrt(effectiveSingularities) * extraMult / 4 - : 1 + Math.pow(effectiveSingularities, 0.75) * extraMult / 1000 - } else if (debuff === 'Platonic Costs') { - return (singularityCount > 36) ? 1 + Math.pow(effectiveSingularities, 3 / 10) / 12 : 1 - } else if (debuff === 'Hepteract Costs') { - return (singularityCount > 50) ? 1 + Math.pow(effectiveSingularities, 11 / 50) / 25 : 1 + : 1 + Math.pow(effectiveSingularities, 0.75) / 10000; + } else if (debuff === "Cubes") { + const extraMult = + player.singularityCount > 100 + ? Math.pow(1.02, player.singularityCount - 100) + : 1; + return player.singularityCount < 150 + ? 1 + (Math.sqrt(effectiveSingularities) * extraMult) / 4 + : 1 + (Math.pow(effectiveSingularities, 0.75) * extraMult) / 1000; + } else if (debuff === "Platonic Costs") { + return singularityCount > 36 + ? 1 + Math.pow(effectiveSingularities, 3 / 10) / 12 + : 1; + } else if (debuff === "Hepteract Costs") { + return singularityCount > 50 + ? 1 + Math.pow(effectiveSingularities, 11 / 50) / 25 + : 1; } else { // Cube upgrades - return Math.cbrt(effectiveSingularities + 1) + return Math.cbrt(effectiveSingularities + 1); } -} +}; diff --git a/translations/en.json b/translations/en.json index 97b243a17..92fa06dfb 100644 --- a/translations/en.json +++ b/translations/en.json @@ -95,6 +95,21 @@ "name": "Shameless, Ambrosial Patreon Reminder", "description": "In every realm, Platonic sells out. +1% Blueberry Generation Speed for every +1% Quarks by the Patreon bonus!", "effect": "Generous Patreon supporters grant you {{amount}}% more Blueberry Time Generation. If you are not already, consider becoming a Patreon supporter to support development!" + }, + "ambrosiaObtainium1": { + "name": "RNG-based Obtainium Booster", + "description": "Gain +0.1% Obtainium per ☘ Ambrosia Luck!", + "effect": "This module increases Obtainium gain by {{amount}}%!" + }, + "ambrosiaOffering1": { + "name": "RNG-based Offering Booster", + "description": "Gain +0.1% Offerings per ☘ Ambrosia Luck!", + "effect": "This module increases Offering gain by {{amount}}%!" + }, + "ambrosiaHyperflux": { + "name": "Hyperfluxed Wow! Cube Industrial Production", + "description": "Gain +1% cubes per level, per level of Platonic Upgrade 4x4 purchased (multiplicative!!!)", + "effect": "This module increases Cubes gain by {{amount}}%!" } }, "loadouts": {