generated from nhcarrigan/template
fix: integer formatting, exploration durations, runestone preview, and gold achievement tracking
Closes #199 Closes #203 Closes #204 Closes #219 Closes #220 Closes #231 Closes #232
This commit is contained in:
@@ -15,6 +15,7 @@ import { updateChallengeProgress } from "../services/dailyChallenges.js";
|
||||
import { logger } from "../services/logger.js";
|
||||
import {
|
||||
buildPostPrestigeState,
|
||||
calculatePrestigeThreshold,
|
||||
computeRunestoneMultipliers,
|
||||
isEligibleForPrestige,
|
||||
} from "../services/prestige.js";
|
||||
@@ -40,10 +41,15 @@ prestigeRouter.post("/", async(context) => {
|
||||
const state = record.state as unknown as GameState;
|
||||
|
||||
if (!isEligibleForPrestige(state)) {
|
||||
const thresholdMultiplier
|
||||
= state.transcendence?.echoPrestigeThresholdMultiplier ?? 1;
|
||||
const required = calculatePrestigeThreshold(
|
||||
state.prestige.count,
|
||||
thresholdMultiplier,
|
||||
);
|
||||
return context.json(
|
||||
{
|
||||
// eslint-disable-next-line stylistic/max-len -- Error message cannot be shortened
|
||||
error: "Not eligible for prestige — collect 1,000,000 total gold first",
|
||||
error: `Not eligible for prestige — collect ${required.toLocaleString()} total gold first`,
|
||||
},
|
||||
400,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user