Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
KhafraDev committed Jan 3, 2025
1 parent 2614223 commit dabaf0d
Show file tree
Hide file tree
Showing 13 changed files with 96 additions and 66 deletions.
10 changes: 8 additions & 2 deletions src/BlueberryUpgrades.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,10 @@ export class BlueberryUpgrade extends DynamicUpgrade {
}

public get rewardDesc (): string {
const effectiveLevel = (player.singularityChallenges.noAmbrosiaUpgrades.enabled || player.singularityChallenges.sadisticPrequel.enabled) ? 0 : this.level
const effectiveLevel =
(player.singularityChallenges.noAmbrosiaUpgrades.enabled || player.singularityChallenges.sadisticPrequel.enabled)
? 0
: this.level
if ('desc' in this.rewards(0)) {
return String(this.rewards(effectiveLevel).desc)
} else {
Expand All @@ -295,7 +298,10 @@ export class BlueberryUpgrade extends DynamicUpgrade {
}

public get bonus () {
const effectiveLevel = (player.singularityChallenges.noAmbrosiaUpgrades.enabled || player.singularityChallenges.sadisticPrequel.enabled) ? 0 : this.level
const effectiveLevel =
(player.singularityChallenges.noAmbrosiaUpgrades.enabled || player.singularityChallenges.sadisticPrequel.enabled)
? 0
: this.level
return this.rewards(effectiveLevel)
}
}
Expand Down
32 changes: 20 additions & 12 deletions src/Calculate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1774,7 +1774,12 @@ export const calculateAllCubeMultiplier = () => {
// Platonic DELTA
1
+ +player.singularityUpgrades.platonicDelta.getEffect().bonus
* Math.min(9, (player.shopUpgrades.shopSingularitySpeedup > 0) ? player.singularityCounter * 20 / (3600 * 24) : player.singularityCounter / (3600 * 24)),
* Math.min(
9,
(player.shopUpgrades.shopSingularitySpeedup > 0)
? player.singularityCounter * 20 / (3600 * 24)
: player.singularityCounter / (3600 * 24)
),
// Wow Pass INF
Math.pow(1.02, player.shopUpgrades.seasonPassInfinity),
// Ambrosia Mult
Expand Down Expand Up @@ -2118,7 +2123,12 @@ export const getOcteractValueMultipliers = () => {
1 + calculateEventBuff(BuffType.Octeract),
1
+ +player.singularityUpgrades.platonicDelta.getEffect().bonus
* Math.min(9, (player.shopUpgrades.shopSingularitySpeedup > 0) ? player.singularityCounter * 20 / (3600 * 24) : player.singularityCounter / (3600 * 24)),
* Math.min(
9,
(player.shopUpgrades.shopSingularitySpeedup > 0)
? player.singularityCounter * 20 / (3600 * 24)
: player.singularityCounter / (3600 * 24)
),
// No Singulairty Upgrades
+player.singularityChallenges.noSingularityUpgrades.rewards.cubes,
// Wow Pass INF
Expand Down Expand Up @@ -2214,7 +2224,7 @@ export const calculateTimeAcceleration = () => {
calculateSigmoid(2, player.antUpgrades[12 - 1]! + G.bonusant12, 69), // ant 12
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
Expand Down Expand Up @@ -2478,8 +2488,8 @@ export const calculateQuarkMultiplier = () => {
multiplier *= +player.blueberryUpgrades.ambrosiaLuckQuark1.bonus.quarks
multiplier *= +player.blueberryUpgrades.ambrosiaQuarks2.bonus.quarks
multiplier *= calculateCashGrabQuarkBonus()
multiplier *= (1 + +player.singularityChallenges.limitedTime.rewards.quarkMult)
multiplier *= (1 + +player.singularityChallenges.sadisticPrequel.rewards.quarkMult)
multiplier *= 1 + +player.singularityChallenges.limitedTime.rewards.quarkMult
multiplier *= 1 + +player.singularityChallenges.sadisticPrequel.rewards.quarkMult

if (player.highestSingularityCount === 0) {
multiplier *= 1.25
Expand Down Expand Up @@ -2521,7 +2531,7 @@ export const calculateGoldenQuarkMultiplier = (computeMultiplier = false) => {
player.highestSingularityCount >= 100
? 1 + Math.min(1, player.highestSingularityCount / 250)
: 1, // Golden Revolution II
perkMultiplier, // Immaculate Alchemy
perkMultiplier // Immaculate Alchemy
]

// Total Quarks Coefficient
Expand Down Expand Up @@ -3298,9 +3308,8 @@ export const calculateExalt6Penalty = (comps: number, time: number) => {
const displacedTime = Math.max(0, time - 600 + 20 * comps)
if (displacedTime === 0) {
return 1
}
else {
return Math.pow(10 + comps, -displacedTime/60)
} else {
return Math.pow(10 + comps, -displacedTime / 60)
}
}

Expand Down Expand Up @@ -3492,8 +3501,7 @@ export const derpsmithCornucopiaBonus = () => {
export const sing6Mult = () => {
if (player.singularityCount <= 200) {
return 1
}
else {
} else {
return Math.pow(1.01, player.singularityCount - 200)
}
}
Expand All @@ -3504,4 +3512,4 @@ export const sumOfExaltCompletions = () => {
sum += challenge.completions
}
return sum
}
}
3 changes: 1 addition & 2 deletions src/Helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ export const addTimers = (input: TimerInput, time = 0) => {

if (player.insideSingularityChallenge) {
player.singChallengeTimer += time * timeMultiplier
}
else {
} else {
player.singChallengeTimer = 0
}

Expand Down
11 changes: 8 additions & 3 deletions src/ImportExport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -573,13 +573,18 @@ export const promocodes = async (input: string | null, amount?: number) => {
rolls += player.shopUpgrades.shopImprovedDaily3
rolls += player.shopUpgrades.shopImprovedDaily4
rolls += +player.singularityUpgrades.platonicPhi.getEffect().bonus
* Math.min(50, (player.shopUpgrades.shopSingularitySpeedup) ? (100 * player.singularityCounter) / (3600 * 24) : (5 * player.singularityCounter) / (3600 * 24))
* Math.min(
50,
(player.shopUpgrades.shopSingularitySpeedup)
? (100 * player.singularityCounter) / (3600 * 24)
: (5 * player.singularityCounter) / (3600 * 24)
)
rolls += +player.octeractUpgrades.octeractImprovedDaily3.getEffect().bonus
rolls += +player.singularityChallenges.sadisticPrequel.rewards.extraFree
rolls *= +player.octeractUpgrades.octeractImprovedDaily2.getEffect().bonus
rolls *= 1
+ +player.octeractUpgrades.octeractImprovedDaily3.getEffect().bonus / 200
rolls *= (1 + +player.singularityChallenges.sadisticPrequel.rewards.freeUpgradeMult)
rolls *= 1 + +player.singularityChallenges.sadisticPrequel.rewards.freeUpgradeMult
if (player.highestSingularityCount >= 200) {
rolls *= 2
}
Expand Down Expand Up @@ -928,7 +933,7 @@ export const promocodes = async (input: string | null, amount?: number) => {
if (playerConfirmed) {
const diff = Math.abs(Date.now() - (start + random))
player.promoCodeTiming.time = Date.now()

if (diff <= 2500 + 125 * player.cubeUpgrades[61]) {
const reward = Math.floor(
Math.min(1000, 125 + 25 * player.highestSingularityCount)
Expand Down
5 changes: 4 additions & 1 deletion src/Octeracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,10 @@ export class OcteractUpgrade extends DynamicUpgrade {
}

public actualTotalLevels (): number {
if ((player.singularityChallenges.noOcteracts.enabled || player.singularityChallenges.sadisticPrequel.enabled) && !this.qualityOfLife) {
if (
(player.singularityChallenges.noOcteracts.enabled || player.singularityChallenges.sadisticPrequel.enabled)
&& !this.qualityOfLife
) {
return 0
}
const actualFreeLevels = this.computeFreeLevelSoftcap()
Expand Down
3 changes: 1 addition & 2 deletions src/Reset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1199,8 +1199,7 @@ export const singularity = async (setSingNumber = -1): Promise<void> => {
if (!player.singularityChallenges.limitedTime.rewards.preserveQuarks) {
player.worlds.reset()
hold.worlds = Number(hold.worlds)
}
else {
} else {
hold.worlds = Number(player.worlds)
}

Expand Down
54 changes: 29 additions & 25 deletions src/Shop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1322,27 +1322,30 @@ export const shopDescriptions = (input: ShopUpgradeNames) => {
)
})
break
case 'shopEXUltra': {
const capacity = 125000 * player.shopUpgrades.shopEXUltra
lol.innerHTML = i18next.t('shop.upgradeEffects.shopEXUltra', {
amount: format(0.1 * Math.floor(Math.min(capacity, player.lifetimeAmbrosia) / 1000), 1, true)
})
}
case 'shopEXUltra':
{
const capacity = 125000 * player.shopUpgrades.shopEXUltra
lol.innerHTML = i18next.t('shop.upgradeEffects.shopEXUltra', {
amount: format(0.1 * Math.floor(Math.min(capacity, player.lifetimeAmbrosia) / 1000), 1, true)
})
}
break
case 'shopChronometerS': {
const singularity = player.singularityCount
const obtained = player.shopUpgrades.shopChronometerS > 0
lol.innerHTML = i18next.t('shop.upgradeEffects.shopChronometerS', {
amount: format(Math.max(0, 100 * (Math.pow(1.01, (singularity - 200) * +obtained) - 1)), 2, true)
})
}
case 'shopChronometerS':
{
const singularity = player.singularityCount
const obtained = player.shopUpgrades.shopChronometerS > 0
lol.innerHTML = i18next.t('shop.upgradeEffects.shopChronometerS', {
amount: format(Math.max(0, 100 * (Math.pow(1.01, (singularity - 200) * +obtained) - 1)), 2, true)
})
}
break
case 'shopAmbrosiaUltra': {
const exaltCompletions = sumOfExaltCompletions()
lol.innerHTML = i18next.t('shop.upgradeEffects.shopAmbrosiaUltra', {
amount: format(player.shopUpgrades.shopAmbrosiaUltra * exaltCompletions, 0, true)
})
}
case 'shopAmbrosiaUltra':
{
const exaltCompletions = sumOfExaltCompletions()
lol.innerHTML = i18next.t('shop.upgradeEffects.shopAmbrosiaUltra', {
amount: format(player.shopUpgrades.shopAmbrosiaUltra * exaltCompletions, 0, true)
})
}
break
case 'shopSingularitySpeedup': {
const obtained = player.shopUpgrades.shopSingularitySpeedup > 0
Expand All @@ -1351,12 +1354,13 @@ export const shopDescriptions = (input: ShopUpgradeNames) => {
})
break
}
case 'shopSingularityPotency': {
const obtained = player.shopUpgrades.shopSingularityPotency > 0
lol.innerHTML = i18next.t('shop.upgradeEffects.shopSingularityPotency', {
amount: obtained ? 7.66 : 1
})
}
case 'shopSingularityPotency':
{
const obtained = player.shopUpgrades.shopSingularityPotency > 0
lol.innerHTML = i18next.t('shop.upgradeEffects.shopSingularityPotency', {
amount: obtained ? 7.66 : 1
})
}
break
case 'shopSadisticRune': {
lol.innerHTML = i18next.t('shop.upgradeEffects.shopSadisticRune')
Expand Down
9 changes: 4 additions & 5 deletions src/SingularityChallenges.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export interface ISingularityChallengeData {
effect: (n: number) => Record<string, number | boolean>
scalingrewardcount: number
uniquerewardcount: number
resetTime ?: boolean
resetTime?: boolean
completions?: number
enabled?: boolean
highestSingularityCompleted?: number
Expand Down Expand Up @@ -123,11 +123,10 @@ export class SingularityChallenge {
G.currentSingChallenge = this.HTMLTag
player.insideSingularityChallenge = true
await singularity(setSingularity)

if (!this.resetTime) {
player.singularityCounter = holdSingTimer
}
else {
} else {
player.singularityCounter = 0
}
player.goldenQuarks = currentGQ + goldenQuarkGain
Expand Down Expand Up @@ -418,7 +417,7 @@ export const singularityChallengeData: Record<
globalSpeed: 0.06 * n,
ascensionSpeed: 0.06 * n,
tier1Upgrade: n >= 15,
tier2Upgrade: n >= 25,
tier2Upgrade: n >= 25
}
}
},
Expand Down
8 changes: 6 additions & 2 deletions src/Statistics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -663,8 +663,12 @@ export const loadQuarkMultiplier = () => {
)
}`
DOMCacheGetOrSet('sGQM31').textContent = `x${format(calculateCashGrabQuarkBonus(), 3, true)}`
DOMCacheGetOrSet('sGQM32').textContent = `x${format(1 + +player.singularityChallenges.limitedTime.rewards.quarkMult, 2, true)}`
DOMCacheGetOrSet('sGQM33').textContent = `x${format(1 + +player.singularityChallenges.sadisticPrequel.rewards.quarkMult, 2, true)}`
DOMCacheGetOrSet('sGQM32').textContent = `x${
format(1 + +player.singularityChallenges.limitedTime.rewards.quarkMult, 2, true)
}`
DOMCacheGetOrSet('sGQM33').textContent = `x${
format(1 + +player.singularityChallenges.sadisticPrequel.rewards.quarkMult, 2, true)
}`
DOMCacheGetOrSet('sGQM34').textContent = `x${format(player.highestSingularityCount === 0 ? 1.25 : 1, 2, true)}` // Buff in s0

DOMCacheGetOrSet('sGQMT').textContent = `x${
Expand Down
6 changes: 3 additions & 3 deletions src/Synergism.ts
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ export const player: Player = {
shopAmbrosiaUltra: 0,
shopSingularitySpeedup: 0,
shopSingularityPotency: 0,
shopSadisticRune: 0,
shopSadisticRune: 0
},
shopBuyMaxToggle: false,
shopHideToggle: false,
Expand Down Expand Up @@ -860,7 +860,7 @@ export const player: Player = {
3: false,
4: false,
5: false,
6: false,
6: false
},

prototypeCorruptions: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
Expand Down Expand Up @@ -1404,7 +1404,7 @@ export const player: Player = {
sadisticPrequel: new SingularityChallenge(
singularityChallengeData.sadisticPrequel,
'sadisticPrequel'
),
)
},

ambrosia: 0,
Expand Down
9 changes: 5 additions & 4 deletions src/UpdateHTML.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1121,11 +1121,12 @@ const updateAscensionStats = () => {
dom.textContent = fillers[key]
}
if (key === 'ascSingChallengeLen') {
if ( player.singularityChallenges.limitedTime.enabled &&
player.singChallengeTimer > 600 - 20 * player.singularityChallenges.limitedTime.completions) {
if (
player.singularityChallenges.limitedTime.enabled
&& player.singChallengeTimer > 600 - 20 * player.singularityChallenges.limitedTime.completions
) {
dom.style.color = 'red'
}
else {
} else {
dom.style.color = 'white'
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/saves/PlayerSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,9 @@ export const playerSchema = z.object({
crystalUpgradesCost: z.number().array().default(() => [...blankSave.crystalUpgradesCost]),

runelevels: z.number().array().transform((array) => arrayExtend(array, 'runelevels')),
runeexp: z.union([z.number(), z.null().transform(() => 0)]).array().transform((value) => arrayExtend(value, 'runeexp')),
runeexp: z.union([z.number(), z.null().transform(() => 0)]).array().transform((value) =>
arrayExtend(value, 'runeexp')
),
runeshards: z.number(),
maxofferings: z.number().default(() => blankSave.maxofferings),
offeringpersecond: z.number().default(() => blankSave.offeringpersecond),
Expand Down
8 changes: 4 additions & 4 deletions src/singularity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,13 +359,11 @@ export class SingularityUpgrade extends DynamicUpgrade {
}

public computeFreeLevelSoftcap (): number {

const baseRealFreeLevels = player.shopUpgrades.shopSingularityPotency > 0 ? 7.66 * this.freeLevels : this.freeLevels
return (
Math.min(this.level, baseRealFreeLevels)
+ Math.sqrt(Math.max(0, baseRealFreeLevels - this.level))
)

}

public computeMaxLevel (): number {
Expand All @@ -388,14 +386,16 @@ export class SingularityUpgrade extends DynamicUpgrade {

public actualTotalLevels (): number {
if (
(player.singularityChallenges.noSingularityUpgrades.enabled || player.singularityChallenges.sadisticPrequel.enabled)
(player.singularityChallenges.noSingularityUpgrades.enabled
|| player.singularityChallenges.sadisticPrequel.enabled)
&& !this.qualityOfLife
) {
return 0
}

if (
(player.singularityChallenges.limitedAscensions.enabled || player.singularityChallenges.limitedTime.enabled || player.singularityChallenges.sadisticPrequel.enabled)
(player.singularityChallenges.limitedAscensions.enabled || player.singularityChallenges.limitedTime.enabled
|| player.singularityChallenges.sadisticPrequel.enabled)
&& this.name === player.singularityUpgrades.platonicDelta.name
) {
return 0
Expand Down

0 comments on commit dabaf0d

Please sign in to comment.