Added BotConfig.ReplaceScavWith to allow adjustment of scavs into other bot types

This commit is contained in:
Chomp
2025-10-17 10:53:25 +01:00
parent 2604db86e6
commit 4ce5512d7d
3 changed files with 32 additions and 1 deletions
@@ -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>