Added wool games table
This commit is contained in:
@@ -1,6 +1,29 @@
|
||||
import { CLASSES, DIFFICULTIES, EASY_XP, ICONS, NORMAL_XP, PRESTIGES } from "@/data/hypixel/woolgames"
|
||||
import { getColorFromCode } from "@/lib/colors"
|
||||
import { floorLevel } from "../general"
|
||||
import { NonNullStats } from "@/lib/schema/player"
|
||||
import { devide, floorLevel } from "../general"
|
||||
|
||||
export function getWoolGamesWoolWarsClassStats(
|
||||
classId: typeof CLASSES[number]["id"],
|
||||
stats: NonNullable<NonNullStats["WoolGames"]>["wool_wars"]
|
||||
) {
|
||||
const nums: number[] = []
|
||||
for (let i = 0; i++; i < 7) {
|
||||
nums.push(0)
|
||||
}
|
||||
|
||||
if (!stats) return nums
|
||||
|
||||
return [
|
||||
stats.stats?.classes[classId]?.kills || 0,
|
||||
stats.stats?.classes[classId]?.assists || 0,
|
||||
stats.stats?.classes[classId]?.deaths || 0,
|
||||
devide(stats.stats?.classes[classId]?.kills || 0, stats.stats?.classes[classId]?.deaths || 0),
|
||||
stats.stats?.classes[classId]?.wool_placed || 0,
|
||||
stats.stats?.classes[classId]?.blocks_broken || 0,
|
||||
stats.stats?.classes[classId]?.powerups_gotten || 0
|
||||
]
|
||||
}
|
||||
|
||||
export function getWoolGamesWoolWarsClass(val?: string) {
|
||||
const klass = CLASSES.find(c => c.id === val?.toLowerCase())
|
||||
|
||||
@@ -785,7 +785,7 @@ export const woolGamesStatsSchema = z.object({
|
||||
engineer: woolGamesClassStats.optional(),
|
||||
golem: woolGamesClassStats.optional(),
|
||||
assault: woolGamesClassStats.optional()
|
||||
}).optional()
|
||||
}).default({})
|
||||
}).optional()
|
||||
}).optional()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user