mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 03:29:51 +02:00
14 lines
373 B
TypeScript
14 lines
373 B
TypeScript
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.intraClip;
|
|
} else {
|
|
return (
|
|
gun.reload.reduce((a, b) => a + b, 0) + (gun.count - 1) * gun.intraClip
|
|
);
|
|
}
|
|
}
|