diff --git a/app/modules/analyzer/stats.ts b/app/modules/analyzer/stats.ts index 9eeb48d36..16aff51f8 100644 --- a/app/modules/analyzer/stats.ts +++ b/app/modules/analyzer/stats.ts @@ -120,6 +120,7 @@ export function buildStats({ specialThrowDistance: specialThrowDistance(input), specialAutoChargeRate: specialAutoChargeRate(input), specialMaxRadius: specialMaxRadius(input), + specialRadiusRange: specialRadiusRange(input), }, }; } @@ -1245,3 +1246,49 @@ function specialMaxRadius( modifiedBy: SPECIAL_MAX_RADIUS_KEY, }; } + +function specialRadiusRange( + args: StatFunctionInput +): AnalyzedBuild["stats"]["specialRadiusRange"] { + if ( + !hasEffect({ + key: "RadiusMax", + weapon: args.specialWeaponParams, + }) || + !hasEffect({ + key: "RadiusMin", + weapon: args.specialWeaponParams, + }) + ) { + return; + } + + const SPECIAL_RADIUS_RANGE_KEY = "SPU"; + + const radiusMin = abilityPointsToEffects({ + abilityPoints: apFromMap({ + abilityPoints: args.abilityPoints, + ability: SPECIAL_RADIUS_RANGE_KEY, + }), + key: "RadiusMin", + weapon: args.specialWeaponParams, + }); + const radiusMax = abilityPointsToEffects({ + abilityPoints: apFromMap({ + abilityPoints: args.abilityPoints, + ability: SPECIAL_RADIUS_RANGE_KEY, + }), + key: "RadiusMax", + weapon: args.specialWeaponParams, + }); + + return { + baseValue: `${roundToTwoDecimalPlaces( + radiusMin.baseEffect + )}-${roundToTwoDecimalPlaces(radiusMax.baseEffect)}`, + value: `${roundToTwoDecimalPlaces( + radiusMin.effect + )}-${roundToTwoDecimalPlaces(radiusMax.effect)}`, + modifiedBy: SPECIAL_RADIUS_RANGE_KEY, + }; +} diff --git a/app/modules/analyzer/types.ts b/app/modules/analyzer/types.ts index a85a9b29b..63bd2de84 100644 --- a/app/modules/analyzer/types.ts +++ b/app/modules/analyzer/types.ts @@ -115,9 +115,9 @@ export type ParamsJson = { specialWeapons: SpecialWeaponParamsObject; }; -export interface Stat { - value: number; - baseValue: number; +export interface Stat { + value: T; + baseValue: T; modifiedBy: Ability | Array; } @@ -237,6 +237,7 @@ export interface AnalyzedBuild { specialThrowDistance?: Stat; specialAutoChargeRate?: Stat; specialMaxRadius?: Stat; + specialRadiusRange?: Stat; }; } diff --git a/app/routes/analyzer.tsx b/app/routes/analyzer.tsx index 630597338..2db3caab7 100644 --- a/app/routes/analyzer.tsx +++ b/app/routes/analyzer.tsx @@ -379,6 +379,16 @@ export default function BuildAnalyzerPage() { popoverInfo={t("analyzer:stat.special.maxRadius.explanation")} /> )} + {analyzed.stats.specialRadiusRange && ( + + )} | number; suffix?: string; popoverInfo?: string; }) { diff --git a/public/locales/en/analyzer.json b/public/locales/en/analyzer.json index f9604224b..a85515660 100644 --- a/public/locales/en/analyzer.json +++ b/public/locales/en/analyzer.json @@ -64,6 +64,7 @@ "stat.special.autoChargeRate": "{{weapon}} auto charge rate", "stat.special.maxRadius": "{{weapon}} wave max radius", "stat.special.maxRadius.explanation": "Travel speed of the wave is always the same despite the increased radius.", + "stat.special.radiusRange": "{{weapon}} sucking radius", "damage.header.type": "Type", "damage.header.damage": "Damage", "damage.header.distance": "Distance",