Deathgasp changes for mutes (#19025)
Co-authored-by: Errant <35878406+errant@users.noreply.github.com>
This commit is contained in:
@@ -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;
|
||||
/// </summary>
|
||||
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<MutedComponent>(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;
|
||||
|
||||
Reference in New Issue
Block a user