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

@@ -1650,7 +1650,6 @@ export async function definitions() {
};
});
return;
await commitAssets('definitions', [
{
content: encodePBBuffer(GameDefinitions, gameDefinitions),
@@ -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"
@@ -505,6 +505,7 @@ export function tankCharacteristics(
const shellNormalization = shell.normalization ?? 0;
const shellRicochet = isExplosive(shell.type) ? undefined : shell.ricochet;
const crewCount = tank.crew.length;
const shellRange = shell.range;
return {
crewCount,
@@ -568,5 +569,6 @@ export function tankCharacteristics(
height,
length,
volume,
shellRange,
};
}
@@ -15,6 +15,7 @@ export const SORT_UNITS: Record<TankopediaSortBy, string | undefined> = {
'fire.premiumPenetration': 'mm',
'fire.reload': 's',
'fire.shellVelocity': 'm/s',
'fire.shellRange': 'm',
'fire.standardPenetration': 'mm',
'maneuverability.backwardsSpeed': 'kph',
'maneuverability.forwardsSpeed': 'kph',
@@ -46,6 +47,7 @@ export const SORT_NAMES = {
'fire.premiumPenetration': 'premium penetration',
'fire.damage': 'damage',
'fire.shellVelocity': 'shell velocity',
'fire.shellRange': 'shell range',
'fire.aimTime': 'aim time',
'fire.dispersionStill': 'dispersion still',
'fire.dispersionMoving': 'dispersion moving',