diff --git a/config.json.example b/config.json.example index 4c5fafb5..8dfdfd31 100644 --- a/config.json.example +++ b/config.json.example @@ -20,6 +20,10 @@ "infiniteRegalAya": false, "infiniteHelminthMaterials": false, "claimingBlueprintRefundsIngredients": false, + "dontSubtractPurchaseCreditCost": false, + "dontSubtractPurchasePlatinumCost": false, + "dontSubtractPurchaseItemCost": false, + "dontSubtractPurchaseStandingCost": false, "dontSubtractVoidTraces": false, "dontSubtractConsumables": false, "unlockAllShipFeatures": false, diff --git a/src/services/configService.ts b/src/services/configService.ts index a45645a2..b14ffb67 100644 --- a/src/services/configService.ts +++ b/src/services/configService.ts @@ -25,6 +25,10 @@ export interface IConfig { infiniteRegalAya?: boolean; infiniteHelminthMaterials?: boolean; claimingBlueprintRefundsIngredients?: boolean; + dontSubtractPurchaseCreditCost?: boolean; + dontSubtractPurchasePlatinumCost?: boolean; + dontSubtractPurchaseItemCost?: boolean; + dontSubtractPurchaseStandingCost?: boolean; dontSubtractVoidTraces?: boolean; dontSubtractConsumables?: boolean; unlockAllShipFeatures?: boolean; diff --git a/src/services/purchaseService.ts b/src/services/purchaseService.ts index 59a431c3..4fb5bb2d 100644 --- a/src/services/purchaseService.ts +++ b/src/services/purchaseService.ts @@ -67,25 +67,31 @@ export const handlePurchase = async ( if (!offer) { throw new Error(`unknown vendor offer: ${ItemId ? ItemId : purchaseRequest.PurchaseParams.StoreItem}`); } - if (offer.RegularPrice) { - combineInventoryChanges( - prePurchaseInventoryChanges, - updateCurrency(inventory, offer.RegularPrice[0], false) - ); + if (!config.dontSubtractPurchaseCreditCost) { + if (offer.RegularPrice) { + combineInventoryChanges( + prePurchaseInventoryChanges, + updateCurrency(inventory, offer.RegularPrice[0], false) + ); + } } - if (offer.PremiumPrice) { - combineInventoryChanges( - prePurchaseInventoryChanges, - updateCurrency(inventory, offer.PremiumPrice[0], true) - ); + if (!config.dontSubtractPurchasePlatinumCost) { + if (offer.PremiumPrice) { + combineInventoryChanges( + prePurchaseInventoryChanges, + updateCurrency(inventory, offer.PremiumPrice[0], true) + ); + } } - if (offer.ItemPrices) { - handleItemPrices( - inventory, - offer.ItemPrices, - purchaseRequest.PurchaseParams.Quantity, - prePurchaseInventoryChanges - ); + if (!config.dontSubtractPurchaseItemCost) { + if (offer.ItemPrices) { + handleItemPrices( + inventory, + offer.ItemPrices, + purchaseRequest.PurchaseParams.Quantity, + prePurchaseInventoryChanges + ); + } } if (offer.LocTagRandSeed !== undefined) { seed = BigInt(offer.LocTagRandSeed); @@ -179,21 +185,25 @@ export const handlePurchase = async ( x => x.ItemType == purchaseRequest.PurchaseParams.StoreItem ); if (offer) { - combineInventoryChanges( - purchaseResponse.InventoryChanges, - updateCurrency(inventory, offer.RegularPrice, false) - ); + if (!config.dontSubtractPurchaseCreditCost) { + combineInventoryChanges( + purchaseResponse.InventoryChanges, + updateCurrency(inventory, offer.RegularPrice, false) + ); + } if (purchaseRequest.PurchaseParams.ExpectedPrice) { throw new Error(`vendor purchase should not have an expected price`); } - const invItem: IMiscItem = { - ItemType: "/Lotus/Types/Items/MiscItems/PrimeBucks", - ItemCount: offer.PrimePrice * purchaseRequest.PurchaseParams.Quantity * -1 - }; - addMiscItems(inventory, [invItem]); - purchaseResponse.InventoryChanges.MiscItems ??= []; - purchaseResponse.InventoryChanges.MiscItems.push(invItem); + if (!config.dontSubtractPurchaseItemCost) { + const invItem: IMiscItem = { + ItemType: "/Lotus/Types/Items/MiscItems/PrimeBucks", + ItemCount: offer.PrimePrice * purchaseRequest.PurchaseParams.Quantity * -1 + }; + addMiscItems(inventory, [invItem]); + purchaseResponse.InventoryChanges.MiscItems ??= []; + purchaseResponse.InventoryChanges.MiscItems.push(invItem); + } } break; } @@ -211,7 +221,7 @@ export const handlePurchase = async ( Title: lastTitle } ]; - } else { + } else if (!config.dontSubtractPurchaseStandingCost) { const syndicate = ExportSyndicates[syndicateTag]; // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition if (syndicate) { @@ -239,19 +249,19 @@ export const handlePurchase = async ( const vendor = ExportVendors[purchaseRequest.PurchaseParams.SourceId!]; const offer = vendor.items.find(x => x.storeItem == purchaseRequest.PurchaseParams.StoreItem); if (offer) { - if (typeof offer.credits == "number") { + if (typeof offer.credits == "number" && !config.dontSubtractPurchaseCreditCost) { combineInventoryChanges( purchaseResponse.InventoryChanges, updateCurrency(inventory, offer.credits, false) ); } - if (typeof offer.platinum == "number") { + if (typeof offer.platinum == "number" && !config.dontSubtractPurchasePlatinumCost) { combineInventoryChanges( purchaseResponse.InventoryChanges, updateCurrency(inventory, offer.platinum, true) ); } - if (offer.itemPrices) { + if (offer.itemPrices && !config.dontSubtractPurchaseItemCost) { handleItemPrices( inventory, offer.itemPrices, @@ -278,15 +288,17 @@ export const handlePurchase = async ( ); if (offer) { if (offer.RegularPrice) { - const invItem: IMiscItem = { - ItemType: "/Lotus/Types/Items/MiscItems/SchismKey", - ItemCount: offer.RegularPrice * purchaseRequest.PurchaseParams.Quantity * -1 - }; + if (!config.dontSubtractPurchaseItemCost) { + const invItem: IMiscItem = { + ItemType: "/Lotus/Types/Items/MiscItems/SchismKey", + ItemCount: offer.RegularPrice * purchaseRequest.PurchaseParams.Quantity * -1 + }; - addMiscItems(inventory, [invItem]); + addMiscItems(inventory, [invItem]); - purchaseResponse.InventoryChanges.MiscItems ??= []; - purchaseResponse.InventoryChanges.MiscItems.push(invItem); + purchaseResponse.InventoryChanges.MiscItems ??= []; + purchaseResponse.InventoryChanges.MiscItems.push(invItem); + } } else if (!config.infiniteRegalAya) { inventory.PrimeTokens -= offer.PrimePrice! * purchaseRequest.PurchaseParams.Quantity; diff --git a/static/webui/index.html b/static/webui/index.html index 9b9015a2..b6d87db4 100644 --- a/static/webui/index.html +++ b/static/webui/index.html @@ -604,13 +604,29 @@ +
+ + +
- - + + +
+
+ + +
+
+ + +
+
+ +
diff --git a/static/webui/translations/de.js b/static/webui/translations/de.js index c42d3cf9..6672d726 100644 --- a/static/webui/translations/de.js +++ b/static/webui/translations/de.js @@ -135,11 +135,15 @@ dict = { cheats_infiniteRegalAya: `Unendlich Reines Aya`, cheats_infiniteHelminthMaterials: `Unendlich Helminth-Materialien`, cheats_claimingBlueprintRefundsIngredients: `Fertige Blaupausen erstatten Ressourcen zurück`, + cheats_dontSubtractPurchaseCreditCost: `[UNTRANSLATED] Don't Subtract Purchase Credit Cost`, + cheats_dontSubtractPurchasePlatinumCost: `[UNTRANSLATED] Don't Subtract Purchase Platinum Cost`, + cheats_dontSubtractPurchaseItemCost: `[UNTRANSLATED] Don't Subtract Purchase Item Cost`, + cheats_dontSubtractPurchaseStandingCost: `[UNTRANSLATED] Don't Subtract Purchase Standing Cost`, cheats_dontSubtractVoidTraces: `Void-Spuren nicht verbrauchen`, cheats_dontSubtractConsumables: `Verbrauchsgegenstände (Ausrüstung) nicht verbrauchen`, cheats_unlockAllShipFeatures: `Alle Schiffs-Funktionen freischalten`, cheats_unlockAllShipDecorations: `Alle Schiffsdekorationen freischalten`, - cheats_unlockAllFlavourItems: `Alle Sammlerstücke freischalten`, + cheats_unlockAllFlavourItems: `Alle Sammlerstücke freischalten`, cheats_unlockAllSkins: `Alle Skins freischalten`, cheats_unlockAllCapturaScenes: `Alle Photora-Szenen freischalten`, cheats_unlockAllDecoRecipes: `Alle Dojo-Deko-Baupläne freischalten`, diff --git a/static/webui/translations/en.js b/static/webui/translations/en.js index aa35d2a9..f7869ac2 100644 --- a/static/webui/translations/en.js +++ b/static/webui/translations/en.js @@ -134,11 +134,15 @@ dict = { cheats_infiniteRegalAya: `Infinite Regal Aya`, cheats_infiniteHelminthMaterials: `Infinite Helminth Materials`, cheats_claimingBlueprintRefundsIngredients: `Claiming Blueprint Refunds Ingredients`, + cheats_dontSubtractPurchaseCreditCost: `Don't Subtract Purchase Credit Cost`, + cheats_dontSubtractPurchasePlatinumCost: `Don't Subtract Purchase Platinum Cost`, + cheats_dontSubtractPurchaseItemCost: `Don't Subtract Purchase Item Cost`, + cheats_dontSubtractPurchaseStandingCost: `Don't Subtract Purchase Standing Cost`, cheats_dontSubtractVoidTraces: `Don't Subtract Void Traces`, cheats_dontSubtractConsumables: `Don't Subtract Consumables`, cheats_unlockAllShipFeatures: `Unlock All Ship Features`, cheats_unlockAllShipDecorations: `Unlock All Ship Decorations`, - cheats_unlockAllFlavourItems: `Unlock All Flavor Items`, + cheats_unlockAllFlavourItems: `Unlock All Flavor Items`, cheats_unlockAllSkins: `Unlock All Skins`, cheats_unlockAllCapturaScenes: `Unlock All Captura Scenes`, cheats_unlockAllDecoRecipes: `Unlock All Dojo Deco Recipes`, diff --git a/static/webui/translations/es.js b/static/webui/translations/es.js index d3eb257b..79aedacd 100644 --- a/static/webui/translations/es.js +++ b/static/webui/translations/es.js @@ -135,6 +135,10 @@ dict = { cheats_infiniteRegalAya: `Aya Real infinita`, cheats_infiniteHelminthMaterials: `Materiales Helminto infinitos`, cheats_claimingBlueprintRefundsIngredients: `Reclamar ingredientes devueltos por planos`, + cheats_dontSubtractPurchaseCreditCost: `[UNTRANSLATED] Don't Subtract Purchase Credit Cost`, + cheats_dontSubtractPurchasePlatinumCost: `[UNTRANSLATED] Don't Subtract Purchase Platinum Cost`, + cheats_dontSubtractPurchaseItemCost: `[UNTRANSLATED] Don't Subtract Purchase Item Cost`, + cheats_dontSubtractPurchaseStandingCost: `[UNTRANSLATED] Don't Subtract Purchase Standing Cost`, cheats_dontSubtractVoidTraces: `No descontar vestigios del Vacío`, cheats_dontSubtractConsumables: `No restar consumibles`, cheats_unlockAllShipFeatures: `Desbloquear todas las funciones de nave`, diff --git a/static/webui/translations/fr.js b/static/webui/translations/fr.js index e4fb0f3f..c605fce8 100644 --- a/static/webui/translations/fr.js +++ b/static/webui/translations/fr.js @@ -135,11 +135,15 @@ dict = { cheats_infiniteRegalAya: `Aya Raffiné infini`, cheats_infiniteHelminthMaterials: `Ressources d'Helminth infinies`, cheats_claimingBlueprintRefundsIngredients: `Récupérer les items rend les ressources`, + cheats_dontSubtractPurchaseCreditCost: `[UNTRANSLATED] Don't Subtract Purchase Credit Cost`, + cheats_dontSubtractPurchasePlatinumCost: `[UNTRANSLATED] Don't Subtract Purchase Platinum Cost`, + cheats_dontSubtractPurchaseItemCost: `[UNTRANSLATED] Don't Subtract Purchase Item Cost`, + cheats_dontSubtractPurchaseStandingCost: `[UNTRANSLATED] Don't Subtract Purchase Standing Cost`, cheats_dontSubtractVoidTraces: `Ne pas consommer de Void Traces`, cheats_dontSubtractConsumables: `Ne pas retirer de consommables`, cheats_unlockAllShipFeatures: `Débloquer tous les segments du vaisseau`, cheats_unlockAllShipDecorations: `Débloquer toutes les décorations du vaisseau`, - cheats_unlockAllFlavourItems: `Débloquer tous les Flavor Items`, + cheats_unlockAllFlavourItems: `Débloquer tous les Flavor Items`, cheats_unlockAllSkins: `Débloquer tous les skins`, cheats_unlockAllCapturaScenes: `Débloquer toutes les scènes captura`, cheats_unlockAllDecoRecipes: `Débloquer toutes les recherches dojo`, diff --git a/static/webui/translations/ru.js b/static/webui/translations/ru.js index e50f2959..cb89fa7d 100644 --- a/static/webui/translations/ru.js +++ b/static/webui/translations/ru.js @@ -135,11 +135,15 @@ dict = { cheats_infiniteRegalAya: `Бесконечная Королевская Айя`, cheats_infiniteHelminthMaterials: `Бесконечные Выделения Гельминта`, cheats_claimingBlueprintRefundsIngredients: `[UNTRANSLATED] Claiming Blueprint Refunds Ingredients`, + cheats_dontSubtractPurchaseCreditCost: `[UNTRANSLATED] Don't Subtract Purchase Credit Cost`, + cheats_dontSubtractPurchasePlatinumCost: `[UNTRANSLATED] Don't Subtract Purchase Platinum Cost`, + cheats_dontSubtractPurchaseItemCost: `[UNTRANSLATED] Don't Subtract Purchase Item Cost`, + cheats_dontSubtractPurchaseStandingCost: `[UNTRANSLATED] Don't Subtract Purchase Standing Cost`, cheats_dontSubtractVoidTraces: `[UNTRANSLATED] Don't Subtract Void Traces`, cheats_dontSubtractConsumables: `Не уменьшать количество расходников`, cheats_unlockAllShipFeatures: `Разблокировать все функции корабля`, cheats_unlockAllShipDecorations: `Разблокировать все украшения корабля`, - cheats_unlockAllFlavourItems: `Разблокировать все уникальные предметы`, + cheats_unlockAllFlavourItems: `Разблокировать все уникальные предметы`, cheats_unlockAllSkins: `Разблокировать все скины`, cheats_unlockAllCapturaScenes: `Разблокировать все сцены Каптуры`, cheats_unlockAllDecoRecipes: `Разблокировать все рецепты декораций Дoдзё`, diff --git a/static/webui/translations/zh.js b/static/webui/translations/zh.js index 4b763583..06b2ece9 100644 --- a/static/webui/translations/zh.js +++ b/static/webui/translations/zh.js @@ -135,11 +135,15 @@ dict = { cheats_infiniteRegalAya: `无限御品阿耶`, cheats_infiniteHelminthMaterials: `无限Helminth材料`, cheats_claimingBlueprintRefundsIngredients: `取消蓝图制造时返还材料`, + cheats_dontSubtractPurchaseCreditCost: `[UNTRANSLATED] Don't Subtract Purchase Credit Cost`, + cheats_dontSubtractPurchasePlatinumCost: `[UNTRANSLATED] Don't Subtract Purchase Platinum Cost`, + cheats_dontSubtractPurchaseItemCost: `[UNTRANSLATED] Don't Subtract Purchase Item Cost`, + cheats_dontSubtractPurchaseStandingCost: `[UNTRANSLATED] Don't Subtract Purchase Standing Cost`, cheats_dontSubtractVoidTraces: `虚空光体无消耗`, cheats_dontSubtractConsumables: `消耗物品使用时无损耗`, cheats_unlockAllShipFeatures: `解锁所有飞船功能`, cheats_unlockAllShipDecorations: `解锁所有飞船装饰`, - cheats_unlockAllFlavourItems: `解锁所有装饰物品`, + cheats_unlockAllFlavourItems: `解锁所有装饰物品`, cheats_unlockAllSkins: `解锁所有外观`, cheats_unlockAllCapturaScenes: `解锁所有Captura场景`, cheats_unlockAllDecoRecipes: `解锁所有道场配方`,