Some checks failed
Deploy to Production / test (push) Failing after 33s
- Rewrite AGENTS and README files to match the current app layout - Document API routes, trivia UI, and the active panel design language
740 B
740 B
Leveling module
Model
- total XP is the source of truth
- level is derived from XP on each award
- XP curve is driven by
config.leveling.baseandconfig.leveling.exponent
Main methods
getXpToReachLevel(level)getLevelFromXp(totalXp)getXpForNextLevel(currentLevel)addXp(userId, amount)processChatXp(userId)
Chat XP
- gated by a
user_timerscooldown onTimerKey.CHAT_XP - base award is random between
config.leveling.chat.minXpandmaxXp - active XP boost timers can multiply the award
Notes
addXp()emitsXP_GAINEDfor quest progression- the level curve currently converts
bigintXP tonumberfor the math loop, so extremely large totals would be the stress point to watch