feat: implement polarization (forma) (#173)

This commit is contained in:
Sainan 2024-05-09 01:07:14 +02:00 committed by GitHub
parent bc3fca8ccf
commit d62785a883
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 20 additions and 2 deletions

View File

@ -1,5 +1,6 @@
import { RequestHandler } from "express";
import { IUpgradesRequest } from "@/src/types/requestTypes";
import { IPolarity } from "@/src/types/inventoryTypes/commonInventoryTypes";
import { IGenericItemDatabase, IMiscItem, TGenericItemKey } from "@/src/types/inventoryTypes/inventoryTypes";
import { addMiscItems, getInventory } from "@/src/services/inventoryService";
@ -42,6 +43,20 @@ export const upgradesController: RequestHandler = async (req, res) => {
if (item._id.toString() == payload.ItemId.$oid) {
item.Features ??= 0;
item.Features |= 32;
}
}
break;
case "/Lotus/Types/Items/MiscItems/Forma":
for (const item of inventory[payload.ItemCategory as TGenericItemKey] as IGenericItemDatabase[]) {
if (item._id.toString() == payload.ItemId.$oid) {
item.XP = 0;
item.Polarity ??= [];
item.Polarity.push({
Slot: operation.PolarizeSlot,
Value: operation.PolarizeValue
} satisfies IPolarity);
item.Polarized ??= 0;
item.Polarized += 1;
break;
}
}

View File

@ -91,7 +91,9 @@ export interface IGenericItem {
Configs: IItemConfig[];
UpgradeVer: number;
ItemId: IOid;
Features?: number; //space suit has this
Features?: number;
Polarity?: IPolarity[];
Polarized?: number;
}
export interface IGenericItemDatabase extends Omit<IGenericItem, "ItemId"> {

View File

@ -1,4 +1,5 @@
import { IOid } from "./commonTypes";
import { FocusSchool } from "@/src/types/inventoryTypes/commonInventoryTypes";
import {
IBooster,
IChallengeProgress,
@ -78,6 +79,6 @@ export interface IUpgradeOperation {
OperationType: string;
UpgradeRequirement: string; // uniqueName of item being consumed
PolarizeSlot: number;
PolarizeValue: string; // polarity
PolarizeValue: FocusSchool;
PolarityRemap: {}[];
}