feat: sort options

This commit is contained in:
TrèsAbhi committed 2024-02-09 16:01:06 -06:00
1 parent ded71bf4f9
commit e7525006b5
5 files changed
+655 -76

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
import { GunDefinition, ShellDefinition } from './tankDefinitions';
export function resolveDpm(gun: GunDefinition, shell: ShellDefinition) {
if (gun.type === 'regular') {
return (shell.damage.armor / gun.reload) * 60;
} else if (gun.type === 'autoLoader') {
return (
((shell.damage.armor * gun.count) /
(gun.reload + (gun.count - 1) * gun.interClip)) *
60
);
} else {
return (
((shell.damage.armor * gun.count) /
(gun.reload.reduce((a, b) => a + b, 0) +
(gun.count - 1) * gun.interClip)) *
60
);
}
}
+13
View File
@@ -0,0 +1,13 @@
import { GunDefinition } from './tankDefinitions';
export function resolveReload(gun: GunDefinition) {
if (gun.type === 'regular') {
return gun.reload;
} else if (gun.type === 'autoLoader') {
return gun.reload + (gun.count - 1) * gun.interClip;
} else {
return (
gun.reload.reduce((a, b) => a + b, 0) + (gun.count - 1) * gun.interClip
);
}
}