返回提交历史
Modified
src/controllers/api/upgradesController.ts
+15
-0
Modified
src/types/inventoryTypes/inventoryTypes.ts
+3
-1
Modified
src/types/requestTypes.ts
+2
-1
XFEstudio/XFESpaceNinjaServer
feat: implement polarization (forma) (#173)
d62785a8
代码差异
3 个文件
+20
-2
@@ -1,5 +1,6 @@
1
1
import { RequestHandler } from "express";
2
2
import { IUpgradesRequest } from "@/src/types/requestTypes";
3
import { IPolarity } from "@/src/types/inventoryTypes/commonInventoryTypes";
3
4
import { IGenericItemDatabase, IMiscItem, TGenericItemKey } from "@/src/types/inventoryTypes/inventoryTypes";
4
5
import { addMiscItems, getInventory } from "@/src/services/inventoryService";
5
6
@@ -42,6 +43,20 @@ export const upgradesController: RequestHandler = async (req, res) => {
42
43
if (item._id.toString() == payload.ItemId.$oid) {
43
44
item.Features ??= 0;
44
45
item.Features |= 32;
46
}
47
}
48
break;
49
case "/Lotus/Types/Items/MiscItems/Forma":
50
for (const item of inventory[payload.ItemCategory as TGenericItemKey] as IGenericItemDatabase[]) {
51
if (item._id.toString() == payload.ItemId.$oid) {
52
item.XP = 0;
53
item.Polarity ??= [];
54
item.Polarity.push({
55
Slot: operation.PolarizeSlot,
56
Value: operation.PolarizeValue
57
} satisfies IPolarity);
58
item.Polarized ??= 0;
59
item.Polarized += 1;
45
60
break;
46
61
}
47
62
}
@@ -91,7 +91,9 @@ export interface IGenericItem {
91
91
Configs: IItemConfig[];
92
92
UpgradeVer: number;
93
93
ItemId: IOid;
94
Features?: number; //space suit has this
94
Features?: number;
95
Polarity?: IPolarity[];
96
Polarized?: number;
95
97
}
96
98
97
99
export interface IGenericItemDatabase extends Omit<IGenericItem, "ItemId"> {
@@ -1,4 +1,5 @@
1
1
import { IOid } from "./commonTypes";
2
import { FocusSchool } from "@/src/types/inventoryTypes/commonInventoryTypes";
2
3
import {
3
4
IBooster,
4
5
IChallengeProgress,
@@ -78,6 +79,6 @@ export interface IUpgradeOperation {
78
79
OperationType: string;
79
80
UpgradeRequirement: string; // uniqueName of item being consumed
80
81
PolarizeSlot: number;
81
PolarizeValue: string; // polarity
82
PolarizeValue: FocusSchool;
82
83
PolarityRemap: {}[];
83
84
}