Move trainArrivalDelaySeconds value into config

This commit is contained in:
Dev 2023-12-01 09:03:14 +00:00
parent 1994832281
commit 2a3839f6de
3 changed files with 217 additions and 201 deletions

View File

@ -841,6 +841,10 @@
"allowDuplicateItemsInStaticContainers": true,
"looseLootBlacklist": {},
"scavRaidTimeSettings": {
"settings": {
"trainArrivalDelaySeconds": 90
},
"maps": {
"bigmap": {
"reduceLootByPercent": true,
"minDynamicLootPercent": 50,
@ -1028,3 +1032,4 @@
}
}
}
}

View File

@ -39,31 +39,7 @@ export interface ILocationConfig extends IBaseConfig
/** Key: map, value: loose loot ids to ignore */
looseLootBlacklist: Record<string, string[]>;
/** Key: map, value: settings to control how long scav raids are*/
scavRaidTimeSettings: Record<string, IScavRaidTimeLocationSettings>;
}
export interface IScavRaidTimeLocationSettings
{
/** Should loot be reduced by same percent length of raid is reduced by */
reduceLootByPercent: boolean;
minStaticLootPercent: number;
minDynamicLootPercent: number;
/** Chance raid time is reduced */
reducedChancePercent: number;
reductionPercentWeights: Record<string, number>;
/** Should bot waves be removed / spawn times be adjusted */
adjustWaves: boolean;
}
export interface IContainerRandomistionSettings
{
enabled: boolean;
/** What maps can use the container randomisation feature */
maps: Record<string, boolean>;
/** Some container types don't work when randomised */
containerTypesToNotRandomise: string[];
containerGroupMinSizeMultiplier: number;
containerGroupMaxSizeMultiplier: number;
scavRaidTimeSettings: IScavRaidTimeSettings;
}
export interface IFixEmptyBotWavesSettings
@ -119,3 +95,38 @@ export interface LootMultiplier
terminal: number;
town: number;
}
export interface IContainerRandomistionSettings
{
enabled: boolean;
/** What maps can use the container randomisation feature */
maps: Record<string, boolean>;
/** Some container types don't work when randomised */
containerTypesToNotRandomise: string[];
containerGroupMinSizeMultiplier: number;
containerGroupMaxSizeMultiplier: number;
}
export interface IScavRaidTimeSettings
{
settings: IScavRaidTimeConfigSettings
maps: Record<string, IScavRaidTimeLocationSettings>
}
export interface IScavRaidTimeConfigSettings
{
trainArrivalDelaySeconds: number
}
export interface IScavRaidTimeLocationSettings
{
/** Should loot be reduced by same percent length of raid is reduced by */
reduceLootByPercent: boolean;
minStaticLootPercent: number;
minDynamicLootPercent: number;
/** Chance raid time is reduced */
reducedChancePercent: number;
reductionPercentWeights: Record<string, number>;
/** Should bot waves be removed / spawn times be adjusted */
adjustWaves: boolean;
}

View File

@ -171,11 +171,11 @@ export class RaidTimeAdjustmentService
*/
protected getMapSettings(location: string): IScavRaidTimeLocationSettings
{
const mapSettings = this.locationConfig.scavRaidTimeSettings[location.toLowerCase()];
const mapSettings = this.locationConfig.scavRaidTimeSettings.maps[location.toLowerCase()];
if (!mapSettings)
{
this.logger.warning(`Unable to find scav raid time settings for map: ${location}, using defaults`);
return this.locationConfig.scavRaidTimeSettings.default;
return this.locationConfig.scavRaidTimeSettings.maps.default;
}
return mapSettings;
@ -226,7 +226,7 @@ export class RaidTimeAdjustmentService
//
// I added 2 seconds just to be safe...
//
const trainArrivalDelaySeconds = 90;
const trainArrivalDelaySeconds = this.locationConfig.scavRaidTimeSettings.settings.trainArrivalDelaySeconds;
// Determine the earliest possible time in the raid when the train would leave
const earliestPossibleDepartureMinutes = (exit.MinTime + exit.Count + exit.ExfiltrationTime + trainArrivalDelaySeconds) / 60;