From 1ad9ecf781a797754079db16cbd980fa110ff30a Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Wed, 1 Mar 2023 18:44:45 +0200 Subject: [PATCH] Support Super Chump paint stat Closes #1288 --- .../build-analyzer/core/ability-values.json | 3 +- app/features/build-analyzer/core/stats.ts | 38 ++++++++++--------- 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/app/features/build-analyzer/core/ability-values.json b/app/features/build-analyzer/core/ability-values.json index 6e6973556..090161feb 100644 --- a/app/features/build-analyzer/core/ability-values.json +++ b/app/features/build-analyzer/core/ability-values.json @@ -65,5 +65,6 @@ "SplashAroundVelocityMax": [0.0, 0.0, 0.0], "SplashAroundPaintRadius": [0.0, 0.0, 0.0], "SpecialTotalFrame": [0.0, 0.0, 0.0], - "PowerUpFrame": [0.0, 0.0, 0.0] + "PowerUpFrame": [0.0, 0.0, 0.0], + "CrossPaintRadius": [0.0, 0.0, 0.0] } diff --git a/app/features/build-analyzer/core/stats.ts b/app/features/build-analyzer/core/stats.ts index 6541286a1..718aa0083 100644 --- a/app/features/build-analyzer/core/stats.ts +++ b/app/features/build-analyzer/core/stats.ts @@ -1218,25 +1218,29 @@ function specialDamageDistance( function specialPaintRadius( args: StatFunctionInput ): AnalyzedBuild["stats"]["specialPaintRadius"] { - if (!hasEffect({ key: "PaintRadius", weapon: args.specialWeaponParams })) { - return; + for (const key of ["PaintRadius", "CrossPaintRadius"] as const) { + if (!hasEffect({ key, weapon: args.specialWeaponParams })) { + continue; + } + + const SPECIAL_PAINT_RADIUS_KEY = "SPU"; + const { baseEffect, effect } = abilityPointsToEffects({ + abilityPoints: apFromMap({ + abilityPoints: args.abilityPoints, + ability: SPECIAL_PAINT_RADIUS_KEY, + }), + key, + weapon: args.specialWeaponParams, + }); + + return { + baseValue: roundToNDecimalPlaces(baseEffect), + value: roundToNDecimalPlaces(effect), + modifiedBy: SPECIAL_PAINT_RADIUS_KEY, + }; } - const SPECIAL_PAINT_RADIUS_KEY = "SPU"; - const { baseEffect, effect } = abilityPointsToEffects({ - abilityPoints: apFromMap({ - abilityPoints: args.abilityPoints, - ability: SPECIAL_PAINT_RADIUS_KEY, - }), - key: "PaintRadius", - weapon: args.specialWeaponParams, - }); - - return { - baseValue: roundToNDecimalPlaces(baseEffect), - value: roundToNDecimalPlaces(effect), - modifiedBy: SPECIAL_PAINT_RADIUS_KEY, - }; + return; } export function specialFieldHp(