From 35b3062be2869572b341d2059a221a51878fed72 Mon Sep 17 00:00:00 2001 From: Jacob Koshy <42344274+jacobk999@users.noreply.github.com> Date: Wed, 5 Feb 2025 10:25:09 -0500 Subject: [PATCH] fix(arcade): remove map difficulties from alien arcadium (#742) --- .../src/commands/arcade/arcade.profile.tsx | 2 +- .../src/commands/arcade/modes/zombies.tsx | 63 +++++++++++-------- .../src/player/gamemodes/arcade/mode.ts | 4 +- 3 files changed, 39 insertions(+), 30 deletions(-) diff --git a/apps/discord-bot/src/commands/arcade/arcade.profile.tsx b/apps/discord-bot/src/commands/arcade/arcade.profile.tsx index 46321b09c..a31b8da10 100644 --- a/apps/discord-bot/src/commands/arcade/arcade.profile.tsx +++ b/apps/discord-bot/src/commands/arcade/arcade.profile.tsx @@ -135,7 +135,7 @@ export const ArcadeProfile = ({ case "zombies": table = submode.api === "overall" ? : - ; + ; break; default: diff --git a/apps/discord-bot/src/commands/arcade/modes/zombies.tsx b/apps/discord-bot/src/commands/arcade/modes/zombies.tsx index e556d5eff..78dc6a714 100644 --- a/apps/discord-bot/src/commands/arcade/modes/zombies.tsx +++ b/apps/discord-bot/src/commands/arcade/modes/zombies.tsx @@ -6,28 +6,27 @@ * https://github.com/Statsify/statsify/blob/main/LICENSE */ +import { ApiSubModeForMode, ArcadeModes, Zombies, ZombiesMapDifficulty } from "@statsify/schemas"; import { Historical, Table } from "#components"; import { LocalizeFunction } from "@statsify/discord"; -import { Zombies, ZombiesMap, ZombiesMapDifficulty } from "@statsify/schemas"; import { formatTime } from "@statsify/util"; import type { ProfileTime } from "#commands/base.hypixel-command"; interface ZombiesMapColumnProps { title: string; - stats: ZombiesMap; + stats: ZombiesMapDifficulty; t: LocalizeFunction; time: ProfileTime; } const ZombiesMapColumn = ({ title, stats, t, time }: ZombiesMapColumnProps) => { - const mapStat = - (stats.overall.bestRound >= 30 && stats.overall.wins >= 1) ? - [t("stats.fastestWin"), formatTime(stats.overall.fastestWin)] : - [t("stats.bestRound"), t(stats.overall.bestRound)]; + const mapStat = stats.wins >= 1 ? + [t("stats.fastestWin"), stats.fastestWin ? formatTime(stats.fastestWin) : "N/A"] : + [t("stats.bestRound"), t(stats.bestRound)]; return ( - + @@ -54,8 +53,8 @@ export const ZombiesTable = ({ stats, t, time }: ZombiesTableProps) => { - - + + { /> @@ -77,11 +76,10 @@ interface ZombiesMapDifficultyTableProps { stats: ZombiesMapDifficulty; t: LocalizeFunction; time: ProfileTime; - difficulty: string; } -export const ZombiesMapDifficultyTable = ({ stats, t, time, difficulty }: ZombiesMapDifficultyTableProps) => ( - +export const ZombiesMapDifficultyTable = ({ stats, t, time }: ZombiesMapDifficultyTableProps) => ( + <> {time === "LIVE" && stats.wins === 0 ? : @@ -95,24 +93,35 @@ export const ZombiesMapDifficultyTable = ({ stats, t, time, difficulty }: Zombie - + ); export interface ZombiesMapTableProps { - stats: ZombiesMap; + stats: Zombies; t: LocalizeFunction; time: ProfileTime; + map: Exclude, "overall">; } -export const ZombiesMapTable = ({ stats, t, time }: ZombiesMapTableProps) => ( - - - - - - - - - - -); +export const ZombiesMapTable = ({ stats, t, time, map }: ZombiesMapTableProps) => map === "alienArcadium" ? + : + ( + + + + + + + + + + + + + + + + + + + ); diff --git a/packages/schemas/src/player/gamemodes/arcade/mode.ts b/packages/schemas/src/player/gamemodes/arcade/mode.ts index 4a0fba7af..ec830dc67 100644 --- a/packages/schemas/src/player/gamemodes/arcade/mode.ts +++ b/packages/schemas/src/player/gamemodes/arcade/mode.ts @@ -1069,7 +1069,7 @@ export class Zombies { public badBlood: ZombiesMap; @Field() - public alienArcadium: ZombiesMap; + public alienArcadium: ZombiesMapDifficulty; @Field() public prison: ZombiesMap; @@ -1078,7 +1078,7 @@ export class Zombies { this.overall = new ZombiesMapDifficulty(data); this.deadEnd = new ZombiesMap(data, "deadend"); this.badBlood = new ZombiesMap(data, "badblood"); - this.alienArcadium = new ZombiesMap(data, "alienarcadium"); + this.alienArcadium = new ZombiesMapDifficulty(data, "alienarcadium"); this.prison = new ZombiesMap(data, "prison"); } }