From c3f4f0b132f472636917e06220c4f376acfaef60 Mon Sep 17 00:00:00 2001 From: themias <89101928+themias@users.noreply.github.com> Date: Wed, 3 May 2023 13:24:00 -0400 Subject: [PATCH] Stop mimes from screaming or laughing (#16052) --- .../Abilities/Mime/MimePowersSystem.cs | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/Content.Server/Abilities/Mime/MimePowersSystem.cs b/Content.Server/Abilities/Mime/MimePowersSystem.cs index 6bec9c908a..9adc91610d 100644 --- a/Content.Server/Abilities/Mime/MimePowersSystem.cs +++ b/Content.Server/Abilities/Mime/MimePowersSystem.cs @@ -11,6 +11,10 @@ using Robust.Shared.Player; using Robust.Shared.Physics; using Robust.Shared.Physics.Components; using Robust.Shared.Timing; +using Content.Server.Chat.Systems; +using Content.Server.Speech.Components; +using Content.Shared.Chat.Prototypes; +using Content.Server.Speech.EntitySystems; namespace Content.Server.Abilities.Mime { @@ -28,6 +32,8 @@ namespace Content.Server.Abilities.Mime SubscribeLocalEvent(OnComponentInit); SubscribeLocalEvent(OnSpeakAttempt); SubscribeLocalEvent(OnInvisibleWall); + SubscribeLocalEvent(OnEmote, before: new[] { typeof(VocalSystem) }); + SubscribeLocalEvent(OnScreamAction, before: new[] { typeof(VocalSystem) }); } public override void Update(float frameTime) { @@ -60,6 +66,25 @@ namespace Content.Server.Abilities.Mime args.Cancel(); } + private void OnEmote(EntityUid uid, MimePowersComponent component, ref EmoteEvent args) + { + if (!component.Enabled || args.Handled) + return; + + //still leaves the text so it looks like they are pantomiming a laugh + if (args.Emote.Category.HasFlag(EmoteCategory.Vocal)) + args.Handled = true; + } + + private void OnScreamAction(EntityUid uid, MimePowersComponent component, ScreamActionEvent args) + { + if (!component.Enabled || args.Handled) + return; + + _popupSystem.PopupEntity(Loc.GetString("mime-cant-speak"), uid, uid); + args.Handled = true; + } + /// /// Creates an invisible wall in a free space after some checks. /// -- 2.51.2