diff --git a/Content.IntegrationTests/Tests/Damageable/MobThresholdsTest.cs b/Content.IntegrationTests/Tests/Damageable/MobThresholdsTest.cs new file mode 100644 index 0000000000..e2f841fc59 --- /dev/null +++ b/Content.IntegrationTests/Tests/Damageable/MobThresholdsTest.cs @@ -0,0 +1,40 @@ +using Content.Shared.Alert; +using Content.Shared.Mobs.Components; + +namespace Content.IntegrationTests.Tests.Damageable; + +public sealed class MobThresholdsTest +{ + /// + /// Inspects every entity prototype with a and makes + /// sure that every possible mob state is mapped to an . + /// + [Test] + public async Task ValidateMobThresholds() + { + await using var pair = await PoolManager.GetServerClient(); + var server = pair.Server; + + var entMan = server.EntMan; + var protoMan = server.ProtoMan; + + var protos = pair.GetPrototypesWithComponent(); + + Assert.Multiple(() => + { + foreach (var (proto, comp) in protos) + { + // See which mob states are mapped to alerts + var alertStates = comp.StateAlertDict.Keys; + // Check each mob state that this mob can be in + foreach (var (_, state) in comp.Thresholds) + { + // Make sure that an alert exists for each possible mob state + Assert.That(alertStates, Does.Contain(state), $"{proto.ID} does not have an alert state for mob state {state}"); + } + } + }); + + await pair.CleanReturnAsync(); + } +} diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/silicon.yml b/Resources/Prototypes/Entities/Mobs/NPCs/silicon.yml index ceb9e67330..8cf66765bd 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/silicon.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/silicon.yml @@ -62,6 +62,7 @@ 120: Dead stateAlertDict: Alive: BorgHealth + Dead: BorgDead showOverlays: false - type: Stamina critThreshold: 120