Updates speed uhc stats
This commit is contained in:
17
src/lib/hypixel/speeduhc/general.ts
Normal file
17
src/lib/hypixel/speeduhc/general.ts
Normal 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
|
||||
}
|
||||
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user