feat: gravimag installation #366
@ -1,7 +1,7 @@
 | 
				
			|||||||
import { RequestHandler } from "express";
 | 
					import { RequestHandler } from "express";
 | 
				
			||||||
import { IUpgradesRequest } from "@/src/types/requestTypes";
 | 
					import { IUpgradesRequest } from "@/src/types/requestTypes";
 | 
				
			||||||
import { FocusSchool, IEquipmentDatabase, EquipmentFeatures } from "@/src/types/inventoryTypes/commonInventoryTypes";
 | 
					import { FocusSchool, IEquipmentDatabase, EquipmentFeatures } from "@/src/types/inventoryTypes/commonInventoryTypes";
 | 
				
			||||||
import { IMiscItem, TEquipmentKey } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
					import { IMiscItem } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
				
			||||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
					import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
				
			||||||
import { addMiscItems, getInventory, updateCurrency } from "@/src/services/inventoryService";
 | 
					import { addMiscItems, getInventory, updateCurrency } from "@/src/services/inventoryService";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -29,7 +29,7 @@ export const upgradesController: RequestHandler = async (req, res) => {
 | 
				
			|||||||
        switch (operation.UpgradeRequirement) {
 | 
					        switch (operation.UpgradeRequirement) {
 | 
				
			||||||
            case "/Lotus/Types/Items/MiscItems/OrokinReactor":
 | 
					            case "/Lotus/Types/Items/MiscItems/OrokinReactor":
 | 
				
			||||||
            case "/Lotus/Types/Items/MiscItems/OrokinCatalyst":
 | 
					            case "/Lotus/Types/Items/MiscItems/OrokinCatalyst":
 | 
				
			||||||
                for (const item of inventory[payload.ItemCategory as TEquipmentKey] as IEquipmentDatabase[]) {
 | 
					                for (const item of inventory[payload.ItemCategory]) {
 | 
				
			||||||
                    if (item._id.toString() == payload.ItemId.$oid) {
 | 
					                    if (item._id.toString() == payload.ItemId.$oid) {
 | 
				
			||||||
                        item.Features ??= 0;
 | 
					                        item.Features ??= 0;
 | 
				
			||||||
                        item.Features |= EquipmentFeatures.DOUBLE_CAPACITY;
 | 
					                        item.Features |= EquipmentFeatures.DOUBLE_CAPACITY;
 | 
				
			||||||
@ -39,7 +39,7 @@ export const upgradesController: RequestHandler = async (req, res) => {
 | 
				
			|||||||
                break;
 | 
					                break;
 | 
				
			||||||
            case "/Lotus/Types/Items/MiscItems/UtilityUnlocker":
 | 
					            case "/Lotus/Types/Items/MiscItems/UtilityUnlocker":
 | 
				
			||||||
            case "/Lotus/Types/Items/MiscItems/WeaponUtilityUnlocker":
 | 
					            case "/Lotus/Types/Items/MiscItems/WeaponUtilityUnlocker":
 | 
				
			||||||
                for (const item of inventory[payload.ItemCategory as TEquipmentKey] as IEquipmentDatabase[]) {
 | 
					                for (const item of inventory[payload.ItemCategory]) {
 | 
				
			||||||
                    if (item._id.toString() == payload.ItemId.$oid) {
 | 
					                    if (item._id.toString() == payload.ItemId.$oid) {
 | 
				
			||||||
                        item.Features ??= 0;
 | 
					                        item.Features ??= 0;
 | 
				
			||||||
                        item.Features |= EquipmentFeatures.UTILITY_SLOT;
 | 
					                        item.Features |= EquipmentFeatures.UTILITY_SLOT;
 | 
				
			||||||
@ -47,10 +47,20 @@ export const upgradesController: RequestHandler = async (req, res) => {
 | 
				
			|||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					            case "/Lotus/Types/Items/MiscItems/HeavyWeaponCatalyst":
 | 
				
			||||||
 | 
					                console.assert(payload.ItemCategory == "SpaceGuns");
 | 
				
			||||||
 | 
					                for (const item of inventory[payload.ItemCategory]) {
 | 
				
			||||||
 | 
					                    if (item._id.toString() == payload.ItemId.$oid) {
 | 
				
			||||||
 | 
					                        item.Features ??= 0;
 | 
				
			||||||
 | 
					                        item.Features |= EquipmentFeatures.GRAVIMAG_INSTALLED;
 | 
				
			||||||
 | 
					                        break;
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                break;
 | 
				
			||||||
            case "/Lotus/Types/Items/MiscItems/WeaponPrimaryArcaneUnlocker":
 | 
					            case "/Lotus/Types/Items/MiscItems/WeaponPrimaryArcaneUnlocker":
 | 
				
			||||||
            case "/Lotus/Types/Items/MiscItems/WeaponSecondaryArcaneUnlocker":
 | 
					            case "/Lotus/Types/Items/MiscItems/WeaponSecondaryArcaneUnlocker":
 | 
				
			||||||
            case "/Lotus/Types/Items/MiscItems/WeaponMeleeArcaneUnlocker":
 | 
					            case "/Lotus/Types/Items/MiscItems/WeaponMeleeArcaneUnlocker":
 | 
				
			||||||
                for (const item of inventory[payload.ItemCategory as TEquipmentKey] as IEquipmentDatabase[]) {
 | 
					                for (const item of inventory[payload.ItemCategory]) {
 | 
				
			||||||
                    if (item._id.toString() == payload.ItemId.$oid) {
 | 
					                    if (item._id.toString() == payload.ItemId.$oid) {
 | 
				
			||||||
                        item.Features ??= 0;
 | 
					                        item.Features ??= 0;
 | 
				
			||||||
                        item.Features |= EquipmentFeatures.ARCANE_SLOT;
 | 
					                        item.Features |= EquipmentFeatures.ARCANE_SLOT;
 | 
				
			||||||
@ -62,7 +72,7 @@ export const upgradesController: RequestHandler = async (req, res) => {
 | 
				
			|||||||
            case "/Lotus/Types/Items/MiscItems/FormaUmbra":
 | 
					            case "/Lotus/Types/Items/MiscItems/FormaUmbra":
 | 
				
			||||||
            case "/Lotus/Types/Items/MiscItems/FormaAura":
 | 
					            case "/Lotus/Types/Items/MiscItems/FormaAura":
 | 
				
			||||||
            case "/Lotus/Types/Items/MiscItems/FormaStance":
 | 
					            case "/Lotus/Types/Items/MiscItems/FormaStance":
 | 
				
			||||||
                for (const item of inventory[payload.ItemCategory as TEquipmentKey] as IEquipmentDatabase[]) {
 | 
					                for (const item of inventory[payload.ItemCategory]) {
 | 
				
			||||||
                    if (item._id.toString() == payload.ItemId.$oid) {
 | 
					                    if (item._id.toString() == payload.ItemId.$oid) {
 | 
				
			||||||
                        item.XP = 0;
 | 
					                        item.XP = 0;
 | 
				
			||||||
                        setSlotPolarity(item, operation.PolarizeSlot, operation.PolarizeValue);
 | 
					                        setSlotPolarity(item, operation.PolarizeSlot, operation.PolarizeValue);
 | 
				
			||||||
@ -73,7 +83,7 @@ export const upgradesController: RequestHandler = async (req, res) => {
 | 
				
			|||||||
                }
 | 
					                }
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
            case "/Lotus/Types/Items/MiscItems/ModSlotUnlocker":
 | 
					            case "/Lotus/Types/Items/MiscItems/ModSlotUnlocker":
 | 
				
			||||||
                for (const item of inventory[payload.ItemCategory as TEquipmentKey] as IEquipmentDatabase[]) {
 | 
					                for (const item of inventory[payload.ItemCategory]) {
 | 
				
			||||||
                    if (item._id.toString() == payload.ItemId.$oid) {
 | 
					                    if (item._id.toString() == payload.ItemId.$oid) {
 | 
				
			||||||
                        item.ModSlotPurchases ??= 0;
 | 
					                        item.ModSlotPurchases ??= 0;
 | 
				
			||||||
                        item.ModSlotPurchases += 1;
 | 
					                        item.ModSlotPurchases += 1;
 | 
				
			||||||
@ -88,7 +98,7 @@ export const upgradesController: RequestHandler = async (req, res) => {
 | 
				
			|||||||
                }
 | 
					                }
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
            case "/Lotus/Types/Items/MiscItems/CustomizationSlotUnlocker":
 | 
					            case "/Lotus/Types/Items/MiscItems/CustomizationSlotUnlocker":
 | 
				
			||||||
                for (const item of inventory[payload.ItemCategory as TEquipmentKey] as IEquipmentDatabase[]) {
 | 
					                for (const item of inventory[payload.ItemCategory]) {
 | 
				
			||||||
                    if (item._id.toString() == payload.ItemId.$oid) {
 | 
					                    if (item._id.toString() == payload.ItemId.$oid) {
 | 
				
			||||||
                        item.CustomizationSlotPurchases ??= 0;
 | 
					                        item.CustomizationSlotPurchases ??= 0;
 | 
				
			||||||
                        item.CustomizationSlotPurchases += 1;
 | 
					                        item.CustomizationSlotPurchases += 1;
 | 
				
			||||||
@ -104,7 +114,7 @@ export const upgradesController: RequestHandler = async (req, res) => {
 | 
				
			|||||||
                break;
 | 
					                break;
 | 
				
			||||||
            case "":
 | 
					            case "":
 | 
				
			||||||
                console.assert(operation.OperationType == "UOT_SWAP_POLARITY");
 | 
					                console.assert(operation.OperationType == "UOT_SWAP_POLARITY");
 | 
				
			||||||
                for (const item of inventory[payload.ItemCategory as TEquipmentKey] as IEquipmentDatabase[]) {
 | 
					                for (const item of inventory[payload.ItemCategory]) {
 | 
				
			||||||
                    if (item._id.toString() == payload.ItemId.$oid) {
 | 
					                    if (item._id.toString() == payload.ItemId.$oid) {
 | 
				
			||||||
                        for (let i = 0; i != operation.PolarityRemap.length; ++i) {
 | 
					                        for (let i = 0; i != operation.PolarityRemap.length; ++i) {
 | 
				
			||||||
                            if (operation.PolarityRemap[i].Slot != i) {
 | 
					                            if (operation.PolarityRemap[i].Slot != i) {
 | 
				
			||||||
 | 
				
			|||||||
@ -85,6 +85,7 @@ export interface IEquipmentClient extends Omit<IEquipmentDatabase, "_id"> {
 | 
				
			|||||||
export enum EquipmentFeatures {
 | 
					export enum EquipmentFeatures {
 | 
				
			||||||
    DOUBLE_CAPACITY = 1,
 | 
					    DOUBLE_CAPACITY = 1,
 | 
				
			||||||
    UTILITY_SLOT = 2,
 | 
					    UTILITY_SLOT = 2,
 | 
				
			||||||
 | 
					    GRAVIMAG_INSTALLED = 4,
 | 
				
			||||||
    ARCANE_SLOT = 32,
 | 
					    ARCANE_SLOT = 32,
 | 
				
			||||||
    INCARNON_GENESIS = 512
 | 
					    INCARNON_GENESIS = 512
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -66,7 +66,8 @@ export type TEquipmentKey =
 | 
				
			|||||||
    | "Melee"
 | 
					    | "Melee"
 | 
				
			||||||
    | "SpecialItems"
 | 
					    | "SpecialItems"
 | 
				
			||||||
    | "Sentinels"
 | 
					    | "Sentinels"
 | 
				
			||||||
    | "SentinelWeapons";
 | 
					    | "SentinelWeapons"
 | 
				
			||||||
 | 
					    | "SpaceGuns";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export interface IDuviriInfo {
 | 
					export interface IDuviriInfo {
 | 
				
			||||||
    Seed: number;
 | 
					    Seed: number;
 | 
				
			||||||
 | 
				
			|||||||
@ -10,7 +10,8 @@ import {
 | 
				
			|||||||
    ITypeCount,
 | 
					    ITypeCount,
 | 
				
			||||||
    IMission,
 | 
					    IMission,
 | 
				
			||||||
    IRawUpgrade,
 | 
					    IRawUpgrade,
 | 
				
			||||||
    ISeasonChallenge
 | 
					    ISeasonChallenge,
 | 
				
			||||||
 | 
					    TEquipmentKey
 | 
				
			||||||
} from "./inventoryTypes/inventoryTypes";
 | 
					} from "./inventoryTypes/inventoryTypes";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export interface IArtifactsRequest {
 | 
					export interface IArtifactsRequest {
 | 
				
			||||||
@ -85,7 +86,7 @@ export interface IUpdateGlyphRequest {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export interface IUpgradesRequest {
 | 
					export interface IUpgradesRequest {
 | 
				
			||||||
    ItemCategory: string;
 | 
					    ItemCategory: TEquipmentKey;
 | 
				
			||||||
    ItemId: IOid;
 | 
					    ItemId: IOid;
 | 
				
			||||||
    ItemFeatures: number;
 | 
					    ItemFeatures: number;
 | 
				
			||||||
    UpgradeVersion: number;
 | 
					    UpgradeVersion: number;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user