diff --git a/packages/i18n/strings/en.json b/packages/i18n/strings/en.json index 19b803155..fe4ed47b1 100644 --- a/packages/i18n/strings/en.json +++ b/packages/i18n/strings/en.json @@ -630,6 +630,8 @@ "shellRicochet": "Ricochet", "dpm": "DPM", "dpmEffective": "Effective at 60s", + "peekabooDpm": "Peekaboo DPM", + "peekabooDpmInfo": "Damage per minute assuming you only fire after resetting camouflage (or the reload finishes, if it's slower) \u2014 at least 10 seconds between shots.", "shells": "Shells", "mostOptimalShellIndex": "Most optimal shell", "shellReloads": "Reloads", diff --git a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/Firepower.tsx b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/Firepower.tsx index bcebbf061..c1efdc8b4 100644 --- a/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/Firepower.tsx +++ b/packages/website/src/components/Tankopedia/CharacteristicsSection/components/Characteristics/components/Firepower.tsx @@ -1,6 +1,14 @@ import { alias, isExplosive } from "@blitzkit/core"; import { literals } from "@blitzkit/i18n"; -import { Flex, Heading, IconButton, Tooltip } from "@radix-ui/themes"; +import { InfoCircledIcon } from "@radix-ui/react-icons"; +import { + Flex, + Heading, + IconButton, + Popover, + Text, + Tooltip, +} from "@radix-ui/themes"; import { useLocale } from "../../../../../../hooks/useLocale"; import { useTankModelDefinition } from "../../../../../../hooks/useTankModelDefinition"; import { Duel } from "../../../../../../stores/duel"; @@ -77,6 +85,40 @@ export function Firepower({ {strings.common.gun_types[gun.gun_type!.$case]} + {gun.gun_type!.$case === "regular" && ( + + { + strings.website.tools.tankopedia.characteristics.values + .peekabooDpm + } + + + + + + + + + + + { + strings.website.tools.tankopedia.characteristics.values + .peekabooDpmInfo + } + + + + + } + value={(tank) => tank.peekabooDpm} + /> + )} {gun.gun_type!.$case !== "regular" && ( diff --git a/packages/website/src/core/blitzkit/tankCharacteristics.ts b/packages/website/src/core/blitzkit/tankCharacteristics.ts index d9d041098..0cc72302e 100644 --- a/packages/website/src/core/blitzkit/tankCharacteristics.ts +++ b/packages/website/src/core/blitzkit/tankCharacteristics.ts @@ -418,6 +418,10 @@ export function tankCharacteristics( : (gun.gun_type!.$case === "regular" ? gun.gun_type!.value.reload : gun.gun_type!.value.clip_reload) * reloadCoefficient; + const peekabooDpm = + gun.gun_type!.$case === "regular" + ? Math.round(damage * (60 / Math.max(shellReload!, 10))) + : undefined; const caliber = shell.caliber; const penetration = shell.penetration!.near * penetrationCoefficient; const clipDamage = @@ -545,6 +549,7 @@ export function tankCharacteristics( shellRicochet, dpm, dpmEffective, + peekabooDpm, shells, mostOptimalShellIndex, shellReloads,