feat: shell range

This commit is contained in:
tresabhi committed 2024-11-09 16:00:15 -06:00
1 parent 594b1eb311
commit 0722ff6bfb
7 files changed
+32 -1

No files matched your search

@@ -151,6 +151,12 @@ export function Body({ stats }: BodyProps) {
value="shellVelocity"
decimals={0}
/>
<CompareRow
stats={stats}
name="Shell range"
value="shellRange"
decimals={0}
/>
<CompareRow
stats={stats}
name="Aim time"
@@ -116,6 +116,14 @@ export function Sort() {
>
Shell velocity
</DropdownMenu.CheckboxItem>
<DropdownMenu.CheckboxItem
checked={tankopediaSort.by === 'fire.shellRange'}
onClick={() => {
$tankopediaSort.setKey('by', 'fire.shellRange');
}}
>
Shell range
</DropdownMenu.CheckboxItem>
<DropdownMenu.CheckboxItem
checked={tankopediaSort.by === 'fire.aimTime'}
onClick={() => {
@@ -265,6 +265,16 @@ export const TankSearch = memo<TankSearchProps>(
);
break;
case 'fire.shellRange':
sorted = filtered.sort(
(a, b) =>
a.turrets.at(-1)!.guns.at(-1)!.gun_type!.value.base.shells[0]
.range -
b.turrets.at(-1)!.guns.at(-1)!.gun_type!.value.base.shells[0]
.range,
);
break;
case 'fire.aimTime':
sorted = filtered.sort(
(a, b) =>
@@ -329,6 +329,10 @@ export function Characteristics() {
<InfoWithDelta name="Shell velocity" unit="m/s" decimals={0}>
{stats.shellVelocity}
</InfoWithDelta>
<InfoWithDelta name="Shell range" unit="m/s" decimals={0}>
{stats.shellRange}
</InfoWithDelta>
<InfoWithDelta
decimals={2}
name="Aim time"