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 @@ +
+ + +
diff --git a/static/webui/translations/de.js b/static/webui/translations/de.js index 0d6d4c9f..aefd1f84 100644 --- a/static/webui/translations/de.js +++ b/static/webui/translations/de.js @@ -110,6 +110,7 @@ dict = { cheats_unlockExilusEverywhere: `Exilus-Adapter überall`, cheats_unlockArcanesEverywhere: `Arkana-Adapter überall`, cheats_noDailyStandingLimits: `Kein tägliches Ansehenslimit`, + cheats_noArgonCrystalDecay: `[UNTRANSLATED] No Argon Crystal Decay`, cheats_noVendorPurchaseLimits: `Keine Kaufbeschränkungen bei Händlern`, cheats_instantResourceExtractorDrones: `Sofortige Ressourcen-Extraktor-Drohnen`, cheats_noDojoRoomBuildStage: `Kein Dojo-Raum-Bauvorgang`, diff --git a/static/webui/translations/en.js b/static/webui/translations/en.js index 455ab2e4..b60ba241 100644 --- a/static/webui/translations/en.js +++ b/static/webui/translations/en.js @@ -109,6 +109,7 @@ dict = { cheats_unlockExilusEverywhere: `Exilus Adapters Everywhere`, cheats_unlockArcanesEverywhere: `Arcane Adapters Everywhere`, cheats_noDailyStandingLimits: `No Daily Standing Limits`, + cheats_noArgonCrystalDecay: `No Argon Crystal Decay`, cheats_noVendorPurchaseLimits: `No Vendor Purchase Limits`, cheats_instantResourceExtractorDrones: `Instant Resource Extractor Drones`, cheats_noDojoRoomBuildStage: `No Dojo Room Build Stage`, diff --git a/static/webui/translations/fr.js b/static/webui/translations/fr.js index 9840911a..96b52eaa 100644 --- a/static/webui/translations/fr.js +++ b/static/webui/translations/fr.js @@ -110,6 +110,7 @@ dict = { cheats_unlockExilusEverywhere: `Adaptateurs Exilus partout`, cheats_unlockArcanesEverywhere: `Adaptateur d'Arcanes partout`, cheats_noDailyStandingLimits: `Pas de limite de réputation journalière`, + cheats_noArgonCrystalDecay: `[UNTRANSLATED] No Argon Crystal Decay`, cheats_noVendorPurchaseLimits: `[UNTRANSLATED] No Vendor Purchase Limits`, cheats_instantResourceExtractorDrones: `Ressources de drone d'extraction instantannées`, cheats_noDojoRoomBuildStage: `No Dojo Room Build Stage`, diff --git a/static/webui/translations/ru.js b/static/webui/translations/ru.js index 030c704b..502b84af 100644 --- a/static/webui/translations/ru.js +++ b/static/webui/translations/ru.js @@ -110,6 +110,7 @@ dict = { cheats_unlockExilusEverywhere: `Адаптеры Эксилус везде`, cheats_unlockArcanesEverywhere: `Адаптеры для мистификаторов везде`, cheats_noDailyStandingLimits: `Без ежедневных ограничений репутации`, + cheats_noArgonCrystalDecay: `[UNTRANSLATED] No Argon Crystal Decay`, cheats_noVendorPurchaseLimits: `[UNTRANSLATED] No Vendor Purchase Limits`, cheats_instantResourceExtractorDrones: `Мгновенные Экстракторы Ресурсов`, cheats_noDojoRoomBuildStage: `Мгновенное Строительтво Комнат Додзё`, diff --git a/static/webui/translations/zh.js b/static/webui/translations/zh.js index a783bb04..57207f0a 100644 --- a/static/webui/translations/zh.js +++ b/static/webui/translations/zh.js @@ -110,6 +110,7 @@ dict = { cheats_unlockExilusEverywhere: `全物品自带适配器`, cheats_unlockArcanesEverywhere: `全物品自带赋能适配器`, cheats_noDailyStandingLimits: `无每日声望限制`, + cheats_noArgonCrystalDecay: `[UNTRANSLATED] No Argon Crystal Decay`, cheats_noVendorPurchaseLimits: `[UNTRANSLATED] No Vendor Purchase Limits`, cheats_instantResourceExtractorDrones: `即时资源采集无人机`, cheats_noDojoRoomBuildStage: `无视道场房间建造阶段`,