feat: infiniteHelminthMaterials cheat
All checks were successful
Build / build (18) (push) Successful in 39s
Build / build (20) (push) Successful in 59s
Build / build (18) (pull_request) Successful in 40s
Build / build (22) (push) Successful in 1m3s
Build / build (20) (pull_request) Successful in 59s
Build / build (22) (pull_request) Successful in 36s

This commit is contained in:
Sainan 2025-02-22 07:15:54 +01:00
parent df70050cfd
commit 506011859c
8 changed files with 73 additions and 20 deletions

View File

@ -20,6 +20,7 @@
"infinitePlatinum": true, "infinitePlatinum": true,
"infiniteEndo": true, "infiniteEndo": true,
"infiniteRegalAya": true, "infiniteRegalAya": true,
"infiniteHelminthMaterials": false,
"unlockAllShipFeatures": true, "unlockAllShipFeatures": true,
"unlockAllShipDecorations": true, "unlockAllShipDecorations": true,
"unlockAllFlavourItems": true, "unlockAllFlavourItems": true,

View File

@ -6,7 +6,9 @@ import { IOid } from "@/src/types/commonTypes";
import { import {
IConsumedSuit, IConsumedSuit,
IHelminthFoodRecord, IHelminthFoodRecord,
IInfestedFoundryClient,
IInfestedFoundryDatabase, IInfestedFoundryDatabase,
IInventoryClient,
IMiscItem, IMiscItem,
ITypeCount ITypeCount
} from "@/src/types/inventoryTypes/inventoryTypes"; } from "@/src/types/inventoryTypes/inventoryTypes";
@ -16,6 +18,7 @@ import { TInventoryDatabaseDocument } from "@/src/models/inventoryModels/invento
import { toMongoDate } from "@/src/helpers/inventoryHelpers"; import { toMongoDate } from "@/src/helpers/inventoryHelpers";
import { logger } from "@/src/utils/logger"; import { logger } from "@/src/utils/logger";
import { colorToShard } from "@/src/helpers/shardHelper"; import { colorToShard } from "@/src/helpers/shardHelper";
import { config } from "@/src/services/configService";
export const infestedFoundryController: RequestHandler = async (req, res) => { export const infestedFoundryController: RequestHandler = async (req, res) => {
const accountId = await getAccountIdForRequest(req); const accountId = await getAccountIdForRequest(req);
@ -69,18 +72,22 @@ export const infestedFoundryController: RequestHandler = async (req, res) => {
// remove from suit // remove from suit
suit.ArchonCrystalUpgrades![request.Slot] = {}; suit.ArchonCrystalUpgrades![request.Slot] = {};
if (!config.infiniteHelminthMaterials) {
// remove bile // remove bile
const bile = inventory.InfestedFoundry!.Resources!.find( const bile = inventory.InfestedFoundry!.Resources!.find(
x => x.ItemType == "/Lotus/Types/Items/InfestedFoundry/HelminthBile" x => x.ItemType == "/Lotus/Types/Items/InfestedFoundry/HelminthBile"
)!; )!;
bile.Count -= 300; bile.Count -= 300;
}
await inventory.save(); await inventory.save();
const infestedFoundry = inventory.toJSON<IInventoryClient>().InfestedFoundry!;
applyCheatsToInfestedFoundry(infestedFoundry);
res.json({ res.json({
InventoryChanges: { InventoryChanges: {
MiscItems: miscItemChanges, MiscItems: miscItemChanges,
InfestedFoundry: inventory.toJSON().InfestedFoundry InfestedFoundry: infestedFoundry
} }
}); });
break; break;
@ -105,6 +112,12 @@ export const infestedFoundryController: RequestHandler = async (req, res) => {
case "c": { case "c": {
// consume items // consume items
if (config.infiniteHelminthMaterials) {
res.status(400).end();
return;
}
const request = getJSONfromString<IHelminthFeedRequest>(String(req.body)); const request = getJSONfromString<IHelminthFeedRequest>(String(req.body));
const inventory = await getInventory(accountId); const inventory = await getInventory(accountId);
inventory.InfestedFoundry ??= {}; inventory.InfestedFoundry ??= {};
@ -210,9 +223,11 @@ export const infestedFoundryController: RequestHandler = async (req, res) => {
inventory.InfestedFoundry.InvigorationsApplied = 0; inventory.InfestedFoundry.InvigorationsApplied = 0;
} }
await inventory.save(); await inventory.save();
const infestedFoundry = inventory.toJSON<IInventoryClient>().InfestedFoundry!;
applyCheatsToInfestedFoundry(infestedFoundry);
res.json({ res.json({
InventoryChanges: { InventoryChanges: {
InfestedFoundry: inventory.toJSON().InfestedFoundry InfestedFoundry: infestedFoundry
} }
}); });
break; break;
@ -223,12 +238,14 @@ export const infestedFoundryController: RequestHandler = async (req, res) => {
const request = getJSONfromString<IHelminthSubsumeRequest>(String(req.body)); const request = getJSONfromString<IHelminthSubsumeRequest>(String(req.body));
const inventory = await getInventory(accountId); const inventory = await getInventory(accountId);
const recipe = getRecipe(request.Recipe)!; const recipe = getRecipe(request.Recipe)!;
if (!config.infiniteHelminthMaterials) {
for (const ingredient of recipe.secretIngredients!) { for (const ingredient of recipe.secretIngredients!) {
const resource = inventory.InfestedFoundry!.Resources!.find(x => x.ItemType == ingredient.ItemType); const resource = inventory.InfestedFoundry!.Resources!.find(x => x.ItemType == ingredient.ItemType);
if (resource) { if (resource) {
resource.Count -= ingredient.ItemCount; resource.Count -= ingredient.ItemCount;
} }
} }
}
const suit = inventory.Suits.id(request.SuitId.$oid)!; const suit = inventory.Suits.id(request.SuitId.$oid)!;
inventory.Suits.pull(suit); inventory.Suits.pull(suit);
const consumedSuit: IConsumedSuit = { s: suit.ItemType }; const consumedSuit: IConsumedSuit = { s: suit.ItemType };
@ -247,6 +264,8 @@ export const infestedFoundryController: RequestHandler = async (req, res) => {
const recipeChanges = addInfestedFoundryXP(inventory.InfestedFoundry!, 1600_00); const recipeChanges = addInfestedFoundryXP(inventory.InfestedFoundry!, 1600_00);
addRecipes(inventory, recipeChanges); addRecipes(inventory, recipeChanges);
await inventory.save(); await inventory.save();
const infestedFoundry = inventory.toJSON<IInventoryClient>().InfestedFoundry!;
applyCheatsToInfestedFoundry(infestedFoundry);
res.json({ res.json({
InventoryChanges: { InventoryChanges: {
Recipes: recipeChanges, Recipes: recipeChanges,
@ -260,7 +279,7 @@ export const infestedFoundryController: RequestHandler = async (req, res) => {
platinum: 0, platinum: 0,
Slots: 1 Slots: 1
}, },
InfestedFoundry: inventory.toJSON().InfestedFoundry InfestedFoundry: infestedFoundry
} }
}); });
break; break;
@ -272,11 +291,13 @@ export const infestedFoundryController: RequestHandler = async (req, res) => {
const currencyChanges = updateCurrency(inventory, 50, true); const currencyChanges = updateCurrency(inventory, 50, true);
const recipeChanges = handleSubsumeCompletion(inventory); const recipeChanges = handleSubsumeCompletion(inventory);
await inventory.save(); await inventory.save();
const infestedFoundry = inventory.toJSON<IInventoryClient>().InfestedFoundry!;
applyCheatsToInfestedFoundry(infestedFoundry);
res.json({ res.json({
InventoryChanges: { InventoryChanges: {
...currencyChanges, ...currencyChanges,
Recipes: recipeChanges, Recipes: recipeChanges,
InfestedFoundry: inventory.toJSON().InfestedFoundry InfestedFoundry: infestedFoundry
} }
}); });
break; break;
@ -292,13 +313,17 @@ export const infestedFoundryController: RequestHandler = async (req, res) => {
suit.UpgradesExpiry = upgradesExpiry; suit.UpgradesExpiry = upgradesExpiry;
const recipeChanges = addInfestedFoundryXP(inventory.InfestedFoundry!, 4800_00); const recipeChanges = addInfestedFoundryXP(inventory.InfestedFoundry!, 4800_00);
addRecipes(inventory, recipeChanges); addRecipes(inventory, recipeChanges);
if (!config.infiniteHelminthMaterials) {
for (let i = 0; i != request.ResourceTypes.length; ++i) { for (let i = 0; i != request.ResourceTypes.length; ++i) {
inventory.InfestedFoundry!.Resources!.find(x => x.ItemType == request.ResourceTypes[i])!.Count -= inventory.InfestedFoundry!.Resources!.find(x => x.ItemType == request.ResourceTypes[i])!.Count -=
request.ResourceCosts[i]; request.ResourceCosts[i];
} }
}
inventory.InfestedFoundry!.InvigorationsApplied ??= 0; inventory.InfestedFoundry!.InvigorationsApplied ??= 0;
inventory.InfestedFoundry!.InvigorationsApplied += 1; inventory.InfestedFoundry!.InvigorationsApplied += 1;
await inventory.save(); await inventory.save();
const infestedFoundry = inventory.toJSON<IInventoryClient>().InfestedFoundry!;
applyCheatsToInfestedFoundry(infestedFoundry);
res.json({ res.json({
SuitId: request.SuitId, SuitId: request.SuitId,
OffensiveUpgrade: request.OffensiveUpgradeType, OffensiveUpgrade: request.OffensiveUpgradeType,
@ -306,7 +331,7 @@ export const infestedFoundryController: RequestHandler = async (req, res) => {
UpgradesExpiry: toMongoDate(upgradesExpiry), UpgradesExpiry: toMongoDate(upgradesExpiry),
InventoryChanges: { InventoryChanges: {
Recipes: recipeChanges, Recipes: recipeChanges,
InfestedFoundry: inventory.toJSON().InfestedFoundry InfestedFoundry: infestedFoundry
} }
}); });
break; break;
@ -453,6 +478,19 @@ export const handleSubsumeCompletion = (inventory: TInventoryDatabaseDocument):
return recipeChanges; return recipeChanges;
}; };
export const applyCheatsToInfestedFoundry = (infestedFoundry: IInfestedFoundryClient): void => {
if (config.infiniteHelminthMaterials) {
infestedFoundry.Resources = [
{ ItemType: "/Lotus/Types/Items/InfestedFoundry/HelminthCalx", Count: 1000 },
{ ItemType: "/Lotus/Types/Items/InfestedFoundry/HelminthBiotics", Count: 1000 },
{ ItemType: "/Lotus/Types/Items/InfestedFoundry/HelminthSynthetics", Count: 1000 },
{ ItemType: "/Lotus/Types/Items/InfestedFoundry/HelminthPheromones", Count: 1000 },
{ ItemType: "/Lotus/Types/Items/InfestedFoundry/HelminthBile", Count: 1000 },
{ ItemType: "/Lotus/Types/Items/InfestedFoundry/HelminthOxides", Count: 1000 }
];
}
};
interface IHelminthOfferingsUpdate { interface IHelminthOfferingsUpdate {
OfferingsIndex: number; OfferingsIndex: number;
SuitTypes: string[]; SuitTypes: string[];

View File

@ -13,7 +13,7 @@ import {
ExportResources, ExportResources,
ExportVirtuals ExportVirtuals
} from "warframe-public-export-plus"; } from "warframe-public-export-plus";
import { handleSubsumeCompletion } from "./infestedFoundryController"; import { applyCheatsToInfestedFoundry, handleSubsumeCompletion } from "./infestedFoundryController";
import { allDailyAffiliationKeys } from "@/src/services/inventoryService"; import { allDailyAffiliationKeys } from "@/src/services/inventoryService";
export const inventoryController: RequestHandler = async (request, response) => { export const inventoryController: RequestHandler = async (request, response) => {
@ -212,6 +212,10 @@ export const getInventoryResponse = async (
} }
} }
if (inventoryResponse.InfestedFoundry) {
applyCheatsToInfestedFoundry(inventoryResponse.InfestedFoundry);
}
// Fix for #380 // Fix for #380
inventoryResponse.NextRefill = { $date: { $numberLong: "9999999999999" } }; inventoryResponse.NextRefill = { $date: { $numberLong: "9999999999999" } };

View File

@ -12,6 +12,7 @@ import { addMiscItems, addRecipes, getInventory, updateCurrency } from "@/src/se
import { getRecipeByResult } from "@/src/services/itemDataService"; import { getRecipeByResult } from "@/src/services/itemDataService";
import { IInventoryChanges } from "@/src/types/purchaseTypes"; import { IInventoryChanges } from "@/src/types/purchaseTypes";
import { addInfestedFoundryXP } from "./infestedFoundryController"; import { addInfestedFoundryXP } from "./infestedFoundryController";
import { config } from "@/src/services/configService";
export const upgradesController: RequestHandler = async (req, res) => { export const upgradesController: RequestHandler = async (req, res) => {
const accountId = await getAccountIdForRequest(req); const accountId = await getAccountIdForRequest(req);
@ -48,10 +49,12 @@ export const upgradesController: RequestHandler = async (req, res) => {
const recipe = getRecipeByResult(operation.UpgradeRequirement)!; const recipe = getRecipeByResult(operation.UpgradeRequirement)!;
for (const ingredient of recipe.ingredients) { for (const ingredient of recipe.ingredients) {
totalPercentagePointsConsumed += ingredient.ItemCount / 10; totalPercentagePointsConsumed += ingredient.ItemCount / 10;
if (!config.infiniteHelminthMaterials) {
inventory.InfestedFoundry!.Resources!.find(x => x.ItemType == ingredient.ItemType)!.Count -= inventory.InfestedFoundry!.Resources!.find(x => x.ItemType == ingredient.ItemType)!.Count -=
ingredient.ItemCount; ingredient.ItemCount;
} }
} }
}
for (const entry of operation.PolarityRemap) { for (const entry of operation.PolarityRemap) {
suit.Configs[entry.Slot] ??= {}; suit.Configs[entry.Slot] ??= {};

View File

@ -46,6 +46,7 @@ interface IConfig {
infinitePlatinum?: boolean; infinitePlatinum?: boolean;
infiniteEndo?: boolean; infiniteEndo?: boolean;
infiniteRegalAya?: boolean; infiniteRegalAya?: boolean;
infiniteHelminthMaterials?: boolean;
unlockAllShipFeatures?: boolean; unlockAllShipFeatures?: boolean;
unlockAllShipDecorations?: boolean; unlockAllShipDecorations?: boolean;
unlockAllFlavourItems?: boolean; unlockAllFlavourItems?: boolean;

View File

@ -473,6 +473,10 @@
<input class="form-check-input" type="checkbox" id="infiniteRegalAya" /> <input class="form-check-input" type="checkbox" id="infiniteRegalAya" />
<label class="form-check-label" for="infiniteRegalAya" data-loc="cheats_infiniteRegalAya"></label> <label class="form-check-label" for="infiniteRegalAya" data-loc="cheats_infiniteRegalAya"></label>
</div> </div>
<div class="form-check">
<input class="form-check-input" type="checkbox" id="infiniteHelminthMaterials" />
<label class="form-check-label" for="infiniteHelminthMaterials" data-loc="cheats_infiniteHelminthMaterials"></label>
</div>
<div class="form-check"> <div class="form-check">
<input class="form-check-input" type="checkbox" id="unlockAllShipFeatures" /> <input class="form-check-input" type="checkbox" id="unlockAllShipFeatures" />
<label class="form-check-label" for="unlockAllShipFeatures" data-loc="cheats_unlockAllShipFeatures"></label> <label class="form-check-label" for="unlockAllShipFeatures" data-loc="cheats_unlockAllShipFeatures"></label>

View File

@ -99,6 +99,7 @@ dict = {
cheats_infinitePlatinum: `Infinite Platinum`, cheats_infinitePlatinum: `Infinite Platinum`,
cheats_infiniteEndo: `Infinite Endo`, cheats_infiniteEndo: `Infinite Endo`,
cheats_infiniteRegalAya: `Infinite Regal Aya`, cheats_infiniteRegalAya: `Infinite Regal Aya`,
cheats_infiniteHelminthMaterials: `Infinite Helminth Materials`,
cheats_unlockAllShipFeatures: `Unlock All Ship Features`, cheats_unlockAllShipFeatures: `Unlock All Ship Features`,
cheats_unlockAllShipDecorations: `Unlock All Ship Decorations`, cheats_unlockAllShipDecorations: `Unlock All Ship Decorations`,
cheats_unlockAllFlavourItems: `Unlock All <abbr title=\"Animation Sets, Glyphs, Plattes, etc.\">Flavor Items</abbr>`, cheats_unlockAllFlavourItems: `Unlock All <abbr title=\"Animation Sets, Glyphs, Plattes, etc.\">Flavor Items</abbr>`,

View File

@ -100,6 +100,7 @@ dict = {
cheats_infinitePlatinum: `Бесконечная платина`, cheats_infinitePlatinum: `Бесконечная платина`,
cheats_infiniteEndo: `Бесконечное эндо`, cheats_infiniteEndo: `Бесконечное эндо`,
cheats_infiniteRegalAya: `Бесконечная Королевская Айя`, cheats_infiniteRegalAya: `Бесконечная Королевская Айя`,
cheats_infiniteHelminthMaterials: `[UNTRANSLATED] Infinite Helminth Materials`,
cheats_unlockAllShipFeatures: `Разблокировать все функции корабля`, cheats_unlockAllShipFeatures: `Разблокировать все функции корабля`,
cheats_unlockAllShipDecorations: `Разблокировать все украшения корабля`, cheats_unlockAllShipDecorations: `Разблокировать все украшения корабля`,
cheats_unlockAllFlavourItems: `Разблокировать все <abbr title=\"Наборы анимаций, глифы, палитры и т. д.\">уникальные предметы</abbr>`, cheats_unlockAllFlavourItems: `Разблокировать все <abbr title=\"Наборы анимаций, глифы, палитры и т. д.\">уникальные предметы</abbr>`,