feat: acquiring CrewShipHarness with CrewShip
All checks were successful
Build / build (22) (pull_request) Successful in 34s
Build / build (20) (pull_request) Successful in 56s
Build / build (18) (pull_request) Successful in 1m24s

This commit is contained in:
AMelonInsideLemon 2025-02-03 20:52:16 +01:00
parent 01d369bf38
commit 5b584efbf2

View File

@ -239,7 +239,13 @@ export const addItem = async (
}
};
} else if (ExportResources[typeName].productCategory == "CrewShips") {
const inventoryChanges = addCrewShip(inventory, typeName);
const inventoryChanges = {
...addCrewShip(inventory, typeName),
...(!inventory.CrewShipHarnesses?.length
? addCrewShipHarness(inventory, "/Lotus/Types/Game/CrewShip/RailJack/DefaultHarness")
: {})
};
return { InventoryChanges: inventoryChanges };
} else if (ExportResources[typeName].productCategory == "ShipDecorations") {
const changes = [
@ -804,6 +810,17 @@ const addCrewShip = (
return inventoryChanges;
};
const addCrewShipHarness = (
inventory: TInventoryDatabaseDocument,
typeName: string,
inventoryChanges: IInventoryChanges = {}
): IInventoryChanges => {
const index = inventory.CrewShipHarnesses.push({ ItemType: typeName }) - 1;
inventoryChanges.CrewShipHarnesses ??= [];
(inventoryChanges.CrewShipHarnesses as object[]).push(inventory.CrewShipHarnesses[index].toJSON());
return inventoryChanges;
};
//TODO: wrong id is not erroring
export const addGearExpByCategory = (
inventory: TInventoryDatabaseDocument,