Fixed configureZombies()
not correctly handling factory or sandbox maps
This commit is contained in:
parent
bf8cf20ec8
commit
59eb80f29b
@ -7751,7 +7751,9 @@
|
|||||||
"zombieSettings": {
|
"zombieSettings": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"mapInfectionAmount": {
|
"mapInfectionAmount": {
|
||||||
"laboratory": 100
|
"laboratory": 100,
|
||||||
|
"factory4": 0,
|
||||||
|
"Sandbox": 0
|
||||||
},
|
},
|
||||||
"disableBosses": [
|
"disableBosses": [
|
||||||
"laboratory"
|
"laboratory"
|
||||||
|
@ -389,6 +389,7 @@
|
|||||||
"CrowdCooldownPerPlayerSec": 300,
|
"CrowdCooldownPerPlayerSec": 300,
|
||||||
"CrowdsLimit": 2,
|
"CrowdsLimit": 2,
|
||||||
"InfectedLookCoeff": 2,
|
"InfectedLookCoeff": 2,
|
||||||
|
"InfectionPercentage": 0,
|
||||||
"MaxCrowdAttackSpawnLimit": 20,
|
"MaxCrowdAttackSpawnLimit": 20,
|
||||||
"MinInfectionPercentage": 0,
|
"MinInfectionPercentage": 0,
|
||||||
"MinSpawnDistToPlayer": 50,
|
"MinSpawnDistToPlayer": 50,
|
||||||
|
@ -483,11 +483,18 @@ export class SeasonalEventService {
|
|||||||
infectionHalloween.DisplayUIEnabled = true;
|
infectionHalloween.DisplayUIEnabled = true;
|
||||||
infectionHalloween.Enabled = true;
|
infectionHalloween.Enabled = true;
|
||||||
|
|
||||||
for (const locationKey in zombieSettings.mapInfectionAmount) {
|
for (const infectedLocationKey in zombieSettings.mapInfectionAmount) {
|
||||||
this.databaseService.getLocation(locationKey.toLowerCase()).base.Events.Halloween2024.InfectionPercentage =
|
const mappedLocations = this.getLocationFromInfectedLocation(infectedLocationKey.toLowerCase());
|
||||||
zombieSettings.mapInfectionAmount[locationKey];
|
|
||||||
this.databaseService.getGlobals().LocationInfection[locationKey] =
|
for (const locationKey of mappedLocations) {
|
||||||
zombieSettings.mapInfectionAmount[locationKey];
|
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) {
|
for (const locationId of zombieSettings.disableBosses) {
|
||||||
@ -504,6 +511,23 @@ export class SeasonalEventService {
|
|||||||
this.addEventBossesToMaps("halloweenzombies", activeMaps);
|
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 {
|
protected addEventWavesToMaps(eventType: string): void {
|
||||||
const wavesToAddByMap = this.seasonalEventConfig.eventWaves[eventType.toLowerCase()];
|
const wavesToAddByMap = this.seasonalEventConfig.eventWaves[eventType.toLowerCase()];
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user