From fb232f74bd99901853ebb3552142ef8eeb7bf981 Mon Sep 17 00:00:00 2001 From: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com> Date: Tue, 4 Feb 2025 02:29:23 -0800 Subject: [PATCH] feat: acquiring CrewShipHarness with CrewShip (#888) Closes #886 Reviewed-on: http://209.141.38.3/OpenWF/SpaceNinjaServer/pulls/888 Reviewed-by: Sainan Co-authored-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com> Co-committed-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com> --- src/services/inventoryService.ts | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/services/inventoryService.ts b/src/services/inventoryService.ts index a09ba252..4e375615 100644 --- a/src/services/inventoryService.ts +++ b/src/services/inventoryService.ts @@ -240,7 +240,14 @@ export const addItem = async ( } }; } else if (ExportResources[typeName].productCategory == "CrewShips") { - const inventoryChanges = addCrewShip(inventory, typeName); + const inventoryChanges = { + ...addCrewShip(inventory, typeName), + // fix to unlock railjack modding, item bellow supposed to be obtained from archwing quest + ...(!inventory.CrewShipHarnesses?.length + ? addCrewShipHarness(inventory, "/Lotus/Types/Game/CrewShip/RailJack/DefaultHarness") + : {}) + }; + return { InventoryChanges: inventoryChanges }; } else if (ExportResources[typeName].productCategory == "ShipDecorations") { const changes = [ @@ -810,6 +817,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,