From 2565a045ca0772a9aa9360439ebf2493d228f77d Mon Sep 17 00:00:00 2001 From: Errant <35878406+Errant-4@users.noreply.github.com> Date: Tue, 22 Aug 2023 06:05:16 +0000 Subject: [PATCH] Deathgasp changes for mutes (#19025) Co-authored-by: Errant <35878406+errant@users.noreply.github.com> --- Content.Server/Mobs/CritMobActionsSystem.cs | 12 ++++++++++++ Content.Server/Mobs/DeathgaspSystem.cs | 4 ++++ Resources/Locale/en-US/speech/speech-effects.ftl | 1 + 3 files changed, 17 insertions(+) diff --git a/Content.Server/Mobs/CritMobActionsSystem.cs b/Content.Server/Mobs/CritMobActionsSystem.cs index 47da6961e7..d8f8c4ea13 100644 --- a/Content.Server/Mobs/CritMobActionsSystem.cs +++ b/Content.Server/Mobs/CritMobActionsSystem.cs @@ -2,6 +2,9 @@ using Content.Server.Chat.Systems; using Content.Server.GameTicking; using Content.Server.Mind.Components; +using Content.Server.Popups; +using Content.Server.Speech.Muting; +using Content.Shared.ActionBlocker; using Content.Shared.Actions; using Content.Shared.Mobs.Components; using Content.Shared.Mobs.Systems; @@ -16,10 +19,12 @@ namespace Content.Server.Mobs; /// public sealed class CritMobActionsSystem : EntitySystem { + [Dependency] private readonly ActionBlockerSystem _actionBlocker = default!; [Dependency] private readonly ChatSystem _chat = default!; [Dependency] private readonly DeathgaspSystem _deathgasp = default!; [Dependency] private readonly IServerConsoleHost _host = default!; [Dependency] private readonly MobStateSystem _mobState = default!; + [Dependency] private readonly PopupSystem _popupSystem = default!; [Dependency] private readonly QuickDialogSystem _quickDialog = default!; private const int MaxLastWordsLength = 30; @@ -47,6 +52,12 @@ public sealed class CritMobActionsSystem : EntitySystem if (!_mobState.IsCritical(uid)) return; + if (HasComp(uid)) + { + _popupSystem.PopupEntity(Loc.GetString("fake-death-muted"), uid, uid); + return; + } + args.Handled = _deathgasp.Deathgasp(uid); } @@ -58,6 +69,7 @@ public sealed class CritMobActionsSystem : EntitySystem _quickDialog.OpenDialog(actor.PlayerSession, Loc.GetString("action-name-crit-last-words"), "", (string lastWords) => { + // Intentionally does not check for muteness if (actor.PlayerSession.AttachedEntity != uid || !_mobState.IsCritical(uid)) return; diff --git a/Content.Server/Mobs/DeathgaspSystem.cs b/Content.Server/Mobs/DeathgaspSystem.cs index ef1cf24932..3919d9a4be 100644 --- a/Content.Server/Mobs/DeathgaspSystem.cs +++ b/Content.Server/Mobs/DeathgaspSystem.cs @@ -1,4 +1,5 @@ using Content.Server.Chat.Systems; +using Content.Server.Speech.Muting; using Content.Shared.Mobs; using Robust.Shared.Prototypes; @@ -33,6 +34,9 @@ public sealed class DeathgaspSystem: EntitySystem if (!Resolve(uid, ref component, false)) return false; + if (HasComp(uid)) + return false; + _chat.TryEmoteWithChat(uid, component.Prototype, ignoreActionBlocker: true); return true; diff --git a/Resources/Locale/en-US/speech/speech-effects.ftl b/Resources/Locale/en-US/speech/speech-effects.ftl index 9f5ae07051..d017a199bd 100644 --- a/Resources/Locale/en-US/speech/speech-effects.ftl +++ b/Resources/Locale/en-US/speech/speech-effects.ftl @@ -1 +1,2 @@ speech-muted = You can't speak right now! +fake-death-muted = You can't fake your death without a voice!