diff --git a/project/assets/configs/seasonalevents.json b/project/assets/configs/seasonalevents.json index e1e9e1f5..e412de2a 100644 --- a/project/assets/configs/seasonalevents.json +++ b/project/assets/configs/seasonalevents.json @@ -7751,7 +7751,9 @@ "zombieSettings": { "enabled": true, "mapInfectionAmount": { - "laboratory": 100 + "laboratory": 100, + "factory4": 0, + "Sandbox": 0 }, "disableBosses": [ "laboratory" diff --git a/project/assets/database/locations/sandbox_high/base.json b/project/assets/database/locations/sandbox_high/base.json index 2b6a25bc..687d7d3e 100644 --- a/project/assets/database/locations/sandbox_high/base.json +++ b/project/assets/database/locations/sandbox_high/base.json @@ -389,6 +389,7 @@ "CrowdCooldownPerPlayerSec": 300, "CrowdsLimit": 2, "InfectedLookCoeff": 2, + "InfectionPercentage": 0, "MaxCrowdAttackSpawnLimit": 20, "MinInfectionPercentage": 0, "MinSpawnDistToPlayer": 50, diff --git a/project/src/services/SeasonalEventService.ts b/project/src/services/SeasonalEventService.ts index 25caae1f..1132f0b1 100644 --- a/project/src/services/SeasonalEventService.ts +++ b/project/src/services/SeasonalEventService.ts @@ -483,11 +483,18 @@ export class SeasonalEventService { infectionHalloween.DisplayUIEnabled = true; infectionHalloween.Enabled = true; - for (const locationKey in zombieSettings.mapInfectionAmount) { - this.databaseService.getLocation(locationKey.toLowerCase()).base.Events.Halloween2024.InfectionPercentage = - zombieSettings.mapInfectionAmount[locationKey]; - this.databaseService.getGlobals().LocationInfection[locationKey] = - zombieSettings.mapInfectionAmount[locationKey]; + for (const infectedLocationKey in zombieSettings.mapInfectionAmount) { + const mappedLocations = this.getLocationFromInfectedLocation(infectedLocationKey.toLowerCase()); + + for (const locationKey of mappedLocations) { + this.databaseService.getLocation( + locationKey.toLowerCase(), + ).base.Events.Halloween2024.InfectionPercentage = + zombieSettings.mapInfectionAmount[infectedLocationKey]; + } + + this.databaseService.getGlobals().LocationInfection[infectedLocationKey] = + zombieSettings.mapInfectionAmount[infectedLocationKey]; } for (const locationId of zombieSettings.disableBosses) { @@ -504,6 +511,23 @@ export class SeasonalEventService { this.addEventBossesToMaps("halloweenzombies", activeMaps); } + /** + * BSG store the location ids differently inside `LocationInfection`, need to convert to matching location IDs + * @param infectedLocationKey Key to convert + * @returns Array of locations + */ + protected getLocationFromInfectedLocation(infectedLocationKey: string): string[] { + if (infectedLocationKey === "factory4") { + return ["factory4_day", "factory4_night"]; + } + + if (infectedLocationKey === "sandbox") { + return ["sandbox", "sandbox_high"]; + } + + return [infectedLocationKey]; + } + protected addEventWavesToMaps(eventType: string): void { const wavesToAddByMap = this.seasonalEventConfig.eventWaves[eventType.toLowerCase()];