Disable double torpedos in analyzer (#1058)

* Note about torpedo

* no magic numbers -> constant
This commit is contained in:
Igor
2022-10-29 10:17:27 +03:00
committed by GitHub
parent e20b1b92b4
commit 327df35380
2 changed files with 4 additions and 1 deletions

View File

@@ -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({
</table>
<div className="analyzer__consumption-table-explanation">
{t("analyzer:consumptionExplanation", { maxSubsToUse })}
{subWeaponId === TORPEDO_ID && <>{" "}{t("analyzer:torpedoExplanation")}</>}
</div>
</>
);

View File

@@ -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",