From 4343157799f93ab7df0e2d147fdbbd2573a0c9c1 Mon Sep 17 00:00:00 2001 From: jacobk999 Date: Wed, 14 Aug 2024 14:38:48 -0400 Subject: [PATCH 1/4] feat: add more indepth warlords mode and class stats --- .../warlords/tables/classes.table.tsx | 45 +++++--- .../commands/warlords/warlords.profile.tsx | 86 +++++++++++---- locales/en-US/default.json | 7 +- .../src/player/gamemodes/warlords/class.ts | 101 +++++++++++++++++- .../src/player/gamemodes/warlords/index.ts | 57 ++++++---- .../src/player/gamemodes/warlords/mode.ts | 62 +++++++++++ 6 files changed, 304 insertions(+), 54 deletions(-) create mode 100644 packages/schemas/src/player/gamemodes/warlords/mode.ts diff --git a/apps/discord-bot/src/commands/warlords/tables/classes.table.tsx b/apps/discord-bot/src/commands/warlords/tables/classes.table.tsx index cabb06f46..6ecab5786 100644 --- a/apps/discord-bot/src/commands/warlords/tables/classes.table.tsx +++ b/apps/discord-bot/src/commands/warlords/tables/classes.table.tsx @@ -6,17 +6,18 @@ * https://github.com/Statsify/statsify/blob/main/LICENSE */ +import { ClassMetadata, METADATA_KEY, WarlordsClass, WarlordsSpecification } from "@statsify/schemas"; import { LocalizeFunction } from "@statsify/discord"; import { Table } from "#components"; -import { Warlords, WarlordsClass } from "@statsify/schemas"; +import type { Constructor } from "@statsify/util"; interface WarlordsClassColumnProps { title: string; - stats: WarlordsClass; + stats: WarlordsSpecification; t: LocalizeFunction; } -const WarlordsClassColumn = ({ title, stats, t }: WarlordsClassColumnProps) => ( +const WarlordsSpecificationColumn = ({ title, stats, t }: WarlordsClassColumnProps) => ( @@ -27,17 +28,33 @@ const WarlordsClassColumn = ({ title, stats, t }: WarlordsClassColumnProps) => ( ); export interface WarlordsClassTableProps { - warlords: Warlords; + stats: WarlordsClass; + constructor: Constructor; + color: string; t: LocalizeFunction; } -export const WarlordsClassTable = ({ warlords, t }: WarlordsClassTableProps) => ( - - - - - - - - -); +export const WarlordsClassTable = ({ stats, t, constructor, color }: WarlordsClassTableProps) => { + const { attack, defense, healer } = getSpecificationNames(constructor); + + return ( + + + + + + + + + ); +}; + +function getSpecificationNames(constructor: Constructor) { + const metadata = Reflect.getMetadata(METADATA_KEY, constructor.prototype) as ClassMetadata; + + return { + attack: metadata.attack.leaderboard.name, + defense: metadata.defense.leaderboard.name, + healer: metadata.healer.leaderboard.name, + }; +} diff --git a/apps/discord-bot/src/commands/warlords/warlords.profile.tsx b/apps/discord-bot/src/commands/warlords/warlords.profile.tsx index 40ec3e1b5..b50fdb012 100644 --- a/apps/discord-bot/src/commands/warlords/warlords.profile.tsx +++ b/apps/discord-bot/src/commands/warlords/warlords.profile.tsx @@ -7,7 +7,7 @@ */ import { Container, Footer, Header, SidebarItem, Table } from "#components"; -import { FormattedGame, GameMode, WarlordsModes } from "@statsify/schemas"; +import { FormattedGame, GameMode, WarlordsMage, WarlordsModes, WarlordsPaladin, WarlordsShaman, WarlordsWarrior } from "@statsify/schemas"; import { WarlordsClassTable } from "./tables/index.js"; import { prettify } from "@statsify/util"; import type { BaseProfileProps } from "#commands/base.hypixel-command"; @@ -31,37 +31,85 @@ export const WarlordsProfile = ({ const sidebar: SidebarItem[] = [ [t("stats.coins"), t(warlords.coins), "§6"], - [t("stats.class"), prettify(warlords.class), "§e"], ]; + if (mode.api !== "overall") + sidebar.push( + [t("stats.spec"), prettify(warlords[mode.api].specification), "§a"], + [t("stats.level"), t(warlords[mode.api].level), "§a"] + ); + let table: JSX.Element; switch (mode.api) { - case "overall": + case "overall": { + sidebar.push([t("stats.class"), prettify(warlords.class), "§e"]); + const clazz = warlords.class as "mage" | "warrior" | "paladin" | "shaman"; + // Verify that the cast is correct and the class is a valid class + if (clazz in warlords && typeof warlords[clazz] === "object") sidebar.push([t("stats.spec"), prettify(warlords[clazz].specification), "§a"]); + table = ( + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + + + ); break; + } + + case "mage": + table = ; + break; + + case "warrior": + table = ; + break; + + case "paladin": + table = ; + break; - case "classes": - table = ; + case "shaman": + table = ; break; } diff --git a/locales/en-US/default.json b/locales/en-US/default.json index 5e9ead13e..bd6f35171 100644 --- a/locales/en-US/default.json +++ b/locales/en-US/default.json @@ -790,7 +790,10 @@ "fails": "Fails", "mapsCompleted": "Maps Completed", "arcadeWins": "Arcade Wins", - "draws": "Draws" + "draws": "Draws", + "spec": "Spec", + "capturePoints": "Capture Points", + "defendPoints": "Defend Points" }, "tips": { "discord": "$t(emojis:socials.discord) Join our **$t(socials.discord)** and get **20% lower cooldowns** $t(emojis:heart)", @@ -836,4 +839,4 @@ "successfulUnverification": "Successfully unverified your account!", "successfulVerification": "You are now verified to **{{displayName}}**" } -} \ No newline at end of file +} diff --git a/packages/schemas/src/player/gamemodes/warlords/class.ts b/packages/schemas/src/player/gamemodes/warlords/class.ts index 5cebeb547..8fe5f8f3e 100644 --- a/packages/schemas/src/player/gamemodes/warlords/class.ts +++ b/packages/schemas/src/player/gamemodes/warlords/class.ts @@ -10,7 +10,7 @@ import { Field } from "#metadata"; import { add } from "@statsify/math"; import type { APIData } from "@statsify/util"; -export class WarlordsClass { +export class WarlordsSpecification { @Field() public wins: number; @@ -36,3 +36,102 @@ export class WarlordsClass { this.total = add(this.damage, this.prevent, this.healing); } } + +export class WarlordsClass extends WarlordsSpecification { + @Field({ store: { default: "none" } }) + public specification: string; + + // Warlords class level maxes out at 90 + @Field({ leaderboard: { enabled: false } }) + public level: number; + + @Field() + public attack: WarlordsSpecification; + + @Field() + public defense: WarlordsSpecification; + + @Field() + public healer: WarlordsSpecification; + + public constructor(data: APIData, clazz: string, attack: string, defense: string, tank: string) { + super(data, clazz); + + this.specification = data[`${clazz}_spec`] ?? "none"; + this.level = add( + data[`${clazz}_cooldown`], + data[`${clazz}_critchance`], + data[`${clazz}_critmultiplier`], + data[`${clazz}_energy`], + data[`${clazz}_health`], + data[`${clazz}_skill1`], + data[`${clazz}_skill2`], + data[`${clazz}_skill3`], + data[`${clazz}_skill4`], + data[`${clazz}_skill5`] + ); + this.attack = new WarlordsSpecification(data, attack); + this.defense = new WarlordsSpecification(data, defense); + this.healer = new WarlordsSpecification(data, tank); + } +} + +export class WarlordsShaman extends WarlordsClass { + @Field({ leaderboard: { name: "Thunderlord" } }) + public declare attack: WarlordsSpecification; + + @Field({ leaderboard: { name: "Spiritguard" } }) + public declare defense: WarlordsSpecification; + + @Field({ leaderboard: { name: "Earthwarden" } }) + public declare healer: WarlordsSpecification; + + public constructor(data: APIData) { + super(data, "shaman", "thunderlord", "spiritguard", "earthwarden"); + } +} + +export class WarlordsMage extends WarlordsClass { + @Field({ leaderboard: { name: "Pyromancer" } }) + public declare attack: WarlordsSpecification; + + @Field({ leaderboard: { name: "Cyromancer" } }) + public declare defense: WarlordsSpecification; + + @Field({ leaderboard: { name: "Aquamancer" } }) + public declare healer: WarlordsSpecification; + + public constructor(data: APIData) { + super(data, "mage", "pyromancer", "cyromancer", "aquamancer"); + } +} + +export class WarlordsWarrior extends WarlordsClass { + @Field({ leaderboard: { name: "Berserker" } }) + public declare attack: WarlordsSpecification; + + @Field({ leaderboard: { name: "Defender" } }) + public declare defense: WarlordsSpecification; + + @Field({ leaderboard: { name: "Revenant" } }) + public declare healer: WarlordsSpecification; + + public constructor(data: APIData) { + super(data, "warrior", "berserker", "defender", "revenant"); + } +} + +export class WarlordsPaladin extends WarlordsClass { + @Field({ leaderboard: { name: "Avenger" } }) + public declare attack: WarlordsSpecification; + + @Field({ leaderboard: { name: "Crusader" } }) + public declare defense: WarlordsSpecification; + + @Field({ leaderboard: { name: "Protector" } }) + public declare healer: WarlordsSpecification; + + public constructor(data: APIData) { + super(data, "paladin", "avenger", "crusader", "protector"); + } +} diff --git a/packages/schemas/src/player/gamemodes/warlords/index.ts b/packages/schemas/src/player/gamemodes/warlords/index.ts index c038d31d7..b527a856e 100644 --- a/packages/schemas/src/player/gamemodes/warlords/index.ts +++ b/packages/schemas/src/player/gamemodes/warlords/index.ts @@ -8,39 +8,56 @@ import { Field } from "#metadata"; import { GameModes, type IGameModes } from "#game"; -import { WarlordsClass } from "./class.js"; +import { WarlordsCaptureTheFlag, WarlordsDomination, WarlordsTeamDeathmatch } from "./mode.js"; +import { WarlordsMage, WarlordsPaladin, WarlordsShaman, WarlordsWarrior } from "./class.js"; import { add, ratio, sub } from "@statsify/math"; import type { APIData } from "@statsify/util"; export const WARLORDS_MODES = new GameModes([ { api: "overall" }, - { api: "classes" }, - { hypixel: "ctf_mini", formatted: "CTF" }, + { api: "mage" }, + { api: "warrior" }, + { api: "paladin" }, + { api: "shaman" }, + + { hypixel: "ctf_mini", formatted: "Capture the Flag" }, { hypixel: "domination", formatted: "Domination" }, - { hypixel: "team_deathmatch", formatted: "Deathmatch" }, + { hypixel: "team_deathmatch", formatted: "Team Deathmatch" }, ]); export type WarlordsModes = IGameModes; +// flag_conquer_self +// flag_returns + export class Warlords { + @Field({ store: { default: "warrior" } }) + public class: string; + + @Field({ historical: { enabled: false } }) + public coins: number; + @Field() - public mage: WarlordsClass; + public mage: WarlordsMage; @Field() - public warrior: WarlordsClass; + public warrior: WarlordsWarrior; @Field() - public paladin: WarlordsClass; + public paladin: WarlordsPaladin; @Field() - public shaman: WarlordsClass; + public shaman: WarlordsShaman; - @Field({ store: { default: "warrior" } }) - public class: string; + @Field() + public domination: WarlordsDomination; - @Field({ historical: { enabled: false } }) - public coins: number; + @Field() + public captureTheFlag: WarlordsCaptureTheFlag; + + @Field() + public teamDeathmatch: WarlordsTeamDeathmatch; @Field() public gamesPlayed: number; @@ -67,14 +84,18 @@ export class Warlords { public assists: number; public constructor(data: APIData) { - this.mage = new WarlordsClass(data, "mage"); - this.warrior = new WarlordsClass(data, "warrior"); - this.paladin = new WarlordsClass(data, "paladin"); - this.shaman = new WarlordsClass(data, "shaman"); - this.class = data.chosen_class || "warrior"; this.coins = data.coins; + this.mage = new WarlordsMage(data); + this.warrior = new WarlordsWarrior(data); + this.paladin = new WarlordsPaladin(data); + this.shaman = new WarlordsShaman(data); + + this.domination = new WarlordsDomination(data); + this.captureTheFlag = new WarlordsCaptureTheFlag(data); + this.teamDeathmatch = new WarlordsTeamDeathmatch(data); + this.gamesPlayed = Math.ceil( add( data.aquamancer_plays, @@ -100,8 +121,8 @@ export class Warlords { // Warlords Losses in API are bugged (~90% accurate) // https://hypixel.net/threads/warlords-skillrating-website.1560046/post-12210896 this.losses = sub(this.gamesPlayed, this.wins); - this.wlr = ratio(this.wins, this.losses); + this.kills = data.kills; this.deaths = data.deaths; this.kdr = ratio(this.kills, this.deaths); diff --git a/packages/schemas/src/player/gamemodes/warlords/mode.ts b/packages/schemas/src/player/gamemodes/warlords/mode.ts new file mode 100644 index 000000000..5b850d8ad --- /dev/null +++ b/packages/schemas/src/player/gamemodes/warlords/mode.ts @@ -0,0 +1,62 @@ +/** + * Copyright (c) Statsify + * + * This source code is licensed under the GNU GPL v3 license found in the + * LICENSE file in the root directory of this source tree. + * https://github.com/Statsify/statsify/blob/main/LICENSE + */ + +import { Field } from "#metadata"; +import type { APIData } from "@statsify/util"; + +export class WarlordsDomination { + @Field() + public capturePoints: number; + + @Field() + public defendPoints: number; + + @Field() + public kills: number; + + @Field() + public score: number; + + @Field() + public wins: number; + + public constructor(data: APIData) { + this.capturePoints = data.dom_point_captures; + this.defendPoints = data.dom_point_defends; + this.kills = data.kills_domination; + this.score = data.total_domination_score; + this.wins = data.wins_domination; + } +} + +export class WarlordsCaptureTheFlag { + @Field() + public wins: number; + + @Field() + public kills: number; + + public constructor(data: APIData) { + this.wins = data.wins_capturetheflag; + this.kills = data.kills_capturetheflag; + } +} + +export class WarlordsTeamDeathmatch { + @Field() + public wins: number; + + @Field() + public kills: number; + + public constructor(data: APIData) { + this.wins = data.wins_teamdeathmatch; + this.kills = data.kills_teamdeathmatch; + } +} + From 8bd1bef5d7a65a6080da5ec8e820a824e0b18cbe Mon Sep 17 00:00:00 2001 From: jacobk999 Date: Wed, 14 Aug 2024 14:57:33 -0400 Subject: [PATCH 2/4] change colors --- .../commands/warlords/warlords.profile.tsx | 28 +++++++++---------- locales/en-US/default.json | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/apps/discord-bot/src/commands/warlords/warlords.profile.tsx b/apps/discord-bot/src/commands/warlords/warlords.profile.tsx index b50fdb012..066fd28e4 100644 --- a/apps/discord-bot/src/commands/warlords/warlords.profile.tsx +++ b/apps/discord-bot/src/commands/warlords/warlords.profile.tsx @@ -50,7 +50,7 @@ export const WarlordsProfile = ({ table = ( - + @@ -68,29 +68,29 @@ export const WarlordsProfile = ({ - - - - - - - - - - + - + - + - + + + + + + + + + + ); break; diff --git a/locales/en-US/default.json b/locales/en-US/default.json index bd6f35171..40dc39480 100644 --- a/locales/en-US/default.json +++ b/locales/en-US/default.json @@ -839,4 +839,4 @@ "successfulUnverification": "Successfully unverified your account!", "successfulVerification": "You are now verified to **{{displayName}}**" } -} +} \ No newline at end of file From e12710f21a4c8f3814cfee7acc3b12c4cd0290b8 Mon Sep 17 00:00:00 2001 From: jacobk999 Date: Sun, 18 Aug 2024 20:38:56 -0400 Subject: [PATCH 3/4] separate mode stats into their own pages --- .../tables/capture-the-flag.table.tsx | 29 +++++++ .../warlords/tables/deathmatch.table.tsx | 25 ++++++ .../warlords/tables/domination.table.tsx | 30 ++++++++ .../src/commands/warlords/tables/index.ts | 4 + .../warlords/tables/overall.table.tsx | 37 +++++++++ .../commands/warlords/warlords.profile.tsx | 76 ++++++------------- assets/private | 2 +- locales/en-US/default.json | 6 +- .../src/player/gamemodes/warlords/index.ts | 11 +-- .../src/player/gamemodes/warlords/mode.ts | 9 +++ 10 files changed, 164 insertions(+), 65 deletions(-) create mode 100644 apps/discord-bot/src/commands/warlords/tables/capture-the-flag.table.tsx create mode 100644 apps/discord-bot/src/commands/warlords/tables/deathmatch.table.tsx create mode 100644 apps/discord-bot/src/commands/warlords/tables/domination.table.tsx create mode 100644 apps/discord-bot/src/commands/warlords/tables/overall.table.tsx diff --git a/apps/discord-bot/src/commands/warlords/tables/capture-the-flag.table.tsx b/apps/discord-bot/src/commands/warlords/tables/capture-the-flag.table.tsx new file mode 100644 index 000000000..af59ef4c5 --- /dev/null +++ b/apps/discord-bot/src/commands/warlords/tables/capture-the-flag.table.tsx @@ -0,0 +1,29 @@ +/** + * Copyright (c) Statsify + * + * This source code is licensed under the GNU GPL v3 license found in the + * LICENSE file in the root directory of this source tree. + * https://github.com/Statsify/statsify/blob/main/LICENSE + */ + +import { Table } from "#components"; +import type { LocalizeFunction } from "@statsify/discord"; +import type { Warlords } from "@statsify/schemas"; + +export interface WarlordsCaptureTheFlagTableProps { + warlords: Warlords; + t: LocalizeFunction; +} + +export const WarlordsCaptureTheFlagTable = ({ warlords, t }: WarlordsCaptureTheFlagTableProps) => ( + + + + + + + + + + +); diff --git a/apps/discord-bot/src/commands/warlords/tables/deathmatch.table.tsx b/apps/discord-bot/src/commands/warlords/tables/deathmatch.table.tsx new file mode 100644 index 000000000..d3b76e87a --- /dev/null +++ b/apps/discord-bot/src/commands/warlords/tables/deathmatch.table.tsx @@ -0,0 +1,25 @@ +/** + * Copyright (c) Statsify + * + * This source code is licensed under the GNU GPL v3 license found in the + * LICENSE file in the root directory of this source tree. + * https://github.com/Statsify/statsify/blob/main/LICENSE + */ + +import { Table } from "#components"; +import type { LocalizeFunction } from "@statsify/discord"; +import type { Warlords } from "@statsify/schemas"; + +export interface WarlordsDeathmatchTableProps { + warlords: Warlords; + t: LocalizeFunction; +} + +export const WarlordsDeathmatchTable = ({ warlords, t }: WarlordsDeathmatchTableProps) => ( + + + + + + +); diff --git a/apps/discord-bot/src/commands/warlords/tables/domination.table.tsx b/apps/discord-bot/src/commands/warlords/tables/domination.table.tsx new file mode 100644 index 000000000..23fbebb6c --- /dev/null +++ b/apps/discord-bot/src/commands/warlords/tables/domination.table.tsx @@ -0,0 +1,30 @@ +/** + * Copyright (c) Statsify + * + * This source code is licensed under the GNU GPL v3 license found in the + * LICENSE file in the root directory of this source tree. + * https://github.com/Statsify/statsify/blob/main/LICENSE + */ + +import { Table } from "#components"; +import type { LocalizeFunction } from "@statsify/discord"; +import type { Warlords } from "@statsify/schemas"; + +export interface WarlordsDominationTableProps { + warlords: Warlords; + t: LocalizeFunction; +} + +export const WarlordsDominationTable = ({ warlords, t }: WarlordsDominationTableProps) => ( + + + + + + + + + + + +); diff --git a/apps/discord-bot/src/commands/warlords/tables/index.ts b/apps/discord-bot/src/commands/warlords/tables/index.ts index f255ec2ab..21becef55 100644 --- a/apps/discord-bot/src/commands/warlords/tables/index.ts +++ b/apps/discord-bot/src/commands/warlords/tables/index.ts @@ -7,3 +7,7 @@ */ export * from "./classes.table.js"; +export * from "./capture-the-flag.table.js"; +export * from "./domination.table.js"; +export * from "./overall.table.js"; +export * from "./deathmatch.table.js"; diff --git a/apps/discord-bot/src/commands/warlords/tables/overall.table.tsx b/apps/discord-bot/src/commands/warlords/tables/overall.table.tsx new file mode 100644 index 000000000..4a275bea5 --- /dev/null +++ b/apps/discord-bot/src/commands/warlords/tables/overall.table.tsx @@ -0,0 +1,37 @@ +/** + * Copyright (c) Statsify + * + * This source code is licensed under the GNU GPL v3 license found in the + * LICENSE file in the root directory of this source tree. + * https://github.com/Statsify/statsify/blob/main/LICENSE + */ + +import { Table } from "#components"; +import type { LocalizeFunction } from "@statsify/discord"; +import type { Warlords } from "@statsify/schemas"; + +export interface WarlordsOverallTableProps { + warlords: Warlords; + t: LocalizeFunction; +} + +export const WarlordsOverallTable = ({ warlords, t }: WarlordsOverallTableProps) => ( + + + + + + + + + + + + + + +); diff --git a/apps/discord-bot/src/commands/warlords/warlords.profile.tsx b/apps/discord-bot/src/commands/warlords/warlords.profile.tsx index 09e92215f..5efd2fb13 100644 --- a/apps/discord-bot/src/commands/warlords/warlords.profile.tsx +++ b/apps/discord-bot/src/commands/warlords/warlords.profile.tsx @@ -6,9 +6,9 @@ * https://github.com/Statsify/statsify/blob/main/LICENSE */ -import { Container, Footer, Header, SidebarItem, Table } from "#components"; +import { Container, Footer, Header, type SidebarItem } from "#components"; import { FormattedGame, type GameMode, WarlordsMage, WarlordsModes, WarlordsPaladin, WarlordsShaman, WarlordsWarrior } from "@statsify/schemas"; -import { WarlordsClassTable } from "./tables/index.js"; +import { WarlordsCaptureTheFlagTable, WarlordsClassTable, WarlordsDeathmatchTable, WarlordsDominationTable, WarlordsOverallTable } from "./tables/index.js"; import { prettify } from "@statsify/util"; import type { BaseProfileProps } from "#commands/base.hypixel-command"; @@ -33,68 +33,36 @@ export const WarlordsProfile = ({ [t("stats.coins"), t(warlords.coins), "§6"], ]; - if (mode.api !== "overall") + if (mode.api !== "overall" && mode.api !== "captureTheFlag" && mode.api !== "domination" && mode.api !== "teamDeathmatch") { sidebar.push( [t("stats.spec"), prettify(warlords[mode.api].specification), "§a"], [t("stats.level"), t(warlords[mode.api].level), "§a"] ); + } else { + sidebar.push([t("stats.class"), prettify(warlords.class), "§e"]); + const clazz = warlords.class as "mage" | "warrior" | "paladin" | "shaman"; + // Verify that the cast is correct and the class is a valid class + if (clazz in warlords && typeof warlords[clazz] === "object") sidebar.push([t("stats.spec"), prettify(warlords[clazz].specification), "§a"]); + } let table: JSX.Element; switch (mode.api) { - case "overall": { - sidebar.push([t("stats.class"), prettify(warlords.class), "§e"]); - const clazz = warlords.class as "mage" | "warrior" | "paladin" | "shaman"; - // Verify that the cast is correct and the class is a valid class - if (clazz in warlords && typeof warlords[clazz] === "object") sidebar.push([t("stats.spec"), prettify(warlords[clazz].specification), "§a"]); + case "overall": + table = ; + break; + + case "captureTheFlag": + table = ; + break; + + case "domination": + table = ; + break; - table = ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ); + case "teamDeathmatch": + table = ; break; - } case "mage": table = ; diff --git a/assets/private b/assets/private index 2e5630f28..f8b5157d1 160000 --- a/assets/private +++ b/assets/private @@ -1 +1 @@ -Subproject commit 2e5630f2865b933d2d83d0d64ceb1cecd1f7b05b +Subproject commit f8b5157d157b79b51fd1b3e3a9f6c97ed6f4856e diff --git a/locales/en-US/default.json b/locales/en-US/default.json index 0ca82840b..5a5df0c71 100644 --- a/locales/en-US/default.json +++ b/locales/en-US/default.json @@ -796,7 +796,9 @@ "defendPoints": "Defend Points", "draws": "Draws", "sheepThrown": "Sheep Thrown", - "magicWool": "Magic Wool" + "magicWool": "Magic Wool", + "flagCaptures": "Flag Captures", + "flagReturns": "Flag Returns" }, "tips": { "discord": "$t(emojis:socials.discord) Join our **$t(socials.discord)** and get **20% lower cooldowns** $t(emojis:heart)", @@ -842,4 +844,4 @@ "successfulUnverification": "Successfully unverified your account!", "successfulVerification": "You are now verified to **{{displayName}}**" } -} \ No newline at end of file +} diff --git a/packages/schemas/src/player/gamemodes/warlords/index.ts b/packages/schemas/src/player/gamemodes/warlords/index.ts index 7cb1d6e69..b23415276 100644 --- a/packages/schemas/src/player/gamemodes/warlords/index.ts +++ b/packages/schemas/src/player/gamemodes/warlords/index.ts @@ -15,22 +15,17 @@ import type { APIData } from "@statsify/util"; export const WARLORDS_MODES = new GameModes([ { api: "overall" }, - + { api: "captureTheFlag", hypixel: "ctf_mini", formatted: "Capture the Flag" }, + { api: "domination", hypixel: "domination", formatted: "Domination" }, + { api: "teamDeathmatch", hypixel: "team_deathmatch", formatted: "Team Deathmatch" }, { api: "mage" }, { api: "warrior" }, { api: "paladin" }, { api: "shaman" }, - - { hypixel: "ctf_mini", formatted: "Capture the Flag" }, - { hypixel: "domination", formatted: "Domination" }, - { hypixel: "team_deathmatch", formatted: "Team Deathmatch" }, ] as const); export type WarlordsModes = ExtractGameModes; -// [TODO]: flag_conquer_self -// [TODO]: flag_returns - export class Warlords { @Field({ store: { default: "warrior" } }) public class: string; diff --git a/packages/schemas/src/player/gamemodes/warlords/mode.ts b/packages/schemas/src/player/gamemodes/warlords/mode.ts index 5b850d8ad..7ea8a912e 100644 --- a/packages/schemas/src/player/gamemodes/warlords/mode.ts +++ b/packages/schemas/src/player/gamemodes/warlords/mode.ts @@ -41,9 +41,18 @@ export class WarlordsCaptureTheFlag { @Field() public kills: number; + @Field() + public flagCaptures: number; + + @Field() + public flagReturns: number; + public constructor(data: APIData) { this.wins = data.wins_capturetheflag; this.kills = data.kills_capturetheflag; + + this.flagCaptures = data.flag_conquer_self; + this.flagReturns = data.flag_returns; } } From ee5f1128b1960e67038c54a4f35f5ad7e1a5a7e3 Mon Sep 17 00:00:00 2001 From: jacobk999 Date: Sun, 18 Aug 2024 23:05:17 -0400 Subject: [PATCH 4/4] fix locales --- locales/en-US/default.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locales/en-US/default.json b/locales/en-US/default.json index c45c91376..135dd38d4 100644 --- a/locales/en-US/default.json +++ b/locales/en-US/default.json @@ -798,7 +798,7 @@ "sheepKilled": "Sheep Killed", "magicWool": "Magic Wool", "flagCaptures": "Flag Captures", - "flagReturns": "Flag Returns" + "flagReturns": "Flag Returns", "airTime": "Air Time", "potionsSplashed": "Potions Splashed", "powerOrbs": "Power Orbs" @@ -847,4 +847,4 @@ "successfulUnverification": "Successfully unverified your account!", "successfulVerification": "You are now verified to **{{displayName}}**" } -} +} \ No newline at end of file