mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-28 04:59:50 +01:00
feat: sorting by he shell penetratoin
This commit is contained in:
1 parent
0e6b0087ce
commit
17755641a1
5 files changed
+16
No files matched your search
@@ -790,6 +790,7 @@
|
|||||||
"fire.caliber": "caliber",
|
"fire.caliber": "caliber",
|
||||||
"fire.standardPenetration": "standard penetration",
|
"fire.standardPenetration": "standard penetration",
|
||||||
"fire.premiumPenetration": "premium penetration",
|
"fire.premiumPenetration": "premium penetration",
|
||||||
|
"fire.tertiaryPenetration": "tertiary penetration",
|
||||||
"fire.damage": "damage",
|
"fire.damage": "damage",
|
||||||
"fire.moduleDamage": "module damage",
|
"fire.moduleDamage": "module damage",
|
||||||
"fire.shellVelocity": "shell velocity",
|
"fire.shellVelocity": "shell velocity",
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ export function TankSearchCard({ tank, onSelect }: TankSearchCardProps) {
|
|||||||
const gun = turret.guns.at(-1)!;
|
const gun = turret.guns.at(-1)!;
|
||||||
const shell0 = gun.gun_type!.value.base.shells[0];
|
const shell0 = gun.gun_type!.value.base.shells[0];
|
||||||
const shell1 = gun.gun_type!.value.base.shells[1];
|
const shell1 = gun.gun_type!.value.base.shells[1];
|
||||||
|
const shell2 = gun.gun_type!.value.base.shells[2];
|
||||||
const tracks = tank.tracks.at(-1)!;
|
const tracks = tank.tracks.at(-1)!;
|
||||||
const engine = tank.engines.at(-1)!;
|
const engine = tank.engines.at(-1)!;
|
||||||
const tankModelDefinition = modelDefinitions.models[tank.id];
|
const tankModelDefinition = modelDefinitions.models[tank.id];
|
||||||
@@ -57,6 +58,8 @@ export function TankSearchCard({ tank, onSelect }: TankSearchCardProps) {
|
|||||||
return shell0.penetration.near.toFixed(0);
|
return shell0.penetration.near.toFixed(0);
|
||||||
case 'fire.premiumPenetration':
|
case 'fire.premiumPenetration':
|
||||||
return shell1 ? shell1.penetration.near.toFixed(0) : '--';
|
return shell1 ? shell1.penetration.near.toFixed(0) : '--';
|
||||||
|
case 'fire.tertiaryPenetration':
|
||||||
|
return shell1 ? shell2.penetration.near.toFixed(0) : '--';
|
||||||
case 'fire.shellVelocity':
|
case 'fire.shellVelocity':
|
||||||
return shell0.velocity.toFixed(0);
|
return shell0.velocity.toFixed(0);
|
||||||
case 'fire.shellCapacity':
|
case 'fire.shellCapacity':
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ export function Sort() {
|
|||||||
<Item by="fire.caliber" />
|
<Item by="fire.caliber" />
|
||||||
<Item by="fire.standardPenetration" />
|
<Item by="fire.standardPenetration" />
|
||||||
<Item by="fire.premiumPenetration" />
|
<Item by="fire.premiumPenetration" />
|
||||||
|
<Item by="fire.tertiaryPenetration" />
|
||||||
<Item by="fire.damage" />
|
<Item by="fire.damage" />
|
||||||
<Item by="fire.moduleDamage" />
|
<Item by="fire.moduleDamage" />
|
||||||
<Item by="fire.shellVelocity" />
|
<Item by="fire.shellVelocity" />
|
||||||
|
|||||||
@@ -238,6 +238,16 @@ export const TankSearch = memo<TankSearchProps>(
|
|||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'fire.tertiaryPenetration':
|
||||||
|
sorted = filtered.sort(
|
||||||
|
(a, b) =>
|
||||||
|
(a.turrets.at(-1)!.guns.at(-1)!.gun_type!.value.base.shells[2]
|
||||||
|
?.penetration.near ?? 0) -
|
||||||
|
(b.turrets.at(-1)!.guns.at(-1)!.gun_type!.value.base.shells[2]
|
||||||
|
?.penetration.near ?? 0),
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
|
||||||
case 'fire.damage':
|
case 'fire.damage':
|
||||||
sorted = filtered.sort(
|
sorted = filtered.sort(
|
||||||
(a, b) =>
|
(a, b) =>
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ export const SORT_UNITS: Record<TankopediaSortBy, string | undefined> = {
|
|||||||
'fire.gunDepression': '°',
|
'fire.gunDepression': '°',
|
||||||
'fire.gunElevation': '°',
|
'fire.gunElevation': '°',
|
||||||
'fire.premiumPenetration': 'mm',
|
'fire.premiumPenetration': 'mm',
|
||||||
|
'fire.tertiaryPenetration': 'mm',
|
||||||
'fire.reload': 's',
|
'fire.reload': 's',
|
||||||
'fire.shellVelocity': 'm/s',
|
'fire.shellVelocity': 'm/s',
|
||||||
'fire.shellRange': 'm',
|
'fire.shellRange': 'm',
|
||||||
|
|||||||
Reference in new issue
Block a user