mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-22 11:17:05 +02:00
feat: wm8 and average tier calculation
This commit is contained in:
1 parent
c2fca42a86
commit
a12f969251
15 files changed
+315
-328
No files matched your search
@@ -0,0 +1,44 @@
|
||||
import { AllStats, SupplementaryStats } from '../types/accountInfo.js';
|
||||
import GenericStats from './GenericStats/index.js';
|
||||
|
||||
export interface GenericAllStatsProps {
|
||||
stats: AllStats;
|
||||
supplementaryStats?: SupplementaryStats;
|
||||
}
|
||||
|
||||
export default function GenericAllStats({
|
||||
stats,
|
||||
supplementaryStats,
|
||||
}: GenericAllStatsProps) {
|
||||
return (
|
||||
<GenericStats
|
||||
stats={[
|
||||
['Winrate', `${(100 * (stats.wins / stats.battles)).toFixed(2)}%`],
|
||||
['WN8', supplementaryStats?.wn8.toFixed(0) ?? -Infinity],
|
||||
[
|
||||
'Survival',
|
||||
`${(100 * (stats.survived_battles / stats.battles)).toFixed(2)}%`,
|
||||
],
|
||||
['Accuracy', `${((stats.hits / stats.shots) * 100).toFixed(2)}%`],
|
||||
['Battles', stats.battles],
|
||||
['Wins', stats.wins],
|
||||
['Losses', stats.losses],
|
||||
['Average damage', (stats.damage_dealt / stats.battles).toFixed(0)],
|
||||
['Average tier', supplementaryStats?.tier.toFixed(2) ?? -Infinity],
|
||||
['Average XP', (stats.xp / stats.battles).toFixed(0)],
|
||||
['Average shots', (stats.shots / stats.battles).toFixed(2)],
|
||||
['Average hits', (stats.hits / stats.battles).toFixed(2)],
|
||||
['Average kills', (stats.frags / stats.battles).toFixed(2)],
|
||||
['Average spots', (stats.spotted / stats.battles).toFixed(2)],
|
||||
[
|
||||
'Damage ratio',
|
||||
(stats.damage_dealt / stats.damage_received).toFixed(2),
|
||||
],
|
||||
[
|
||||
'Kills to death ratio',
|
||||
(stats.frags / (stats.battles - stats.survived_battles)).toFixed(2),
|
||||
],
|
||||
]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user