feat: zanuka capture #1416

Merged
Sainan merged 3 commits from zanuka into main 2025-04-01 02:29:30 -07:00
2 changed files with 21 additions and 1 deletions
Showing only changes of commit 381ab49cad - Show all commits

View File

@ -47,6 +47,7 @@ import kuriaMessage100 from "@/static/fixed_responses/kuriaMessages/oneHundredPe
import conservationAnimals from "@/static/fixed_responses/conservationAnimals.json";
import { getInfNodes } from "@/src/helpers/nemesisHelpers";
import { Loadout } from "../models/inventoryModels/loadoutModel";
import { ILoadoutConfigDatabase } from "../types/saveLoadoutTypes";
const getRotations = (rotationCount: number): number[] => {
if (rotationCount === 0) return [0];
@ -412,6 +413,21 @@ export const addMissionInventoryUpdates = async (
inventory.LockedWeaponGroup = undefined;
break;
}
case "CurrentLoadOutIds": {
const loadout = await Loadout.findOne({ loadoutOwnerId: inventory.accountOwnerId });
if (loadout) {
for (const [loadoutId, loadoutConfig] of Object.entries(value.LoadOuts.NORMAL)) {
const { ItemId, ...loadoutConfigItemIdRemoved } = loadoutConfig;
const loadoutConfigDatabase: ILoadoutConfigDatabase = {
_id: new Types.ObjectId(ItemId.$oid),
...loadoutConfigItemIdRemoved
};
loadout.NORMAL.id(loadoutId)!.overwrite(loadoutConfigDatabase);
}
await loadout.save();
}
break;
}
default:
// Equipment XP updates
if (equipmentKeys.includes(key as TEquipmentKey)) {

View File

@ -18,7 +18,8 @@ import {
IUpgradeClient,
ICollectibleEntry,
IDiscoveredMarker,
ILockedWeaponGroupClient
ILockedWeaponGroupClient,
ILoadOutPresets
} from "./inventoryTypes/inventoryTypes";
export interface IAffiliationChange {
@ -112,6 +113,9 @@ export type IMissionInventoryUpdateRequest = {
LockedWeaponGroup?: ILockedWeaponGroupClient; // sent when captured by zanuka
UnlockWeapons?: boolean; // sent when recovered weapons from zanuka capture
IncHarvester?: boolean; // sent when recovered weapons from zanuka capture
CurrentLoadOutIds?: {
LoadOuts: ILoadOutPresets; // sent when recovered weapons from zanuka capture
};
} & {
[K in TEquipmentKey]?: IEquipmentClient[];
};