Updated wool games stats

This commit is contained in:
2025-09-12 12:42:20 +02:00
parent 66277a90dc
commit 2e32e72852
4 changed files with 34 additions and 9 deletions

View File

@@ -47,7 +47,6 @@ export default function WoolGamesStats({ stats }: { stats: NonNullStats["WoolGam
<WoolGamesSheepWars sw={stats.sheep_wars} /> <WoolGamesSheepWars sw={stats.sheep_wars} />
<Separator className="my-4" /> <Separator className="my-4" />
<WoolGamesWoolWars ww={stats.wool_wars} /> <WoolGamesWoolWars ww={stats.wool_wars} />
<Separator className="my-4" />
<WoolGamesStatTable stats={stats} /> <WoolGamesStatTable stats={stats} />
<Separator className="my-4" /> <Separator className="my-4" />
</GeneralStats> </GeneralStats>

View File

@@ -26,12 +26,12 @@ export const ICONS = {
YIN_YANG: "\u262f" // ☯ YIN_YANG: "\u262f" // ☯
} as const } as const
export const CLASSES = [ export const CLASSES = [
{ id: "TANK", name: "Tank", difficulty: 1 }, { id: "tank", name: "Tank", difficulty: 1 },
{ id: "ARCHER", name: "Archer", difficulty: 2 }, { id: "archer", name: "Archer", difficulty: 2 },
{ id: "SWORDSMAN", name: "Swordsman", difficulty: 1 }, { id: "swordsman", name: "Swordsman", difficulty: 1 },
{ id: "ENGINEER", name: "Engineer", difficulty: 1 }, { id: "engineer", name: "Engineer", difficulty: 1 },
{ id: "GOLEM", name: "Golem", difficulty: 2 }, { id: "golem", name: "Golem", difficulty: 2 },
{ id: "ASSAULT", name: "Assault", difficulty: 3 } { id: "assault", name: "Assault", difficulty: 3 }
] as const ] as const
export const DIFFICULTIES = { export const DIFFICULTIES = {
"1": "green", "1": "green",

View File

@@ -1,9 +1,18 @@
import { CLASSES, DIFFICULTIES, EASY_XP, ICONS, NORMAL_XP, PRESTIGES } from "@/data/hypixel/woolgames" import { CLASSES, DIFFICULTIES, EASY_XP, ICONS, NORMAL_XP, PRESTIGES } from "@/data/hypixel/woolgames"
import { getColorFromCode } from "@/lib/colors" import { getColorFromCode } from "@/lib/colors"
import { NonNullStats } from "@/lib/schema/player"
import { floorLevel } from "../general" import { floorLevel } from "../general"
export function getWoolGamesWoolWarsClassStats(
classId: typeof CLASSES[number]["id"],
{ stats }: NonNullable<NonNullable<NonNullStats["WoolGames"]>["wool_wars"]>
) {
const id = classId.toLowerCase()
return []
}
export function getWoolGamesWoolWarsClass(val?: string) { export function getWoolGamesWoolWarsClass(val?: string) {
const klass = CLASSES.find(c => c.id === val) const klass = CLASSES.find(c => c.id === val?.toLowerCase())
return klass || null return klass || null
} }

View File

@@ -724,6 +724,15 @@ export const copsAndCrimsStatsSchema = z.looseObject({
...copsAndCrimsGunUpgrades() ...copsAndCrimsGunUpgrades()
}) })
const woolGamesClassStats = z.looseObject({
kills: z.number().default(0),
assists: z.number().default(0),
deaths: z.number().default(0),
wool_placed: z.number().default(0),
blocks_broken: z.number().default(0),
powerups_gotten: z.number().default(0)
})
export const woolGamesStatsSchema = z.looseObject({ export const woolGamesStatsSchema = z.looseObject({
wool_wars_prestige_icon: z.string().optional(), wool_wars_prestige_icon: z.string().optional(),
playtime: z.number().default(0), playtime: z.number().default(0),
@@ -768,7 +777,15 @@ export const woolGamesStatsSchema = z.looseObject({
losses: z.number().default(0), losses: z.number().default(0),
wool_placed: z.number().default(0), wool_placed: z.number().default(0),
blocks_broken: z.number().default(0), blocks_broken: z.number().default(0),
powerups_gotten: z.number().default(0) powerups_gotten: z.number().default(0),
classes: z.looseObject({
tank: woolGamesClassStats.optional(),
archer: woolGamesClassStats.optional(),
swordsman: woolGamesClassStats.optional(),
engineer: woolGamesClassStats.optional(),
golem: woolGamesClassStats.optional(),
assault: woolGamesClassStats.optional()
}).optional()
}).optional() }).optional()
}).optional() }).optional()
}) })