Added zombies stats
This commit is contained in:
@@ -4,7 +4,7 @@ import { getArcadeTotalWins } from "@/lib/hypixel/arcade/general"
|
||||
import { NonNullStats } from "@/lib/schema/player"
|
||||
import { BasicStat } from "../../_components/Stats"
|
||||
import GeneralStats from "../GeneralStats"
|
||||
import { ArcadeMiniWallsStats, ArcadePixelPartyStats } from "./stats"
|
||||
import { ArcadeMiniWallsStats, ArcadePixelPartyStats, ArcadeZombieStats } from "./stats"
|
||||
|
||||
export default function ArcadeStats({ stats }: { stats: NonNullStats["Arcade"] }) {
|
||||
if (!stats) return null
|
||||
@@ -29,6 +29,8 @@ export default function ArcadeStats({ stats }: { stats: NonNullStats["Arcade"] }
|
||||
<Separator className="my-4" />
|
||||
<ArcadePixelPartyStats stats={stats} />
|
||||
<Separator className="my-4" />
|
||||
<ArcadeZombieStats stats={stats} />
|
||||
<Separator className="my-4" />
|
||||
</GeneralStats>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -5,6 +5,43 @@ import { capitalizeFirstLetter } from "@/lib/utils"
|
||||
import { BasicStat } from "../../_components/Stats"
|
||||
import { PixelPartyStatsTable } from "./table"
|
||||
|
||||
export function ArcadeZombieStats({ stats }: { stats: NonNullable<NonNullStats["Arcade"]> }) {
|
||||
const bha = devide(stats.bullets_hit_zombies, stats.bullets_shot_zombies) * 100
|
||||
const zha = devide(stats.headshots_zombies, stats.bullets_hit_zombies) * 100
|
||||
return (
|
||||
<>
|
||||
<h2 className="pb-5 text-xl font-bold">Zombies</h2>
|
||||
<div className="flex pb-5">
|
||||
<div className="flex-1">
|
||||
<BasicStat title="Wins: " value={formatNumber(stats.wins_zombies)} />
|
||||
<p>
|
||||
<br />
|
||||
</p>
|
||||
<BasicStat title="Rounds Survived: " value={formatNumber(stats.total_rounds_survived_zombies)} />
|
||||
<BasicStat title="Best Round: " value={formatNumber(stats.best_round_zombies)} />
|
||||
<BasicStat title="Zombies Killed: " value={formatNumber(stats.zombie_kills_zombies)} />
|
||||
</div>
|
||||
<div className="flex-1">
|
||||
<BasicStat title="Bullets Hit: " value={formatNumber(stats.bullets_hit_zombies)} />
|
||||
<BasicStat title="Bullets Shot: " value={formatNumber(stats.bullets_shot_zombies)} />
|
||||
<BasicStat title="Bullet Hit Accuracy: " value={`${formatNumber(bha)}%`} />
|
||||
<BasicStat title="Headshots: " value={formatNumber(stats.headshots_zombies)} />
|
||||
<BasicStat title="Headshot Accuracy: " value={`${formatNumber(zha)}%`} />
|
||||
</div>
|
||||
<div className="flex-1">
|
||||
<BasicStat title="Players Revived: " value={formatNumber(stats.players_revived_zombies)} />
|
||||
<BasicStat title="Times Knocked Down: " value={formatNumber(stats.times_knocked_down_zombies)} />
|
||||
<p>
|
||||
<br />
|
||||
</p>
|
||||
<BasicStat title="Doors Opened: " value={formatNumber(stats.doors_opened_zombies)} />
|
||||
<BasicStat title="Windows Repaired: " value={formatNumber(stats.windows_repaired_zombies)} />
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export function ArcadePixelPartyStats({ stats }: { stats: NonNullable<NonNullStats["Arcade"]> }) {
|
||||
const losses = (stats.pixel_party?.games_played || 0) - (stats.pixel_party?.wins || 0)
|
||||
const wl = formatNumber(devide(stats.pixel_party?.wins || 0, losses))
|
||||
|
||||
Reference in New Issue
Block a user