From 474e71843d6db164e97239c5aa7234f6ca9289e9 Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Sun, 4 Oct 2026 17:57:12 -0500 Subject: [PATCH] assaultDamageCoefficient --- packages/website/src/config/characteristics.ts | 10 +++++++++- .../website/src/core/blitzkit/tankCharacteristics.ts | 10 ---------- packages/website/src/stores/tankopedia.ts | 4 ++-- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/packages/website/src/config/characteristics.ts b/packages/website/src/config/characteristics.ts index 7dfc8e3b1..914ca878b 100644 --- a/packages/website/src/config/characteristics.ts +++ b/packages/website/src/config/characteristics.ts @@ -28,7 +28,7 @@ export const characteristics = { damage: { type: CharacteristicType.Number, - compute({ shell, environment, equalizer, script }) { + compute({ shell, environment, equalizer, script, gun }) { let coefficient = 1; if (environment.equalize) coefficient *= equalizer.damage; @@ -55,6 +55,14 @@ export const characteristics = { coefficient *= effect.bonusValues!.factor; }); + if (gun.assault_ranges && gun.assault_ranges.types.includes(shell.type)) { + const range = gun.assault_ranges.ranges.find( + ({ distance }) => distance >= environment.distance, + ); + + if (range) coefficient *= range.factor; + } + return coefficient * shell.armor_damage; }, }, diff --git a/packages/website/src/core/blitzkit/tankCharacteristics.ts b/packages/website/src/core/blitzkit/tankCharacteristics.ts index 31596587d..bbb5cf683 100644 --- a/packages/website/src/core/blitzkit/tankCharacteristics.ts +++ b/packages/website/src/core/blitzkit/tankCharacteristics.ts @@ -166,12 +166,6 @@ export function tankCharacteristics( const intraClipCoefficient = coefficient([hasShellReloadBoost, -0.3]); const burstShells = gun.burst?.count ?? 1; const burstInterShell = gun.burst?.interval; - const assaultDamageCoefficient = - gun.assault_ranges && gun.assault_ranges.types.includes(shell.type) - ? (gun.assault_ranges.ranges.find( - ({ distance }) => distance >= assaultDistance, - )?.factor ?? 0) - : 1; const moduleDamageCoefficient = coefficient([hasTungsten, 0.15]); const reloadCoefficient = (coefficient([hasGunRammer, -0.05]) * @@ -340,10 +334,6 @@ export function tankCharacteristics( stockTurret.weight + stockGun.weight; const resolvedEnginePower = engine.power * enginePowerCoefficient; - const damageCoefficientWithoutAssault = - armorDamageCoefficient * equalizer.damage; - const damageCoefficient = - damageCoefficientWithoutAssault * assaultDamageCoefficient; const dpm = resolveDpm( gun, shell, diff --git a/packages/website/src/stores/tankopedia.ts b/packages/website/src/stores/tankopedia.ts index 58afd9a56..89d02fb97 100644 --- a/packages/website/src/stores/tankopedia.ts +++ b/packages/website/src/stores/tankopedia.ts @@ -77,7 +77,7 @@ export enum TankopediaRelativeAgainst { export interface TankEnvironment { equalize: boolean; - assault_distance: number; + distance: number; } interface Tankopedia { @@ -125,7 +125,7 @@ export const Tankopedia = new Soapstone( antagonist: createTankState(tank), model: models.models[tank.id], - environment: { equalize: false, assault_distance: 0 }, + environment: { equalize: false, distance: 0 }, relativeAgainst: TankopediaRelativeAgainst.Class, editStatic: false,