fix: preserve all-time stats, achievements, and boss first-kill across prestige #47

Merged
naomi merged 3 commits from fix/prestige-resets into main 2026-03-09 21:53:59 -07:00

3 Commits

Author SHA1 Message Date
hikari 35e4d71d98 fix: preserve boss first-kill state across prestige
CI / Lint, Build & Test (pull_request) Successful in 1m10s
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 1m11s
Fixes #39. Added bountyRunestonesClaimed?: boolean to the Boss type.
The first-kill bounty runestones are now only awarded once across all
prestige resets — the boss route checks the flag before awarding, sets
it on first defeat, and buildPostPrestigeState carries the flag forward
through fresh boss state on prestige. The boss panel badge no longer
shows for bosses whose bounty has already been claimed.
2026-03-09 21:35:03 -07:00
hikari f2d82d58fc fix: preserve achievements across prestige
Fixes #38. buildPostPrestigeState was using structuredClone(defaultAchievements)
via the freshState, which reset all achievements on every prestige. Achievements
are now carried forward from currentState.achievements instead, ensuring unlocked
achievements are never lost across prestige resets.
2026-03-09 21:31:06 -07:00
hikari 062e5b59a6 fix: preserve lifetime player stats across prestige
Fixes #37. After prestige, the GameState's player.lifetime* fields were
stale — they did not include the current run's contributions. The Prisma
Player record was updated correctly, but the saved GameState had old values,
so the UI showed stale all-time totals on reload.

buildPostPrestigeState now computes run-stat contributions and folds them
into the fresh player object before writing the prestige state, ensuring
the GameState is always consistent with the DB Player record.
2026-03-09 21:28:16 -07:00