diff --git a/project/assets/configs/seasonalevents.json b/project/assets/configs/seasonalevents.json index 5ec2d70c..bb44cb04 100644 --- a/project/assets/configs/seasonalevents.json +++ b/project/assets/configs/seasonalevents.json @@ -8361,6 +8361,7 @@ "endDay": "31", "endMonth": "12", "settings": { + "enableChristmasHideout": true, "enableSanta": true, "adjustBotAppearances": true } @@ -8371,8 +8372,27 @@ "type": "NEWYEARS", "startDay": "1", "startMonth": "1", + "endDay": "1", + "endMonth": "1", + "settings": { + "enableChristmasHideout": true, + "enableSanta": true, + "adjustBotAppearances": true + } + }, + { + "enabled": true, + "name": "christmas January", + "type": "CHRISTMAS", + "startDay": "2", + "startMonth": "1", "endDay": "7", - "endMonth": "1" + "endMonth": "1", + "settings": { + "enableChristmasHideout": true, + "enableSanta": true, + "adjustBotAppearances": true + } }, { "enabled": true, diff --git a/project/src/models/spt/config/ISeasonalEventConfig.ts b/project/src/models/spt/config/ISeasonalEventConfig.ts index 89020ecd..4ca9af52 100644 --- a/project/src/models/spt/config/ISeasonalEventConfig.ts +++ b/project/src/models/spt/config/ISeasonalEventConfig.ts @@ -30,7 +30,7 @@ export interface ISeasonalEvent { startMonth: number; endDay: number; endMonth: number; - settings?: Record; + settings?: Record; } export interface ISeasonalEventSettings { diff --git a/project/src/services/SeasonalEventService.ts b/project/src/services/SeasonalEventService.ts index 45001a8f..cb0b0178 100644 --- a/project/src/services/SeasonalEventService.ts +++ b/project/src/services/SeasonalEventService.ts @@ -404,41 +404,14 @@ export class SeasonalEventService { switch (event.type.toLowerCase()) { case SeasonalEventType.HALLOWEEN.toLowerCase(): - globalConfig.EventType = globalConfig.EventType.filter((x) => x !== "None"); - globalConfig.EventType.push("Halloween"); - globalConfig.EventType.push("HalloweenIllumination"); - globalConfig.Health.ProfileHealthSettings.DefaultStimulatorBuff = "Buffs_Halloween"; - this.addEventGearToBots(event.type); - this.adjustZryachiyMeleeChance(); - if (event.settings?.enableSummoning) { - this.enableHalloweenSummonEvent(); - this.addEventBossesToMaps("halloweensummon"); - } - if (event.settings?.zombieSettings?.enabled) { - this.configureZombies(event.settings?.zombieSettings); - } - if (event.settings?.removeEntryRequirement) { - this.removeEntryRequirement(event.settings.removeEntryRequirement); - } - if (event.settings?.replaceBotHostility) { - this.replaceBotHostility(this.seasonalEventConfig.hostilitySettingsForEvent.zombies); - } - this.addPumpkinsToScavBackpacks(); - this.adjustTraderIcons(event.type); + this.applyHalloweenEvent(event, globalConfig); break; case SeasonalEventType.CHRISTMAS.toLowerCase(): - globalConfig.EventType = globalConfig.EventType.filter((x) => x !== "None"); - globalConfig.EventType.push("Christmas"); - this.addEventGearToBots(event.type); - this.addEventLootToBots(event.type); - if (event.settings?.enableSanta) { - this.addGifterBotToMaps(); - this.addLootItemsToGifterDropItemsList(); - } - this.enableDancingTree(); - this.adjustBotAppearanceValues(event.type); + this.applyChristmasEvent(event, globalConfig); break; case SeasonalEventType.NEW_YEARS.toLowerCase(): + this.applyNewYearsEvent(event, globalConfig); + break; case SeasonalEventType.APRIL_FOOLS.toLowerCase(): this.addGifterBotToMaps(); @@ -459,6 +432,74 @@ export class SeasonalEventService { } } + protected applyHalloweenEvent(event: ISeasonalEvent, globalConfig: IConfig) { + globalConfig.EventType = globalConfig.EventType.filter((x) => x !== "None"); + globalConfig.EventType.push("Halloween"); + globalConfig.EventType.push("HalloweenIllumination"); + globalConfig.Health.ProfileHealthSettings.DefaultStimulatorBuff = "Buffs_Halloween"; + this.addEventGearToBots(event.type); + this.adjustZryachiyMeleeChance(); + if (event.settings?.enableSummoning) { + this.enableHalloweenSummonEvent(); + this.addEventBossesToMaps("halloweensummon"); + } + if (event.settings?.zombieSettings?.enabled) { + this.configureZombies(event.settings.zombieSettings); + } + if (event.settings?.removeEntryRequirement) { + this.removeEntryRequirement(event.settings.removeEntryRequirement); + } + if (event.settings?.replaceBotHostility) { + this.replaceBotHostility(this.seasonalEventConfig.hostilitySettingsForEvent.zombies); + } + if (event.settings?.adjustBotAppearances) { + this.adjustBotAppearanceValues(event.type); + } + this.addPumpkinsToScavBackpacks(); + this.adjustTraderIcons(event.type); + } + + protected applyChristmasEvent(event: ISeasonalEvent, globalConfig: IConfig) { + if (event.settings?.enableChristmasHideout) { + globalConfig.EventType = globalConfig.EventType.filter((x) => x !== "None"); + globalConfig.EventType.push("Christmas"); + } + + this.addEventGearToBots(event.type); + this.addEventLootToBots(event.type); + + if (event.settings?.enableSanta) { + this.addGifterBotToMaps(); + this.addLootItemsToGifterDropItemsList(); + } + + this.enableDancingTree(); + if (event.settings?.adjustBotAppearances) { + this.adjustBotAppearanceValues(event.type); + } + } + + protected applyNewYearsEvent(event: ISeasonalEvent, globalConfig: IConfig) { + if (event.settings?.enableChristmasHideout) { + globalConfig.EventType = globalConfig.EventType.filter((x) => x !== "None"); + globalConfig.EventType.push("Christmas"); + } + + this.addEventGearToBots(SeasonalEventType.CHRISTMAS); + this.addEventLootToBots(SeasonalEventType.CHRISTMAS); + + if (event.settings?.enableSanta) { + this.addGifterBotToMaps(); + this.addLootItemsToGifterDropItemsList(); + } + + this.enableDancingTree(); + + if (event.settings?.adjustBotAppearances) { + this.adjustBotAppearanceValues(SeasonalEventType.CHRISTMAS); + } + } + protected adjustBotAppearanceValues(season: SeasonalEventType): void { const adjustments = this.seasonalEventConfig.botAppearanceChanges[season]; if (!adjustments) {