mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
feat: sort options
This commit is contained in:
1 parent
ded71bf4f9
commit
e7525006b5
5 files changed
+655
-76
No files matched your search
@@ -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
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user