From 5b645159764e7a0701df780abbe38c354166b81d Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Sun, 18 Sep 2022 21:26:59 +0300 Subject: [PATCH] Booyah Bomb SPU effect --- app/modules/analyzer/stats.ts | 30 ++++++++++++++++++++++++++++++ app/modules/analyzer/types.ts | 1 + app/routes/analyzer.tsx | 10 ++++++++++ public/locales/en/analyzer.json | 1 + 4 files changed, 42 insertions(+) diff --git a/app/modules/analyzer/stats.ts b/app/modules/analyzer/stats.ts index 229060b29..706a55f93 100644 --- a/app/modules/analyzer/stats.ts +++ b/app/modules/analyzer/stats.ts @@ -118,6 +118,7 @@ export function buildStats({ specialInkConsumptionPerSecondPercentage(input), specialReticleRadius: specialReticleRadius(input), specialThrowDistance: specialThrowDistance(input), + specialAutoChargeRate: specialAutoChargeRate(input), }, }; } @@ -1185,3 +1186,32 @@ function specialThrowDistance( modifiedBy: SPECIAL_THROW_DISTANCE_KEY, }; } + +function specialAutoChargeRate( + args: StatFunctionInput +): AnalyzedBuild["stats"]["specialAutoChargeRate"] { + if ( + !hasEffect({ + key: "ChargeRateAutoPerFrame", + weapon: args.specialWeaponParams, + }) + ) { + return; + } + + const SPECIAL_AUTO_CHARGE_RATE_KEY = "SPU"; + const { baseEffect, effect } = abilityPointsToEffects({ + abilityPoints: apFromMap({ + abilityPoints: args.abilityPoints, + ability: SPECIAL_AUTO_CHARGE_RATE_KEY, + }), + key: "ChargeRateAutoPerFrame", + weapon: args.specialWeaponParams, + }); + + return { + baseValue: roundToTwoDecimalPlaces(baseEffect * 100), + value: roundToTwoDecimalPlaces(effect * 100), + modifiedBy: SPECIAL_AUTO_CHARGE_RATE_KEY, + }; +} diff --git a/app/modules/analyzer/types.ts b/app/modules/analyzer/types.ts index 68a7d6c39..875a67654 100644 --- a/app/modules/analyzer/types.ts +++ b/app/modules/analyzer/types.ts @@ -235,6 +235,7 @@ export interface AnalyzedBuild { specialInkConsumptionPerSecondPercentage?: Stat; specialReticleRadius?: Stat; specialThrowDistance?: Stat; + specialAutoChargeRate?: Stat; }; } diff --git a/app/routes/analyzer.tsx b/app/routes/analyzer.tsx index 59ee983fe..05a890b31 100644 --- a/app/routes/analyzer.tsx +++ b/app/routes/analyzer.tsx @@ -358,6 +358,16 @@ export default function BuildAnalyzerPage() { })} /> )} + {analyzed.stats.specialAutoChargeRate && ( + + )}