From f2fc3492e52ca9ef2eac9214d0d9faf9286b05e4 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Thu, 15 Sep 2022 18:21:50 +0300 Subject: [PATCH] Analyzer Ink Resistance --- app/modules/analyzer/stats.ts | 90 +++++++++++++++++++++++++++++++++ app/modules/analyzer/types.ts | 4 ++ app/routes/analyzer.tsx | 18 +++++++ public/locales/en/analyzer.json | 4 ++ 4 files changed, 116 insertions(+) diff --git a/app/modules/analyzer/stats.ts b/app/modules/analyzer/stats.ts index e1f33b991..8b7a8be70 100644 --- a/app/modules/analyzer/stats.ts +++ b/app/modules/analyzer/stats.ts @@ -63,6 +63,11 @@ export function buildStats({ runSpeed: runSpeed(input), // shootingRunSpeed: shootingRunSpeed(input), swimSpeed: swimSpeed(input), + runSpeedInEnemyInk: runSpeedInEnemyInk(input), + damageTakenInEnemyInkPerSecond: damageTakenInEnemyInkPerSecond(input), + enemyInkDamageLimit: enemyInkDamageLimit(input), + framesBeforeTakingDamageInEnemyInk: + framesBeforeTakingDamageInEnemyInk(input), quickRespawnTime: quickRespawnTime(input), superJumpTimeGroundFrames: superJumpTimeGroundFrames(input), superJumpTimeTotal: superJumpTimeTotal(input), @@ -357,6 +362,26 @@ function runSpeed(args: StatFunctionInput): AnalyzedBuild["stats"]["runSpeed"] { }; } +function runSpeedInEnemyInk( + args: StatFunctionInput +): AnalyzedBuild["stats"]["runSpeedInEnemyInk"] { + const RUN_SPEED_IN_ENEMY_INK_ABILITY = "RES"; + const { baseEffect, effect } = abilityPointsToEffects({ + abilityPoints: apFromMap({ + abilityPoints: args.abilityPoints, + ability: RUN_SPEED_IN_ENEMY_INK_ABILITY, + }), + key: "OpInk_MoveVel", + weapon: args.mainWeaponParams, + }); + + return { + baseValue: effectToRounded(baseEffect * 10), + value: effectToRounded(effect * 10), + modifiedBy: RUN_SPEED_IN_ENEMY_INK_ABILITY, + }; +} + function swimSpeed( args: StatFunctionInput ): AnalyzedBuild["stats"]["swimSpeed"] { @@ -466,3 +491,68 @@ function superJumpTimeTotal( modifiedBy: SUPER_JUMP_TIME_TOTAL_ABILITY, }; } + +function damageTakenInEnemyInkPerSecond( + args: StatFunctionInput +): AnalyzedBuild["stats"]["damageTakenInEnemyInkPerSecond"] { + const DAMAGE_TAKEN_IN_ENEMY_INK_ABILITY = "RES"; + const { baseEffect, effect } = abilityPointsToEffects({ + abilityPoints: apFromMap({ + abilityPoints: args.abilityPoints, + ability: DAMAGE_TAKEN_IN_ENEMY_INK_ABILITY, + }), + key: "OpInk_DamagePerFrame", + weapon: args.mainWeaponParams, + }); + + return { + baseValue: effectToDamage(baseEffect) * 60, + value: effectToDamage(effect) * 60, + modifiedBy: DAMAGE_TAKEN_IN_ENEMY_INK_ABILITY, + }; +} + +function enemyInkDamageLimit( + args: StatFunctionInput +): AnalyzedBuild["stats"]["enemyInkDamageLimit"] { + const ENEMY_INK_DAMAGE_LIMIT_ABILITY = "RES"; + const { baseEffect, effect } = abilityPointsToEffects({ + abilityPoints: apFromMap({ + abilityPoints: args.abilityPoints, + ability: ENEMY_INK_DAMAGE_LIMIT_ABILITY, + }), + key: "OpInk_DamageLmt", + weapon: args.mainWeaponParams, + }); + + return { + baseValue: effectToDamage(baseEffect), + value: effectToDamage(effect), + modifiedBy: ENEMY_INK_DAMAGE_LIMIT_ABILITY, + }; +} + +function effectToDamage(effect: number) { + // not sure where the 0.05 is coming from. Old analyzer had it as well so assuming it's correct. + return Number((effect * 100 - 0.05).toFixed(1)); +} + +function framesBeforeTakingDamageInEnemyInk( + args: StatFunctionInput +): AnalyzedBuild["stats"]["framesBeforeTakingDamageInEnemyInk"] { + const FRAMES_BEFORE_TAKING_DAMAGE_IN_ENEMY_INK_ABILITY = "RES"; + const { baseEffect, effect } = abilityPointsToEffects({ + abilityPoints: apFromMap({ + abilityPoints: args.abilityPoints, + ability: FRAMES_BEFORE_TAKING_DAMAGE_IN_ENEMY_INK_ABILITY, + }), + key: "OpInk_ArmorHP", + weapon: args.mainWeaponParams, + }); + + return { + baseValue: Math.ceil(baseEffect), + value: Math.ceil(effect), + modifiedBy: FRAMES_BEFORE_TAKING_DAMAGE_IN_ENEMY_INK_ABILITY, + }; +} diff --git a/app/modules/analyzer/types.ts b/app/modules/analyzer/types.ts index 3a3c99457..740a6850a 100644 --- a/app/modules/analyzer/types.ts +++ b/app/modules/analyzer/types.ts @@ -173,6 +173,10 @@ export interface AnalyzedBuild { // xxx: missing from json // shootingRunSpeed: Stat; swimSpeed: Stat; + runSpeedInEnemyInk: Stat; + framesBeforeTakingDamageInEnemyInk: Stat; + damageTakenInEnemyInkPerSecond: Stat; + enemyInkDamageLimit: Stat; quickRespawnTime: Stat; superJumpTimeGroundFrames: Stat; superJumpTimeTotal: Stat; diff --git a/app/routes/analyzer.tsx b/app/routes/analyzer.tsx index d652ef22e..d33039fc5 100644 --- a/app/routes/analyzer.tsx +++ b/app/routes/analyzer.tsx @@ -114,6 +114,10 @@ export default function BuildAnalyzerPage() { stat={analyzed.stats.runSpeed} title={t("stat.runSpeed")} /> + + + + diff --git a/public/locales/en/analyzer.json b/public/locales/en/analyzer.json index 2dafa49ad..0b5576728 100644 --- a/public/locales/en/analyzer.json +++ b/public/locales/en/analyzer.json @@ -20,6 +20,10 @@ "stat.superJumpTimeTotal": "Super jump time (total)", "stat.swimSpeed": "Swim speed (units per frame)", "stat.runSpeed": "Run speed (units per frame)", + "stat.runSpeedInEnemyInk": "Run speed in enemy ink", + "stat.framesBeforeTakingDamageInEnemyInk": "Frames before enemy ink damage", + "stat.damageTakenInEnemyInkPerSecond": "Damage from enemy ink per second", + "stat.enemyInkDamageLimit": "Max damage from enemy ink", "stat.consumption.NORMAL": "Shots", "stat.consumption.SWING": "Swings", "stat.consumption.SLOSH": "Sloshes",