generated from nhcarrigan/template
fix: preserve all-time stats, achievements, and boss first-kill across prestige #47
Reference in New Issue
Block a user
Delete Branch "fix/prestige-resets"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Resolves #37, resolves #38, and resolves #39 — three related bugs where prestige incorrectly reset data that should survive all prestige resets.
Changes
fix: preserve lifetime player stats across prestige (#37)
After prestige,
GameState.player.lifetime*fields were stale — they reflected values from before the current run. The Prisma Player record was incremented correctly, but the GameState JSON saved to the DB had old values, so the UI showed wrong all-time totals on reload.buildPostPrestigeStatenow computes the run-stat contributions (bosses defeated, quests completed, adventurers recruited, achievements unlocked, gold earned, clicks) and folds them into the fresh player object before writing the prestige state.fix: preserve achievements across prestige (#38)
buildPostPrestigeStatewas reconstructing achievements fromdefaultAchievements(viainitialGameState), resetting all unlocked achievements on every prestige. Achievements are now carried forward fromcurrentState.achievementsinstead.fix: preserve boss first-kill state across prestige (#39)
Added
bountyRunestonesClaimed?: booleanto theBosstype. The boss challenge route now:bountyRunestonesClaimed !== truebountyRunestonesClaimed = trueon first defeatbuildPostPrestigeStatemaps the fresh boss list and carries thebountyRunestonesClaimedflag forward from the current state, so the bounty is never re-awarded in subsequent prestige runs. The boss panel badge is also hidden for bosses whose bounty is already claimed.Test Coverage
All three fixes include new tests covering the new behaviours. API coverage remains at 100%.
✨ This PR was created with help from Hikari~ 🌸