From 5781880be4281a1ff3d7b22c908671030e875a2d Mon Sep 17 00:00:00 2001 From: Taken Date: Mon, 8 Sep 2025 15:19:53 +0200 Subject: [PATCH] Updated cc stats --- .../_stats/copsandcrims/copsandcrims.tsx | 4 ++ .../[ign]/_stats/copsandcrims/stats.tsx | 43 +++++++++++++++++++ src/lib/schema/stats.ts | 8 +++- 3 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 src/app/(stats)/player/[ign]/_stats/copsandcrims/stats.tsx diff --git a/src/app/(stats)/player/[ign]/_stats/copsandcrims/copsandcrims.tsx b/src/app/(stats)/player/[ign]/_stats/copsandcrims/copsandcrims.tsx index 264d881..d35d7a9 100644 --- a/src/app/(stats)/player/[ign]/_stats/copsandcrims/copsandcrims.tsx +++ b/src/app/(stats)/player/[ign]/_stats/copsandcrims/copsandcrims.tsx @@ -6,11 +6,13 @@ import { getScoreColor } from "@/lib/hypixel/copsandcrims/general" import { devide } from "@/lib/hypixel/general" import { NonNullStats } from "@/lib/schema/player" import CollapsedStats from "../../_components/CollapsedStats" +import CopsAndCrimsGeneralStats from "./stats" export default function CopsAndCrimsStats({ stats }: { stats: NonNullStats["CopsAndCrims"] }) { if (!stats) return null const kills = stats.kills + stats.kills_deathmatch + stats.kills_gungame + const assists = stats.assists + stats.assists_deathmatch + stats.assists_gungame const deaths = stats.deaths + stats.deaths_deathmatch + stats.deaths_gungame const wins = stats.game_wins + stats.game_wins_deathmatch + stats.game_wins_gungame const kd = formatNumber(devide(kills, deaths)) @@ -48,6 +50,8 @@ export default function CopsAndCrimsStats({ stats }: { stats: NonNullStats["Cops + + diff --git a/src/app/(stats)/player/[ign]/_stats/copsandcrims/stats.tsx b/src/app/(stats)/player/[ign]/_stats/copsandcrims/stats.tsx new file mode 100644 index 0000000..437124c --- /dev/null +++ b/src/app/(stats)/player/[ign]/_stats/copsandcrims/stats.tsx @@ -0,0 +1,43 @@ +import { formatNumber } from "@/lib/formatters" +import { devide } from "@/lib/hypixel/general" +import { NonNullStats } from "@/lib/schema/player" +import { BasicStat } from "../../_components/Stats" + +export default function CopsAndCrimsGeneralStats( + { stats, kills, assits, deaths, wins }: { + stats: NonNullable + kills: number + assits: number + deaths: number + wins: number + } +) { + return ( +
+
+ +

+
+

+

+
+

+ + + + +
+
+ + +

+
+

+ + + + +
+
+ ) +} diff --git a/src/lib/schema/stats.ts b/src/lib/schema/stats.ts index 6ceec75..b67c117 100644 --- a/src/lib/schema/stats.ts +++ b/src/lib/schema/stats.ts @@ -662,15 +662,21 @@ export const megawallsStats = z.looseObject({ export const copsAndCrimsStatsSchema = z.looseObject({ kills: z.number().default(0), + assists: z.number().default(0), deaths: z.number().default(0), game_wins: z.number().default(0), kills_deathmatch: z.number().default(0), + assists_deathmatch: z.number().default(0), deaths_deathmatch: z.number().default(0), game_wins_deathmatch: z.number().default(0), kills_gungame: z.number().default(0), + assists_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) + shots_fired: z.number().default(0), + coins: z.number().default(0), + round_wins: z.number().default(0), + headshot_kills: z.number().default(0) })