Updates speed uhc stats

This commit is contained in:
2025-09-17 15:17:18 +02:00
parent a9125d255c
commit cdc13c1258
7 changed files with 115 additions and 3 deletions

View File

@@ -0,0 +1,17 @@
import { TITLES } from "@/data/hypixel/speeduhc"
export function getSpeedUHCStar(score: number) {
for (let i = 0; i < TITLES.length; i++) {
if (score < TITLES[i].value) {
return i + (score - TITLES[i - 1].value) / (TITLES[i].value - TITLES[i - 1].value)
}
}
return TITLES.length
}
export function getSpeedUHCScore(level: number) {
if (level > TITLES.length) return TITLES.at(-1)!.value
if (level === 0) return TITLES.at(0)!.value
return TITLES.at(level - 1)!.value
}

View File

@@ -10,6 +10,7 @@ import {
murderMysteryStatsSchema,
pitStats,
skywarsStatsSchema,
speedUhcStatsSchema,
tntGamesStatsSchema,
uhcSchema,
woolGamesStatsSchema
@@ -40,7 +41,8 @@ export const playerSchema = z.looseObject({
MCGO: copsAndCrimsStatsSchema.optional(),
WoolGames: woolGamesStatsSchema.optional(),
HungerGames: blitzStatsSchema.optional(),
Arcade: arcadeStatsSchema.optional()
Arcade: arcadeStatsSchema.optional(),
SpeedUHC: speedUhcStatsSchema.optional()
}).transform(({ Walls3, MCGO, HungerGames, ...rest }) => {
return {
MegaWalls: Walls3,

View File

@@ -1047,3 +1047,11 @@ export const arcadeStatsSchema = z.object({
...arcadeZombiesModeStats(),
...arcadeZombiesTypeStats()
})
export const speedUhcStatsSchema = z.object({
kills: z.number().default(0),
deaths: z.number().default(0),
wins: z.number().default(0),
losses: z.number().default(0),
score: z.number().default(0)
})