-
-
Notifications
You must be signed in to change notification settings - Fork 202
/
Copy pathCalculate.ts
2015 lines (1800 loc) · 93.8 KB
/
Calculate.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import { player, saveSynergy, format, resourceGain, updateAll, getTimePinnedToLoadDate } from './Synergism';
import { sumContents, productContents, calculateContents } from './Utility';
import { Globals as G } from './Variables';
import { CalcECC } from './Challenges';
import Decimal from 'break_infinity.js';
import { toggleTalismanBuy, updateTalismanInventory } from './Talismans';
import { reset } from './Reset';
import { achievementaward } from './Achievements';
import type { resetNames } from './types/Synergism';
import { hepteractEffective } from './Hepteracts';
import { addTimers, automaticTools } from './Helper';
import { Alert, Prompt } from './UpdateHTML';
import { quarkHandler } from './Quark';
import { DOMCacheGetOrSet } from './Cache/DOM';
import { calculateSingularityDebuff } from './singularity';
import { calculateEventSourceBuff } from './Event';
import { disableHotkeys, enableHotkeys } from './Hotkeys';
import { setInterval, clearInterval } from './Timers';
import { getFastForwardTotalMultiplier } from './singularity';
export const calculateTotalCoinOwned = () => {
G['totalCoinOwned'] =
player.firstOwnedCoin +
player.secondOwnedCoin +
player.thirdOwnedCoin +
player.fourthOwnedCoin +
player.fifthOwnedCoin;
}
export const calculateTotalAcceleratorBoost = () => {
let b = 0
if (player.upgrades[26] > 0.5) {
b += 1;
}
if (player.upgrades[31] > 0.5) {
b += Math.floor(G['totalCoinOwned'] / 2000) * 100 / 100
}
if (player.achievements[7] > 0.5) {
b += Math.floor(player.firstOwnedCoin / 2000)
}
if (player.achievements[14] > 0.5) {
b += Math.floor(player.secondOwnedCoin / 2000)
}
if (player.achievements[21] > 0.5) {
b += Math.floor(player.thirdOwnedCoin / 2000)
}
if (player.achievements[28] > 0.5) {
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;
}
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'] *= Math.pow(1.01, 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) {
G['acceleratorMultiplier'] *= 1.25
}
}
export const calculateRecycleMultiplier = () => {
// Factors where recycle bonus comes from
const recycleFactors = sumContents([
0.05 * player.achievements[80],
0.05 * player.achievements[87],
0.05 * player.achievements[94],
0.05 * player.achievements[101],
0.05 * player.achievements[108],
0.05 * player.achievements[115],
0.075 * player.achievements[122],
0.075 * player.achievements[129],
0.05 * player.upgrades[61],
0.25 * Math.min(1, G['rune4level'] / 400),
0.005 * player.cubeUpgrades[2]
]);
return 1 / (1 - recycleFactors);
}
export function calculateRuneExpGiven(runeIndex: number, all: boolean, runeLevel: number, returnFactors: true): number[];
export function calculateRuneExpGiven(runeIndex: number, all: boolean, runeLevel: number, returnFactors: false): number;
export function calculateRuneExpGiven(runeIndex: number, all: boolean, runeLevel: number): number;
export function calculateRuneExpGiven(runeIndex: number, all: boolean): 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();
// Rune multiplier that is summed instead of added
let allRuneExpAdditiveMultiplier: number | null = null;
if (all) {
allRuneExpAdditiveMultiplier = sumContents([
//Challenge 3 completions
1 / 100 * player.highestchallengecompletions[3],
//Reincarnation 2x1
1 * player.upgrades[66]
]);
} else {
allRuneExpAdditiveMultiplier = sumContents([
// Base amount multiplied per offering
1,
// +1 if C1 completion
Math.min(1, player.highestchallengecompletions[1]),
// +0.10 per C1 completion
0.4 / 10 * player.highestchallengecompletions[1],
// Research 5x2
0.6 * player.researches[22],
// Research 5x3
0.3 * player.researches[23],
// Particle Upgrade 1x1
2 * player.upgrades[61],
// Particle upgrade 3x1
player.upgrades[71] * runeLevel / 25
]);
}
// Rune multiplier that gets applied to all runes
const allRuneExpMultiplier = productContents([
// Research 4x16
1 + (player.researches[91] / 20),
// Research 4x17
1 + (player.researches[92] / 20),
// Ant 8
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]),
// Constant Upgrade Multiplier
1 + 1 / 10 * player.constantUpgrades[8],
// Challenge 15 reward multiplier
G['challenge15Rewards'].runeExp
]);
// Corruption Divisor
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
]),
productContents([
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
]),
productContents([
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
]),
productContents([1]),
productContents([1])
];
const fact = [
allRuneExpAdditiveMultiplier,
allRuneExpMultiplier,
recycleMultiplier,
runeExpMultiplier[runeIndex]
];
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,
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))
]);
return allRuneExpRequiredMultiplier
}
let lookupTableRuneExp: number[] | null = null;
// Returns the amount of exp required to level a rune
export const calculateRuneExpToLevel = (runeIndex: number, runeLevel = player.runelevels[runeIndex]) => {
lookupTableRuneExp ??= Array.from({ length: 40000 }, (_, i) => lookupTableGen(i));
// For runes 6 and 7 we will apply a special multiplier
let multiplier = lookupTableRuneExp[runeLevel]
if (runeIndex === 5) {
multiplier = Math.pow(100, runeLevel)
}
if (runeIndex === 6) {
multiplier = Math.pow(1e25, runeLevel) * (player.singularityCount + 1)
}
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])
const increaseMaxLevel = [
null,
10 * (player.researches[78] + player.researches[111]) + increaseAll,
10 * (player.researches[80] + player.researches[112]) + increaseAll,
10 * (player.researches[79] + player.researches[113]) + increaseAll,
10 * (player.researches[77] + player.researches[114]) + increaseAll,
10 * player.researches[115] + increaseAll,
-901,
-999
]
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): 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;
if (input == 'reincarnation' || input == 'reincarnationChallenge') {
a += 3
if (player.achievements[52] > 0.5) {
a += (25 * Math.min(player.reincarnationcounter / 1800, 1))
}
if (player.upgrades[62] > 0.5) {
a += 1 / 50 * (sumContents(player.challengecompletions))
}
a += 0.6 * player.researches[25]
if (player.researches[95] === 1) {
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)
if (player.reincarnationcounter >= 5) {
a *= Math.max(1, player.reincarnationcounter / 10)
}
}
if (input == 'transcension' || input == 'transcensionChallenge' || input == 'reincarnation' ||
input == 'reincarnationChallenge') {
b += 2
if (player.reincarnationCount > 0) {
b += 2
}
if (player.achievements[44] > 0.5) {
b += (15 * Math.min(player.transcendcounter / 1800, 1))
}
if (player.challengecompletions[2] > 0) {
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)
if (player.transcendCount >= 5) {
b *= Math.max(1, player.transcendcounter / 10)
}
}
// This will always be calculated if '0' is not already returned
c += 1
if (player.transcendCount > 0 || player.reincarnationCount > 0) {
c += 1
}
if (player.reincarnationCount > 0) {
c += 2
}
if (player.achievements[37] > 0.5) {
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)
if (player.prestigeCount >= 5) {
c *= Math.max(1, player.prestigecounter / 10)
}
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:
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 + 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.05 * player.cubeUpgrades[46], // Cube Upgrade 5x6
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
G['challenge15Rewards'].offering, // C15 Reward
1 + 5 * (player.singularityUpgrades.starterPack.getEffect().bonus ? 1 : 0), // Starter Pack Upgrade
+player.singularityUpgrades.singOfferings1.getEffect().bonus, // Offering Charge GQ Upgrade
+player.singularityUpgrades.singOfferings2.getEffect().bonus, // Offering Storm GQ Upgrade
+player.singularityUpgrades.singOfferings3.getEffect().bonus, // Offering Tempest GQ Upgrade
+player.singularityUpgrades.singCitadel.getEffect().bonus, // Citadel GQ Upgrade
1 + player.cubeUpgrades[54] / 100, // Cube upgrade 6x4 (Cx4)
+player.octeractUpgrades.octeractOfferings1.getEffect().bonus, // Offering Electrolosis OC Upgrade
1 + calculateEventBuff('Offering') // Event
];
if (calcMult) {
q *= productContents(arr)
} else {
return arr;
}
if (statistic) {
return productContents(arr)
}
q /= calculateSingularityDebuff('Offering');
q = Math.floor(q) * 100 / 100
if (player.currentChallenge.ascension === 15) {
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 = Math.min(1e300, q);
let persecond = 0;
if (input === 'prestige') {
persecond = q / (1 + player.prestigecounter)
}
if (input === 'transcension' || input == 'transcensionChallenge') {
persecond = q / (1 + player.transcendcounter)
}
if (input === 'reincarnation' || input == 'reincarnationChallenge') {
persecond = q / (1 + player.reincarnationcounter)
}
if (persecond > player.offeringpersecond) {
player.offeringpersecond = persecond
}
return q;
}
export const calculateObtainium = () => {
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())
}
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]))
}
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])
if (player.achievements[53] > 0) {
G['obtainiumGain'] *= (1 + 1 / 800 * (G['runeSum']))
}
if (player.achievements[128]) {
G['obtainiumGain'] *= 1.5
}
if (player.achievements[129]) {
G['obtainiumGain'] *= 1.25
}
if (player.achievements[51] > 0) {
G['obtainiumGain'] += 4
}
if (player.reincarnationcounter >= 2) {
G['obtainiumGain'] += 1 * player.researches[63]
}
if (player.reincarnationcounter >= 5) {
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)
if (player.reincarnationCount >= 5) {
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(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['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('Obtainium');
G['obtainiumGain'] *= +player.singularityUpgrades.singCitadel.getEffect().bonus;
G['obtainiumGain'] *= +player.octeractUpgrades.octeractObtainium1.getEffect().bonus;
G['obtainiumGain'] *= Math.pow(1.02, player.shopUpgrades.obtainiumEX3);
if (player.currentChallenge.ascension === 15) {
G['obtainiumGain'] += 1;
G['obtainiumGain'] *= (1 + 7 * player.cubeUpgrades[62])
}
if (!isFinite(G['obtainiumGain'])) {
G['obtainiumGain'] = 1e300;
}
G['obtainiumGain'] = Math.min(1e300, G['obtainiumGain']);
G['obtainiumGain'] /= calculateSingularityDebuff('Obtainium');
if (player.usedCorruptions[5] >= 15) {
G['obtainiumGain'] = Math.pow(G['obtainiumGain'], 1/4)
}
if (player.usedCorruptions[5] >= 16) {
G['obtainiumGain'] = Math.pow(G['obtainiumGain'], 1/3)
}
G['obtainiumGain'] = Math.max(1 + player.singularityCount, G['obtainiumGain']);
if (player.currentChallenge.ascension === 14) {
G['obtainiumGain'] = 0
}
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);
}
// TODO: REFACTOR THIS - May 15, 2022.
export const calculateTalismanEffects = () => {
let positiveBonus = 0;
let negativeBonus = 0;
if (player.achievements[135] === 1) {
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]
if (player.singularityCount >= 7) {
positiveBonus += negativeBonus;
negativeBonus = positiveBonus
}
if (player.singularityCount < 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
} else {
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
} else {
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
} else {
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
} else {
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
} else {
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
} else {
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
} else {
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
}
}
const talismansEffects = [G['talisman1Effect'], G['talisman2Effect'], G['talisman3Effect'], G['talisman4Effect'], G['talisman5Effect'], G['talisman6Effect'], 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;
if (player.talismanRarity[1-1] === 6) {
G['rune2Talisman'] += 400;
}
if (player.talismanRarity[2-1] === 6) {
G['rune1Talisman'] += 400;
}
if (player.talismanRarity[3-1] === 6) {
G['rune4Talisman'] += 400;
}
if (player.talismanRarity[4-1] === 6) {
G['rune3Talisman'] += 400;
}
if (player.talismanRarity[5-1] === 6) {
G['rune5Talisman'] += 400;
}
if (player.talismanRarity[6-1] === 6) {
G['talisman6Power'] = 2.5;
}
if (player.talismanRarity[7-1] === 6) {
G['talisman7Quarks'] = 2;
}
}
export const calculateRuneLevels = () => {
calculateTalismanEffects();
if (player.currentChallenge.reincarnation !== 9) {
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])
G['rune2level'] = Math.max(1, 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])
G['rune4level'] = Math.max(1, 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();
}
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)
if (player.researches[160] > 0) {
G['blessingMultiplier'] *= Math.pow(1.25, 8)
}
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'] *= (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]
}
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
} 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
}
if (G['runeSpirits'][i] <= 1e25) {
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
}
}
}
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;
if (player.currentChallenge.ascension === 11) {
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)));
}
G['bonusant1'] = Math.min(player.antUpgrades[1-1]! + c11, 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)
G['bonusant3'] = Math.min(player.antUpgrades[3-1]! + c11, 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)
G['bonusant5'] = Math.min(player.antUpgrades[5-1]! + c11, 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)
G['bonusant7'] = Math.min(player.antUpgrades[7-1]! + c11, 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)
G['bonusant9'] = Math.min(player.antUpgrades[9-1]! + c11, 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)
G['bonusant11'] = Math.min(player.antUpgrades[11-1]! + c11, 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)
}
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)
if (player.achievements[176] === 1) {
G['antELO'] += 25
}
if (player.achievements[177] === 1) {
G['antELO'] += 50
}
if (player.achievements[178] === 1) {
G['antELO'] += 75
}
if (player.achievements[179] === 1) {
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])
}
}
const calculateAntSacrificeMultipliers = () => {
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))
}
if (player.achievements[177] > 0) {
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);
if (player.achievements[132] === 1) {
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('Ant Sacrifice'));
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
}
export const calculateAntSacrificeRewards = (): IAntSacRewards => {
calculateAntSacrificeELO();
calculateAntSacrificeMultipliers();
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;
}
export const timeWarp = async () => {
const time = await Prompt('How far in the future would you like to go into the future? Anything awaits when it is testing season.');
const timeUse = Number(time);
if (
Number.isNaN(timeUse) ||
timeUse <= 0
) {
return Alert('Hey! That\'s not a valid time!');
}
DOMCacheGetOrSet('offlineContainer').style.display = 'flex'
DOMCacheGetOrSet('offlineBlur').style.display = ''
await calculateOffline(timeUse)
}
export const calculateOffline = async (forceTime = 0) => {
disableHotkeys();
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 = 'You have ' + format(timeAdd, 0) + ' seconds of Offline Progress!';
//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();
const offlineDialog = player.offlinetick > 0;
player.offlinetick = (player.offlinetick < 1.5e12) ? (Date.now()) : player.offlinetick;
G['timeMultiplier'] = calculateTimeAcceleration();
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']
};
const timerAdd = {
prestige: timeAdd * G['timeMultiplier'],
transcension: timeAdd * G['timeMultiplier'],
reincarnation: timeAdd * G['timeMultiplier'],
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);
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();
calculateObtainium();
//Reset Stuff lmao!
addTimers('prestige', timeTick);
addTimers('transcension', timeTick);
addTimers('reincarnation', timeTick);
addTimers('octeracts', timeTick);
resourceGain(timeTick * G['timeMultiplier']);
//Auto Obtainium Stuff
if (player.researches[61] > 0 && player.currentChallenge.ascension !== 14) {
automaticTools('addObtainium', timeTick);
}
//Auto Ant Sacrifice Stuff
if (player.achievements[173] > 0) {
automaticTools('antSacrifice', timeTick);
}
//Auto Offerings
automaticTools('addOfferings', timeTick);
//Auto Rune Sacrifice Stuff
if (player.shopUpgrades.offeringAuto > 0 && player.autoSacrificeToggle) {
automaticTools('runeSacrifice', timeTick);
}
if (resourceTicks % 5 === 1) {
// 196, 191, ... , 6, 1 ticks remaining
updateAll();
}
resourceTicks -= 1;
//Misc functions
if (resourceTicks < 1) {
clearInterval(runOffline);
G['timeWarp'] = false;
}
}, 0);
DOMCacheGetOrSet('offlinePrestigeCountNumber').textContent = format(resetAdd.prestige, 0, true)
DOMCacheGetOrSet('offlinePrestigeTimerNumber').textContent = format(timerAdd.prestige, 2, false)
DOMCacheGetOrSet('offlineOfferingCountNumber').textContent = format(resetAdd.offering, 0, true)
DOMCacheGetOrSet('offlineTranscensionCountNumber').textContent = format(resetAdd.transcension, 0, true)
DOMCacheGetOrSet('offlineTranscensionTimerNumber').textContent = format(timerAdd.transcension, 2, false)
DOMCacheGetOrSet('offlineReincarnationCountNumber').textContent = format(resetAdd.reincarnation, 0, true)
DOMCacheGetOrSet('offlineReincarnationTimerNumber').textContent = format(timerAdd.reincarnation, 2, false)
DOMCacheGetOrSet('offlineObtainiumCountNumber').textContent = format(resetAdd.obtainium, 0, true)
DOMCacheGetOrSet('offlineAntTimerNumber').textContent = format(timerAdd.ants, 2, false)
DOMCacheGetOrSet('offlineRealAntTimerNumber').textContent = format(timerAdd.antsReal, 2, true)
DOMCacheGetOrSet('offlineAscensionTimerNumber').textContent = format(timerAdd.ascension, 2, true)
DOMCacheGetOrSet('offlineQuarkCountNumber').textContent = format(timerAdd.quarks, 0, true)
DOMCacheGetOrSet('progressbardescription').textContent = 'You have gained the following from offline progression!'
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)
}
player.loadedNov13Vers = true
}
await saveSynergy();
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');