diff --git a/config-vanilla.json b/config-vanilla.json index d13eb84e..cce20a79 100644 --- a/config-vanilla.json +++ b/config-vanilla.json @@ -18,7 +18,6 @@ "unlockAllSkins": false, "unlockAllCapturaScenes": false, "fullyStockedVendors": false, - "unlockAllProfitTakerStages": false, "skipClanKeyCrafting": false, "noDojoRoomBuildStage": false, "noDecoBuildStage": false, diff --git a/src/controllers/api/inventoryController.ts b/src/controllers/api/inventoryController.ts index 5a508f04..100f0a1a 100644 --- a/src/controllers/api/inventoryController.ts +++ b/src/controllers/api/inventoryController.ts @@ -486,19 +486,6 @@ export const getInventoryResponse = async ( } } - if (config.unlockAllProfitTakerStages) { - inventoryResponse.CompletedJobChains ??= []; - const EudicoHeists = inventoryResponse.CompletedJobChains.find(x => x.LocationTag == "EudicoHeists"); - if (EudicoHeists) { - EudicoHeists.Jobs = allEudicoHeistJobs; - } else { - inventoryResponse.CompletedJobChains.push({ - LocationTag: "EudicoHeists", - Jobs: allEudicoHeistJobs - }); - } - } - if (config.unlockAllSimarisResearchEntries) { inventoryResponse.LibraryPersonalTarget = undefined; inventoryResponse.LibraryPersonalProgress = [ @@ -515,13 +502,6 @@ export const getInventoryResponse = async ( return inventoryResponse; }; -const allEudicoHeistJobs = [ - "/Lotus/Types/Gameplay/Venus/Jobs/Heists/HeistProfitTakerBountyOne", - "/Lotus/Types/Gameplay/Venus/Jobs/Heists/HeistProfitTakerBountyTwo", - "/Lotus/Types/Gameplay/Venus/Jobs/Heists/HeistProfitTakerBountyThree", - "/Lotus/Types/Gameplay/Venus/Jobs/Heists/HeistProfitTakerBountyFour" -]; - const getExpRequiredForMr = (rank: number): number => { if (rank <= 30) { return 2500 * rank * rank; diff --git a/src/controllers/custom/unlockAllProfitTakerStagesController.ts b/src/controllers/custom/unlockAllProfitTakerStagesController.ts new file mode 100644 index 00000000..79fe3b87 --- /dev/null +++ b/src/controllers/custom/unlockAllProfitTakerStagesController.ts @@ -0,0 +1,24 @@ +import { getInventory } from "../../services/inventoryService.ts"; +import { getAccountIdForRequest } from "../../services/loginService.ts"; +import type { RequestHandler } from "express"; + +const allEudicoHeistJobs = [ + "/Lotus/Types/Gameplay/Venus/Jobs/Heists/HeistProfitTakerBountyOne", + "/Lotus/Types/Gameplay/Venus/Jobs/Heists/HeistProfitTakerBountyTwo", + "/Lotus/Types/Gameplay/Venus/Jobs/Heists/HeistProfitTakerBountyThree", + "/Lotus/Types/Gameplay/Venus/Jobs/Heists/HeistProfitTakerBountyFour" +]; + +export const unlockAllProfitTakerStagesController: RequestHandler = async (req, res) => { + const accountId = await getAccountIdForRequest(req); + const inventory = await getInventory(accountId, "CompletedJobChains"); + inventory.CompletedJobChains ??= []; + const chain = inventory.CompletedJobChains.find(x => x.LocationTag == "EudicoHeists"); + if (chain) { + chain.Jobs = allEudicoHeistJobs; + } else { + inventory.CompletedJobChains.push({ LocationTag: "EudicoHeists", Jobs: allEudicoHeistJobs }); + } + await inventory.save(); + res.end(); +}; diff --git a/src/routes/custom.ts b/src/routes/custom.ts index 58ab5c3c..6f10f563 100644 --- a/src/routes/custom.ts +++ b/src/routes/custom.ts @@ -14,6 +14,7 @@ import { addMissingMaxRankModsController } from "../controllers/custom/addMissin import { webuiFileChangeDetectedController } from "../controllers/custom/webuiFileChangeDetectedController.ts"; import { completeAllMissionsController } from "../controllers/custom/completeAllMissionsController.ts"; import { addMissingHelminthBlueprintsController } from "../controllers/custom/addMissingHelminthBlueprintsController.ts"; +import { unlockAllProfitTakerStagesController } from "../controllers/custom/unlockAllProfitTakerStagesController.ts"; import { abilityOverrideController } from "../controllers/custom/abilityOverrideController.ts"; import { createAccountController } from "../controllers/custom/createAccountController.ts"; @@ -48,6 +49,7 @@ customRouter.get("/addMissingMaxRankMods", addMissingMaxRankModsController); customRouter.get("/webuiFileChangeDetected", webuiFileChangeDetectedController); customRouter.get("/completeAllMissions", completeAllMissionsController); customRouter.get("/addMissingHelminthBlueprints", addMissingHelminthBlueprintsController); +customRouter.get("/unlockAllProfitTakerStages", unlockAllProfitTakerStagesController); customRouter.post("/abilityOverride", abilityOverrideController); customRouter.post("/createAccount", createAccountController); diff --git a/src/services/configService.ts b/src/services/configService.ts index a75c5f2c..97817f76 100644 --- a/src/services/configService.ts +++ b/src/services/configService.ts @@ -26,7 +26,6 @@ export interface IConfig extends IConfigRemovedOptions { unlockAllCapturaScenes?: boolean; unlockAllDecoRecipes?: boolean; fullyStockedVendors?: boolean; - unlockAllProfitTakerStages?: boolean; skipClanKeyCrafting?: boolean; noDojoRoomBuildStage?: boolean; noDojoDecoBuildStage?: boolean; @@ -105,6 +104,7 @@ export const configRemovedOptionsKeys = [ "unlockDoubleCapacityPotatoesEverywhere", "unlockExilusEverywhere", "unlockArcanesEverywhere", + "unlockAllProfitTakerStages", "noDailyStandingLimits", "noDailyFocusLimit", "noArgonCrystalDecay", diff --git a/static/webui/index.html b/static/webui/index.html index ef74222b..834f5ea4 100644 --- a/static/webui/index.html +++ b/static/webui/index.html @@ -791,6 +791,7 @@ +