Added ability to override hideout craft times via config

This commit is contained in:
Dev 2024-04-06 20:25:57 +01:00
parent 31641334aa
commit 35e48add20
3 changed files with 49 additions and 2 deletions

View File

@ -5,5 +5,7 @@
"inRaid": 60, "inRaid": 60,
"outOfRaid": 10 "outOfRaid": 10
}, },
"expCraftAmount": 10 "expCraftAmount": 10,
"overrideCraftTimeSeconds": -1,
"overrideBuildTimeSeconds": -1
} }

View File

@ -209,6 +209,9 @@ export class GameController
this.adjustLabsRaiderSpawnRate(); this.adjustLabsRaiderSpawnRate();
this.adjustHideoutCraftTimes();
this.adjustHideoutBuildTimes();
this.removePraporTestMessage(); this.removePraporTestMessage();
this.saveActiveModsToProfile(fullProfile); 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 protected adjustLocationBotValues(): void
{ {
const mapsDb = this.databaseServer.getTables().locations; const mapsDb = this.databaseServer.getTables().locations;

View File

@ -9,4 +9,6 @@ export interface IHideoutConfig extends IBaseConfig
runIntervalValues: IRunIntervalValues; runIntervalValues: IRunIntervalValues;
hoursForSkillCrafting: number; hoursForSkillCrafting: number;
expCraftAmount: number; expCraftAmount: number;
overrideCraftTimeSeconds: number;
overrideBuildTimeSeconds: number;
} }