From e1438cbdd45ac1f7fb20866c8cba683d5bb21455 Mon Sep 17 00:00:00 2001 From: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com> Date: Fri, 22 Aug 2025 14:32:10 +0200 Subject: [PATCH] chore: move more cheats to account section Re #2391 --- config-vanilla.json | 18 -- .../api/activateRandomModController.ts | 5 +- .../api/claimCompletedRecipeController.ts | 3 +- .../api/confirmGuildInvitationController.ts | 5 +- src/controllers/api/createGuildController.ts | 2 +- src/controllers/api/dronesController.ts | 12 +- src/controllers/api/inventoryController.ts | 14 +- .../api/projectionManagerController.ts | 5 +- src/controllers/api/saveDialogueController.ts | 5 +- .../api/trainingResultController.ts | 5 +- src/models/inventoryModels/inventoryModel.ts | 23 +++ src/services/configService.ts | 23 --- src/services/guildService.ts | 2 +- src/services/inventoryService.ts | 14 +- src/services/missionInventoryUpdateService.ts | 8 +- src/services/purchaseService.ts | 27 ++- src/types/inventoryTypes/inventoryTypes.ts | 23 +++ static/webui/index.html | 184 +++++++++--------- 18 files changed, 193 insertions(+), 185 deletions(-) diff --git a/config-vanilla.json b/config-vanilla.json index c7cf618c..52c271b4 100644 --- a/config-vanilla.json +++ b/config-vanilla.json @@ -13,24 +13,11 @@ "skipTutorial": false, "skipAllDialogue": false, "unlockAllScans": false, - "claimingBlueprintRefundsIngredients": false, - "dontSubtractPurchaseCreditCost": false, - "dontSubtractPurchasePlatinumCost": false, - "dontSubtractPurchaseItemCost": false, - "dontSubtractPurchaseStandingCost": false, - "dontSubtractVoidTraces": false, - "dontSubtractConsumables": false, "unlockAllShipFeatures": false, "unlockAllShipDecorations": false, "unlockAllFlavourItems": false, "unlockAllSkins": false, "unlockAllCapturaScenes": false, - "universalPolarityEverywhere": false, - "unlockDoubleCapacityPotatoesEverywhere": false, - "unlockExilusEverywhere": false, - "unlockArcanesEverywhere": false, - "noDailyStandingLimits": false, - "noDailyFocusLimit": false, "noArgonCrystalDecay": false, "noMasteryRankUpCooldown": false, "noVendorPurchaseLimits": false, @@ -39,12 +26,7 @@ "fullyStockedVendors": false, "baroAlwaysAvailable": false, "baroFullyStocked": false, - "syndicateMissionsRepeatable": false, "unlockAllProfitTakerStages": false, - "instantFinishRivenChallenge": false, - "instantResourceExtractorDrones": false, - "noResourceExtractorDronesDamage": false, - "skipClanKeyCrafting": false, "noDojoRoomBuildStage": false, "noDecoBuildStage": false, "fastDojoRoomDestruction": false, diff --git a/src/controllers/api/activateRandomModController.ts b/src/controllers/api/activateRandomModController.ts index b0350434..06d4c488 100644 --- a/src/controllers/api/activateRandomModController.ts +++ b/src/controllers/api/activateRandomModController.ts @@ -10,11 +10,10 @@ import { getAccountIdForRequest } from "@/src/services/loginService"; import { getRandomElement } from "@/src/services/rngService"; import { RequestHandler } from "express"; import { ExportUpgrades } from "warframe-public-export-plus"; -import { config } from "@/src/services/configService"; export const activateRandomModController: RequestHandler = async (req, res) => { const accountId = await getAccountIdForRequest(req); - const inventory = await getInventory(accountId); + const inventory = await getInventory(accountId, "RawUpgrades Upgrades instantFinishRivenChallenge"); const request = getJSONfromString(String(req.body)); addMods(inventory, [ { @@ -23,7 +22,7 @@ export const activateRandomModController: RequestHandler = async (req, res) => { } ]); const rivenType = getRandomElement(rivenRawToRealWeighted[request.ItemType])!; - const fingerprint = config.instantFinishRivenChallenge + const fingerprint = inventory.instantFinishRivenChallenge ? createUnveiledRivenFingerprint(ExportUpgrades[rivenType]) : createVeiledRivenFingerprint(ExportUpgrades[rivenType]); const upgradeIndex = diff --git a/src/controllers/api/claimCompletedRecipeController.ts b/src/controllers/api/claimCompletedRecipeController.ts index f07200e5..377680b3 100644 --- a/src/controllers/api/claimCompletedRecipeController.ts +++ b/src/controllers/api/claimCompletedRecipeController.ts @@ -23,7 +23,6 @@ import { InventorySlot, IPendingRecipeDatabase } from "@/src/types/inventoryType import { toOid2 } from "@/src/helpers/inventoryHelpers"; import { TInventoryDatabaseDocument } from "@/src/models/inventoryModels/inventoryModel"; import { IRecipe } from "warframe-public-export-plus"; -import { config } from "@/src/services/configService"; import { EquipmentFeatures, IEquipmentClient, Status } from "@/src/types/equipmentTypes"; interface IClaimCompletedRecipeRequest { @@ -247,7 +246,7 @@ export const claimCompletedRecipeController: RequestHandler = async (req, res) = } } if ( - config.claimingBlueprintRefundsIngredients && + inventory.claimingBlueprintRefundsIngredients && recipe.secretIngredientAction != "SIA_CREATE_KUBROW" // Can't refund the egg ) { await refundRecipeIngredients(inventory, InventoryChanges, recipe, pendingRecipe); diff --git a/src/controllers/api/confirmGuildInvitationController.ts b/src/controllers/api/confirmGuildInvitationController.ts index 11deac0c..08123a37 100644 --- a/src/controllers/api/confirmGuildInvitationController.ts +++ b/src/controllers/api/confirmGuildInvitationController.ts @@ -95,7 +95,10 @@ export const confirmGuildInvitationPostController: RequestHandler = async (req, await GuildMember.deleteMany({ accountId: guildMember.accountId, status: 1 }); // Update inventory of new member - const inventory = await getInventory(guildMember.accountId.toString(), "GuildId LevelKeys Recipes"); + const inventory = await getInventory( + guildMember.accountId.toString(), + "GuildId LevelKeys Recipes skipClanKeyCrafting" + ); inventory.GuildId = new Types.ObjectId(req.query.clanId as string); giveClanKey(inventory); await inventory.save(); diff --git a/src/controllers/api/createGuildController.ts b/src/controllers/api/createGuildController.ts index ea0e48a6..6fc5f8e5 100644 --- a/src/controllers/api/createGuildController.ts +++ b/src/controllers/api/createGuildController.ts @@ -27,7 +27,7 @@ export const createGuildController: RequestHandler = async (req, res) => { rank: 0 }); - const inventory = await getInventory(account._id.toString(), "GuildId LevelKeys Recipes"); + const inventory = await getInventory(account._id.toString(), "GuildId LevelKeys Recipes skipClanKeyCrafting"); inventory.GuildId = guild._id; const inventoryChanges: IInventoryChanges = {}; giveClanKey(inventory, inventoryChanges); diff --git a/src/controllers/api/dronesController.ts b/src/controllers/api/dronesController.ts index a1f8a505..15d7758f 100644 --- a/src/controllers/api/dronesController.ts +++ b/src/controllers/api/dronesController.ts @@ -1,5 +1,4 @@ import { toMongoDate, toOid } from "@/src/helpers/inventoryHelpers"; -import { config } from "@/src/services/configService"; import { addMiscItems, getInventory } from "@/src/services/inventoryService"; import { fromStoreItem } from "@/src/services/itemDataService"; import { getAccountIdForRequest } from "@/src/services/loginService"; @@ -39,10 +38,13 @@ export const dronesController: RequestHandler = async (req, res) => { ActiveDrones: activeDrones }); } else if ("droneId" in req.query && "systemIndex" in req.query) { - const inventory = await getInventory(accountId, "Drones"); + const inventory = await getInventory( + accountId, + "Drones instantResourceExtractorDrones noResourceExtractorDronesDamage" + ); const drone = inventory.Drones.id(req.query.droneId as string)!; const droneMeta = ExportDrones[drone.ItemType]; - drone.DeployTime = config.instantResourceExtractorDrones ? new Date(0) : new Date(); + drone.DeployTime = inventory.instantResourceExtractorDrones ? new Date(0) : new Date(); if (drone.RepairStart) { const repairMinutes = (Date.now() - drone.RepairStart.getTime()) / 60_000; const hpPerMinute = droneMeta.repairRate / 60; @@ -51,11 +53,11 @@ export const dronesController: RequestHandler = async (req, res) => { } drone.System = parseInt(req.query.systemIndex as string); const system = ExportSystems[drone.System - 1]; - drone.DamageTime = config.instantResourceExtractorDrones + drone.DamageTime = inventory.instantResourceExtractorDrones ? new Date() : new Date(Date.now() + getRandomInt(3 * 3600 * 1000, 4 * 3600 * 1000)); drone.PendingDamage = - !config.noResourceExtractorDronesDamage && Math.random() < system.damageChance + !inventory.noResourceExtractorDronesDamage && Math.random() < system.damageChance ? getRandomInt(system.droneDamage.minValue, system.droneDamage.maxValue) : 0; const resource = getRandomWeightedRewardUc(system.resources, droneMeta.probabilities)!; diff --git a/src/controllers/api/inventoryController.ts b/src/controllers/api/inventoryController.ts index d5df7619..1556c271 100644 --- a/src/controllers/api/inventoryController.ts +++ b/src/controllers/api/inventoryController.ts @@ -68,7 +68,7 @@ export const inventoryController: RequestHandler = async (request, response) => const lastLoginDay = Math.trunc(inventory.NextRefill.getTime() / 86400000) - 1; const daysPassed = today - lastLoginDay; - if (config.noArgonCrystalDecay) { + if (inventory.noArgonCrystalDecay) { inventory.FoundToday = undefined; } else { for (let i = 0; i != daysPassed; ++i) { @@ -387,7 +387,7 @@ export const getInventoryResponse = async ( } } - if (config.universalPolarityEverywhere) { + if (inventory.universalPolarityEverywhere) { const Polarity: IPolarity[] = []; // 12 is needed for necramechs. 15 is needed for plexus/crewshipharness. for (let i = 0; i != 15; ++i) { @@ -405,7 +405,7 @@ export const getInventoryResponse = async ( } } - if (config.unlockDoubleCapacityPotatoesEverywhere) { + if (inventory.unlockDoubleCapacityPotatoesEverywhere) { for (const key of equipmentKeys) { if (key in inventoryResponse) { for (const equipment of inventoryResponse[key]) { @@ -416,7 +416,7 @@ export const getInventoryResponse = async ( } } - if (config.unlockExilusEverywhere) { + if (inventory.unlockExilusEverywhere) { for (const key of equipmentKeys) { if (key in inventoryResponse) { for (const equipment of inventoryResponse[key]) { @@ -427,7 +427,7 @@ export const getInventoryResponse = async ( } } - if (config.unlockArcanesEverywhere) { + if (inventory.unlockArcanesEverywhere) { for (const key of equipmentKeys) { if (key in inventoryResponse) { for (const equipment of inventoryResponse[key]) { @@ -438,14 +438,14 @@ export const getInventoryResponse = async ( } } - if (config.noDailyStandingLimits) { + if (inventory.noDailyStandingLimits) { const spoofedDailyAffiliation = Math.max(999_999, 16000 + inventoryResponse.PlayerLevel * 500); for (const key of allDailyAffiliationKeys) { inventoryResponse[key] = spoofedDailyAffiliation; } } - if (config.noDailyFocusLimit) { + if (inventory.noDailyFocusLimit) { inventoryResponse.DailyFocus = Math.max(999_999, 250000 + inventoryResponse.PlayerLevel * 5000); } diff --git a/src/controllers/api/projectionManagerController.ts b/src/controllers/api/projectionManagerController.ts index f419e964..b549bd8f 100644 --- a/src/controllers/api/projectionManagerController.ts +++ b/src/controllers/api/projectionManagerController.ts @@ -2,14 +2,13 @@ import { RequestHandler } from "express"; import { getAccountIdForRequest } from "@/src/services/loginService"; import { addMiscItems, getInventory } from "@/src/services/inventoryService"; import { ExportRelics, IRelic } from "warframe-public-export-plus"; -import { config } from "@/src/services/configService"; export const projectionManagerController: RequestHandler = async (req, res) => { const accountId = await getAccountIdForRequest(req); - const inventory = await getInventory(accountId); + const inventory = await getInventory(accountId, "MiscItems dontSubtractVoidTraces"); const request = JSON.parse(String(req.body)) as IProjectionUpgradeRequest; const [era, category, currentQuality] = parseProjection(request.projectionType); - const upgradeCost = config.dontSubtractVoidTraces + const upgradeCost = inventory.dontSubtractVoidTraces ? 0 : qualityNumberToCost[request.qualityTag] - qualityNumberToCost[qualityKeywordToNumber[currentQuality]]; const newProjectionType = findProjection(era, category, qualityNumberToKeyword[request.qualityTag]); diff --git a/src/controllers/api/saveDialogueController.ts b/src/controllers/api/saveDialogueController.ts index fa5a89cb..bd969b09 100644 --- a/src/controllers/api/saveDialogueController.ts +++ b/src/controllers/api/saveDialogueController.ts @@ -1,4 +1,3 @@ -import { config } from "@/src/services/configService"; import { addEmailItem, getDialogue, getInventory, updateCurrency } from "@/src/services/inventoryService"; import { getAccountIdForRequest } from "@/src/services/loginService"; import { ICompletedDialogue } from "@/src/types/inventoryTypes/inventoryTypes"; @@ -9,7 +8,7 @@ export const saveDialogueController: RequestHandler = async (req, res) => { const accountId = await getAccountIdForRequest(req); const request = JSON.parse(String(req.body)) as SaveDialogueRequest; if ("YearIteration" in request) { - const inventory = await getInventory(accountId, "DialogueHistory"); + const inventory = await getInventory(accountId, "DialogueHistory noKimCooldowns"); inventory.DialogueHistory ??= {}; inventory.DialogueHistory.YearIteration = request.YearIteration; await inventory.save(); @@ -17,7 +16,7 @@ export const saveDialogueController: RequestHandler = async (req, res) => { } else { const inventory = await getInventory(accountId); const inventoryChanges: IInventoryChanges = {}; - const tomorrowAt0Utc = config.noKimCooldowns + const tomorrowAt0Utc = inventory.noKimCooldowns ? Date.now() : (Math.trunc(Date.now() / 86400_000) + 1) * 86400_000; inventory.DialogueHistory ??= {}; diff --git a/src/controllers/api/trainingResultController.ts b/src/controllers/api/trainingResultController.ts index 0e436386..39df6c26 100644 --- a/src/controllers/api/trainingResultController.ts +++ b/src/controllers/api/trainingResultController.ts @@ -6,7 +6,6 @@ import { RequestHandler } from "express"; import { unixTimesInMs } from "@/src/constants/timeConstants"; import { IInventoryChanges } from "@/src/types/purchaseTypes"; import { createMessage } from "@/src/services/inboxService"; -import { config } from "@/src/services/configService"; interface ITrainingResultsRequest { numLevelsGained: number; @@ -23,11 +22,11 @@ const trainingResultController: RequestHandler = async (req, res): Promise const trainingResults = getJSONfromString(String(req.body)); - const inventory = await getInventory(accountId, "TrainingDate PlayerLevel TradesRemaining"); + const inventory = await getInventory(accountId, "TrainingDate PlayerLevel TradesRemaining noMasteryRankUpCooldown"); if (trainingResults.numLevelsGained == 1) { let time = Date.now(); - if (!config.noMasteryRankUpCooldown) { + if (!inventory.noMasteryRankUpCooldown) { time += unixTimesInMs.hour * 23; } inventory.TrainingDate = new Date(time); diff --git a/src/models/inventoryModels/inventoryModel.ts b/src/models/inventoryModels/inventoryModel.ts index 5d4bf32e..7eec5836 100644 --- a/src/models/inventoryModels/inventoryModel.ts +++ b/src/models/inventoryModels/inventoryModel.ts @@ -1427,11 +1427,34 @@ const inventorySchema = new Schema( accountOwnerId: Schema.Types.ObjectId, // SNS account cheats + dontSubtractPurchaseCreditCost: Boolean, + dontSubtractPurchasePlatinumCost: Boolean, + dontSubtractPurchaseItemCost: Boolean, + dontSubtractPurchaseStandingCost: Boolean, + dontSubtractVoidTraces: Boolean, + dontSubtractConsumables: Boolean, infiniteCredits: Boolean, infinitePlatinum: Boolean, infiniteEndo: Boolean, infiniteRegalAya: Boolean, infiniteHelminthMaterials: Boolean, + universalPolarityEverywhere: Boolean, + unlockDoubleCapacityPotatoesEverywhere: Boolean, + unlockExilusEverywhere: Boolean, + unlockArcanesEverywhere: Boolean, + syndicateMissionsRepeatable: Boolean, + instantFinishRivenChallenge: Boolean, + noDailyStandingLimits: Boolean, + noDailyFocusLimit: Boolean, + noArgonCrystalDecay: Boolean, + noMasteryRankUpCooldown: Boolean, + noVendorPurchaseLimits: Boolean, + noDeathMarks: Boolean, + noKimCooldowns: Boolean, + skipClanKeyCrafting: Boolean, + claimingBlueprintRefundsIngredients: Boolean, + instantResourceExtractorDrones: Boolean, + noResourceExtractorDronesDamage: Boolean, SubscribedToEmails: { type: Number, default: 0 }, SubscribedToEmailsPersonalized: { type: Number, default: 0 }, diff --git a/src/services/configService.ts b/src/services/configService.ts index 1ecba208..ad465d25 100644 --- a/src/services/configService.ts +++ b/src/services/configService.ts @@ -20,39 +20,16 @@ export interface IConfig { skipTutorial?: boolean; skipAllDialogue?: boolean; unlockAllScans?: boolean; - claimingBlueprintRefundsIngredients?: boolean; - dontSubtractPurchaseCreditCost?: boolean; - dontSubtractPurchasePlatinumCost?: boolean; - dontSubtractPurchaseItemCost?: boolean; - dontSubtractPurchaseStandingCost?: boolean; - dontSubtractVoidTraces?: boolean; - dontSubtractConsumables?: boolean; unlockAllShipFeatures?: boolean; unlockAllShipDecorations?: boolean; unlockAllFlavourItems?: boolean; unlockAllSkins?: boolean; unlockAllCapturaScenes?: boolean; unlockAllDecoRecipes?: boolean; - universalPolarityEverywhere?: boolean; - unlockDoubleCapacityPotatoesEverywhere?: boolean; - unlockExilusEverywhere?: boolean; - unlockArcanesEverywhere?: boolean; - noDailyStandingLimits?: boolean; - noDailyFocusLimit?: boolean; - noArgonCrystalDecay?: boolean; - noMasteryRankUpCooldown?: boolean; - noVendorPurchaseLimits?: boolean; - noDeathMarks?: boolean; - noKimCooldowns?: boolean; fullyStockedVendors?: boolean; baroAlwaysAvailable?: boolean; baroFullyStocked?: boolean; - syndicateMissionsRepeatable?: boolean; unlockAllProfitTakerStages?: boolean; - instantFinishRivenChallenge?: boolean; - instantResourceExtractorDrones?: boolean; - noResourceExtractorDronesDamage?: boolean; - skipClanKeyCrafting?: boolean; noDojoRoomBuildStage?: boolean; noDojoDecoBuildStage?: boolean; fastDojoRoomDestruction?: boolean; diff --git a/src/services/guildService.ts b/src/services/guildService.ts index cd7ee147..06a970dc 100644 --- a/src/services/guildService.ts +++ b/src/services/guildService.ts @@ -690,7 +690,7 @@ export const checkClanAscensionHasRequiredContributors = async (guild: TGuildDat }; export const giveClanKey = (inventory: TInventoryDatabaseDocument, inventoryChanges?: IInventoryChanges): void => { - if (config.skipClanKeyCrafting) { + if (inventory.skipClanKeyCrafting) { const levelKeyChanges = [ { ItemType: "/Lotus/Types/Keys/DojoKey", diff --git a/src/services/inventoryService.ts b/src/services/inventoryService.ts index c6f16b08..ee91fec2 100644 --- a/src/services/inventoryService.ts +++ b/src/services/inventoryService.ts @@ -1299,15 +1299,19 @@ const standingLimitBinToInventoryKey: Record< export const allDailyAffiliationKeys: (keyof IDailyAffiliations)[] = Object.values(standingLimitBinToInventoryKey); -const getStandingLimit = (inventory: IDailyAffiliations, bin: TStandingLimitBin): number => { - if (bin == "STANDING_LIMIT_BIN_NONE" || config.noDailyStandingLimits) { +const getStandingLimit = (inventory: TInventoryDatabaseDocument, bin: TStandingLimitBin): number => { + if (bin == "STANDING_LIMIT_BIN_NONE" || inventory.noDailyStandingLimits) { return Number.MAX_SAFE_INTEGER; } return inventory[standingLimitBinToInventoryKey[bin]]; }; -const updateStandingLimit = (inventory: IDailyAffiliations, bin: TStandingLimitBin, subtrahend: number): void => { - if (bin != "STANDING_LIMIT_BIN_NONE" && !config.noDailyStandingLimits) { +const updateStandingLimit = ( + inventory: TInventoryDatabaseDocument, + bin: TStandingLimitBin, + subtrahend: number +): void => { + if (bin != "STANDING_LIMIT_BIN_NONE" && !inventory.noDailyStandingLimits) { inventory[standingLimitBinToInventoryKey[bin]] -= subtrahend; } }; @@ -1922,7 +1926,7 @@ export const addFocusXpIncreases = (inventory: TInventoryDatabaseDocument, focus inventory.FocusXP.AP_WARD += focusXpPlus[FocusType.AP_WARD]; } - if (!config.noDailyFocusLimit) { + if (!inventory.noDailyFocusLimit) { inventory.DailyFocus -= focusXpPlus.reduce((a, b) => a + b, 0); } }; diff --git a/src/services/missionInventoryUpdateService.ts b/src/services/missionInventoryUpdateService.ts index 7ae15e01..ca95161c 100644 --- a/src/services/missionInventoryUpdateService.ts +++ b/src/services/missionInventoryUpdateService.ts @@ -295,7 +295,7 @@ export const addMissionInventoryUpdates = async ( addMiscItems(inventory, value); break; case "Consumables": - if (config.dontSubtractConsumables) { + if (inventory.dontSubtractConsumables) { addConsumables( inventory, value.filter(x => x.ItemCount > 0) @@ -466,7 +466,7 @@ export const addMissionInventoryUpdates = async ( }); break; case "SyndicateId": { - if (!config.syndicateMissionsRepeatable) { + if (!inventory.syndicateMissionsRepeatable) { inventory.CompletedSyndicates.push(value); } break; @@ -486,7 +486,7 @@ export const addMissionInventoryUpdates = async ( break; } case "DeathMarks": { - if (!config.noDeathMarks) { + if (!inventory.noDeathMarks) { for (const bossName of value) { if (inventory.DeathMarks.indexOf(bossName) == -1) { // It's a new death mark; we have to say the line. @@ -1550,7 +1550,7 @@ export const addMissionRewards = async ( const dialogue = getDialogue(inventory, buddy); if (Date.now() >= dialogue.BountyChemExpiry.getTime()) { logger.debug(`Giving 20 chemistry for ${buddy}`); - const tomorrowAt0Utc = config.noKimCooldowns + const tomorrowAt0Utc = inventory.noKimCooldowns ? Date.now() : (Math.trunc(Date.now() / 86400_000) + 1) * 86400_000; dialogue.Chemistry += 20; diff --git a/src/services/purchaseService.ts b/src/services/purchaseService.ts index 11d3de82..5c850eb9 100644 --- a/src/services/purchaseService.ts +++ b/src/services/purchaseService.ts @@ -31,7 +31,6 @@ import { ExportVendors, TRarity } from "warframe-public-export-plus"; -import { config } from "@/src/services/configService"; import { TInventoryDatabaseDocument } from "@/src/models/inventoryModels/inventoryModel"; import { fromStoreItem, toStoreItem } from "@/src/services/itemDataService"; import { DailyDeal } from "@/src/models/worldStateModel"; @@ -63,7 +62,7 @@ const tallyVendorPurchase = ( numPurchased: number, Expiry: Date ): void => { - if (!config.noVendorPurchaseLimits) { + if (!inventory.noVendorPurchaseLimits) { inventory.RecentVendorPurchases ??= []; let vendorPurchases = inventory.RecentVendorPurchases.find(x => x.VendorType == VendorType); if (!vendorPurchases) { @@ -130,12 +129,12 @@ export const handlePurchase = async ( if (!offer) { throw new Error(`unknown vendor offer: ${ItemId ? ItemId : purchaseRequest.PurchaseParams.StoreItem}`); } - if (!config.dontSubtractPurchaseCreditCost) { + if (!inventory.dontSubtractPurchaseCreditCost) { if (offer.RegularPrice) { updateCurrency(inventory, offer.RegularPrice[0], false, prePurchaseInventoryChanges); } } - if (!config.dontSubtractPurchasePlatinumCost) { + if (!inventory.dontSubtractPurchasePlatinumCost) { if (offer.PremiumPrice) { updateCurrency(inventory, offer.PremiumPrice[0], true, prePurchaseInventoryChanges); } @@ -156,7 +155,7 @@ export const handlePurchase = async ( }); } } - if (!config.dontSubtractPurchaseItemCost) { + if (!inventory.dontSubtractPurchaseItemCost) { if (offer.ItemPrices) { handleItemPrices( inventory, @@ -223,14 +222,14 @@ export const handlePurchase = async ( x => x.ItemType == purchaseRequest.PurchaseParams.StoreItem ); if (offer) { - if (!config.dontSubtractPurchaseCreditCost) { + if (!inventory.dontSubtractPurchaseCreditCost) { updateCurrency(inventory, offer.RegularPrice, false, purchaseResponse.InventoryChanges); } if (purchaseRequest.PurchaseParams.ExpectedPrice) { throw new Error(`vendor purchase should not have an expected price`); } - if (offer.PrimePrice && !config.dontSubtractPurchaseItemCost) { + if (offer.PrimePrice && !inventory.dontSubtractPurchaseItemCost) { const invItem: IMiscItem = { ItemType: "/Lotus/Types/Items/MiscItems/PrimeBucks", ItemCount: offer.PrimePrice * purchaseRequest.PurchaseParams.Quantity * -1 @@ -267,7 +266,7 @@ export const handlePurchase = async ( Title: lastTitle } ]; - } else if (!config.dontSubtractPurchaseStandingCost) { + } else if (!inventory.dontSubtractPurchaseStandingCost) { const syndicate = ExportSyndicates[syndicateTag]; // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition if (syndicate) { @@ -301,13 +300,13 @@ 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" && !config.dontSubtractPurchaseCreditCost) { + if (typeof offer.credits == "number" && !inventory.dontSubtractPurchaseCreditCost) { updateCurrency(inventory, offer.credits, false, purchaseResponse.InventoryChanges); } - if (typeof offer.platinum == "number" && !config.dontSubtractPurchasePlatinumCost) { + if (typeof offer.platinum == "number" && !inventory.dontSubtractPurchasePlatinumCost) { updateCurrency(inventory, offer.platinum, true, purchaseResponse.InventoryChanges); } - if (offer.itemPrices && !config.dontSubtractPurchaseItemCost) { + if (offer.itemPrices && !inventory.dontSubtractPurchaseItemCost) { handleItemPrices( inventory, offer.itemPrices, @@ -335,7 +334,7 @@ export const handlePurchase = async ( ); if (offer) { if (offer.RegularPrice) { - if (!config.dontSubtractPurchaseItemCost) { + if (!inventory.dontSubtractPurchaseItemCost) { const invItem: IMiscItem = { ItemType: "/Lotus/Types/Items/MiscItems/SchismKey", ItemCount: offer.RegularPrice * purchaseRequest.PurchaseParams.Quantity * -1 @@ -394,11 +393,11 @@ export const handleDailyDealPurchase = async ( dailyDeal.AmountSold += 1; await dailyDeal.save(); - if (!config.dontSubtractPurchasePlatinumCost) { + if (!inventory.dontSubtractPurchasePlatinumCost) { updateCurrency(inventory, dailyDeal.SalePrice, true, purchaseResponse.InventoryChanges); } - if (!config.noVendorPurchaseLimits) { + if (!inventory.noVendorPurchaseLimits) { inventory.UsedDailyDeals.push(purchaseParams.StoreItem); purchaseResponse.DailyDealUsed = purchaseParams.StoreItem; } diff --git a/src/types/inventoryTypes/inventoryTypes.ts b/src/types/inventoryTypes/inventoryTypes.ts index 9139a677..b23b7437 100644 --- a/src/types/inventoryTypes/inventoryTypes.ts +++ b/src/types/inventoryTypes/inventoryTypes.ts @@ -21,11 +21,34 @@ export type InventoryDatabaseEquipment = { // Fields specific to SNS export interface IAccountCheats { + dontSubtractPurchaseCreditCost?: boolean; + dontSubtractPurchasePlatinumCost?: boolean; + dontSubtractPurchaseItemCost?: boolean; + dontSubtractPurchaseStandingCost?: boolean; + dontSubtractVoidTraces?: boolean; + dontSubtractConsumables?: boolean; infiniteCredits?: boolean; infinitePlatinum?: boolean; infiniteEndo?: boolean; infiniteRegalAya?: boolean; infiniteHelminthMaterials?: boolean; + universalPolarityEverywhere?: boolean; + unlockDoubleCapacityPotatoesEverywhere?: boolean; + unlockExilusEverywhere?: boolean; + unlockArcanesEverywhere?: boolean; + syndicateMissionsRepeatable?: boolean; + instantFinishRivenChallenge?: boolean; + noDailyStandingLimits?: boolean; + noDailyFocusLimit?: boolean; + noArgonCrystalDecay?: boolean; + noMasteryRankUpCooldown?: boolean; + noVendorPurchaseLimits?: boolean; + noDeathMarks?: boolean; + noKimCooldowns?: boolean; + skipClanKeyCrafting?: boolean; + claimingBlueprintRefundsIngredients?: boolean; + instantResourceExtractorDrones?: boolean; + noResourceExtractorDronesDamage?: boolean; } export interface IInventoryDatabase diff --git a/static/webui/index.html b/static/webui/index.html index fc60a986..b578e625 100644 --- a/static/webui/index.html +++ b/static/webui/index.html @@ -663,34 +663,6 @@ -
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
@@ -715,50 +687,6 @@
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
@@ -771,30 +699,10 @@
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
@@ -872,6 +780,30 @@
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
@@ -892,6 +824,74 @@
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +