From c8d2d996e44f89f9ba2462ce8fef91a5c0e5cef4 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Thu, 15 Sep 2022 00:16:37 +0300 Subject: [PATCH] Run/swim speed to analyzer --- app/modules/analyzer/stats.ts | 53 +++++++++++++++++++++++++ app/modules/analyzer/types.ts | 6 +++ app/modules/analyzer/weapon-params.json | 21 ++++++++++ app/routes/analyzer.tsx | 10 +++++ public/locales/en/analyzer.json | 3 ++ scripts/create-analyzer-json.ts | 1 + 6 files changed, 94 insertions(+) diff --git a/app/modules/analyzer/stats.ts b/app/modules/analyzer/stats.ts index e104658a5..06c72c1ab 100644 --- a/app/modules/analyzer/stats.ts +++ b/app/modules/analyzer/stats.ts @@ -52,6 +52,9 @@ export function buildStats({ fullInkTankOptions: fullInkTankOptions(input), subWeaponWhiteInkFrames: subWeaponParams.InkRecoverStop, squidFormInkRecoverySeconds: squidFormInkRecoverySeconds(input), + runSpeed: runSpeed(input), + // shootingRunSpeed: shootingRunSpeed(input), + swimSpeed: swimSpeed(input), }, }; } @@ -248,3 +251,53 @@ function squidFormInkRecoverySeconds( modifiedBy: SQUID_FORM_INK_RECOVERY_SECONDS_ABILITY, }; } + +function runSpeed(args: StatFunctionInput): AnalyzedBuild["stats"]["runSpeed"] { + const key = + args.mainWeaponParams.WeaponSpeedType === "Fast" + ? "_Fast" + : args.mainWeaponParams.WeaponSpeedType === "Slow" + ? "_Slow" + : ""; + const RUN_SPEED_ABILITY = "RSU"; + const { baseEffect, effect } = abilityPointsToEffects({ + abilityPoints: apFromMap({ + abilityPoints: args.abilityPoints, + ability: RUN_SPEED_ABILITY, + }), + key: `MoveVel_Human${key}`, + weapon: args.mainWeaponParams, + }); + + return { + baseValue: effectToRounded(baseEffect * 10), + value: effectToRounded(effect * 10), + modifiedBy: RUN_SPEED_ABILITY, + }; +} + +function swimSpeed( + args: StatFunctionInput +): AnalyzedBuild["stats"]["swimSpeed"] { + const key = + args.mainWeaponParams.WeaponSpeedType === "Fast" + ? "_Fast" + : args.mainWeaponParams.WeaponSpeedType === "Slow" + ? "_Slow" + : ""; + const SWIM_SPEED_ABILITY = "SSU"; + const { baseEffect, effect } = abilityPointsToEffects({ + abilityPoints: apFromMap({ + abilityPoints: args.abilityPoints, + ability: SWIM_SPEED_ABILITY, + }), + key: `MoveVel_Stealth${key}`, + weapon: args.mainWeaponParams, + }); + + return { + baseValue: effectToRounded(baseEffect * 10), + value: effectToRounded(effect * 10), + modifiedBy: SWIM_SPEED_ABILITY, + }; +} diff --git a/app/modules/analyzer/types.ts b/app/modules/analyzer/types.ts index 18b6cef65..b3d992e19 100644 --- a/app/modules/analyzer/types.ts +++ b/app/modules/analyzer/types.ts @@ -11,6 +11,8 @@ export interface MainWeaponParams { /** Replacing default values of the ability json for this specific weapon */ overwrites?: Record>>; SpecialPoint: number; + /** Weapon's weight class. "Light/Heavy weapon" */ + WeaponSpeedType?: "Slow" | "Fast"; /** How much ink one shot consumes? InkConsume = 0.5 means 2 shots per full tank */ InkConsume?: number; /** How much ink one slosh of slosher consumes? */ @@ -125,5 +127,9 @@ export interface AnalyzedBuild { subWeaponWhiteInkFrames: number; fullInkTankOptions: Array; squidFormInkRecoverySeconds: Stat; + runSpeed: Stat; + // xxx: missing from json + // shootingRunSpeed: Stat; + swimSpeed: Stat; }; } diff --git a/app/modules/analyzer/weapon-params.json b/app/modules/analyzer/weapon-params.json index 896baf395..669ffce2b 100644 --- a/app/modules/analyzer/weapon-params.json +++ b/app/modules/analyzer/weapon-params.json @@ -4,24 +4,28 @@ "SpecialPoint": 180, "subWeaponId": 6, "specialWeaponId": 11, + "WeaponSpeedType": "Fast", "InkConsume": 0.008 }, "10": { "SpecialPoint": 180, "subWeaponId": 0, "specialWeaponId": 2, + "WeaponSpeedType": "Fast", "InkConsume": 0.0043 }, "20": { "SpecialPoint": 200, "subWeaponId": 2, "specialWeaponId": 12, + "WeaponSpeedType": "Fast", "InkConsume": 0.008 }, "30": { "SpecialPoint": 200, "subWeaponId": 5, "specialWeaponId": 13, + "WeaponSpeedType": "Fast", "InkConsume": 0.0055 }, "40": { @@ -46,6 +50,7 @@ "SpecialPoint": 200, "subWeaponId": 1, "specialWeaponId": 15, + "WeaponSpeedType": "Fast", "InkConsume": 0.008 }, "70": { @@ -75,6 +80,7 @@ "Mid": 0.5 } }, + "WeaponSpeedType": "Fast", "InkConsume": 0.075 }, "210": { @@ -108,6 +114,7 @@ "Mid": 0.5 } }, + "WeaponSpeedType": "Fast", "InkConsume": 0.04 }, "240": { @@ -154,6 +161,7 @@ "SpecialPoint": 180, "subWeaponId": 7, "specialWeaponId": 3, + "WeaponSpeedType": "Fast", "InkConsume_WeaponSwingParam": 0.0396 }, "1010": { @@ -166,6 +174,7 @@ "SpecialPoint": 190, "subWeaponId": 3, "specialWeaponId": 15, + "WeaponSpeedType": "Slow", "InkConsume_WeaponSwingParam": 0.18 }, "1030": { @@ -179,6 +188,7 @@ "SpecialPoint": 180, "subWeaponId": 0, "specialWeaponId": 9, + "WeaponSpeedType": "Fast", "InkConsume_WeaponSwingParam": 0.02 }, "1110": { @@ -212,6 +222,7 @@ "SpecialPoint": 200, "subWeaponId": 10, "specialWeaponId": 7, + "WeaponSpeedType": "Slow", "InkConsumeFullCharge": 0.25, "InkConsumeMinCharge": 0.0225 }, @@ -219,6 +230,7 @@ "SpecialPoint": 200, "subWeaponId": 10, "specialWeaponId": 7, + "WeaponSpeedType": "Slow", "InkConsumeFullCharge": 0.25, "InkConsumeMinCharge": 0.0225 }, @@ -226,6 +238,7 @@ "SpecialPoint": 200, "subWeaponId": 7, "specialWeaponId": 9, + "WeaponSpeedType": "Fast", "InkConsumeFullCharge": 0.084, "InkConsumeMinCharge": 0.0336 }, @@ -246,6 +259,7 @@ "SpecialPoint": 190, "subWeaponId": 11, "specialWeaponId": 10, + "WeaponSpeedType": "Fast", "InkConsumeSlosher": 0.06 }, "3020": { @@ -264,6 +278,7 @@ "SpecialPoint": 200, "subWeaponId": 9, "specialWeaponId": 5, + "WeaponSpeedType": "Slow", "InkConsumeSlosher": 0.117 }, "4000": { @@ -282,6 +297,7 @@ "SpecialPoint": 190, "subWeaponId": 7, "specialWeaponId": 6, + "WeaponSpeedType": "Slow", "InkConsumeFullChargeSplatling": 0.35 }, "4030": { @@ -300,6 +316,7 @@ "SpecialPoint": 180, "subWeaponId": 8, "specialWeaponId": 15, + "WeaponSpeedType": "Fast", "InkConsume": 0.00663, "InkConsume_SideStepParam": 0.05 }, @@ -341,6 +358,7 @@ "SpecialPoint": 190, "subWeaponId": 8, "specialWeaponId": 8, + "WeaponSpeedType": "Slow", "InkConsumeUmbrella_WeaponShelterCanopyParam": 0.3, "InkConsume_WeaponShelterShotgunParam": 0.11 }, @@ -348,6 +366,7 @@ "SpecialPoint": 180, "subWeaponId": 10, "specialWeaponId": 13, + "WeaponSpeedType": "Fast", "InkConsumeUmbrella_WeaponShelterCanopyParam": 0, "InkConsume_WeaponShelterShotgunParam": 0.04 }, @@ -361,6 +380,7 @@ "SpecialPoint": 200, "subWeaponId": 6, "specialWeaponId": 4, + "WeaponSpeedType": "Fast", "InkConsumeFullCharge_ChargeParam": 0.065 }, "8000": { @@ -374,6 +394,7 @@ "SpecialPoint": 180, "subWeaponId": 13, "specialWeaponId": 11, + "WeaponSpeedType": "Fast", "InkConsume_SwingParam": 0.03, "InkConsumeFullCharge_ChargeParam": 0.06 } diff --git a/app/routes/analyzer.tsx b/app/routes/analyzer.tsx index 302482a0b..b3166a300 100644 --- a/app/routes/analyzer.tsx +++ b/app/routes/analyzer.tsx @@ -75,6 +75,16 @@ export default function BuildAnalyzerPage() { subWeaponId={analyzed.weapon.subWeaponSplId} /> + + + +