diff --git a/project/assets/configs/hideout.json b/project/assets/configs/hideout.json index b5e229f9..47bdfb7c 100644 --- a/project/assets/configs/hideout.json +++ b/project/assets/configs/hideout.json @@ -1,9 +1,11 @@ { "runIntervalSeconds": 10, "hoursForSkillCrafting": 28800, - "runIntervalValues": { + "runIntervalValues": { "inRaid": 60, "outOfRaid": 10 }, - "expCraftAmount": 10 + "expCraftAmount": 10, + "overrideCraftTimeSeconds": -1, + "overrideBuildTimeSeconds": -1 } \ No newline at end of file diff --git a/project/src/controllers/GameController.ts b/project/src/controllers/GameController.ts index 1cede6dc..cb8439e1 100644 --- a/project/src/controllers/GameController.ts +++ b/project/src/controllers/GameController.ts @@ -209,6 +209,9 @@ export class GameController this.adjustLabsRaiderSpawnRate(); + this.adjustHideoutCraftTimes(); + this.adjustHideoutBuildTimes(); + this.removePraporTestMessage(); this.saveActiveModsToProfile(fullProfile); @@ -240,6 +243,46 @@ export class GameController } } + protected adjustHideoutCraftTimes(): void + { + const craftTimeOverrideSeconds = this.hideoutConfig.overrideCraftTimeSeconds; + if (craftTimeOverrideSeconds === -1) + { + return; + } + + for (const craft of this.databaseServer.getTables().hideout.production) + { + // Only adjust crafts ABOVE the override + if (craft.productionTime > craftTimeOverrideSeconds) + { + craft.productionTime = craftTimeOverrideSeconds; + } + } + } + + protected adjustHideoutBuildTimes(): void + { + const craftTimeOverrideSeconds = this.hideoutConfig.overrideBuildTimeSeconds; + if (craftTimeOverrideSeconds === -1) + { + return; + } + + for (const area of this.databaseServer.getTables().hideout.areas) + { + for (const stageKey of Object.keys(area.stages)) + { + const stage = area.stages[stageKey]; + // Only adjust crafts ABOVE the override + if (stage.constructionTime > craftTimeOverrideSeconds) + { + stage.constructionTime = craftTimeOverrideSeconds; + } + } + } + } + protected adjustLocationBotValues(): void { const mapsDb = this.databaseServer.getTables().locations; diff --git a/project/src/models/spt/config/IHideoutConfig.ts b/project/src/models/spt/config/IHideoutConfig.ts index 5d17a15b..e2f419b2 100644 --- a/project/src/models/spt/config/IHideoutConfig.ts +++ b/project/src/models/spt/config/IHideoutConfig.ts @@ -9,4 +9,6 @@ export interface IHideoutConfig extends IBaseConfig runIntervalValues: IRunIntervalValues; hoursForSkillCrafting: number; expCraftAmount: number; + overrideCraftTimeSeconds: number; + overrideBuildTimeSeconds: number; }