Expanded zombies configuration

This commit is contained in:
Dev 2024-11-01 15:19:54 +00:00
parent 5ec265d9bd
commit edaec549c9
3 changed files with 38 additions and 12 deletions

View File

@ -1307,7 +1307,18 @@
"endMonth": "11", "endMonth": "11",
"settings": { "settings": {
"enableSummoning": false, "enableSummoning": false,
"enableZombies": true "zombieSettings": {
"enabled": true,
"mapInfectionAmount": {
"laboratory": 100
},
"disableBosses": {
"laboratory": true
},
"disableWaves": {
"laboratory": true
}
}
} }
}, },
{ {

View File

@ -22,7 +22,14 @@ export interface ISeasonalEvent {
startMonth: number; startMonth: number;
endDay: number; endDay: number;
endMonth: number; endMonth: number;
settings?: Record<string, boolean>; settings?: Record<string, any>;
}
export interface IZombieSettings {
enabled: boolean;
mapInfectionAmount: Record<string, number>;
disableBosses: Record<string, boolean>;
disableWaves: Record<string, boolean>;
} }
export interface IGifterSetting { export interface IGifterSetting {

View File

@ -10,7 +10,7 @@ import { Season } from "@spt/models/enums/Season";
import { SeasonalEventType } from "@spt/models/enums/SeasonalEventType"; import { SeasonalEventType } from "@spt/models/enums/SeasonalEventType";
import { IHttpConfig } from "@spt/models/spt/config/IHttpConfig"; import { IHttpConfig } from "@spt/models/spt/config/IHttpConfig";
import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig";
import { ISeasonalEvent, ISeasonalEventConfig } from "@spt/models/spt/config/ISeasonalEventConfig"; import { ISeasonalEvent, ISeasonalEventConfig, IZombieSettings } from "@spt/models/spt/config/ISeasonalEventConfig";
import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig"; import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig";
import { ILogger } from "@spt/models/spt/utils/ILogger"; import { ILogger } from "@spt/models/spt/utils/ILogger";
import { ConfigServer } from "@spt/servers/ConfigServer"; import { ConfigServer } from "@spt/servers/ConfigServer";
@ -352,9 +352,8 @@ export class SeasonalEventService {
this.enableHalloweenSummonEvent(); this.enableHalloweenSummonEvent();
this.addEventBossesToMaps(event.type); this.addEventBossesToMaps(event.type);
} }
if (event.settings?.enableZombies) { if (event.settings?.zombieSettings?.enabled) {
this.enableHalloweenZombiesEvent(); this.configureZombies(event.settings?.zombieSettings);
this.addEventWavesToMaps("halloweenZombies");
} }
this.addPumpkinsToScavBackpacks(); this.addPumpkinsToScavBackpacks();
this.adjustTraderIcons(event.type); this.adjustTraderIcons(event.type);
@ -367,7 +366,6 @@ export class SeasonalEventService {
this.addGifterBotToMaps(); this.addGifterBotToMaps();
this.addLootItemsToGifterDropItemsList(); this.addLootItemsToGifterDropItemsList();
} }
this.enableDancingTree(); this.enableDancingTree();
break; break;
case SeasonalEventType.NEW_YEARS.toLowerCase(): case SeasonalEventType.NEW_YEARS.toLowerCase():
@ -420,11 +418,21 @@ export class SeasonalEventService {
this.databaseService.getGlobals().config.EventSettings.EventActive = true; this.databaseService.getGlobals().config.EventSettings.EventActive = true;
} }
protected enableHalloweenZombiesEvent(): void { protected configureZombies(zombieSettings: IZombieSettings) {
// TODO - expand to be more dynamic for (const locationKey in zombieSettings.mapInfectionAmount) {
// TODO - add zombies waves to maps this.databaseService.getLocation(locationKey).base.Events.Halloween2024.InfectionPercentage =
this.databaseService.getLocations().laboratory.base.Events.Halloween2024.InfectionPercentage = 100; zombieSettings.mapInfectionAmount[locationKey];
this.databaseService.getLocations().factory4_day.base.Events.Halloween2024.InfectionPercentage = 50; }
for (const locationKey in zombieSettings.disableBosses) {
this.databaseService.getLocation(locationKey).base.BossLocationSpawn = [];
}
for (const locationKey in zombieSettings.disableWaves) {
this.databaseService.getLocation(locationKey).base.waves = [];
}
this.addEventWavesToMaps("halloweenZombies");
} }
protected addEventWavesToMaps(eventType: string): void { protected addEventWavesToMaps(eventType: string): void {