11import Decimal from 'break_infinity.js'
22import i18next from 'i18next'
3+ import { AntProducers , calculateLeaderboardValue , LAST_ANT } from './Ants'
34import { DOMCacheGetOrSet } from './Cache/DOM'
45import { CalcCorruptionStuff , calculateAscensionScore } from './Calculate'
56import { campaignTokens } from './Campaign'
@@ -241,6 +242,20 @@ export interface ProgressiveAchievement {
241242 displayCondition : ( ) => boolean
242243}
243244
245+ export type ProgressiveAchievements =
246+ | 'runeLevel'
247+ | 'freeRuneLevel'
248+ | 'antMasteries'
249+ | 'rebornELO'
250+ | 'talismanRarities'
251+ | 'singularityCount'
252+ | 'ambrosiaCount'
253+ | 'redAmbrosiaCount'
254+ | 'singularityUpgrades'
255+ | 'octeractUpgrades'
256+ | 'redAmbrosiaUpgrades'
257+ | 'exalts'
258+
244259export const progressiveAchievements : Record < ProgressiveAchievements , ProgressiveAchievement > = {
245260 runeLevel : {
246261 maxPointValue : 1000 ,
@@ -270,6 +285,44 @@ export const progressiveAchievements: Record<ProgressiveAchievements, Progressiv
270285 displayOrder : 2 ,
271286 displayCondition : ( ) => player . prestigeCount > 0
272287 } ,
288+ antMasteries : {
289+ maxPointValue : 324 ,
290+ pointsAwarded : ( _cached : number ) => {
291+ let pointValue = 0
292+ for ( let ant = AntProducers . Workers ; ant <= LAST_ANT ; ant ++ ) {
293+ pointValue += 3 * player . ants . producers [ ant ] . highestMastery
294+ }
295+ return pointValue
296+ } ,
297+ updateValue : ( ) => {
298+ let numMasteries = 0
299+ for ( let ant = AntProducers . Workers ; ant <= LAST_ANT ; ant ++ ) {
300+ numMasteries += player . ants . producers [ ant ] . highestMastery
301+ }
302+ return numMasteries
303+ } ,
304+ useCachedValue : false ,
305+ rewardedAP : 0 ,
306+ displayOrder : 3 ,
307+ displayCondition : ( ) => player . unlocks . anthill
308+ } ,
309+ rebornELO : {
310+ maxPointValue : 600 ,
311+ pointsAwarded : ( _cached : number ) => {
312+ const leaderboardELO = calculateLeaderboardValue ( player . ants . highestRebornELOEver )
313+ return Math . min ( 100 , Math . floor ( leaderboardELO / 100 ) )
314+ + Math . min ( 150 , Math . floor ( leaderboardELO / 1000 ) )
315+ + Math . min ( 150 , Math . floor ( leaderboardELO / 9000 ) )
316+ + Math . min ( 200 , Math . floor ( leaderboardELO / 75000 ) )
317+ } ,
318+ updateValue : ( ) => {
319+ return calculateLeaderboardValue ( player . ants . highestRebornELOEver )
320+ } ,
321+ useCachedValue : false ,
322+ rewardedAP : 0 ,
323+ displayOrder : 4 ,
324+ displayCondition : ( ) => player . unlocks . anthill
325+ } ,
273326 singularityCount : {
274327 maxPointValue : 3600 ,
275328 pointsAwarded : ( _cached : number ) => {
@@ -282,7 +335,7 @@ export const progressiveAchievements: Record<ProgressiveAchievements, Progressiv
282335 } ,
283336 useCachedValue : false ,
284337 rewardedAP : 0 ,
285- displayOrder : 4 ,
338+ displayOrder : 6 ,
286339 displayCondition : ( ) => player . highestSingularityCount > 0
287340 } ,
288341 ambrosiaCount : {
@@ -297,7 +350,7 @@ export const progressiveAchievements: Record<ProgressiveAchievements, Progressiv
297350 } ,
298351 useCachedValue : true ,
299352 rewardedAP : 0 ,
300- displayOrder : 8 ,
353+ displayOrder : 10 ,
301354 displayCondition : ( ) => player . highestSingularityCount >= 25
302355 } ,
303356 redAmbrosiaCount : {
@@ -312,7 +365,7 @@ export const progressiveAchievements: Record<ProgressiveAchievements, Progressiv
312365 } ,
313366 useCachedValue : true ,
314367 rewardedAP : 0 ,
315- displayOrder : 9 ,
368+ displayOrder : 11 ,
316369 displayCondition : ( ) => player . highestSingularityCount >= 150
317370 } ,
318371 exalts : {
@@ -349,7 +402,7 @@ export const progressiveAchievements: Record<ProgressiveAchievements, Progressiv
349402 cap8 : player . singularityChallenges . taxmanLastStand . maxAP
350403 }
351404 } ,
352- displayOrder : 7 ,
405+ displayOrder : 9 ,
353406 displayCondition : ( ) => player . highestSingularityCount >= 25
354407 } ,
355408 singularityUpgrades : {
@@ -369,7 +422,7 @@ export const progressiveAchievements: Record<ProgressiveAchievements, Progressiv
369422 } ,
370423 useCachedValue : false ,
371424 rewardedAP : 0 ,
372- displayOrder : 5 ,
425+ displayOrder : 7 ,
373426 displayCondition : ( ) => player . highestSingularityCount > 0
374427 } ,
375428 octeractUpgrades : {
@@ -389,7 +442,7 @@ export const progressiveAchievements: Record<ProgressiveAchievements, Progressiv
389442 } ,
390443 useCachedValue : false ,
391444 rewardedAP : 0 ,
392- displayOrder : 6 ,
445+ displayOrder : 8 ,
393446 displayCondition : ( ) => Boolean ( getGQUpgradeEffect ( 'octeractUnlock' ) )
394447 } ,
395448 redAmbrosiaUpgrades : {
@@ -408,7 +461,7 @@ export const progressiveAchievements: Record<ProgressiveAchievements, Progressiv
408461 } ,
409462 useCachedValue : false ,
410463 rewardedAP : 0 ,
411- displayOrder : 10 ,
464+ displayOrder : 12 ,
412465 displayCondition : ( ) => player . highestSingularityCount >= 150
413466 } ,
414467 talismanRarities : {
@@ -424,7 +477,7 @@ export const progressiveAchievements: Record<ProgressiveAchievements, Progressiv
424477 } ,
425478 useCachedValue : true ,
426479 rewardedAP : 0 ,
427- displayOrder : 3 ,
480+ displayOrder : 5 ,
428481 displayCondition : ( ) => player . unlocks . talismans
429482 }
430483}
@@ -1260,7 +1313,7 @@ export const achievements: Achievement[] = [
12601313 } ,
12611314 {
12621315 pointValue : 25 ,
1263- unlockCondition : ( ) => player . ants . crumbs . gte ( 1e100 ) ,
1316+ unlockCondition : ( ) => player . ants . crumbs . gte ( 1e70 ) ,
12641317 group : 'antCrumbs' ,
12651318 reward : { antSpeed : ( ) => 1.4 , antSacrificeUnlock : ( ) => 1 , antAutobuyers : ( ) => 1 }
12661319 } ,
@@ -1273,49 +1326,54 @@ export const achievements: Achievement[] = [
12731326 { pointValue : 35 , unlockCondition : ( ) => player . ants . crumbs . gte ( '1e2500' ) , group : 'antCrumbs' } ,
12741327 {
12751328 pointValue : 5 ,
1276- unlockCondition : ( ) => player . ants . immortalELO >= 50 && player . ants . purchased [ 1 ] > 0 ,
1329+ unlockCondition : ( ) => player . ants . immortalELO >= 50 && player . ants . producers [ AntProducers . Breeders ] . purchased > 0 ,
12771330 group : 'sacMult' ,
12781331 reward : { antAutobuyers : ( ) => 1 , antUpgradeAutobuyers : ( ) => 2 } ,
12791332 checkReset : ( ) => player . highestSingularityCount >= 10
12801333 } ,
12811334 {
12821335 pointValue : 10 ,
1283- unlockCondition : ( ) => player . ants . immortalELO >= 200 && player . ants . purchased [ 2 ] > 0 ,
1336+ unlockCondition : ( ) =>
1337+ player . ants . immortalELO >= 200 && player . ants . producers [ AntProducers . MetaBreeders ] . purchased > 0 ,
12841338 group : 'sacMult' ,
12851339 reward : { antAutobuyers : ( ) => 1 , antUpgradeAutobuyers : ( ) => 1 } ,
12861340 checkReset : ( ) => player . highestSingularityCount >= 10
12871341 } ,
12881342 {
12891343 pointValue : 15 ,
1290- unlockCondition : ( ) => player . ants . immortalELO >= 500 && player . ants . purchased [ 3 ] > 0 ,
1344+ unlockCondition : ( ) =>
1345+ player . ants . immortalELO >= 500 && player . ants . producers [ AntProducers . MegaBreeders ] . purchased > 0 ,
12911346 group : 'sacMult' ,
12921347 reward : { antAutobuyers : ( ) => 1 , antUpgradeAutobuyers : ( ) => 2 } ,
12931348 checkReset : ( ) => player . highestSingularityCount >= 10
12941349 } ,
12951350 {
12961351 pointValue : 20 ,
1297- unlockCondition : ( ) => player . ants . immortalELO >= 1000 && player . ants . purchased [ 4 ] > 0 ,
1352+ unlockCondition : ( ) => player . ants . immortalELO >= 1000 && player . ants . producers [ AntProducers . Queens ] . purchased > 0 ,
12981353 group : 'sacMult' ,
12991354 reward : { antAutobuyers : ( ) => 1 , antUpgradeAutobuyers : ( ) => 1 } ,
13001355 checkReset : ( ) => player . highestSingularityCount >= 10
13011356 } ,
13021357 {
13031358 pointValue : 25 ,
1304- unlockCondition : ( ) => player . ants . immortalELO >= 2500 && player . ants . purchased [ 5 ] > 0 ,
1359+ unlockCondition : ( ) =>
1360+ player . ants . immortalELO >= 2500 && player . ants . producers [ AntProducers . LordRoyals ] . purchased > 0 ,
13051361 group : 'sacMult' ,
13061362 reward : { antAutobuyers : ( ) => 1 , antUpgradeAutobuyers : ( ) => 2 } ,
13071363 checkReset : ( ) => player . highestSingularityCount >= 10
13081364 } ,
13091365 {
13101366 pointValue : 30 ,
1311- unlockCondition : ( ) => player . ants . immortalELO >= 20000 && player . ants . purchased [ 6 ] > 0 ,
1367+ unlockCondition : ( ) =>
1368+ player . ants . immortalELO >= 20000 && player . ants . producers [ AntProducers . Almighties ] . purchased > 0 ,
13121369 group : 'sacMult' ,
13131370 reward : { antAutobuyers : ( ) => 1 , antUpgradeAutobuyers : ( ) => 1 } ,
13141371 checkReset : ( ) => player . highestSingularityCount >= 10
13151372 } ,
13161373 {
13171374 pointValue : 35 ,
1318- unlockCondition : ( ) => player . ants . immortalELO >= 100000 && player . ants . purchased [ 7 ] > 0 ,
1375+ unlockCondition : ( ) =>
1376+ player . ants . immortalELO >= 100000 && player . ants . producers [ AntProducers . Disciples ] . purchased > 0 ,
13191377 group : 'sacMult' ,
13201378 reward : { antAutobuyers : ( ) => 1 , antUpgradeAutobuyers : ( ) => 2 } ,
13211379 checkReset : ( ) => player . highestSingularityCount >= 10
@@ -1823,7 +1881,9 @@ export const achievements: Achievement[] = [
18231881 } ,
18241882 {
18251883 pointValue : 50 ,
1826- unlockCondition : ( ) => player . ants . immortalELO >= 5000000 ,
1884+ unlockCondition : ( ) =>
1885+ player . ants . immortalELO >= 5000000 && player . ants . producers [ AntProducers . HolySpirit ] . purchased > 0 ,
1886+ reward : { antAutobuyers : ( ) => 1 } ,
18271887 group : 'sacMult'
18281888 } ,
18291889 { pointValue : 75 , unlockCondition : ( ) => player . ascensionCount >= 1e16 , group : 'ascensionCount' } ,
@@ -2711,18 +2771,6 @@ export const ungroupedAchievementData: Record<UngroupedAchievementNames, Ungroup
27112771
27122772export const ungroupedAchievementKeys = Object . keys ( ungroupedAchievementData ) as UngroupedAchievementNames [ ]
27132773
2714- export type ProgressiveAchievements =
2715- | 'runeLevel'
2716- | 'freeRuneLevel'
2717- | 'talismanRarities'
2718- | 'singularityCount'
2719- | 'ambrosiaCount'
2720- | 'redAmbrosiaCount'
2721- | 'singularityUpgrades'
2722- | 'octeractUpgrades'
2723- | 'redAmbrosiaUpgrades'
2724- | 'exalts'
2725-
27262774export const numAchievements = Object . keys ( achievements ) . length
27272775export const maxAchievementPoints = Object . values ( achievements ) . reduce ( ( sum , ach ) => sum + ach . pointValue , 0 )
27282776 + Object . values ( progressiveAchievements )
0 commit comments