From 6bd6e62167725caa0a5550b51368f72bf11f776c Mon Sep 17 00:00:00 2001 From: Sainan Date: Sun, 12 Jan 2025 08:29:03 +0100 Subject: [PATCH] feat: add potatoes, exilus, & arcanes everywhere cheats --- config.json.example | 3 ++ src/controllers/api/inventoryController.ts | 35 +++++++++++++++++++++- src/services/configService.ts | 3 ++ static/webui/index.html | 18 +++++++++++ 4 files changed, 58 insertions(+), 1 deletion(-) diff --git a/config.json.example b/config.json.example index 72cb9d38..f3803e0b 100644 --- a/config.json.example +++ b/config.json.example @@ -25,5 +25,8 @@ "unlockAllSkins": true, "unlockAllCapturaScenes": true, "universalPolarityEverywhere": true, + "unlockDoubleCapacityPotatoesEverywhere": true, + "unlockExilusEverywhere": true, + "unlockArcanesEverywhere": true, "spoofMasteryRank": -1 } diff --git a/src/controllers/api/inventoryController.ts b/src/controllers/api/inventoryController.ts index 547a38b4..631cd45e 100644 --- a/src/controllers/api/inventoryController.ts +++ b/src/controllers/api/inventoryController.ts @@ -5,7 +5,7 @@ import { config } from "@/src/services/configService"; import allDialogue from "@/static/fixed_responses/allDialogue.json"; import { ILoadoutDatabase } from "@/src/types/saveLoadoutTypes"; import { IInventoryResponse, IShipInventory, equipmentKeys } from "@/src/types/inventoryTypes/inventoryTypes"; -import { IPolarity, ArtifactPolarity } from "@/src/types/inventoryTypes/commonInventoryTypes"; +import { IPolarity, ArtifactPolarity, EquipmentFeatures } from "@/src/types/inventoryTypes/commonInventoryTypes"; import { ExportCustoms, ExportFlavour, @@ -211,6 +211,39 @@ export const inventoryController: RequestHandler = async (request, response) => } } + if (config.unlockDoubleCapacityPotatoesEverywhere) { + for (const key of equipmentKeys) { + if (key in inventoryResponse) { + for (const equipment of inventoryResponse[key]) { + equipment.Features ??= 0; + equipment.Features |= EquipmentFeatures.DOUBLE_CAPACITY; + } + } + } + } + + if (config.unlockExilusEverywhere) { + for (const key of equipmentKeys) { + if (key in inventoryResponse) { + for (const equipment of inventoryResponse[key]) { + equipment.Features ??= 0; + equipment.Features |= EquipmentFeatures.UTILITY_SLOT; + } + } + } + } + + if (config.unlockArcanesEverywhere) { + for (const key of equipmentKeys) { + if (key in inventoryResponse) { + for (const equipment of inventoryResponse[key]) { + equipment.Features ??= 0; + equipment.Features |= EquipmentFeatures.ARCANE_SLOT; + } + } + } + } + // Fix for #380 inventoryResponse.NextRefill = { $date: { $numberLong: "9999999999999" } }; diff --git a/src/services/configService.ts b/src/services/configService.ts index 43f7c2f1..123e02d3 100644 --- a/src/services/configService.ts +++ b/src/services/configService.ts @@ -51,6 +51,9 @@ interface IConfig { unlockAllSkins?: boolean; unlockAllCapturaScenes?: boolean; universalPolarityEverywhere?: boolean; + unlockDoubleCapacityPotatoesEverywhere?: boolean; + unlockExilusEverywhere?: boolean; + unlockArcanesEverywhere?: boolean; spoofMasteryRank?: number; } diff --git a/static/webui/index.html b/static/webui/index.html index 9ffd8e88..c9692f41 100644 --- a/static/webui/index.html +++ b/static/webui/index.html @@ -271,6 +271,24 @@ Universal Polarity Everywhere +
+ + +
+
+ + +
+
+ + +