From d28c56fe1c51a2a5faf4aff7635c54c2633eec75 Mon Sep 17 00:00:00 2001 From: Mark Greene Date: Sun, 28 Dec 2025 09:58:32 +1300 Subject: [PATCH 01/13] Add Randomise function to module selection --- .../components/Modules.tsx | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Modules.tsx b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Modules.tsx index 55703da90..92cbacacd 100644 --- a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Modules.tsx +++ b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Modules.tsx @@ -392,6 +392,42 @@ export function Modules() { > {strings.website.tools.tankopedia.configuration.modules.upgrade} + )} From d1001df3cf0599f2be13952102a71c6f0be01c47 Mon Sep 17 00:00:00 2001 From: Mark Greene Date: Sun, 28 Dec 2025 10:06:53 +1300 Subject: [PATCH 02/13] Add randomise function to modules --- .../Tankopedia/CharacteristicsSection/components/Modules.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Modules.tsx b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Modules.tsx index 92cbacacd..6b1da4aae 100644 --- a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Modules.tsx +++ b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Modules.tsx @@ -464,4 +464,4 @@ export function Modules() { ); -} +} \ No newline at end of file From 9e225d2093c532f53945131efd5d478083d1c356 Mon Sep 17 00:00:00 2001 From: Mark Greene Date: Sun, 28 Dec 2025 12:12:56 +1300 Subject: [PATCH 03/13] Fixed Provison Button Sizes --- .../components/ModuleButtons/GenericTankComponentButton.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/website/src/components/ModuleButtons/GenericTankComponentButton.tsx b/packages/website/src/components/ModuleButtons/GenericTankComponentButton.tsx index 2ca36cd35..1d9409963 100644 --- a/packages/website/src/components/ModuleButtons/GenericTankComponentButton.tsx +++ b/packages/website/src/components/ModuleButtons/GenericTankComponentButton.tsx @@ -34,15 +34,14 @@ export function GenericTankComponentButton({ height: 32, position: 'absolute', opacity: props.disabled ? 0.5 : 1, - transform: 'translate(-50%, -50%) scale(0.75)', + transform: 'translate(-50%, -50%) scale(1)', top: '50%', left: '50%', ...iconStyles, }} /> - {children} ); -} +} \ No newline at end of file From 45c7d741600eb699f5c0139ec90ef98e1f3e1517 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Sat, 27 Dec 2025 18:45:09 -0600 Subject: [PATCH 04/13] revert: icon scale --- .../GenericTankComponentButton.tsx | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/website/src/components/ModuleButtons/GenericTankComponentButton.tsx b/packages/website/src/components/ModuleButtons/GenericTankComponentButton.tsx index 1d9409963..65d32a2ef 100644 --- a/packages/website/src/components/ModuleButtons/GenericTankComponentButton.tsx +++ b/packages/website/src/components/ModuleButtons/GenericTankComponentButton.tsx @@ -1,12 +1,12 @@ -import type { HTMLAttributes } from 'react'; +import type { HTMLAttributes } from "react"; import { TankComponentButton, type TankComponentButtonProps, -} from './TankComponentButton'; +} from "./TankComponentButton"; interface GenericTankComponentButtonProps extends TankComponentButtonProps { icon: string; - iconStyles?: HTMLAttributes['style']; + iconStyles?: HTMLAttributes["style"]; } export function GenericTankComponentButton({ @@ -21,7 +21,7 @@ export function GenericTankComponentButton({ style={{ width: 48, height: 40, - position: 'relative', + position: "relative", }} > @@ -44,4 +44,4 @@ export function GenericTankComponentButton({ {children} ); -} \ No newline at end of file +} From 7e6925772e035eaf683ceaa7e35d64d2c18860db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Sat, 27 Dec 2025 20:02:51 -0600 Subject: [PATCH 05/13] fix: plural --- docs/changelogs/1.29.8.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelogs/1.29.8.md b/docs/changelogs/1.29.8.md index 52d113590..fa010e23f 100644 --- a/docs/changelogs/1.29.8.md +++ b/docs/changelogs/1.29.8.md @@ -1,6 +1,6 @@ # BlitzKit 1.29.8 -Thank you to [Mark Greene](https://github.com/Hitjack007) for your contribution this update. +Thank you to [Mark Greene](https://github.com/Hitjack007) for your contributions this update. ## Features From 5e4c5fc23043ef1791a7d2d730d7ff5af2b91e43 Mon Sep 17 00:00:00 2001 From: Mark Greene Date: Tue, 30 Dec 2025 15:43:16 +1300 Subject: [PATCH 06/13] Fixed Provisions not affecting terrain resistances and added commented-out helper function to log provisions later if needed. --- .../CharacteristicsSection/components/Provisions.tsx | 9 +++++++++ .../website/src/core/blitzkit/tankCharacteristics.ts | 11 +++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Provisions.tsx b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Provisions.tsx index 258b23141..4590a2edc 100644 --- a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Provisions.tsx +++ b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Provisions.tsx @@ -14,6 +14,15 @@ export function Provisions() { const provisionsList = availableProvisions(tank, gun, provisionDefinitions); const { strings } = useLocale(); + // FOR PROVISION LOGGING PURPOSES + // + // console.log('ALL PROVISIONS:', Object.entries(provisionDefinitions.provisions).map(([id, p]) => ({ + // id: Number(id), + // name: p.name, + // crew: p.crew, + // hasCrewBonus: !!p.crew + // }))); + return ( diff --git a/packages/website/src/core/blitzkit/tankCharacteristics.ts b/packages/website/src/core/blitzkit/tankCharacteristics.ts index 86fb8ca5b..396f0d82e 100644 --- a/packages/website/src/core/blitzkit/tankCharacteristics.ts +++ b/packages/website/src/core/blitzkit/tankCharacteristics.ts @@ -236,12 +236,11 @@ export function tankCharacteristics( [hasImprovedEnginePowerBoost, 0.01], [true, crewSkills.virtuoso / 100], ) * coefficient([true, progressiveStat(driverMastery)]); - const resistanceHardCoefficient = coefficient([hasImprovedSuspension, -0.2]); - const resistanceMediumCoefficient = coefficient([ - hasImprovedSuspension, - -0.15, - ]); - const resistanceSoftCoefficient = coefficient([hasImprovedSuspension, -0.3]); + + const resistanceHardCoefficient = coefficient([hasImprovedSuspension, -0.2]) * coefficient([true, degressiveStat(driverMastery)]); + const resistanceMediumCoefficient = coefficient([hasImprovedSuspension, -0.15]) * coefficient([true, degressiveStat(driverMastery)]); + const resistanceSoftCoefficient = coefficient([hasImprovedSuspension, -0.3]) * coefficient([true, degressiveStat(driverMastery)]); + const viewRangeCoefficient = coefficient([ hasImprovedOptics, From 0bd660f255aabcfa232f420643e1b51a5b174135 Mon Sep 17 00:00:00 2001 From: Mark Greene Date: Tue, 30 Dec 2025 15:47:22 +1300 Subject: [PATCH 07/13] Revert changes --- .../GenericTankComponentButton.tsx | 20 +++++++++---------- .../components/Modules.tsx | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/website/src/components/ModuleButtons/GenericTankComponentButton.tsx b/packages/website/src/components/ModuleButtons/GenericTankComponentButton.tsx index 65d32a2ef..1d9409963 100644 --- a/packages/website/src/components/ModuleButtons/GenericTankComponentButton.tsx +++ b/packages/website/src/components/ModuleButtons/GenericTankComponentButton.tsx @@ -1,12 +1,12 @@ -import type { HTMLAttributes } from "react"; +import type { HTMLAttributes } from 'react'; import { TankComponentButton, type TankComponentButtonProps, -} from "./TankComponentButton"; +} from './TankComponentButton'; interface GenericTankComponentButtonProps extends TankComponentButtonProps { icon: string; - iconStyles?: HTMLAttributes["style"]; + iconStyles?: HTMLAttributes['style']; } export function GenericTankComponentButton({ @@ -21,7 +21,7 @@ export function GenericTankComponentButton({ style={{ width: 48, height: 40, - position: "relative", + position: 'relative', }} > @@ -44,4 +44,4 @@ export function GenericTankComponentButton({ {children} ); -} +} \ No newline at end of file diff --git a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Modules.tsx b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Modules.tsx index 6b1da4aae..1170e5e16 100644 --- a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Modules.tsx +++ b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Modules.tsx @@ -394,7 +394,7 @@ export function Modules() { - )} From d2fa93ee714058af094b22184498336fceb04d05 Mon Sep 17 00:00:00 2001 From: Mark Greene Date: Tue, 30 Dec 2025 15:51:57 +1300 Subject: [PATCH 09/13] Revert changes --- .../components/Modules.tsx | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Modules.tsx b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Modules.tsx index c7fc9837f..63a4275fb 100644 --- a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Modules.tsx +++ b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Modules.tsx @@ -176,17 +176,11 @@ export function Modules() { (turret) => turret.id === unlock.id )!; - // Check if current gun exists in new turret - const gunInNewTurret = draft.protagonist.turret.guns.find( - (gun) => gun.id === draft.protagonist.gun.id - ); - - if (gunInNewTurret) { - // Gun exists - get it FROM this turret (this fixes the bug!) - draft.protagonist.gun = gunInNewTurret; - draft.protagonist.shell = gunInNewTurret.shells[0]; - } else { - // Gun doesn't exist - select top gun from new turret + if ( + !draft.protagonist.turret.guns.some( + (gun) => gun.id === draft.protagonist.gun.id + ) + ) { draft.protagonist.gun = draft.protagonist.turret.guns.at(-1)!; draft.protagonist.shell = draft.protagonist.gun.shells[0]; } @@ -428,4 +422,4 @@ export function Modules() { ); -} \ No newline at end of file +} From 53b0f045124fa19e2f07cb195523e81a503d3b2b Mon Sep 17 00:00:00 2001 From: Mark Greene Date: Tue, 30 Dec 2025 15:53:25 +1300 Subject: [PATCH 10/13] Revert changes --- .../components/Modules.tsx | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Modules.tsx b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Modules.tsx index 63a4275fb..219412b84 100644 --- a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Modules.tsx +++ b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Modules.tsx @@ -176,11 +176,17 @@ export function Modules() { (turret) => turret.id === unlock.id )!; - if ( - !draft.protagonist.turret.guns.some( - (gun) => gun.id === draft.protagonist.gun.id - ) - ) { + // Check if current gun exists in new turret + const gunInNewTurret = draft.protagonist.turret.guns.find( + (gun) => gun.id === draft.protagonist.gun.id + ); + + if (gunInNewTurret) { + // Gun exists - get it FROM this turret + draft.protagonist.gun = gunInNewTurret; + draft.protagonist.shell = gunInNewTurret.shells[0]; + } else { + // Gun doesn't exist - select top gun from new turret draft.protagonist.gun = draft.protagonist.turret.guns.at(-1)!; draft.protagonist.shell = draft.protagonist.gun.shells[0]; } @@ -422,4 +428,4 @@ export function Modules() { ); -} +} \ No newline at end of file From 39f1389d77e81245a31fcafad946049a54aae717 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Mon, 29 Dec 2025 21:27:41 -0600 Subject: [PATCH 11/13] Remove unused provision logging comments Removed commented-out logging code for provisions. --- .../CharacteristicsSection/components/Provisions.tsx | 9 --------- 1 file changed, 9 deletions(-) diff --git a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Provisions.tsx b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Provisions.tsx index 4590a2edc..258b23141 100644 --- a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Provisions.tsx +++ b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Provisions.tsx @@ -14,15 +14,6 @@ export function Provisions() { const provisionsList = availableProvisions(tank, gun, provisionDefinitions); const { strings } = useLocale(); - // FOR PROVISION LOGGING PURPOSES - // - // console.log('ALL PROVISIONS:', Object.entries(provisionDefinitions.provisions).map(([id, p]) => ({ - // id: Number(id), - // name: p.name, - // crew: p.crew, - // hasCrewBonus: !!p.crew - // }))); - return ( From faf802cf3de619b292fd40a97ed6f86cbc487573 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Tue, 30 Dec 2025 19:02:05 -0600 Subject: [PATCH 12/13] revert: Modules.tsx --- .../Tankopedia/CharacteristicsSection/components/Modules.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Modules.tsx b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Modules.tsx index 219412b84..55703da90 100644 --- a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Modules.tsx +++ b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Modules.tsx @@ -428,4 +428,4 @@ export function Modules() { ); -} \ No newline at end of file +} From 540e56a12df4622f107555c4de7dd537d5da51b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Tue, 30 Dec 2025 19:03:00 -0600 Subject: [PATCH 13/13] feat: format all --- .../src/core/blitzkit/tankCharacteristics.ts | 190 +++++++++--------- 1 file changed, 98 insertions(+), 92 deletions(-) diff --git a/packages/website/src/core/blitzkit/tankCharacteristics.ts b/packages/website/src/core/blitzkit/tankCharacteristics.ts index 396f0d82e..dcab1976c 100644 --- a/packages/website/src/core/blitzkit/tankCharacteristics.ts +++ b/packages/website/src/core/blitzkit/tankCharacteristics.ts @@ -19,9 +19,9 @@ import { type TankDefinition, type TrackDefinition, type TurretDefinition, -} from '@blitzkit/core'; -import { coefficient } from '@blitzkit/core/src/blitzkit/coefficient'; -import type { EquipmentMatrix } from '../../stores/duel'; +} from "@blitzkit/core"; +import { coefficient } from "@blitzkit/core/src/blitzkit/coefficient"; +import type { EquipmentMatrix } from "../../stores/duel"; export type TankCharacteristics = ReturnType; export type TankCharacteristicsKey = keyof TankCharacteristics; @@ -76,7 +76,7 @@ export function tankCharacteristics( tankModelDefinition: ModelDefinition; equipmentDefinitions: EquipmentDefinitions; provisionDefinitions: ProvisionDefinitions; - }, + } ) { const preset = equipmentDefinitions.presets[tank.equipment_preset]; const turretModelDefinition = tankModelDefinition.turrets[turret.id]; @@ -86,7 +86,7 @@ export function tankCharacteristics( return preset.slots.some((slot, index) => { const choice = equipmentMatrix[Math.floor(index / 3)][index % 3]; if (choice === 0) return false; - const equipped = slot[choice === -1 ? 'left' : 'right']; + const equipped = slot[choice === -1 ? "left" : "right"]; return equipped === id; }); } @@ -138,7 +138,7 @@ export function tankCharacteristics( provisionDefinitions.provisions[provision].crew ? total + provisionDefinitions.provisions[provision].crew! / 100 : total, - 0, + 0 ) + (hasImprovedVentilation ? 0.08 : 0); const commanderMastery = 1 + provisionCrewBonus; const loaderMastery = @@ -158,19 +158,19 @@ export function tankCharacteristics( coefficient( [applyReactiveArmor && shell.type !== ShellType.HE, -0.27], [applyDynamicArmor, -0.1], - [applySpallLiner && shell.type === ShellType.HE, -0.2], + [applySpallLiner && shell.type === ShellType.HE, -0.2] ); const assaultDamageCoefficient = gun.assault_ranges && gun.assault_ranges.types.includes(shell.type) - ? (gun.assault_ranges.ranges.find( - ({ distance }) => distance >= assaultDistance, - )?.factor ?? 0) + ? gun.assault_ranges.ranges.find( + ({ distance }) => distance >= assaultDistance + )?.factor ?? 0 : 1; const moduleDamageCoefficient = coefficient([hasTungsten, 0.15]); const reloadCoefficient = (coefficient([hasGunRammer, -0.05]) * coefficient([true, degressiveStat(loaderMastery)])) / - coefficient([hasAdrenaline && gun.gun_type!.$case === 'regular', 0.17]); + coefficient([hasAdrenaline && gun.gun_type!.$case === "regular", 0.17]); const penetrationCoefficient = coefficient([ hasCalibratedShells, resolvePenetrationCoefficient(true, shell.type) - 1, @@ -178,16 +178,16 @@ export function tankCharacteristics( const healthCoefficient = coefficient( [hasSandbagArmor, 0.03], [hasEnhancedSandbagArmor, 0.06], - [hasImprovedAssembly, 0.04], + [hasImprovedAssembly, 0.04] ); const shellVelocityCoefficient = coefficient( [hasSupercharger, 0.35], - [hasImprovedGunPowder, 0.3], + [hasImprovedGunPowder, 0.3] ); const aimTimeCoefficient = coefficient( [hasEnhancedGunLayingDrive, -0.15], - [hasReticleCalibration, -0.3], + [hasReticleCalibration, -0.3] ) * coefficient([true, degressiveStat(gunnerMastery)]); const dispersionStillCoefficient = coefficient([hasRefinedGun, -0.15], [hasReticleCalibration, -0.3]) * @@ -198,19 +198,19 @@ export function tankCharacteristics( ]); const dispersionHullTraverseCoefficient = coefficient( [hasVerticalStabilizer, -0.15], - [true, -crewSkills.smooth_turn / 100], + [true, -crewSkills.smooth_turn / 100] ); const dispersionAfterShotCoefficient = coefficient( [hasVerticalStabilizer, -0.15], - [true, -crewSkills.soft_recoil / 100], + [true, -crewSkills.soft_recoil / 100] ); const dispersionMovingCoefficient = coefficient( [hasVerticalStabilizer, -0.15], - [true, -crewSkills.smooth_driving / 100], + [true, -crewSkills.smooth_driving / 100] ); const dispersionTurretTraverseCoefficient = coefficient( [hasVerticalStabilizer, -0.15], - [true, -crewSkills.smooth_turret * (2 / 100)], + [true, -crewSkills.smooth_turret * (2 / 100)] ); const enginePowerCoefficient = coefficient( [ @@ -225,7 +225,7 @@ export function tankCharacteristics( [hasStandardFuel, 0.03], [hasImprovedFuel, 0.1], [hasGearOil, 0.03], - [hasImprovedGearOil, 0.06], + [hasImprovedGearOil, 0.06] ); const turretTraverseCoefficient = coefficient([hasStandardFuel, 0.03], [hasImprovedFuel, 0.1]) * @@ -234,35 +234,41 @@ export function tankCharacteristics( coefficient( [hasImprovedControl, 0.11], [hasImprovedEnginePowerBoost, 0.01], - [true, crewSkills.virtuoso / 100], + [true, crewSkills.virtuoso / 100] ) * coefficient([true, progressiveStat(driverMastery)]); - const resistanceHardCoefficient = coefficient([hasImprovedSuspension, -0.2]) * coefficient([true, degressiveStat(driverMastery)]); - const resistanceMediumCoefficient = coefficient([hasImprovedSuspension, -0.15]) * coefficient([true, degressiveStat(driverMastery)]); - const resistanceSoftCoefficient = coefficient([hasImprovedSuspension, -0.3]) * coefficient([true, degressiveStat(driverMastery)]); - + const resistanceHardCoefficient = + coefficient([hasImprovedSuspension, -0.2]) * + coefficient([true, degressiveStat(driverMastery)]); + const resistanceMediumCoefficient = + coefficient([hasImprovedSuspension, -0.15]) * + coefficient([true, degressiveStat(driverMastery)]); + const resistanceSoftCoefficient = + coefficient([hasImprovedSuspension, -0.3]) * + coefficient([true, degressiveStat(driverMastery)]); + const viewRangeCoefficient = coefficient([ hasImprovedOptics, tank.class === TankClass.HEAVY ? 0.06 : tank.class === TankClass.MEDIUM - ? 0.08 - : tank.class === TankClass.LIGHT - ? 0.11 - : 0.04, + ? 0.08 + : tank.class === TankClass.LIGHT + ? 0.11 + : 0.04, ]) * coefficient([true, progressiveStat(commanderMastery)]); const fireChanceCoefficient = coefficient([hasProtectiveKit, -0.2]); const speedForwardsSum = sum( [hasImprovedEnginePowerBoost, 4], [hasGearOil, 2], - [hasImprovedGearOil, 4], + [hasImprovedGearOil, 4] ); const speedBackwardsSum = sum( [hasImprovedEnginePowerBoost, 8], [hasGearOil, 2], - [hasImprovedGearOil, 4], + [hasImprovedGearOil, 4] ); const camouflageCoefficientMoving = sum( [ @@ -272,8 +278,8 @@ export function tankCharacteristics( tank.class === TankClass.TANK_DESTROYER ? 0.04 : tank.class === TankClass.HEAVY - ? 0.03 - : 0.02, + ? 0.03 + : 0.02, ]), ], [ @@ -281,11 +287,11 @@ export function tankCharacteristics( tank.class === TankClass.HEAVY ? 0.02 : tank.class === TankClass.MEDIUM - ? 0.04 - : tank.class === TankClass.LIGHT - ? 0.07 - : 0.1, - ], + ? 0.04 + : tank.class === TankClass.LIGHT + ? 0.07 + : 0.1, + ] ); const camouflageCoefficientStill = sum( [ @@ -296,10 +302,10 @@ export function tankCharacteristics( tank.class === TankClass.TANK_DESTROYER ? 0.04 : tank.class === TankClass.HEAVY - ? 0.03 - : 0.02, + ? 0.03 + : 0.02, ], - [true, crewSkills.camouflage * (3 / 100)], + [true, crewSkills.camouflage * (3 / 100)] ), ], [ @@ -307,18 +313,18 @@ export function tankCharacteristics( tank.class === TankClass.HEAVY ? 0.04 : tank.class === TankClass.MEDIUM - ? 0.08 - : tank.class === TankClass.LIGHT - ? 0.14 - : 0.2, - ], + ? 0.08 + : tank.class === TankClass.LIGHT + ? 0.14 + : 0.2, + ] ); const size = normalizeBoundingBox( unionBoundingBox( tankModelDefinition.bounding_box, - turretModelDefinition.bounding_box, - ), + turretModelDefinition.bounding_box + ) ); const weightKg = tank.weight + engine.weight + track.weight + turret.weight + gun.weight; @@ -338,14 +344,14 @@ export function tankCharacteristics( shell, damageCoefficient, reloadCoefficient, - intraClipCoefficient, + intraClipCoefficient ); const intraClip = - gun.gun_type?.$case === 'regular' + gun.gun_type?.$case === "regular" ? undefined : gun.gun_type!.value.intra_clip * intraClipCoefficient; const mostOptimalShellIndex = - gun.gun_type!.$case === 'auto_reloader' + gun.gun_type!.$case === "auto_reloader" ? gun.gun_type!.value.shell_reloads.reduce gun.gun_type!.value.shell_reloads[1] + gun.gun_type!.value.intra_clip ? ((armorDamageCoefficient * shell.armor_damage) / @@ -388,23 +394,23 @@ export function tankCharacteristics( gun.gun_type!.value.shell_reloads.slice(1).length : undefined; const shells = - gun.gun_type!.$case === 'regular' ? 1 : gun.gun_type!.value.shell_count; + gun.gun_type!.$case === "regular" ? 1 : gun.gun_type!.value.shell_count; const shellReloads = - gun.gun_type!.$case === 'auto_reloader' + gun.gun_type!.$case === "auto_reloader" ? gun.gun_type!.value.shell_reloads.map( - (reload) => reload * reloadCoefficient, + (reload) => reload * reloadCoefficient ) : undefined; const shellReload = - gun.gun_type!.$case === 'auto_reloader' + gun.gun_type!.$case === "auto_reloader" ? undefined - : (gun.gun_type!.$case === 'regular' + : (gun.gun_type!.$case === "regular" ? gun.gun_type!.value.reload : gun.gun_type!.value.clip_reload) * reloadCoefficient; const caliber = shell.caliber; const penetration = shell.penetration.near * penetrationCoefficient; const clipDamage = - gun.gun_type!.$case === 'regular' + gun.gun_type!.$case === "regular" ? undefined : gun.gun_type!.value.shell_count * damage; const moduleDamage = shell.module_damage * moduleDamageCoefficient; @@ -598,45 +604,45 @@ export const characteristicsOrder: { items: TankCharacteristicsKey[]; }[] = [ { - name: 'Firepower', + name: "Firepower", items: [ - 'gunType', - 'dpm', - 'shells', - 'shellReload', - 'shellReloads', - 'intraClip', - 'penetration', - 'penetrationAt250m', - 'damage', - 'clipDamage', - 'moduleDamage', - 'caliber', - 'shellNormalization', - 'shellRicochet', - 'shellVelocity', - 'shellRange', - 'shellCapacity', - 'aimTime', - 'dispersion', - 'dispersionMoving', - 'dispersionHullTraversing', - 'dispersionTurretTraversing', - 'dispersionShooting', - 'dispersionGunDamaged', - 'gunDepression', - 'gunElevation', - 'gunFrontalDepression', - 'gunFrontalElevation', - 'gunRearDepression', - 'gunRearElevation', - 'azimuthLeft', - 'azimuthRight', + "gunType", + "dpm", + "shells", + "shellReload", + "shellReloads", + "intraClip", + "penetration", + "penetrationAt250m", + "damage", + "clipDamage", + "moduleDamage", + "caliber", + "shellNormalization", + "shellRicochet", + "shellVelocity", + "shellRange", + "shellCapacity", + "aimTime", + "dispersion", + "dispersionMoving", + "dispersionHullTraversing", + "dispersionTurretTraversing", + "dispersionShooting", + "dispersionGunDamaged", + "gunDepression", + "gunElevation", + "gunFrontalDepression", + "gunFrontalElevation", + "gunRearDepression", + "gunRearElevation", + "azimuthLeft", + "azimuthRight", ], }, { - name: 'Crew', - items: ['crewCount'], + name: "Crew", + items: ["crewCount"], }, ];