woohoo more data driven stats!

This commit is contained in:
tresabhi committed 2026-10-11 00:43:08 -05:00
1 parent 9c67fd3204
commit 95318d0a99
11 files changed
+737 -151

No files matched your search

+1 -1
View File
@@ -1,3 +1,3 @@
export function degressiveStat(crew: number) {
return 0.875 / (0.00375 * 100 * crew + 0.5) - 1;
return 0.875 / (0.00375 * 100 * crew + 0.5);
}
-1
View File
@@ -17,7 +17,6 @@ export * from "./normalizeBoundingBox";
export * from "./patientFetchJSON";
export * from "./popularTanks";
export * from "./progressiveStat";
export * from "./resolveDpm";
export * from "./resolvePenetrationCoefficient";
export * from "./reviews";
export * from "./romanize";
@@ -1,3 +1,3 @@
export function progressiveStat(crew: number) {
return (0.00375 * 100 * crew + 0.5) / 0.875 - 1;
return (0.00375 * 100 * crew + 0.5) / 0.875;
}
-63
View File
@@ -1,63 +0,0 @@
import {
GunDefinition,
GunDefinitionAutoReloader,
ShellDefinition,
} from '../protos';
export function resolveDpm(
gun: GunDefinition,
shell: ShellDefinition,
damageCoefficient = 1,
reloadCoefficient = 1,
intraClipCoefficient = 1,
) {
const alpha = shell.armor_damage * damageCoefficient;
let dps: number;
if (gun.gun_type!.$case === 'regular') {
dps = alpha / (reloadCoefficient * gun.gun_type!.value.reload);
} else if (gun.gun_type!.$case === 'auto_loader') {
const damage = alpha * gun.gun_type!.value.shell_count;
let time = gun.gun_type!.value.clip_reload * reloadCoefficient;
if (gun.burst) {
time +=
(gun.gun_type!.value.shell_count / gun.burst.count - 1) *
gun.gun_type!.value.intra_clip *
intraClipCoefficient;
time +=
(gun.gun_type!.value.shell_count / gun.burst.count) *
(gun.burst.count - 1) *
gun.burst.interval;
} else {
time +=
(gun.gun_type!.value.shell_count - 1) *
gun.gun_type!.value.intra_clip *
intraClipCoefficient;
}
dps = damage / time;
} else {
const mostOptimalShell = gun.gun_type!.value.shell_reloads.reduce<null | {
index: number;
reload: number;
}>((current, reloadRaw, index) => {
const reload =
reloadRaw * reloadCoefficient +
(index > 0
? (gun.gun_type!.value as GunDefinitionAutoReloader).intra_clip *
intraClipCoefficient
: 0);
if (current === null || reload < current.reload) {
return { index, reload };
}
return current;
}, null)!;
dps = alpha / mostOptimalShell?.reload;
}
return dps * 60;
}