feat: v0.6.0 balance pass, quest-gated bosses, and achievement fixes

This commit is contained in:
2026-07-17 01:02:12 -05:00
parent 9bb1d01d2b
commit 5928eb73d8
49 changed files with 1836 additions and 528 deletions
+17 -5
View File
@@ -68,10 +68,22 @@ transcendenceRouter.post("/", async(context) => {
}
// eslint-disable-next-line capitalized-comments -- v8 ignore
/* v8 ignore next 3 -- @preserve */
const runAchievementsUnlocked = state.achievements.filter((achievement) => {
return achievement.unlockedAt !== null;
}).length;
/* v8 ignore next 5 -- @preserve */
const totalAchievementsUnlocked = state.achievements.filter(
(achievement) => {
return achievement.unlockedAt !== null;
},
).length;
/*
* Achievements now persist across resets, so `totalAchievementsUnlocked`
* already includes everything counted at previous resets — only the
* delta since then should be folded into the lifetime stat.
*/
const achievementsUnlockedDelta = Math.max(
0,
totalAchievementsUnlocked - state.player.lifetimeAchievementsUnlocked,
);
const now = Date.now();
await prisma.gameState.update({
@@ -86,7 +98,7 @@ transcendenceRouter.post("/", async(context) => {
lastSavedAt: now,
lifetimeAchievementsUnlocked: { increment: runAchievementsUnlocked },
lifetimeAchievementsUnlocked: { increment: achievementsUnlockedDelta },
lifetimeAdventurersRecruited: { increment: runAdventurersRecruited },