mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
Add peekaboo DPM stat to Tankopedia firepower
Adds a **Peekaboo DPM** entry nested under DPM for single-shot guns, estimating damage per minute when only firing after resetting camouflage (or waiting out the reload, whichever is slower), assuming at least 10 seconds between shots. - Shots per minute are capped at `60/10` for reloads faster than 10s, and fall back to `60/reload` otherwise - The result is multiplied by the currently selected shell's damage and rounded - An (i) icon next to the label opens a popover explaining the calculation - The row is hidden for auto-loader/auto-reloader guns - No percentile ranking bar is shown, since no dataset exists yet for this new stat
This commit is contained in:
1 parent
84f950ade4
commit
281e4abec7
3 files changed
+50
-1
No files matched your search
@@ -631,6 +631,8 @@
|
|||||||
"shellRicochet": "Ricochet",
|
"shellRicochet": "Ricochet",
|
||||||
"dpm": "DPM",
|
"dpm": "DPM",
|
||||||
"dpmEffective": "Effective at 60s",
|
"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",
|
"shells": "Shells",
|
||||||
"mostOptimalShellIndex": "Most optimal shell",
|
"mostOptimalShellIndex": "Most optimal shell",
|
||||||
"shellReloads": "Reloads",
|
"shellReloads": "Reloads",
|
||||||
|
|||||||
+43
-1
@@ -1,6 +1,14 @@
|
|||||||
import { alias, isExplosive } from "@blitzkit/core";
|
import { alias, isExplosive } from "@blitzkit/core";
|
||||||
import { literals } from "@blitzkit/i18n";
|
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 { useLocale } from "../../../../../../hooks/useLocale";
|
||||||
import { useTankModelDefinition } from "../../../../../../hooks/useTankModelDefinition";
|
import { useTankModelDefinition } from "../../../../../../hooks/useTankModelDefinition";
|
||||||
import { Duel } from "../../../../../../stores/duel";
|
import { Duel } from "../../../../../../stores/duel";
|
||||||
@@ -77,6 +85,40 @@ export function Firepower({
|
|||||||
{strings.common.gun_types[gun.gun_type!.$case]}
|
{strings.common.gun_types[gun.gun_type!.$case]}
|
||||||
</Info>
|
</Info>
|
||||||
<InfoWithDelta stats={stats} decimals={0} value="dpm" />
|
<InfoWithDelta stats={stats} decimals={0} value="dpm" />
|
||||||
|
{gun.gun_type!.$case === "regular" && (
|
||||||
|
<InfoWithDelta
|
||||||
|
stats={stats}
|
||||||
|
indent
|
||||||
|
decimals={0}
|
||||||
|
noRanking
|
||||||
|
name={
|
||||||
|
<Flex align="center" gap="1" display="inline-flex">
|
||||||
|
{
|
||||||
|
strings.website.tools.tankopedia.characteristics.values
|
||||||
|
.peekabooDpm
|
||||||
|
}
|
||||||
|
|
||||||
|
<Popover.Root>
|
||||||
|
<Popover.Trigger>
|
||||||
|
<IconButton variant="ghost" size="1">
|
||||||
|
<InfoCircledIcon />
|
||||||
|
</IconButton>
|
||||||
|
</Popover.Trigger>
|
||||||
|
|
||||||
|
<Popover.Content style={{ maxWidth: 280 }}>
|
||||||
|
<Text size="2">
|
||||||
|
{
|
||||||
|
strings.website.tools.tankopedia.characteristics.values
|
||||||
|
.peekabooDpmInfo
|
||||||
|
}
|
||||||
|
</Text>
|
||||||
|
</Popover.Content>
|
||||||
|
</Popover.Root>
|
||||||
|
</Flex>
|
||||||
|
}
|
||||||
|
value={(tank) => tank.peekabooDpm}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
<InfoWithDelta stats={stats} decimals={0} value="damage" />
|
<InfoWithDelta stats={stats} decimals={0} value="damage" />
|
||||||
{gun.gun_type!.$case !== "regular" && (
|
{gun.gun_type!.$case !== "regular" && (
|
||||||
<InfoWithDelta stats={stats} indent decimals={0} value="clipDamage" />
|
<InfoWithDelta stats={stats} indent decimals={0} value="clipDamage" />
|
||||||
|
|||||||
@@ -418,6 +418,10 @@ export function tankCharacteristics(
|
|||||||
: (gun.gun_type!.$case === "regular"
|
: (gun.gun_type!.$case === "regular"
|
||||||
? gun.gun_type!.value.reload
|
? gun.gun_type!.value.reload
|
||||||
: gun.gun_type!.value.clip_reload) * reloadCoefficient;
|
: 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 caliber = shell.caliber;
|
||||||
const penetration = shell.penetration!.near * penetrationCoefficient;
|
const penetration = shell.penetration!.near * penetrationCoefficient;
|
||||||
const clipDamage =
|
const clipDamage =
|
||||||
@@ -545,6 +549,7 @@ export function tankCharacteristics(
|
|||||||
shellRicochet,
|
shellRicochet,
|
||||||
dpm,
|
dpm,
|
||||||
dpmEffective,
|
dpmEffective,
|
||||||
|
peekabooDpm,
|
||||||
shells,
|
shells,
|
||||||
mostOptimalShellIndex,
|
mostOptimalShellIndex,
|
||||||
shellReloads,
|
shellReloads,
|
||||||
|
|||||||
Reference in new issue
Block a user