fix: some linting for new proto 2

This commit is contained in:
TrèsAbhi committed 2024-10-05 15:57:34 -05:00
1 parent 94f67e30f1
commit 79bc259565
22 files changed
+183 -163

No files matched your search

@@ -6,7 +6,7 @@ export function filterTank(filters: TankFilters, tank: TankDefinition) {
(filters.tiers.length === 0 || filters.tiers.includes(tank.tier)) &&
(filters.nations.length === 0 || filters.nations.includes(tank.nation)) &&
(filters.classes.length === 0 || filters.classes.includes(tank.class)) &&
(filters.types.length === 0 || filters.types.includes(tank.treeType)) &&
(filters.types.length === 0 || filters.types.includes(tank.type)) &&
(filters.testing === 'include' ||
(filters.testing === 'only' && tank.testing) ||
(filters.testing === 'exclude' && !tank.testing))
@@ -1,13 +1,19 @@
import type { GunDefinition } from '@blitzkit/core';
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;
if (gun.gunType!.$case === 'regular') {
return gun.gunType!.value.regular.reload;
} else if (gun.gunType!.$case === 'autoLoader') {
return (
gun.gunType!.value.autoLoader.clipReload +
(gun.gunType!.value.autoLoader.shellCount - 1) *
gun.gunType!.value.autoLoader.intraClip
);
} else {
return (
gun.reload.reduce((a, b) => a + b, 0) + (gun.count - 1) * gun.intraClip
gun.gunType!.value.autoReloader.shellReloads.reduce((a, b) => a + b, 0) +
(gun.gunType!.value.autoReloader.shellCount - 1) *
gun.gunType!.value.autoReloader.intraClip
);
}
}
@@ -1,6 +1,6 @@
import type { ModelArmor } from '@blitzkit/core';
import type { Armor } from '@blitzkit/core';
export function resolveArmor(armor: ModelArmor, index: number) {
export function resolveArmor(armor: Armor, index: number) {
const spaced = armor.spaced?.includes(index) ?? false;
const thickness = index === -1 ? 0 : (armor.thickness[index] ?? 0);