diff --git a/config.json.example b/config.json.example index 85054641..c8a2df6a 100644 --- a/config.json.example +++ b/config.json.example @@ -29,6 +29,7 @@ "unlockExilusEverywhere": false, "unlockArcanesEverywhere": false, "noDailyStandingLimits": false, + "noArgonCrystalDecay": false, "noVendorPurchaseLimits": true, "instantResourceExtractorDrones": false, "noDojoRoomBuildStage": false, diff --git a/src/controllers/api/inventoryController.ts b/src/controllers/api/inventoryController.ts index 070a074d..40d13d4c 100644 --- a/src/controllers/api/inventoryController.ts +++ b/src/controllers/api/inventoryController.ts @@ -37,36 +37,40 @@ export const inventoryController: RequestHandler = async (request, response) => inventory.LibraryAvailableDailyTaskInfo = createLibraryDailyTask(); if (inventory.NextRefill) { - const lastLoginDay = Math.trunc(inventory.NextRefill.getTime() / 86400000) - 1; - const today = Math.trunc(Date.now() / 86400000); - const daysPassed = today - lastLoginDay; - for (let i = 0; i != daysPassed; ++i) { - const numArgonCrystals = - inventory.MiscItems.find(x => x.ItemType == "/Lotus/Types/Items/MiscItems/ArgonCrystal") - ?.ItemCount ?? 0; - if (numArgonCrystals == 0) { - break; - } - const numStableArgonCrystals = - inventory.FoundToday?.find(x => x.ItemType == "/Lotus/Types/Items/MiscItems/ArgonCrystal") - ?.ItemCount ?? 0; - const numDecayingArgonCrystals = numArgonCrystals - numStableArgonCrystals; - const numDecayingArgonCrystalsToRemove = Math.ceil(numDecayingArgonCrystals / 2); - logger.debug(`ticking argon crystals for day ${i + 1} of ${daysPassed}`, { - numArgonCrystals, - numStableArgonCrystals, - numDecayingArgonCrystals, - numDecayingArgonCrystalsToRemove - }); - // Remove half of owned decaying argon crystals - addMiscItems(inventory, [ - { - ItemType: "/Lotus/Types/Items/MiscItems/ArgonCrystal", - ItemCount: numDecayingArgonCrystalsToRemove * -1 - } - ]); - // All stable argon crystals are now decaying + if (config.noArgonCrystalDecay) { inventory.FoundToday = undefined; + } else { + const lastLoginDay = Math.trunc(inventory.NextRefill.getTime() / 86400000) - 1; + const today = Math.trunc(Date.now() / 86400000); + const daysPassed = today - lastLoginDay; + for (let i = 0; i != daysPassed; ++i) { + const numArgonCrystals = + inventory.MiscItems.find(x => x.ItemType == "/Lotus/Types/Items/MiscItems/ArgonCrystal") + ?.ItemCount ?? 0; + if (numArgonCrystals == 0) { + break; + } + const numStableArgonCrystals = + inventory.FoundToday?.find(x => x.ItemType == "/Lotus/Types/Items/MiscItems/ArgonCrystal") + ?.ItemCount ?? 0; + const numDecayingArgonCrystals = numArgonCrystals - numStableArgonCrystals; + const numDecayingArgonCrystalsToRemove = Math.ceil(numDecayingArgonCrystals / 2); + logger.debug(`ticking argon crystals for day ${i + 1} of ${daysPassed}`, { + numArgonCrystals, + numStableArgonCrystals, + numDecayingArgonCrystals, + numDecayingArgonCrystalsToRemove + }); + // Remove half of owned decaying argon crystals + addMiscItems(inventory, [ + { + ItemType: "/Lotus/Types/Items/MiscItems/ArgonCrystal", + ItemCount: numDecayingArgonCrystalsToRemove * -1 + } + ]); + // All stable argon crystals are now decaying + inventory.FoundToday = undefined; + } } } diff --git a/src/services/configService.ts b/src/services/configService.ts index b19ac57e..66c50dda 100644 --- a/src/services/configService.ts +++ b/src/services/configService.ts @@ -55,6 +55,7 @@ interface IConfig { unlockExilusEverywhere?: boolean; unlockArcanesEverywhere?: boolean; noDailyStandingLimits?: boolean; + noArgonCrystalDecay?: boolean; noVendorPurchaseLimits?: boolean; instantResourceExtractorDrones?: boolean; noDojoRoomBuildStage?: boolean; diff --git a/static/webui/index.html b/static/webui/index.html index bd5f13cc..540378d9 100644 --- a/static/webui/index.html +++ b/static/webui/index.html @@ -517,6 +517,10 @@ +