feat: archon shard removal (#724)

This commit is contained in:
Sainan 2025-01-05 13:40:19 +01:00 committed by GitHub
parent d69ebf89ec
commit 9d115a4d02
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -41,6 +41,25 @@ export const infestedFoundryController: RequestHandler = async (req, res) => {
break;
}
case "x": {
// shard removal
const request = getJSONfromString(String(req.body)) as IShardUninstallRequest;
const inventory = await getInventory(accountId);
const suit = inventory.Suits.find(suit => suit._id.toString() == request.SuitId.$oid)!;
suit.ArchonCrystalUpgrades![request.Slot] = {};
const bile = inventory.InfestedFoundry!.Resources!.find(
x => x.ItemType == "/Lotus/Types/Items/InfestedFoundry/HelminthBile"
)!;
bile.Count -= 300;
await inventory.save();
res.json({
InventoryChanges: {
InfestedFoundry: inventory.toJSON().InfestedFoundry
}
});
break;
}
case "n": {
// name the beast
const request = getJSONfromString(String(req.body)) as IHelminthNameRequest;
@ -274,6 +293,11 @@ interface IShardInstallRequest {
Color: string;
}
interface IShardUninstallRequest {
SuitId: IOid;
Slot: number;
}
interface IHelminthNameRequest {
newName: string;
}