From ad70c9a66eeb8c1ed79ca3bc12b65edeb4f0185b Mon Sep 17 00:00:00 2001 From: Chomp Date: Wed, 1 Jan 2025 14:47:56 +0000 Subject: [PATCH] Expanded `handleModEvent` to make use of `forceSeason`, `enableChristmasHideout`, `enableHalloweenHideout`, `addEventGearToBots` and `addEventLootToBots` --- project/src/services/SeasonalEventService.ts | 32 ++++++++++++++++---- 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/project/src/services/SeasonalEventService.ts b/project/src/services/SeasonalEventService.ts index cb0b0178..2eb2708f 100644 --- a/project/src/services/SeasonalEventService.ts +++ b/project/src/services/SeasonalEventService.ts @@ -427,7 +427,7 @@ export class SeasonalEventService { break; default: // Likely a mod event - this.handleModEvent(event); + this.handleModEvent(event, globalConfig); break; } } @@ -890,18 +890,38 @@ export class SeasonalEventService { } } - protected handleModEvent(event: ISeasonalEvent) { - this.addEventGearToBots(event.type); + protected handleModEvent(event: ISeasonalEvent, globalConfig: IConfig): void { + if (event.settings?.enableChristmasHideout) { + globalConfig.EventType = globalConfig.EventType.filter((x) => x !== "None"); + globalConfig.EventType.push("Christmas"); + } + + if (event.settings?.enableHalloweenHideout) { + globalConfig.EventType = globalConfig.EventType.filter((x) => x !== "None"); + globalConfig.EventType.push("Halloween"); + globalConfig.EventType.push("HalloweenIllumination"); + } + + if (event.settings?.addEventGearToBots) { + this.addEventGearToBots(event.type); + } + if (event.settings?.addEventLootToBots) { + this.addEventLootToBots(event.type); + } if (event.settings?.enableSummoning) { this.enableHalloweenSummonEvent(); this.addEventBossesToMaps("halloweensummon"); } if (event.settings?.zombieSettings?.enabled) { - this.configureZombies(event.settings?.zombieSettings); + this.configureZombies(event.settings.zombieSettings); } - if (event.settings?.forceSnow) { - this.enableSnow(); + if (event.settings?.forceSeason) { + this.weatherConfig.overrideSeason = event.settings.forceSeason; + } + + if (event.settings?.adjustBotAppearances) { + this.adjustBotAppearanceValues(event.type); } }