diff --git a/Content.Server/Medical/VomitSystem.cs b/Content.Server/Medical/VomitSystem.cs index 9fee1dfc85..235cc17331 100644 --- a/Content.Server/Medical/VomitSystem.cs +++ b/Content.Server/Medical/VomitSystem.cs @@ -8,6 +8,7 @@ using Content.Shared.Chemistry.Components; using Content.Shared.Chemistry.EntitySystems; using Content.Shared.Chemistry.Reagent; using Content.Shared.IdentityManagement; +using Content.Shared.Mobs.Systems; using Content.Shared.Movement.Systems; using Content.Shared.Nutrition.Components; using Content.Shared.Nutrition.EntitySystems; @@ -21,15 +22,16 @@ namespace Content.Server.Medical { [Dependency] private readonly IPrototypeManager _proto = default!; [Dependency] private readonly AudioSystem _audio = default!; + [Dependency] private readonly BloodstreamSystem _bloodstream = default!; [Dependency] private readonly BodySystem _body = default!; + [Dependency] private readonly ForensicsSystem _forensics = default!; [Dependency] private readonly HungerSystem _hunger = default!; + [Dependency] private readonly MobStateSystem _mobstate = default!; + [Dependency] private readonly MovementModStatusSystem _movementMod = default!; [Dependency] private readonly PopupSystem _popup = default!; [Dependency] private readonly PuddleSystem _puddle = default!; [Dependency] private readonly SharedSolutionContainerSystem _solutionContainer = default!; - [Dependency] private readonly MovementModStatusSystem _movementMod = default!; [Dependency] private readonly ThirstSystem _thirst = default!; - [Dependency] private readonly ForensicsSystem _forensics = default!; - [Dependency] private readonly BloodstreamSystem _bloodstream = default!; private static readonly ProtoId VomitCollection = "Vomit"; @@ -39,13 +41,18 @@ namespace Content.Server.Medical /// /// Make an entity vomit, if they have a stomach. /// - public void Vomit(EntityUid uid, float thirstAdded = -40f, float hungerAdded = -40f) + public void Vomit(EntityUid uid, float thirstAdded = -40f, float hungerAdded = -40f, bool force = false) { // Main requirement: You have a stomach var stomachList = _body.GetBodyOrganEntityComps(uid); if (stomachList.Count == 0) return; + // Vomit only if entity is alive + // Ignore condition if force was set to true + if (!force && _mobstate.IsDead(uid)) + return; + // Vomiting makes you hungrier and thirstier if (TryComp(uid, out var hunger)) _hunger.ModifyHunger(uid, hungerAdded, hunger);