XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

SpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 1 Star 0
返回提交历史

XFEstudio/SpaceNinjaServer

feat: No Dojo Deco Build Stage cheat (#1508)

Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1508 Co-authored-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com> Co-committed-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com>

5692a620
AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com>
提交于

代码差异

9 个文件 +43 -31
Modified config.json.example +1 -0
@@ -34,6 +34,7 @@
34 34 "noVendorPurchaseLimits": true,
35 35 "instantResourceExtractorDrones": false,
36 36 "noDojoRoomBuildStage": false,
37 "noDecoBuildStage": false,
37 38 "fastDojoRoomDestruction": false,
38 39 "noDojoResearchCosts": false,
39 40 "noDojoResearchTime": false,
Modified src/controllers/api/placeDecoInComponentController.ts +32 -31
@@ -13,6 +13,7 @@ import { GuildPermission } from "@/src/types/guildTypes";
13 13 import { RequestHandler } from "express";
14 14 import { Types } from "mongoose";
15 15 import { ExportDojoRecipes, ExportResources } from "warframe-public-export-plus";
16 import { config } from "@/src/services/configService";
16 17
17 18 export const placeDecoInComponentController: RequestHandler = async (req, res) => {
18 19 const accountId = await getAccountIdForRequest(req);
@@ -62,41 +63,41 @@ export const placeDecoInComponentController: RequestHandler = async (req, res) =
62 63 guild.VaultShipDecorations!.find(x => x.ItemType == itemType)!.ItemCount -= 1;
63 64 }
64 65 }
65 if (!meta || (meta.price == 0 && meta.ingredients.length == 0)) {
66 deco.CompletionTime = new Date();
67 } else if (
68 guild.AutoContributeFromVault &&
69 guild.VaultRegularCredits &&
70 guild.VaultMiscItems &&
71 deco.Type != "/Lotus/Objects/Tenno/Props/TnoPaintBotDojoDeco"
72 ) {
73 if (guild.VaultRegularCredits >= scaleRequiredCount(guild.Tier, meta.price)) {
74 let enoughMiscItems = true;
75 for (const ingredient of meta.ingredients) {
76 if (
77 getVaultMiscItemCount(guild, ingredient.ItemType) <
78 scaleRequiredCount(guild.Tier, ingredient.ItemCount)
79 ) {
80 enoughMiscItems = false;
81 break;
82 }
66 if (deco.Type != "/Lotus/Objects/Tenno/Props/TnoPaintBotDojoDeco") {
67 if (!meta || (meta.price == 0 && meta.ingredients.length == 0) || config.noDojoDecoBuildStage) {
68 deco.CompletionTime = new Date();
69 if (meta) {
70 processDojoBuildMaterialsGathered(guild, meta);
83 71 }
84 if (enoughMiscItems) {
85 guild.VaultRegularCredits -= scaleRequiredCount(guild.Tier, meta.price);
86 deco.RegularCredits = scaleRequiredCount(guild.Tier, meta.price);
87
88 deco.MiscItems = [];
72 } else if (guild.AutoContributeFromVault && guild.VaultRegularCredits && guild.VaultMiscItems) {
73 if (guild.VaultRegularCredits >= scaleRequiredCount(guild.Tier, meta.price)) {
74 let enoughMiscItems = true;
89 75 for (const ingredient of meta.ingredients) {
90 guild.VaultMiscItems.find(x => x.ItemType == ingredient.ItemType)!.ItemCount -=
91 scaleRequiredCount(guild.Tier, ingredient.ItemCount);
92 deco.MiscItems.push({
93 ItemType: ingredient.ItemType,
94 ItemCount: scaleRequiredCount(guild.Tier, ingredient.ItemCount)
95 });
76 if (
77 getVaultMiscItemCount(guild, ingredient.ItemType) <
78 scaleRequiredCount(guild.Tier, ingredient.ItemCount)
79 ) {
80 enoughMiscItems = false;
81 break;
82 }
96 83 }
84 if (enoughMiscItems) {
85 guild.VaultRegularCredits -= scaleRequiredCount(guild.Tier, meta.price);
86 deco.RegularCredits = scaleRequiredCount(guild.Tier, meta.price);
97 87
98 deco.CompletionTime = new Date(Date.now() + meta.time * 1000);
99 processDojoBuildMaterialsGathered(guild, meta);
88 deco.MiscItems = [];
89 for (const ingredient of meta.ingredients) {
90 guild.VaultMiscItems.find(x => x.ItemType == ingredient.ItemType)!.ItemCount -=
91 scaleRequiredCount(guild.Tier, ingredient.ItemCount);
92 deco.MiscItems.push({
93 ItemType: ingredient.ItemType,
94 ItemCount: scaleRequiredCount(guild.Tier, ingredient.ItemCount)
95 });
96 }
97
98 deco.CompletionTime = new Date(Date.now() + meta.time * 1000);
99 processDojoBuildMaterialsGathered(guild, meta);
100 }
100 101 }
101 102 }
102 103 }
Modified src/services/configService.ts +1 -0
@@ -39,6 +39,7 @@ interface IConfig {
39 39 noVendorPurchaseLimits?: boolean;
40 40 instantResourceExtractorDrones?: boolean;
41 41 noDojoRoomBuildStage?: boolean;
42 noDojoDecoBuildStage?: boolean;
42 43 fastDojoRoomDestruction?: boolean;
43 44 noDojoResearchCosts?: boolean;
44 45 noDojoResearchTime?: boolean;
Modified static/webui/index.html +4 -0
@@ -608,6 +608,10 @@
608 608 <input class="form-check-input" type="checkbox" id="noDojoRoomBuildStage" />
609 609 <label class="form-check-label" for="noDojoRoomBuildStage" data-loc="cheats_noDojoRoomBuildStage"></label>
610 610 </div>
611 <div class="form-check">
612 <input class="form-check-input" type="checkbox" id="noDojoDecoBuildStage" />
613 <label class="form-check-label" for="noDojoDecoBuildStage" data-loc="cheats_noDojoDecoBuildStage"></label>
614 </div>
611 615 <div class="form-check">
612 616 <input class="form-check-input" type="checkbox" id="fastDojoRoomDestruction" />
613 617 <label class="form-check-label" for="fastDojoRoomDestruction" data-loc="cheats_fastDojoRoomDestruction"></label>
Modified static/webui/translations/de.js +1 -0
@@ -137,6 +137,7 @@ dict = {
137 137 cheats_noVendorPurchaseLimits: `Keine Kaufbeschränkungen bei Händlern`,
138 138 cheats_instantResourceExtractorDrones: `Sofortige Ressourcen-Extraktor-Drohnen`,
139 139 cheats_noDojoRoomBuildStage: `Kein Dojo-Raum-Bauvorgang`,
140 cheats_noDojoDecoBuildStage: `[UNTRANSLATED] No Dojo Deco Build Stage`,
140 141 cheats_fastDojoRoomDestruction: `Schnelle Dojo-Raum-Zerstörung`,
141 142 cheats_noDojoResearchCosts: `Keine Dojo-Forschungskosten`,
142 143 cheats_noDojoResearchTime: `Keine Dojo-Forschungszeit`,
Modified static/webui/translations/en.js +1 -0
@@ -136,6 +136,7 @@ dict = {
136 136 cheats_noVendorPurchaseLimits: `No Vendor Purchase Limits`,
137 137 cheats_instantResourceExtractorDrones: `Instant Resource Extractor Drones`,
138 138 cheats_noDojoRoomBuildStage: `No Dojo Room Build Stage`,
139 cheats_noDojoDecoBuildStage: `No Dojo Deco Build Stage`,
139 140 cheats_fastDojoRoomDestruction: `Fast Dojo Room Destruction`,
140 141 cheats_noDojoResearchCosts: `No Dojo Research Costs`,
141 142 cheats_noDojoResearchTime: `No Dojo Research Time`,
Modified static/webui/translations/fr.js +1 -0
@@ -137,6 +137,7 @@ dict = {
137 137 cheats_noVendorPurchaseLimits: `[UNTRANSLATED] No Vendor Purchase Limits`,
138 138 cheats_instantResourceExtractorDrones: `Ressources de drone d'extraction instantannées`,
139 139 cheats_noDojoRoomBuildStage: `No Dojo Room Build Stage`,
140 cheats_noDojoDecoBuildStage: `[UNTRANSLATED] No Dojo Deco Build Stage`,
140 141 cheats_fastDojoRoomDestruction: `[UNTRANSLATED] Fast Dojo Room Destruction`,
141 142 cheats_noDojoResearchCosts: `Aucun coût de recherche (Dojo)`,
142 143 cheats_noDojoResearchTime: `Aucun temps de recherche (Dojo)`,
Modified static/webui/translations/ru.js +1 -0
@@ -137,6 +137,7 @@ dict = {
137 137 cheats_noVendorPurchaseLimits: `Отсутствие лимитов на покупки у вендоров`,
138 138 cheats_instantResourceExtractorDrones: `Мгновенные Экстракторы Ресурсов`,
139 139 cheats_noDojoRoomBuildStage: `Мгновенное Строительтво Комнат Додзё`,
140 cheats_noDojoDecoBuildStage: `[UNTRANSLATED] No Dojo Deco Build Stage`,
140 141 cheats_fastDojoRoomDestruction: `Мгновенные Уничтожение Комнат Додзё`,
141 142 cheats_noDojoResearchCosts: `Бесплатные Исследование Додзё`,
142 143 cheats_noDojoResearchTime: `Мгновенные Исследование Додзё`,
Modified static/webui/translations/zh.js +1 -0
@@ -137,6 +137,7 @@ dict = {
137 137 cheats_noVendorPurchaseLimits: `[UNTRANSLATED] No Vendor Purchase Limits`,
138 138 cheats_instantResourceExtractorDrones: `即时资源采集无人机`,
139 139 cheats_noDojoRoomBuildStage: `无视道场房间建造阶段`,
140 cheats_noDojoDecoBuildStage: `[UNTRANSLATED] No Dojo Deco Build Stage`,
140 141 cheats_fastDojoRoomDestruction: `快速拆除道场房间`,
141 142 cheats_noDojoResearchCosts: `无视道场研究消耗`,
142 143 cheats_noDojoResearchTime: `无视道场研究时间`,