Added pit progress

This commit is contained in:
2025-09-06 20:11:51 +02:00
parent d05da14259
commit 5b89183791
3 changed files with 28 additions and 1 deletions

View File

@@ -1,4 +1,4 @@
import { LEVELCOLORS, PRESTIGECOLORS } from "@/data/hypixel/pit"
import { LEVELCOLORS, PRESTIGE_MULTIPLIERS, PRESTIGECOLORS } from "@/data/hypixel/pit"
import { NonNullStats } from "@/lib/schema/player"
export function getLevelColor(level: number) {
@@ -17,6 +17,11 @@ export function getPrestigeColor(prestige: number) {
return PRESTIGECOLORS.at(0)!.color
}
export function getXpForPrestige(prestige: number): number {
if (prestige <= 0 || prestige > PRESTIGE_MULTIPLIERS.length) return 0
return PRESTIGE_MULTIPLIERS[prestige - 1].SumXp
}
export function getPrestige(stats: NonNullable<NonNullStats["Pit"]>) {
return stats.profile.prestiges === undefined ? 0 : stats.profile.prestiges.length
}