From 37738ad8e530742a0f8ab44093ea2d7a8d0fdd1a Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Mon, 19 Sep 2022 23:36:40 +0300 Subject: [PATCH] Add Tacticooler effect --- app/modules/analyzer/stats.ts | 30 ++++++++++++++++++++++++++++++ app/modules/analyzer/types.ts | 1 + app/routes/analyzer.tsx | 11 +++++++++++ public/locales/en/analyzer.json | 1 + 4 files changed, 43 insertions(+) diff --git a/app/modules/analyzer/stats.ts b/app/modules/analyzer/stats.ts index 16aff51f8..8610e289b 100644 --- a/app/modules/analyzer/stats.ts +++ b/app/modules/analyzer/stats.ts @@ -121,6 +121,7 @@ export function buildStats({ specialAutoChargeRate: specialAutoChargeRate(input), specialMaxRadius: specialMaxRadius(input), specialRadiusRange: specialRadiusRange(input), + specialPowerUpDuration: specialPowerUpDuration(input), }, }; } @@ -1292,3 +1293,32 @@ function specialRadiusRange( modifiedBy: SPECIAL_RADIUS_RANGE_KEY, }; } + +function specialPowerUpDuration( + args: StatFunctionInput +): AnalyzedBuild["stats"]["specialPowerUpDuration"] { + if ( + !hasEffect({ + key: "PowerUpFrame", + weapon: args.specialWeaponParams, + }) + ) { + return; + } + + const SPECIAL_POWER_UP_DURATION_KEY = "SPU"; + const { baseEffect, effect } = abilityPointsToEffects({ + abilityPoints: apFromMap({ + abilityPoints: args.abilityPoints, + ability: SPECIAL_POWER_UP_DURATION_KEY, + }), + key: "PowerUpFrame", + weapon: args.specialWeaponParams, + }); + + return { + baseValue: framesToSeconds(baseEffect), + value: framesToSeconds(effect), + modifiedBy: SPECIAL_POWER_UP_DURATION_KEY, + }; +} diff --git a/app/modules/analyzer/types.ts b/app/modules/analyzer/types.ts index 63bd2de84..1183ed8de 100644 --- a/app/modules/analyzer/types.ts +++ b/app/modules/analyzer/types.ts @@ -238,6 +238,7 @@ export interface AnalyzedBuild { specialAutoChargeRate?: Stat; specialMaxRadius?: Stat; specialRadiusRange?: Stat; + specialPowerUpDuration?: Stat; }; } diff --git a/app/routes/analyzer.tsx b/app/routes/analyzer.tsx index 2db3caab7..3ad5b0b88 100644 --- a/app/routes/analyzer.tsx +++ b/app/routes/analyzer.tsx @@ -389,6 +389,17 @@ export default function BuildAnalyzerPage() { })} /> )} + {analyzed.stats.specialPowerUpDuration && ( + + )}