From edaec549c927f20f65f3f30018f15a7c95f5cbf6 Mon Sep 17 00:00:00 2001 From: Dev Date: Fri, 1 Nov 2024 15:19:54 +0000 Subject: [PATCH] Expanded zombies configuration --- project/assets/configs/seasonalevents.json | 13 ++++++++- .../models/spt/config/ISeasonalEventConfig.ts | 9 +++++- project/src/services/SeasonalEventService.ts | 28 ++++++++++++------- 3 files changed, 38 insertions(+), 12 deletions(-) diff --git a/project/assets/configs/seasonalevents.json b/project/assets/configs/seasonalevents.json index f4197a85..d39b59c1 100644 --- a/project/assets/configs/seasonalevents.json +++ b/project/assets/configs/seasonalevents.json @@ -1307,7 +1307,18 @@ "endMonth": "11", "settings": { "enableSummoning": false, - "enableZombies": true + "zombieSettings": { + "enabled": true, + "mapInfectionAmount": { + "laboratory": 100 + }, + "disableBosses": { + "laboratory": true + }, + "disableWaves": { + "laboratory": true + } + } } }, { diff --git a/project/src/models/spt/config/ISeasonalEventConfig.ts b/project/src/models/spt/config/ISeasonalEventConfig.ts index 5a9599e9..a342c5a5 100644 --- a/project/src/models/spt/config/ISeasonalEventConfig.ts +++ b/project/src/models/spt/config/ISeasonalEventConfig.ts @@ -22,7 +22,14 @@ export interface ISeasonalEvent { startMonth: number; endDay: number; endMonth: number; - settings?: Record; + settings?: Record; +} + +export interface IZombieSettings { + enabled: boolean; + mapInfectionAmount: Record; + disableBosses: Record; + disableWaves: Record; } export interface IGifterSetting { diff --git a/project/src/services/SeasonalEventService.ts b/project/src/services/SeasonalEventService.ts index 4690ac40..a8801981 100644 --- a/project/src/services/SeasonalEventService.ts +++ b/project/src/services/SeasonalEventService.ts @@ -10,7 +10,7 @@ import { Season } from "@spt/models/enums/Season"; import { SeasonalEventType } from "@spt/models/enums/SeasonalEventType"; import { IHttpConfig } from "@spt/models/spt/config/IHttpConfig"; 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 { ILogger } from "@spt/models/spt/utils/ILogger"; import { ConfigServer } from "@spt/servers/ConfigServer"; @@ -352,9 +352,8 @@ export class SeasonalEventService { this.enableHalloweenSummonEvent(); this.addEventBossesToMaps(event.type); } - if (event.settings?.enableZombies) { - this.enableHalloweenZombiesEvent(); - this.addEventWavesToMaps("halloweenZombies"); + if (event.settings?.zombieSettings?.enabled) { + this.configureZombies(event.settings?.zombieSettings); } this.addPumpkinsToScavBackpacks(); this.adjustTraderIcons(event.type); @@ -367,7 +366,6 @@ export class SeasonalEventService { this.addGifterBotToMaps(); this.addLootItemsToGifterDropItemsList(); } - this.enableDancingTree(); break; case SeasonalEventType.NEW_YEARS.toLowerCase(): @@ -420,11 +418,21 @@ export class SeasonalEventService { this.databaseService.getGlobals().config.EventSettings.EventActive = true; } - protected enableHalloweenZombiesEvent(): void { - // TODO - expand to be more dynamic - // TODO - add zombies waves to maps - this.databaseService.getLocations().laboratory.base.Events.Halloween2024.InfectionPercentage = 100; - this.databaseService.getLocations().factory4_day.base.Events.Halloween2024.InfectionPercentage = 50; + protected configureZombies(zombieSettings: IZombieSettings) { + for (const locationKey in zombieSettings.mapInfectionAmount) { + this.databaseService.getLocation(locationKey).base.Events.Halloween2024.InfectionPercentage = + zombieSettings.mapInfectionAmount[locationKey]; + } + + 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 {