Added warlords class stats table
This commit is contained in:
@@ -1,27 +1,65 @@
|
||||
import z from "zod"
|
||||
|
||||
function warlordsClassStats() {
|
||||
const ids = [
|
||||
"mage",
|
||||
"paladin",
|
||||
"shaman",
|
||||
"warrior"
|
||||
] as const
|
||||
const stats = [
|
||||
"cooldown",
|
||||
"critchance",
|
||||
"critmultiplier",
|
||||
"energy",
|
||||
"health",
|
||||
"skill1",
|
||||
"skill2",
|
||||
"skill3",
|
||||
"skill4",
|
||||
"skill5",
|
||||
"wins",
|
||||
"losses",
|
||||
"plays"
|
||||
] as const
|
||||
const stats2 = [
|
||||
"damage",
|
||||
"damage_prevented",
|
||||
"heal",
|
||||
"wins"
|
||||
] as const
|
||||
|
||||
const entries = new Map<string, z.ZodDefault<z.ZodNumber>>()
|
||||
const entries2 = new Map<string, z.ZodDefault<z.ZodNumber>>()
|
||||
|
||||
for (const id of ids) {
|
||||
for (const stat of stats) {
|
||||
entries.set(`${id}_${stat}`, z.number().default(0))
|
||||
}
|
||||
for (const stat of stats2) {
|
||||
entries2.set(`${stat}_${id}`, z.number().default(0))
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
left_right: Object.fromEntries(entries) as Record<`${typeof ids[number]}_${typeof stats[number]}`, z.ZodDefault<z.ZodNumber>>,
|
||||
right_left: Object.fromEntries(entries2) as Record<`${typeof stats2[number]}_${typeof ids[number]}`, z.ZodDefault<z.ZodNumber>>
|
||||
}
|
||||
}
|
||||
|
||||
export const warlordsStatsSchema = z.object({
|
||||
kills: z.number().default(0),
|
||||
assists: z.number().default(0),
|
||||
deaths: z.number().default(0),
|
||||
wins: z.number().default(0),
|
||||
coins: z.number().default(0),
|
||||
damage: z.number().default(0),
|
||||
damage_prevented: z.number().default(0),
|
||||
heal: z.number().default(0),
|
||||
magic_dust: z.number().default(0),
|
||||
void_shards: z.number().default(0),
|
||||
flag_conquer_self: z.number().default(0),
|
||||
flag_returns: z.number().default(0),
|
||||
mage_plays: z.number().default(0),
|
||||
paladin_plays: z.number().default(0),
|
||||
shaman_plays: z.number().default(0),
|
||||
warrior_plays: z.number().default(0),
|
||||
mage_wins: z.number().default(0),
|
||||
paladin_wins: z.number().default(0),
|
||||
shaman_wins: z.number().default(0),
|
||||
warrior_wins: z.number().default(0),
|
||||
mage_losses: z.number().default(0),
|
||||
paladin_losses: z.number().default(0),
|
||||
shaman_losses: z.number().default(0),
|
||||
warrior_losses: z.number().default(0),
|
||||
repaired: z.number().default(0),
|
||||
repaired_common: z.number().default(0),
|
||||
repaired_rare: z.number().default(0),
|
||||
@@ -32,5 +70,7 @@ export const warlordsStatsSchema = z.object({
|
||||
wins_teamdeathmatch: z.number().default(0),
|
||||
kills_capturetheflag: z.number().default(0),
|
||||
kills_domination: z.number().default(0),
|
||||
kills_teamdeathmatch: z.number().default(0)
|
||||
kills_teamdeathmatch: z.number().default(0),
|
||||
...warlordsClassStats().left_right,
|
||||
...warlordsClassStats().right_left
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user