Added BotConfig.ReplaceScavWith to allow adjustment of scavs into other bot types
This commit is contained in:
@@ -2838,5 +2838,6 @@
|
||||
"bossKnight"
|
||||
],
|
||||
"resetDay": "Monday"
|
||||
}
|
||||
},
|
||||
"replaceScavWith": "assault"
|
||||
}
|
||||
|
||||
@@ -131,6 +131,12 @@ public record BotConfig : BaseConfig
|
||||
/// </summary>
|
||||
[JsonPropertyName("weeklyBoss")]
|
||||
public required WeeklyBossSettings WeeklyBoss { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Replace all scavs across all maps with the provided WildSpawnType
|
||||
/// </summary>
|
||||
[JsonPropertyName("replaceScavWith")]
|
||||
public required WildSpawnType ReplaceScavWith { get; set; }
|
||||
}
|
||||
|
||||
public record WeeklyBossSettings
|
||||
|
||||
@@ -131,6 +131,30 @@ public class PostDbLoadService(
|
||||
var chosenBoss = GetWeeklyBoss(BotConfig.WeeklyBoss.BossPool, BotConfig.WeeklyBoss.ResetDay);
|
||||
FlagMapAsGuaranteedBoss(chosenBoss);
|
||||
}
|
||||
|
||||
if (BotConfig.ReplaceScavWith != WildSpawnType.assault)
|
||||
{
|
||||
ReplaceScavWavesWithRole(BotConfig.ReplaceScavWith);
|
||||
}
|
||||
}
|
||||
|
||||
protected void ReplaceScavWavesWithRole(WildSpawnType newScavRole)
|
||||
{
|
||||
foreach (var location in databaseService.GetLocations().GetDictionary().Values)
|
||||
{
|
||||
if (location.Base?.Waves is null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach (var wave in location.Base.Waves)
|
||||
{
|
||||
if (wave.WildSpawnType == WildSpawnType.assault)
|
||||
{
|
||||
wave.WildSpawnType = newScavRole;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user