XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

SpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 1 Star 0
返回提交历史

XFEstudio/SpaceNinjaServer

feat: archon shard removal (#724)

9d115a4d
Sainan <sainan@calamity.inc>
提交于

代码差异

1 个文件 +24 -0
Modified src/controllers/api/infestedFoundryController.ts +24 -0
@@ -41,6 +41,25 @@ export const infestedFoundryController: RequestHandler = async (req, res) => {
41 41 break;
42 42 }
43 43
44 case "x": {
45 // shard removal
46 const request = getJSONfromString(String(req.body)) as IShardUninstallRequest;
47 const inventory = await getInventory(accountId);
48 const suit = inventory.Suits.find(suit => suit._id.toString() == request.SuitId.$oid)!;
49 suit.ArchonCrystalUpgrades![request.Slot] = {};
50 const bile = inventory.InfestedFoundry!.Resources!.find(
51 x => x.ItemType == "/Lotus/Types/Items/InfestedFoundry/HelminthBile"
52 )!;
53 bile.Count -= 300;
54 await inventory.save();
55 res.json({
56 InventoryChanges: {
57 InfestedFoundry: inventory.toJSON().InfestedFoundry
58 }
59 });
60 break;
61 }
62
44 63 case "n": {
45 64 // name the beast
46 65 const request = getJSONfromString(String(req.body)) as IHelminthNameRequest;
@@ -274,6 +293,11 @@ interface IShardInstallRequest {
274 293 Color: string;
275 294 }
276 295
296 interface IShardUninstallRequest {
297 SuitId: IOid;
298 Slot: number;
299 }
300
277 301 interface IHelminthNameRequest {
278 302 newName: string;
279 303 }