Fixed other arcade stats
This commit is contained in:
@@ -36,6 +36,27 @@ export function formatSecondsToTime(seconds: number) {
|
||||
return parts.join(" ")
|
||||
}
|
||||
|
||||
export function formatMillisecondsToTime(milliseconds: number) {
|
||||
if (!Number.isFinite(milliseconds)) return "0ms"
|
||||
milliseconds = Math.floor(Math.max(0, milliseconds))
|
||||
const seconds = Math.floor(milliseconds / 1000)
|
||||
const ms = milliseconds % 1000
|
||||
|
||||
const days = Math.floor(seconds / 86400)
|
||||
const hours = Math.floor((seconds % 86400) / 3600)
|
||||
const minutes = Math.floor((seconds % 3600) / 60)
|
||||
const secs = seconds % 60
|
||||
|
||||
const parts: string[] = []
|
||||
if (days) parts.push(days + "d")
|
||||
if (hours) parts.push(hours + "h")
|
||||
if (minutes) parts.push(minutes + "m")
|
||||
if (secs) parts.push(secs + "s")
|
||||
if (ms || parts.length === 0) parts.push(ms + "ms")
|
||||
|
||||
return parts.join(" ")
|
||||
}
|
||||
|
||||
export function formatRelativeTime(timestamp: number, type: "past" | "future") {
|
||||
const now = Date.now()
|
||||
let diffMs = timestamp - now
|
||||
|
||||
@@ -991,7 +991,35 @@ export const arcadeStatsSchema = z.object({
|
||||
times_knocked_down_zombies: z.number().default(0),
|
||||
doors_opened_zombies: z.number().default(0),
|
||||
windows_repaired_zombies: z.number().default(0),
|
||||
kills_dayone: z.number().default(0),
|
||||
headshots_dayone: z.number().default(0),
|
||||
melee_weapon: z.string().optional(),
|
||||
kills_oneinthequiver: z.number().default(0),
|
||||
deaths_oneinthequiver: z.number().default(0),
|
||||
max_wave: z.number().default(0),
|
||||
kills_dragonwars2: z.number().default(0),
|
||||
eggs_found_easter_simulator: z.number().default(0),
|
||||
poop_collected: z.number().default(0),
|
||||
goals_soccer: z.number().default(0),
|
||||
kicks_soccer: z.number().default(0),
|
||||
powerkicks_soccer: z.number().default(0),
|
||||
coins: z.number().default(0),
|
||||
sw_kills: z.number().default(0),
|
||||
sw_empire_kills: z.number().default(0),
|
||||
sw_rebel_kills: z.number().default(0),
|
||||
sw_deaths: z.number().default(0),
|
||||
sw_shots_fired: z.number().default(0),
|
||||
gifts_grinch_simulator_v2: z.number().default(0),
|
||||
candy_found_halloween_simulator: z.number().default(0),
|
||||
hitw_record_q: z.number().default(0),
|
||||
hitw_record_f: z.number().default(0),
|
||||
rounds_simon_says: z.number().default(0),
|
||||
delivered_santa_simulator: z.number().default(0),
|
||||
spotted_santa_simulator: z.number().default(0),
|
||||
items_found_scuba_simulator: z.number().default(0),
|
||||
total_points_scuba_simulator: z.number().default(0),
|
||||
kills_throw_out: z.number().default(0),
|
||||
deaths_throw_out: z.number().default(0),
|
||||
pixel_party: z.object({
|
||||
wins: z.number().default(0),
|
||||
games_played: z.number().default(0),
|
||||
@@ -1008,7 +1036,12 @@ export const arcadeStatsSchema = z.object({
|
||||
power_ups_collected_hyper: z.number().default(0)
|
||||
}).optional(),
|
||||
dropper: z.object({
|
||||
wins: z.number().default(0)
|
||||
wins: z.number().default(0),
|
||||
flawless_games: z.number().default(0),
|
||||
games_finished: z.number().default(0),
|
||||
maps_completed: z.number().default(0),
|
||||
fastest_game: z.number().default(0),
|
||||
fails: z.number().default(0)
|
||||
}).optional(),
|
||||
...arcadeModeWins(),
|
||||
...arcadeZombiesModeStats(),
|
||||
|
||||
Reference in New Issue
Block a user