Fix dead mobs sneezing and coughing (#12919)

* Fix dead mobs sneezing and coughing

* SneezeCough update

* Streamlined Event code, moved dead-check

* cleanup

* I can has merge?

* Shared event for SharedMobStateSystem
This commit is contained in:
Errant
2022-12-16 17:33:34 +00:00
committed by GitHub
parent 23ee8ecaaa
commit 656ce251e4
6 changed files with 59 additions and 27 deletions

View File

@@ -1,8 +1,4 @@
using Content.Server.Disease;
using Content.Shared.Audio;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Player;
using Robust.Shared.Random;
namespace Content.Server.Traits.Assorted;
@@ -14,7 +10,6 @@ public sealed class UncontrollableSnoughSystem : EntitySystem
{
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly DiseaseSystem _diseaseSystem = default!;
[Dependency] private readonly AudioSystem _audioSystem = default!;
/// <inheritdoc/>
public override void Initialize()
@@ -43,10 +38,7 @@ public sealed class UncontrollableSnoughSystem : EntitySystem
snough.NextIncidentTime +=
_random.NextFloat(snough.TimeBetweenIncidents.X, snough.TimeBetweenIncidents.Y);
if (snough.SnoughSound != null)
_audioSystem.PlayPvs(snough.SnoughSound, snough.Owner);
_diseaseSystem.SneezeCough(snough.Owner, null, snough.SnoughMessage, false);
_diseaseSystem.SneezeCough(snough.Owner, null, snough.SnoughMessage, snough.SnoughSound, false);
}
}
}