mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 10:47:04 +02:00
feat: more provisions
This commit is contained in:
1 parent
12e2793c92
commit
e7e74f706e
1 file changed
+14
-2
@@ -4,6 +4,12 @@ import { availableProvisions } from './availableProvisions';
|
||||
import { ProvisionDefinitions } from './provisionDefinitions';
|
||||
import { TankDefinition } from './tankDefinitions';
|
||||
|
||||
const PROVISION_PREFERENCES = [
|
||||
19, // improved fuel
|
||||
18, // standard fuel
|
||||
22, // protective kit
|
||||
];
|
||||
|
||||
export function tankToDuelMember(
|
||||
tank: TankDefinition,
|
||||
provisionDefinitions: ProvisionDefinitions,
|
||||
@@ -19,8 +25,14 @@ export function tankToDuelMember(
|
||||
cooldownBooster: 0,
|
||||
crewMastery: 1,
|
||||
provisions: provisionsList
|
||||
.filter((provision) => provision.crew !== undefined)
|
||||
.map((provision) => provision.id),
|
||||
.sort(
|
||||
(a, b) =>
|
||||
PROVISION_PREFERENCES.indexOf(a.id) -
|
||||
PROVISION_PREFERENCES.indexOf(b.id),
|
||||
)
|
||||
.sort((a, b) => (b.crew ?? 0) - (a.crew ?? 0))
|
||||
.slice(0, tank.provisions)
|
||||
.map(({ id }) => id),
|
||||
engine: tank.engines.at(-1)!,
|
||||
gun,
|
||||
shell: tank.turrets.at(-1)!.guns.at(-1)!.shells[0],
|
||||
|
||||
Reference in new issue
Block a user