finished skywars table

This commit is contained in:
2025-08-24 14:19:24 +02:00
parent ba835830b0
commit 8aeaf27b45
3 changed files with 43 additions and 21 deletions

View File

@@ -1,5 +1,25 @@
import { BedwarsModeStats } from "./hypixel/bedwars"
import { devide } from "./hypixel/general"
import { SkywarsModeStats } from "./hypixel/skywars"
export function concatSkywarsStats(...stats: SkywarsModeStats[]) {
const summed = concatStatsArray<SkywarsModeStats>(["kills", "deaths", "wins", "losses"], ...stats)
const ret = {
...summed,
kd: devide(summed.kills, summed.deaths),
wl: devide(summed.wins, summed.losses)
}
return [
ret.kills,
ret.deaths,
ret.kd,
ret.wins,
ret.losses,
ret.wl
]
}
export function concatBedwarsStats(...stats: BedwarsModeStats[]) {
if (stats.length === 0) return []
@@ -15,7 +35,6 @@ export function concatBedwarsStats(...stats: BedwarsModeStats[]) {
"beds_lost_bedwars"
], ...stats)
// winstreak special handling (max of provided, ignore -1)
let winstreak = -1
for (const s of stats) {
if (s.winstreak !== -1) winstreak = Math.max(winstreak, s.winstreak)