feat: acquiring CrewShipHarness with CrewShip (#888)
All checks were successful
Build / build (20) (push) Successful in 36s
Build / build (22) (push) Successful in 52s
Build / build (18) (push) Successful in 1m5s
Build Docker image / docker (push) Successful in 32s

Closes #886

Reviewed-on: http://209.141.38.3/OpenWF/SpaceNinjaServer/pulls/888
Reviewed-by: Sainan <sainan@calamity.inc>
Co-authored-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com>
Co-committed-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com>
This commit is contained in:
AMelonInsideLemon 2025-02-04 02:29:23 -08:00 committed by OrdisPrime
parent c267ce47c3
commit fb232f74bd

View File

@ -240,7 +240,14 @@ export const addItem = async (
} }
}; };
} else if (ExportResources[typeName].productCategory == "CrewShips") { } 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 }; return { InventoryChanges: inventoryChanges };
} else if (ExportResources[typeName].productCategory == "ShipDecorations") { } else if (ExportResources[typeName].productCategory == "ShipDecorations") {
const changes = [ const changes = [
@ -810,6 +817,17 @@ const addCrewShip = (
return inventoryChanges; 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 //TODO: wrong id is not erroring
export const addGearExpByCategory = ( export const addGearExpByCategory = (
inventory: TInventoryDatabaseDocument, inventory: TInventoryDatabaseDocument,