From 5d9a3ea13ce0896f112b62ac58db2e5c5d8c4073 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Sat, 17 Sep 2022 17:20:35 +0300 Subject: [PATCH] Angle Shooter tracking defense stat + explanation --- app/modules/analyzer/stats.ts | 31 +++++++++++++++++++++++++++++++ app/modules/analyzer/types.ts | 3 +-- app/routes/analyzer.tsx | 11 +++++++++++ app/styles/analyzer.css | 6 ++++++ public/locales/en/analyzer.json | 3 ++- 5 files changed, 51 insertions(+), 3 deletions(-) diff --git a/app/modules/analyzer/stats.ts b/app/modules/analyzer/stats.ts index a82803776..450b693bd 100644 --- a/app/modules/analyzer/stats.ts +++ b/app/modules/analyzer/stats.ts @@ -1,4 +1,5 @@ import type { MainWeaponId } from "~/modules/in-game-lists"; +import { ANGLE_SHOOTER_ID } from "~/modules/in-game-lists"; import { INK_MINE_ID, POINT_SENSOR_ID } from "~/modules/in-game-lists"; import type { AbilityPoints, @@ -84,6 +85,8 @@ export function buildStats({ subDefPointSensorMarkedTimeInSeconds: subDefPointSensorMarkedTimeInSeconds(input), subDefInkMineMarkedTimeInSeconds: subDefInkMineMarkedTimeInSeconds(input), + subDefAngleShooterMarkedTimeInSeconds: + subDefAngleShooterMarkedTimeInSeconds(input), ...subStats(input), }, }; @@ -698,3 +701,31 @@ function subDefInkMineMarkedTimeInSeconds( value: framesToSeconds(markingTimeEffect * effect), }; } + +function subDefAngleShooterMarkedTimeInSeconds( + args: StatFunctionInput +): AnalyzedBuild["stats"]["subDefAngleShooterMarkedTimeInSeconds"] { + const SUB_DEF_ANGLE_SHOOTER_MARKED_TIME_IN_SECONDS_KEY = "SRU"; + const { baseEffect, effect } = abilityPointsToEffects({ + abilityPoints: apFromMap({ + abilityPoints: args.abilityPoints, + ability: SUB_DEF_ANGLE_SHOOTER_MARKED_TIME_IN_SECONDS_KEY, + }), + key: "MarkingTimeRt", + weapon: args.mainWeaponParams, + }); + + const angleShooterParams = weaponParams().subWeapons[ANGLE_SHOOTER_ID]; + + const { baseEffect: markingTimeEffect } = abilityPointsToEffects({ + abilityPoints: 0, + key: "MarkingFrameSubSpec", + weapon: angleShooterParams, + }); + + return { + baseValue: framesToSeconds(markingTimeEffect * baseEffect), + modifiedBy: SUB_DEF_ANGLE_SHOOTER_MARKED_TIME_IN_SECONDS_KEY, + value: framesToSeconds(markingTimeEffect * effect), + }; +} diff --git a/app/modules/analyzer/types.ts b/app/modules/analyzer/types.ts index 8ef113f19..a92d0950e 100644 --- a/app/modules/analyzer/types.ts +++ b/app/modules/analyzer/types.ts @@ -188,14 +188,13 @@ export interface AnalyzedBuild { subDefPointSensorMarkedTimeInSeconds: Stat; subDefInkMineMarkedTimeInSeconds: Stat; + subDefAngleShooterMarkedTimeInSeconds: Stat; // subDefBombDamageLight: Stat; // subDefBombDamageHeavy: Stat; // subDefAngleShooterDamage: Stat; // subDefSplashWallDamage: Stat; // subDefSprinklerDamage: Stat; // subDefToxicMistMoveReduction: Stat; - // subDefInkMineMarkingTime: Stat; - // subDefPointSensorMarkingTime: Stat; subVelocity?: Stat; subFirstPhaseDuration?: Stat; diff --git a/app/routes/analyzer.tsx b/app/routes/analyzer.tsx index 2d435b9bf..54f5366ff 100644 --- a/app/routes/analyzer.tsx +++ b/app/routes/analyzer.tsx @@ -20,6 +20,7 @@ import type { SpecialEffectType, } from "~/modules/analyzer/types"; import type { BuildAbilitiesTupleWithUnknown } from "~/modules/in-game-lists"; +import { ANGLE_SHOOTER_ID } from "~/modules/in-game-lists"; import { INK_MINE_ID, POINT_SENSOR_ID } from "~/modules/in-game-lists"; import { abilities, @@ -223,6 +224,16 @@ export default function BuildAnalyzerPage() { })} suffix={t("analyzer:suffix.seconds")} /> + +
+ {t("analyzer:trackingSubDefExplanation")} +
{analyzed.stats.damages.length > 0 && ( diff --git a/app/styles/analyzer.css b/app/styles/analyzer.css index 7e473754a..058028e1d 100644 --- a/app/styles/analyzer.css +++ b/app/styles/analyzer.css @@ -139,6 +139,12 @@ font-size: var(--fonts-xxs); } +.analyzer__stat-category-explanation { + color: var(--text-lighter); + font-size: var(--fonts-xxs); + grid-column: 1 / 4; +} + .analyzer__patch { background-color: var(--theme-transparent); border-radius: var(--rounded); diff --git a/public/locales/en/analyzer.json b/public/locales/en/analyzer.json index a835f7d11..3722dc5d0 100644 --- a/public/locales/en/analyzer.json +++ b/public/locales/en/analyzer.json @@ -65,5 +65,6 @@ "patch": "Patch:", "abilityPoints": "Ability points", "abilityPoints.short": "AP", - "consumptionExplanation": "This chart shows the amount of actions left to perform with main weapon after using sub 0-{{maxSubsToUse}} times. Max amount of consecutive subs to use with full ink tank is {{maxSubsToUse}}." + "consumptionExplanation": "This chart shows the amount of actions left to perform with main weapon after using sub 0-{{maxSubsToUse}} times. Max amount of consecutive subs to use with full ink tank is {{maxSubsToUse}}.", + "trackingSubDefExplanation": "Point Sensor, Ink Mine and Angle Shooter tracking times are calculated against an opponent with 0AP of Sub Power Up." }