diff --git a/config.json.example b/config.json.example index 1bd3b1c1a..04add3dfd 100644 --- a/config.json.example +++ b/config.json.example @@ -31,5 +31,7 @@ "unlockExilusEverywhere": true, "unlockArcanesEverywhere": true, "noDailyStandingLimits": true, + "noDojoResearchCosts": true, + "noDojoResearchTime": true, "spoofMasteryRank": -1 } diff --git a/src/controllers/api/guildTechController.ts b/src/controllers/api/guildTechController.ts index b9d3b75d3..129131d6e 100644 --- a/src/controllers/api/guildTechController.ts +++ b/src/controllers/api/guildTechController.ts @@ -1,10 +1,12 @@ import { RequestHandler } from "express"; import { getGuildForRequestEx } from "@/src/services/guildService"; -import { ExportDojoRecipes } from "warframe-public-export-plus"; +import { ExportDojoRecipes, IDojoResearch } from "warframe-public-export-plus"; import { getAccountIdForRequest } from "@/src/services/loginService"; import { addMiscItems, addRecipes, getInventory, updateCurrency } from "@/src/services/inventoryService"; import { IMiscItem } from "@/src/types/inventoryTypes/inventoryTypes"; import { IInventoryChanges } from "@/src/types/purchaseTypes"; +import { config } from "@/src/services/configService"; +import { ITechProjectDatabase } from "@/src/types/guildTypes"; export const guildTechController: RequestHandler = async (req, res) => { const accountId = await getAccountIdForRequest(req); @@ -20,15 +22,21 @@ export const guildTechController: RequestHandler = async (req, res) => { const recipe = ExportDojoRecipes.research[data.RecipeType!]; guild.TechProjects ??= []; if (!guild.TechProjects.find(x => x.ItemType == data.RecipeType)) { - guild.TechProjects.push({ - ItemType: data.RecipeType!, - ReqCredits: scaleRequiredCount(recipe.price), - ReqItems: recipe.ingredients.map(x => ({ - ItemType: x.ItemType, - ItemCount: scaleRequiredCount(x.ItemCount) - })), - State: 0 - }); + const techProject = + guild.TechProjects[ + guild.TechProjects.push({ + ItemType: data.RecipeType!, + ReqCredits: config.noDojoResearchCosts ? 0 : scaleRequiredCount(recipe.price), + ReqItems: recipe.ingredients.map(x => ({ + ItemType: x.ItemType, + ItemCount: config.noDojoResearchCosts ? 0 : scaleRequiredCount(x.ItemCount) + })), + State: 0 + }) - 1 + ]; + if (config.noDojoResearchCosts) { + processFundedProject(techProject, recipe); + } } await guild.save(); res.end(); @@ -59,9 +67,8 @@ export const guildTechController: RequestHandler = async (req, res) => { if (techProject.ReqCredits == 0 && !techProject.ReqItems.find(x => x.ItemCount > 0)) { // This research is now fully funded. - techProject.State = 1; const recipe = ExportDojoRecipes.research[data.RecipeType!]; - techProject.CompletionDate = new Date(new Date().getTime() + recipe.time * 1000); + processFundedProject(techProject, recipe); } await guild.save(); @@ -98,6 +105,11 @@ export const guildTechController: RequestHandler = async (req, res) => { } }; +const processFundedProject = (techProject: ITechProjectDatabase, recipe: IDojoResearch): void => { + techProject.State = 1; + techProject.CompletionDate = new Date(new Date().getTime() + (config.noDojoResearchTime ? 0 : recipe.time) * 1000); +}; + type TGuildTechRequest = { Action: string; } & Partial & diff --git a/src/services/configService.ts b/src/services/configService.ts index e1b9c9843..466b062c7 100644 --- a/src/services/configService.ts +++ b/src/services/configService.ts @@ -57,6 +57,8 @@ interface IConfig { unlockExilusEverywhere?: boolean; unlockArcanesEverywhere?: boolean; noDailyStandingLimits?: boolean; + noDojoResearchCosts?: boolean; + noDojoResearchTime?: boolean; spoofMasteryRank?: number; } diff --git a/static/webui/index.html b/static/webui/index.html index 0d4b3e951..57e35b478 100644 --- a/static/webui/index.html +++ b/static/webui/index.html @@ -517,6 +517,14 @@ +
+ + +
+
+ + +
diff --git a/static/webui/translations/en.js b/static/webui/translations/en.js index f69a8fd3f..dd8f5d0b3 100644 --- a/static/webui/translations/en.js +++ b/static/webui/translations/en.js @@ -111,6 +111,8 @@ dict = { cheats_unlockExilusEverywhere: `Exilus Adapters Everywhere`, cheats_unlockArcanesEverywhere: `Arcane Adapters Everywhere`, cheats_noDailyStandingLimits: `No Daily Standing Limits`, + cheats_noDojoResearchCosts: `No Dojo Research Costs`, + cheats_noDojoResearchTime: `No Dojo Research Time`, cheats_spoofMasteryRank: `Spoofed Mastery Rank (-1 to disable)`, cheats_saveSettings: `Save Settings`, cheats_account: `Account`, diff --git a/static/webui/translations/ru.js b/static/webui/translations/ru.js index d2cc9a025..a8a2e3aca 100644 --- a/static/webui/translations/ru.js +++ b/static/webui/translations/ru.js @@ -112,6 +112,8 @@ dict = { cheats_unlockExilusEverywhere: `Адаптеры Эксилус везде`, cheats_unlockArcanesEverywhere: `Адаптеры для мистификаторов везде`, cheats_noDailyStandingLimits: `Без ежедневных ограничений репутации`, + cheats_noDojoResearchCosts: `[UNTRANSLATED] No Dojo Research Costs`, + cheats_noDojoResearchTime: `[UNTRANSLATED] No Dojo Research Time`, cheats_spoofMasteryRank: `Подделанный ранг мастерства (-1 для отключения)`, cheats_saveSettings: `Сохранить настройки`, cheats_account: `Аккаунт`,