Finished first column of duels stats

This commit is contained in:
2025-09-01 20:13:49 +02:00
parent 22eb67d5d1
commit 542cdc1cd8
4 changed files with 58 additions and 2 deletions

View File

@@ -2,6 +2,11 @@ import { DIVISIONS, MODES } from "@/data/hypixel/duels"
import { NonNullStats } from "@/lib/schema/player"
type DuelType = "all_modes"
export type Div = {
name: typeof DIVISIONS[number]["name"]
level: number
color: typeof DIVISIONS[number]["color"]
}
export function getDivision(duelType: DuelType, stats: NonNullable<NonNullStats["Duels"]>) {
for (const div of DIVISIONS.slice().reverse()) {

View File

@@ -272,6 +272,12 @@ export const skywarsStatsSchema = z.looseObject({
export const duelsStatsSchema = z.looseObject({
wins: z.number().default(0),
losses: z.number().default(0),
coins: z.number().default(0),
kills: z.number().default(0),
deaths: z.number().default(0),
melee_swings: z.number().default(0),
melee_hits: z.number().default(0),
//
all_modes_rookie_title_prestige: z.number().default(-1),
all_modes_iron_title_prestige: z.number().default(-1),
all_modes_gold_title_prestige: z.number().default(-1),