This commit is contained in:
@@ -133,7 +133,7 @@ export const nemesisController: RequestHandler = async (req, res) => {
|
||||
fromDbOid(inventory.CurrentLoadOutIds[LoadoutIndex.DATAKNIFE])
|
||||
);
|
||||
const dataknifeConfigIndex = dataknifeLoadout?.s?.mod ?? 0;
|
||||
const dataknifeUpgrades = inventory.DataKnives[0].Configs[dataknifeConfigIndex].Upgrades! as string[];
|
||||
const dataknifeUpgrades = inventory.DataKnives[0].Configs[dataknifeConfigIndex].Upgrades!;
|
||||
for (const upgrade of body.knife!.AttachedUpgrades) {
|
||||
switch (upgrade.ItemType) {
|
||||
case "/Lotus/Upgrades/Mods/DataSpike/Potency/GainAntivirusAndSpeedOnUseMod":
|
||||
@@ -226,8 +226,7 @@ export const nemesisController: RequestHandler = async (req, res) => {
|
||||
fromDbOid(inventory.CurrentLoadOutIds[LoadoutIndex.DATAKNIFE])
|
||||
);
|
||||
const dataknifeConfigIndex = dataknifeLoadout?.s?.mod ?? 0;
|
||||
const dataknifeUpgrades = inventory.DataKnives[0].Configs[dataknifeConfigIndex]
|
||||
.Upgrades! as string[];
|
||||
const dataknifeUpgrades = inventory.DataKnives[0].Configs[dataknifeConfigIndex].Upgrades!;
|
||||
for (let i = 3; i != 6; ++i) {
|
||||
//logger.debug(`subtracting a charge from ${dataknifeUpgrades[i]}`);
|
||||
const upgrade = parseUpgrade(inventory, dataknifeUpgrades[i]);
|
||||
|
||||
@@ -102,7 +102,7 @@ export const upgradesController: RequestHandler = async (req, res) => {
|
||||
}
|
||||
payload.UpgradesToAttach.forEach(upgrade => {
|
||||
if (item.Configs[0].Upgrades && upgrade.ItemId.$id && upgrade.Slot) {
|
||||
const arr = item.Configs[0].Upgrades as string[];
|
||||
const arr = item.Configs[0].Upgrades;
|
||||
if (arr.indexOf(upgrade.ItemId.$id) != -1) {
|
||||
// Handle swapping mod to a different slot
|
||||
arr[arr.indexOf(upgrade.ItemId.$id)] = "";
|
||||
@@ -133,7 +133,7 @@ export const upgradesController: RequestHandler = async (req, res) => {
|
||||
}
|
||||
payload.UpgradesToDetach.forEach(upgrade => {
|
||||
if (item.Configs[0].Upgrades && upgrade.ItemId.$id) {
|
||||
const arr = item.Configs[0].Upgrades as string[];
|
||||
const arr = item.Configs[0].Upgrades;
|
||||
arr[arr.indexOf(upgrade.ItemId.$id)] = "";
|
||||
}
|
||||
});
|
||||
|
||||
@@ -33,7 +33,7 @@ import type { IGenericUpdate, IUpdateNodeIntrosResponse } from "../types/generic
|
||||
import type { IKeyChainRequest, IMissionInventoryUpdateRequest } from "../types/requestTypes.ts";
|
||||
import { logger } from "../utils/logger.ts";
|
||||
import { convertInboxMessage, fromStoreItem, getKeyChainItems } from "./itemDataService.ts";
|
||||
import type { IFlavourItem, IItemConfig } from "../types/inventoryTypes/commonInventoryTypes.ts";
|
||||
import type { IFlavourItem, IItemConfig, IItemConfigDatabase } from "../types/inventoryTypes/commonInventoryTypes.ts";
|
||||
import type { IDefaultUpgrade, IPowersuit, ISentinel, TStandingLimitBin } from "warframe-public-export-plus";
|
||||
import {
|
||||
ExportArcanes,
|
||||
@@ -922,9 +922,9 @@ export const addItems = async (
|
||||
export const applyDefaultUpgrades = (
|
||||
inventory: TInventoryDatabaseDocument,
|
||||
defaultUpgrades: IDefaultUpgrade[] | undefined
|
||||
): IItemConfig[] => {
|
||||
): IItemConfigDatabase[] => {
|
||||
const modsToGive: IRawUpgrade[] = [];
|
||||
const configs: IItemConfig[] = [];
|
||||
const configs: IItemConfigDatabase[] = [];
|
||||
if (defaultUpgrades) {
|
||||
const upgrades = [];
|
||||
for (const defaultUpgrade of defaultUpgrades) {
|
||||
|
||||
@@ -14,7 +14,7 @@ import { version_compare } from "../helpers/inventoryHelpers.ts";
|
||||
import { logger } from "../utils/logger.ts";
|
||||
import type { TEquipmentKey } from "../types/inventoryTypes/inventoryTypes.ts";
|
||||
import { equipmentKeys } from "../types/inventoryTypes/inventoryTypes.ts";
|
||||
import type { IItemConfig } from "../types/inventoryTypes/commonInventoryTypes.ts";
|
||||
import type { IItemConfig, IItemConfigDatabase } from "../types/inventoryTypes/commonInventoryTypes.ts";
|
||||
import { importCrewShipMembers, importCrewShipWeapon, importLoadOutConfig } from "./importService.ts";
|
||||
|
||||
//TODO: setup default items on account creation or like originally in giveStartingItems.php
|
||||
@@ -226,7 +226,7 @@ export const handleInventoryItemConfigChange = async (
|
||||
}
|
||||
}
|
||||
}
|
||||
inventoryItem.Configs[parseInt(configId)] = c;
|
||||
inventoryItem.Configs[parseInt(configId)] = c as IItemConfigDatabase;
|
||||
}
|
||||
}
|
||||
if ("Favorite" in itemConfigEntries) {
|
||||
|
||||
@@ -4,6 +4,7 @@ import type {
|
||||
ICrewShipCustomization,
|
||||
IFlavourItem,
|
||||
IItemConfig,
|
||||
IItemConfigDatabase,
|
||||
IPolarity
|
||||
} from "./inventoryTypes/commonInventoryTypes.ts";
|
||||
|
||||
@@ -33,7 +34,7 @@ export enum EquipmentFeatures {
|
||||
export interface IEquipmentDatabase {
|
||||
ItemType: string;
|
||||
ItemName?: string;
|
||||
Configs: IItemConfig[];
|
||||
Configs: IItemConfigDatabase[];
|
||||
UpgradeVer?: number;
|
||||
XP?: number;
|
||||
Features?: number;
|
||||
@@ -68,9 +69,18 @@ export interface IEquipmentDatabase {
|
||||
export interface IEquipmentClient
|
||||
extends Omit<
|
||||
IEquipmentDatabase,
|
||||
"_id" | "InfestationDate" | "Expiry" | "UpgradesExpiry" | "UmbraDate" | "Weapon" | "CrewMembers" | "Details"
|
||||
| "_id"
|
||||
| "Configs"
|
||||
| "InfestationDate"
|
||||
| "Expiry"
|
||||
| "UpgradesExpiry"
|
||||
| "UmbraDate"
|
||||
| "Weapon"
|
||||
| "CrewMembers"
|
||||
| "Details"
|
||||
> {
|
||||
ItemId: IOidWithLegacySupport;
|
||||
Configs: IItemConfig[];
|
||||
InfestationDate?: IMongoDate;
|
||||
Expiry?: IMongoDate;
|
||||
UpgradesExpiry?: IMongoDate;
|
||||
|
||||
@@ -56,13 +56,17 @@ export interface IItemConfig {
|
||||
ugly?: boolean;
|
||||
}
|
||||
|
||||
export interface IItemConfigDatabase extends Omit<IItemConfig, "Upgrades"> {
|
||||
Upgrades?: string[];
|
||||
}
|
||||
|
||||
export interface ISong {
|
||||
m?: string;
|
||||
b?: string;
|
||||
p?: string;
|
||||
s: string;
|
||||
}
|
||||
export interface IOperatorConfigDatabase extends IItemConfig {
|
||||
export interface IOperatorConfigDatabase extends IItemConfigDatabase {
|
||||
_id: Types.ObjectId;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user