Added card for cops and crims
This commit is contained in:
9
src/lib/hypixel/copsandcrims/general.ts
Normal file
9
src/lib/hypixel/copsandcrims/general.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { SCORE } from "@/data/hypixel/copsandcrims"
|
||||
|
||||
export function getScoreColor(score: number) {
|
||||
for (const scoreThreshold of SCORE.slice().reverse()) {
|
||||
if (scoreThreshold.score <= score) return scoreThreshold.color
|
||||
}
|
||||
|
||||
return SCORE.at(0)!.color
|
||||
}
|
||||
@@ -2,6 +2,7 @@ import z from "zod"
|
||||
import {
|
||||
bedwarsStatsSchema,
|
||||
buildBattleStatsSchema,
|
||||
copsAndCrimsStatsSchema,
|
||||
duelsStatsSchema,
|
||||
megawallsStats,
|
||||
murderMysteryStatsSchema,
|
||||
@@ -32,10 +33,12 @@ export const playerSchema = z.looseObject({
|
||||
UHC: uhcSchema.optional(),
|
||||
Pit: pitStats.optional(),
|
||||
TNTGames: tntGamesStatsSchema.optional(),
|
||||
Walls3: megawallsStats.optional()
|
||||
}).transform(({ Walls3, ...rest }) => {
|
||||
Walls3: megawallsStats.optional(),
|
||||
MCGO: copsAndCrimsStatsSchema.optional()
|
||||
}).transform(({ Walls3, MCGO, ...rest }) => {
|
||||
return {
|
||||
MegaWalls: Walls3,
|
||||
CopsAndCrims: MCGO,
|
||||
...rest
|
||||
}
|
||||
}).optional(),
|
||||
|
||||
@@ -659,3 +659,18 @@ export const megawallsStats = z.looseObject({
|
||||
...megawallsClassStats().classStats,
|
||||
...megawallsModeStats()
|
||||
})
|
||||
|
||||
export const copsAndCrimsStatsSchema = z.looseObject({
|
||||
kills: z.number().default(0),
|
||||
deaths: z.number().default(0),
|
||||
game_wins: z.number().default(0),
|
||||
kills_deathmatch: z.number().default(0),
|
||||
deaths_deathmatch: z.number().default(0),
|
||||
game_wins_deathmatch: z.number().default(0),
|
||||
kills_gungame: z.number().default(0),
|
||||
deaths_gungame: z.number().default(0),
|
||||
game_wins_gungame: z.number().default(0),
|
||||
bombs_planted: z.number().default(0),
|
||||
bombs_defused: z.number().default(0),
|
||||
shots_fired: z.number().default(0)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user