Updated mw stats
This commit is contained in:
@@ -586,19 +586,38 @@ function megawallsClassStats() {
|
||||
] as const
|
||||
|
||||
const stats = [
|
||||
"kills",
|
||||
"deaths",
|
||||
"final_kills",
|
||||
"final_deaths",
|
||||
"wins",
|
||||
"losses"
|
||||
] as const
|
||||
|
||||
const classesOther = [
|
||||
"prestige",
|
||||
"enderchest_rows"
|
||||
] as const
|
||||
|
||||
const entries = new Map<string, z.ZodDefault<z.ZodNumber>>()
|
||||
const classes = new Map<string, z.ZodObject<{ prestige: z.ZodDefault<z.ZodNumber>, enderchest_rows: z.ZodDefault<z.ZodNumber> }, z.core.$loose>>()
|
||||
|
||||
for (const id of ids) {
|
||||
for (const stat of stats) {
|
||||
entries.set(`${id}_${stat}`, z.number().default(0))
|
||||
}
|
||||
for (const klass of classesOther) {
|
||||
classes.set(id, z.looseObject({ prestige: z.number().default(0), enderchest_rows: z.number().default(0) }))
|
||||
}
|
||||
}
|
||||
|
||||
return Object.fromEntries(entries) as Record<`${typeof ids[number]}_${typeof stats[number]}`, z.ZodDefault<z.ZodNumber>>
|
||||
return {
|
||||
classStats: Object.fromEntries(entries) as Record<`${typeof ids[number]}_${typeof stats[number]}`, z.ZodDefault<z.ZodNumber>>,
|
||||
classOther: Object.fromEntries(classes) as Record<
|
||||
`${typeof ids[number]}`,
|
||||
z.ZodObject<{ prestige: z.ZodDefault<z.ZodNumber>, enderchest_rows: z.ZodDefault<z.ZodNumber> }, z.core.$loose>
|
||||
>
|
||||
}
|
||||
}
|
||||
|
||||
function megawallsModeStats() {
|
||||
@@ -640,6 +659,7 @@ export const megawallsStats = z.looseObject({
|
||||
coins: z.number().default(0),
|
||||
wither_damage: z.number().default(0),
|
||||
witherDamage: z.number().default(0),
|
||||
...megawallsClassStats(),
|
||||
classes: z.looseObject(megawallsClassStats().classOther).optional(),
|
||||
...megawallsClassStats().classStats,
|
||||
...megawallsModeStats()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user