From 327df35380db3be2c34a84fdcf8c07da1ae65a98 Mon Sep 17 00:00:00 2001 From: Igor <12849336+DoubleCookies@users.noreply.github.com> Date: Sat, 29 Oct 2022 10:17:27 +0300 Subject: [PATCH] Disable double torpedos in analyzer (#1058) * Note about torpedo * no magic numbers -> constant --- app/routes/analyzer.tsx | 4 +++- public/locales/en/analyzer.json | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/routes/analyzer.tsx b/app/routes/analyzer.tsx index 11e6fc99d..47d77b2fe 100644 --- a/app/routes/analyzer.tsx +++ b/app/routes/analyzer.tsx @@ -30,6 +30,7 @@ import { SPLASH_WALL_ID, SPRINKLER_ID, TOXIC_MIST_ID, + TORPEDO_ID, type BuildAbilitiesTupleWithUnknown, type MainWeaponId, type SubWeaponId, @@ -895,7 +896,7 @@ function ConsumptionTable({ subWeaponId: SubWeaponId; }) { const { t } = useTranslation(["analyzer", "weapons"]); - const maxSubsToUse = Math.max(...options.map((opt) => opt.subsUsed)); + const maxSubsToUse = subWeaponId === TORPEDO_ID ? 1 : Math.max(...options.map((opt) => opt.subsUsed)); const types = Array.from(new Set(options.map((opt) => opt.type))); return ( @@ -926,6 +927,7 @@ function ConsumptionTable({
{t("analyzer:consumptionExplanation", { maxSubsToUse })} + {subWeaponId === TORPEDO_ID && <>{" "}{t("analyzer:torpedoExplanation")}}
); diff --git a/public/locales/en/analyzer.json b/public/locales/en/analyzer.json index e6d5e9a2a..b53ffc779 100644 --- a/public/locales/en/analyzer.json +++ b/public/locales/en/analyzer.json @@ -96,6 +96,7 @@ "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}}.", + "torpedoExplanation": "You can't launch more than one torpedo at a time due to game mechanics.", "trackingSubDefExplanation": "Point Sensor, Ink Mine and Angle Shooter tracking times are calculated against an opponent with 0AP of Sub Power Up.", "distanceInline": "Distance: {{value}}", "damageShort": "DMG",