fix: acquisition of CrewShipWeaponSkins (#1019)
Some checks failed
Build Docker image / docker (push) Waiting to run
Build / build (18) (push) Has been cancelled
Build / build (20) (push) Has been cancelled
Build / build (22) (push) Has been cancelled

Reviewed-on: #1019
Co-authored-by: Sainan <sainan@calamity.inc>
Co-committed-by: Sainan <sainan@calamity.inc>
This commit is contained in:
Sainan 2025-02-25 17:31:33 -08:00 committed by OrdisPrime
parent 2b8da4af60
commit d7628d46e9
4 changed files with 27 additions and 9 deletions

8
package-lock.json generated
View File

@ -12,7 +12,7 @@
"copyfiles": "^2.4.1", "copyfiles": "^2.4.1",
"express": "^5", "express": "^5",
"mongoose": "^8.9.4", "mongoose": "^8.9.4",
"warframe-public-export-plus": "^0.5.36", "warframe-public-export-plus": "^0.5.37",
"warframe-riven-info": "^0.1.2", "warframe-riven-info": "^0.1.2",
"winston": "^3.17.0", "winston": "^3.17.0",
"winston-daily-rotate-file": "^5.0.0" "winston-daily-rotate-file": "^5.0.0"
@ -4093,9 +4093,9 @@
} }
}, },
"node_modules/warframe-public-export-plus": { "node_modules/warframe-public-export-plus": {
"version": "0.5.36", "version": "0.5.37",
"resolved": "https://registry.npmjs.org/warframe-public-export-plus/-/warframe-public-export-plus-0.5.36.tgz", "resolved": "https://registry.npmjs.org/warframe-public-export-plus/-/warframe-public-export-plus-0.5.37.tgz",
"integrity": "sha512-FYZECqBSnynl6lQvcQyEqpnGW9l84wzusekhtwKjvg3280CYdn7g5x0Q9tOMhj1jpc/1tuY+akHtHa94sPtqKw==" "integrity": "sha512-atpTQ0IV0HF17rO2+Z+Vdv8nnnUxh5HhkcXBjc5iwY8tlvRgRWwHemq4PdA1bxR4tYFU5xoYjlgDe5D8ZfM4ew=="
}, },
"node_modules/warframe-riven-info": { "node_modules/warframe-riven-info": {
"version": "0.1.2", "version": "0.1.2",

View File

@ -17,7 +17,7 @@
"copyfiles": "^2.4.1", "copyfiles": "^2.4.1",
"express": "^5", "express": "^5",
"mongoose": "^8.9.4", "mongoose": "^8.9.4",
"warframe-public-export-plus": "^0.5.36", "warframe-public-export-plus": "^0.5.37",
"warframe-riven-info": "^0.1.2", "warframe-riven-info": "^0.1.2",
"winston": "^3.17.0", "winston": "^3.17.0",
"winston-daily-rotate-file": "^5.0.0" "winston-daily-rotate-file": "^5.0.0"

View File

@ -1084,7 +1084,7 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
//Default RailJack //Default RailJack
CrewShipAmmo: [typeCountSchema], CrewShipAmmo: [typeCountSchema],
CrewShipWeapons: [Schema.Types.Mixed], CrewShipWeapons: [Schema.Types.Mixed],
CrewShipWeaponSkins: [Schema.Types.Mixed], CrewShipWeaponSkins: [upgradeSchema],
//NPC Crew and weapon //NPC Crew and weapon
CrewMembers: [Schema.Types.Mixed], CrewMembers: [Schema.Types.Mixed],
@ -1323,6 +1323,7 @@ export type InventoryDocumentProps = {
WeaponSkins: Types.DocumentArray<IWeaponSkinDatabase>; WeaponSkins: Types.DocumentArray<IWeaponSkinDatabase>;
QuestKeys: Types.DocumentArray<IQuestKeyDatabase>; QuestKeys: Types.DocumentArray<IQuestKeyDatabase>;
Drones: Types.DocumentArray<IDroneDatabase>; Drones: Types.DocumentArray<IDroneDatabase>;
CrewShipWeaponSkins: Types.DocumentArray<IUpgradeDatabase>;
} & { [K in TEquipmentKey]: Types.DocumentArray<IEquipmentDatabase> }; } & { [K in TEquipmentKey]: Types.DocumentArray<IEquipmentDatabase> };
// eslint-disable-next-line @typescript-eslint/ban-types // eslint-disable-next-line @typescript-eslint/ban-types

View File

@ -25,7 +25,8 @@ import {
IKubrowPetEggClient, IKubrowPetEggClient,
ILibraryAvailableDailyTaskInfo, ILibraryAvailableDailyTaskInfo,
ICalendarProgress, ICalendarProgress,
IDroneClient IDroneClient,
IUpgradeClient
} from "@/src/types/inventoryTypes/inventoryTypes"; } from "@/src/types/inventoryTypes/inventoryTypes";
import { IGenericUpdate } from "../types/genericUpdate"; import { IGenericUpdate } from "../types/genericUpdate";
import { import {
@ -254,8 +255,11 @@ export const addItem = async (
} }
} }
if (typeName in ExportCustoms) { if (typeName in ExportCustoms) {
const inventoryChanges = addSkin(inventory, typeName); if (ExportCustoms[typeName].productCategory == "CrewShipWeaponSkins") {
return { InventoryChanges: inventoryChanges }; return { InventoryChanges: addCrewShipWeaponSkin(inventory, typeName) };
} else {
return { InventoryChanges: addSkin(inventory, typeName) };
}
} }
if (typeName in ExportFlavour) { if (typeName in ExportFlavour) {
const inventoryChanges = addCustomization(inventory, typeName); const inventoryChanges = addCustomization(inventory, typeName);
@ -812,6 +816,19 @@ export const addSkin = (
return inventoryChanges; return inventoryChanges;
}; };
const addCrewShipWeaponSkin = (
inventory: TInventoryDatabaseDocument,
typeName: string,
inventoryChanges: IInventoryChanges = {}
): IInventoryChanges => {
const index = inventory.CrewShipWeaponSkins.push({ ItemType: typeName }) - 1;
inventoryChanges.CrewShipWeaponSkins ??= [];
(inventoryChanges.CrewShipWeaponSkins as IUpgradeClient[]).push(
inventory.CrewShipWeaponSkins[index].toJSON<IUpgradeClient>()
);
return inventoryChanges;
};
const addCrewShip = ( const addCrewShip = (
inventory: TInventoryDatabaseDocument, inventory: TInventoryDatabaseDocument,
typeName: string, typeName: string,