@@ -11,6 +11,7 @@ import { quarkHandler } from './Quark'
11
11
import { reset } from './Reset'
12
12
import { calculateSingularityDebuff } from './singularity'
13
13
import { getFastForwardTotalMultiplier } from './singularity'
14
+ import { cacheReinitialize } from './StatCache'
14
15
import { format , getTimePinnedToLoadDate , player , resourceGain , saveSynergy , updateAll } from './Synergism'
15
16
import { toggleTalismanBuy , updateTalismanInventory } from './Talismans'
16
17
import { clearInterval , setInterval } from './Timers'
@@ -571,6 +572,7 @@ export const calculateObtainium = () => {
571
572
G . obtainiumGain *= 1 + player . researches [ 81 ] / 10
572
573
G . obtainiumGain *= 1 + player . shopUpgrades . obtainiumAuto / 50
573
574
G . obtainiumGain *= 1 + player . shopUpgrades . cashGrab / 100
575
+ G . obtainiumGain *= 1 + ( 1 / 25 ) * player . shopUpgrades . obtainiumEX
574
576
G . obtainiumGain *= 1
575
577
+ ( G . rune5level / 200 )
576
578
* G . effectiveLevelMult
@@ -623,7 +625,6 @@ export const calculateObtainium = () => {
623
625
G . obtainiumGain += 2 * player . researches [ 64 ]
624
626
}
625
627
G . obtainiumGain *= Math . min ( 1 , Math . pow ( player . reincarnationcounter / 10 , 2 ) )
626
- G . obtainiumGain *= 1 + ( 1 / 25 ) * player . shopUpgrades . obtainiumEX
627
628
if ( player . reincarnationCount >= 5 ) {
628
629
G . obtainiumGain *= Math . max ( 1 , player . reincarnationcounter / 10 )
629
630
}
@@ -1398,6 +1399,8 @@ export const calculateOffline = async (forceTime = 0) => {
1398
1399
quarks : quarkHandler ( ) . gain // Calculate this after the fact
1399
1400
}
1400
1401
1402
+ cacheReinitialize ( )
1403
+
1401
1404
addTimers ( 'ascension' , timeAdd )
1402
1405
addTimers ( 'quarks' , timeAdd )
1403
1406
addTimers ( 'goldenQuarks' , timeAdd )
@@ -1777,7 +1780,7 @@ export const calculateAllCubeMultiplier = () => {
1777
1780
// Cash Grab Ultra
1778
1781
+ calculateCashGrabCubeBonus ( ) ,
1779
1782
// EX Ultra
1780
- + calculateEXUltraCubeBonus ( ) ,
1783
+ + calculateEXUltraCubeBonus ( )
1781
1784
// Total Global Cube Multipliers: 33
1782
1785
]
1783
1786
@@ -2117,7 +2120,7 @@ export const getOcteractValueMultipliers = () => {
2117
2120
// Cash Grab ULTRA
2118
2121
+ calculateCashGrabCubeBonus ( ) ,
2119
2122
// EX ULTRA
2120
- + calculateEXUltraCubeBonus ( ) ,
2123
+ + calculateEXUltraCubeBonus ( )
2121
2124
]
2122
2125
}
2123
2126
@@ -3225,7 +3228,7 @@ export const calculateAmbrosiaQuarkMult = () => {
3225
3228
}
3226
3229
3227
3230
export const calculateCashGrabBonus = ( extra : number ) => {
3228
- return 1 + player . shopUpgrades . shopCashGrabUltra * extra * Math . min ( 1 , Math . pow ( player . lifetimeAmbrosia / 1e7 , 1 / 3 ) )
3231
+ return 1 + player . shopUpgrades . shopCashGrabUltra * extra * Math . min ( 1 , Math . pow ( player . lifetimeAmbrosia / 1e7 , 1 / 3 ) )
3229
3232
}
3230
3233
3231
3234
export const calculateCashGrabBlueberryBonus = ( ) => {
@@ -3257,13 +3260,14 @@ export const calculateEXUltraCubeBonus = () => {
3257
3260
}
3258
3261
3259
3262
export const calculateEXALTBonusMult = ( ) => {
3260
- if ( ! player . singularityChallenges . limitedAscensions . rewards . exaltBonus )
3263
+ if ( ! player . singularityChallenges . limitedAscensions . rewards . exaltBonus ) {
3261
3264
return 1
3265
+ }
3262
3266
3263
3267
if ( G . currentSingChallenge !== undefined ) {
3264
3268
return Math . pow ( 1.04 , player . singularityChallenges [ G . currentSingChallenge ] . completions )
3265
3269
}
3266
- return 1
3270
+ return 1
3267
3271
}
3268
3272
3269
3273
export const calculateDilatedFiveLeafBonus = ( ) => {
@@ -3275,6 +3279,93 @@ export const calculateDilatedFiveLeafBonus = () => {
3275
3279
return singThresholds . length / 100
3276
3280
}
3277
3281
3282
+ /**
3283
+ * Computs Additive Luck Multiplier for Ambrosia Luck. Base = 1.00
3284
+ * @returns Additive Luck Multiplier and array of modifiers
3285
+ */
3286
+ export const calculateAdditiveLuckMult = ( ) => {
3287
+ const arr = [
3288
+ 1 ,
3289
+ + player . singularityChallenges . noSingularityUpgrades . rewards . luckBonus , // No Singularity Upgrade 1x30
3290
+ calculateDilatedFiveLeafBonus ( ) , // Dilated Five Leaf Clover Perk
3291
+ player . shopUpgrades . shopAmbrosiaLuckMultiplier4 / 100 , // EXALT-unlocked shop upgrade
3292
+ + player . singularityChallenges . noAmbrosiaUpgrades . rewards . luckBonus , // No Ambrosia Challenge Reward
3293
+ G . isEvent ? calculateEventBuff ( BuffType . AmbrosiaLuck ) : 0 // Event
3294
+ ]
3295
+
3296
+ return {
3297
+ value : sumContents ( arr ) ,
3298
+ array : arr
3299
+ }
3300
+ }
3301
+
3302
+ /**
3303
+ * Computs Ambrosia Luck. Base = 100
3304
+ * @returns Ambrosia Luck * Additive Luck Multiplier, and array of modifiers (last entry is multiplier)
3305
+ */
3306
+ export const calculateAmbrosiaLuck = ( ) => {
3307
+ const arr = [
3308
+ 100 , // Base
3309
+ calculateSingularityAmbrosiaLuckMilestoneBonus ( ) , // Ambrosia Luck Milestones
3310
+ calculateAmbrosiaLuckShopUpgrade ( ) , // Ambrosia Luck from Shop Upgrades (I-IV)
3311
+ calculateAmbrosiaLuckSingularityUpgrade ( ) , // Ambrosia Luck from Singularity Upgrades (I-IV)
3312
+ calculateAmbrosiaLuckOcteractUpgrade ( ) , // Ambrosia Luck from Octeract Upgrades (I-IV)
3313
+ + player . blueberryUpgrades . ambrosiaLuck1 . bonus . ambrosiaLuck , // Ambrosia Luck from Luck Module I
3314
+ + player . blueberryUpgrades . ambrosiaLuck2 . bonus . ambrosiaLuck , // Ambrosia Luck from Luck Module II
3315
+ + player . blueberryUpgrades . ambrosiaCubeLuck1 . bonus . ambrosiaLuck , // Ambrosia Luck from Cube-Luck Synergy Module
3316
+ + player . blueberryUpgrades . ambrosiaQuarkLuck1 . bonus . ambrosiaLuck , // Ambrosia Luck from Quark-Luck Synergy Module
3317
+ player . highestSingularityCount >= 131 ? 131 : 0 , // Singularity Perk "One Hundred Thirty One!"
3318
+ player . highestSingularityCount >= 269 ? 269 : 0 , // Singularity Perk "Two Hundred Sixty Nine!"
3319
+ player . shopUpgrades . shopOcteractAmbrosiaLuck * ( 1 + Math . floor ( Math . log10 ( player . totalWowOcteracts + 1 ) ) ) , // Octeract -> Ambrosia Shop Upgrade
3320
+ + player . singularityChallenges . noAmbrosiaUpgrades . rewards . additiveLuck // No Ambrosia Challenge Reward
3321
+ ]
3322
+
3323
+ const multiplicativeLuck = calculateAdditiveLuckMult ( ) . value
3324
+
3325
+ return {
3326
+ value : sumContents ( arr ) * multiplicativeLuck ,
3327
+ array : arr . concat ( multiplicativeLuck )
3328
+ }
3329
+ }
3330
+
3331
+ /**
3332
+ * Calculates the total number of Blueberries unlocked
3333
+ * @returns Blueberry Count, and array of modifiers
3334
+ */
3335
+ export const calculateBlueberryInventory = ( ) => {
3336
+ const arr = [
3337
+ + ( player . singularityChallenges . noSingularityUpgrades . completions > 0 ) , // E1x1 Clear!
3338
+ + player . singularityUpgrades . blueberries . getEffect ( ) . bonus , // Singularity Blueberry Upgrade
3339
+ calculateSingularityMilestoneBlueberries ( ) , // Singularity Milestones (Congealed Blueberries)
3340
+ + player . singularityChallenges . noAmbrosiaUpgrades . rewards . blueberries // No Ambrosia Challenge Reward
3341
+ ]
3342
+
3343
+ return {
3344
+ value : sumContents ( arr ) ,
3345
+ array : arr
3346
+ }
3347
+ }
3348
+
3349
+ export const calculateAmbrosiaGenerationSpeed = ( ) => {
3350
+ const arr = [
3351
+ + player . visitedAmbrosiaSubtab ,
3352
+ calculateBlueberryInventory ( ) . value ,
3353
+ calculateAmbrosiaGenerationShopUpgrade ( ) ,
3354
+ calculateAmbrosiaGenerationSingularityUpgrade ( ) ,
3355
+ calculateAmbrosiaGenerationOcteractUpgrade ( ) ,
3356
+ + player . blueberryUpgrades . ambrosiaPatreon . bonus . blueberryGeneration ,
3357
+ + player . singularityChallenges . oneChallengeCap . rewards . blueberrySpeedMult ,
3358
+ + player . singularityChallenges . noAmbrosiaUpgrades . rewards . blueberrySpeedMult ,
3359
+ G . isEvent ? 1 + calculateEventBuff ( BuffType . BlueberryTime ) : 1 ,
3360
+ calculateCashGrabBlueberryBonus ( )
3361
+ ]
3362
+
3363
+ return {
3364
+ value : productContents ( arr ) ,
3365
+ array : arr
3366
+ }
3367
+ }
3368
+
3278
3369
export const dailyResetCheck = ( ) => {
3279
3370
if ( ! player . dayCheck ) {
3280
3371
return
0 commit comments