From f1c826c30c01dd7d1e2036eca9f28429874cbd07 Mon Sep 17 00:00:00 2001 From: Cody Date: Thu, 9 Apr 2026 12:16:31 -0400 Subject: [PATCH 1/3] feat(copsandcrims): add shots fired stats (#521) --- .../src/commands/copsandcrims/copsandcrims.profile.tsx | 2 ++ .../schemas/src/player/gamemodes/copsandcrims/mode.ts | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/apps/discord-bot/src/commands/copsandcrims/copsandcrims.profile.tsx b/apps/discord-bot/src/commands/copsandcrims/copsandcrims.profile.tsx index c49932ceb..18287754b 100644 --- a/apps/discord-bot/src/commands/copsandcrims/copsandcrims.profile.tsx +++ b/apps/discord-bot/src/commands/copsandcrims/copsandcrims.profile.tsx @@ -34,6 +34,8 @@ export const CopsAndCrimsProfile = ({ [t("stats.knifeKills"), t(copsandcrims.overall.knifeKills), "§7"], [t("stats.headshotKills"), t(copsandcrims.overall.headshotKills), "§4"], [t("stats.grenadeKills"), t(copsandcrims.overall.grenadeKills), "§2"], + [t("stats.shotsFired"), t(copsandcrims.overall.shotsFired), "§6"], + ["Shots/Kill", t(copsandcrims.overall.shotsPerKill), "§b"], ]; let table: JSX.Element; diff --git a/packages/schemas/src/player/gamemodes/copsandcrims/mode.ts b/packages/schemas/src/player/gamemodes/copsandcrims/mode.ts index fc577349d..9404c5037 100644 --- a/packages/schemas/src/player/gamemodes/copsandcrims/mode.ts +++ b/packages/schemas/src/player/gamemodes/copsandcrims/mode.ts @@ -126,6 +126,12 @@ export class CopsAndCrimsOverall { @Field() public grenadeKills: number; + @Field({ leaderboard: { enabled: false } }) + public shotsFired: number; + + @Field({ leaderboard: { enabled: false } }) + public shotsPerKill: number; + public constructor(data: APIData, defusal: Defusal, deathmatch: Deathmatch, gunGame: GunGame) { this.wins = add(defusal.wins, deathmatch.wins, gunGame.wins); this.kills = add(defusal.kills, deathmatch.kills, gunGame.kills); @@ -135,5 +141,7 @@ export class CopsAndCrimsOverall { this.knifeKills = data.knife_kills; this.headshotKills = data.headshot_kills; this.grenadeKills = data.grenade_kills; + this.shotsFired = data.shots_fired; + this.shotsPerKill = ratio(this.shotsFired, add(defusal.kills, deathmatch.kills)); } } From 8f73d1201058cf418bdae2926d53d4c978a17c82 Mon Sep 17 00:00:00 2001 From: Cody Date: Fri, 29 May 2026 20:58:53 -0600 Subject: [PATCH 2/3] fix(copsandcrims): correct shots per kill translation key * Update translation key for shots per kill in profile * Adjust calculation of shots per kill to use overall kills * Add shots per kill translation to default.json --- .../src/commands/copsandcrims/copsandcrims.profile.tsx | 2 +- locales/en-US/default.json | 3 ++- packages/schemas/src/player/gamemodes/copsandcrims/mode.ts | 2 +- pnpm-lock.yaml | 2 ++ 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/discord-bot/src/commands/copsandcrims/copsandcrims.profile.tsx b/apps/discord-bot/src/commands/copsandcrims/copsandcrims.profile.tsx index 18287754b..aa0aee60f 100644 --- a/apps/discord-bot/src/commands/copsandcrims/copsandcrims.profile.tsx +++ b/apps/discord-bot/src/commands/copsandcrims/copsandcrims.profile.tsx @@ -35,7 +35,7 @@ export const CopsAndCrimsProfile = ({ [t("stats.headshotKills"), t(copsandcrims.overall.headshotKills), "§4"], [t("stats.grenadeKills"), t(copsandcrims.overall.grenadeKills), "§2"], [t("stats.shotsFired"), t(copsandcrims.overall.shotsFired), "§6"], - ["Shots/Kill", t(copsandcrims.overall.shotsPerKill), "§b"], + [t("stats.shotsPerKill"), t(copsandcrims.overall.shotsPerKill), "§b"], ]; let table: JSX.Element; diff --git a/locales/en-US/default.json b/locales/en-US/default.json index b66f3e884..d4fe0d9f2 100644 --- a/locales/en-US/default.json +++ b/locales/en-US/default.json @@ -817,7 +817,8 @@ "airTime": "Air Time", "potionsSplashed": "Potions Splashed", "powerOrbs": "Power Orbs", - "grenadeKills": "Grenade Kills" + "grenadeKills": "Grenade Kills", + "shotsPerKill": "Shots/Kill" }, "tips": { "discord": "$t(emojis:socials.discord) Join our **$t(socials.discord)** and get **20% lower cooldowns** $t(emojis:heart)", diff --git a/packages/schemas/src/player/gamemodes/copsandcrims/mode.ts b/packages/schemas/src/player/gamemodes/copsandcrims/mode.ts index 9404c5037..216b3e004 100644 --- a/packages/schemas/src/player/gamemodes/copsandcrims/mode.ts +++ b/packages/schemas/src/player/gamemodes/copsandcrims/mode.ts @@ -142,6 +142,6 @@ export class CopsAndCrimsOverall { this.headshotKills = data.headshot_kills; this.grenadeKills = data.grenade_kills; this.shotsFired = data.shots_fired; - this.shotsPerKill = ratio(this.shotsFired, add(defusal.kills, deathmatch.kills)); + this.shotsPerKill = ratio(this.shotsFired, this.kills); } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e289028fb..06d805655 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -701,6 +701,8 @@ importers: packages/skin-renderer: {} + packages/skin-renderer/pkg: {} + packages/util: dependencies: '@swc/helpers': From a9fe7de6f984c1f5227fd59d7c8c16073ac1cc6c Mon Sep 17 00:00:00 2001 From: Cody Date: Fri, 29 May 2026 21:01:38 -0600 Subject: [PATCH 3/3] fix(copsandcrims): enable shots fired field for leaderboard --- packages/schemas/src/player/gamemodes/copsandcrims/mode.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/schemas/src/player/gamemodes/copsandcrims/mode.ts b/packages/schemas/src/player/gamemodes/copsandcrims/mode.ts index 216b3e004..0995e3311 100644 --- a/packages/schemas/src/player/gamemodes/copsandcrims/mode.ts +++ b/packages/schemas/src/player/gamemodes/copsandcrims/mode.ts @@ -126,7 +126,7 @@ export class CopsAndCrimsOverall { @Field() public grenadeKills: number; - @Field({ leaderboard: { enabled: false } }) + @Field() public shotsFired: number; @Field({ leaderboard: { enabled: false } })