Fixed configureZombies()
not correctly handling factory or sandbox maps
This commit is contained in:
parent
bf8cf20ec8
commit
59eb80f29b
@ -7751,7 +7751,9 @@
|
||||
"zombieSettings": {
|
||||
"enabled": true,
|
||||
"mapInfectionAmount": {
|
||||
"laboratory": 100
|
||||
"laboratory": 100,
|
||||
"factory4": 0,
|
||||
"Sandbox": 0
|
||||
},
|
||||
"disableBosses": [
|
||||
"laboratory"
|
||||
|
@ -389,6 +389,7 @@
|
||||
"CrowdCooldownPerPlayerSec": 300,
|
||||
"CrowdsLimit": 2,
|
||||
"InfectedLookCoeff": 2,
|
||||
"InfectionPercentage": 0,
|
||||
"MaxCrowdAttackSpawnLimit": 20,
|
||||
"MinInfectionPercentage": 0,
|
||||
"MinSpawnDistToPlayer": 50,
|
||||
|
@ -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()];
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user