diff --git a/Content.Server/Chat/Systems/ChatSystem.cs b/Content.Server/Chat/Systems/ChatSystem.cs index 5fcbf6a051..390faab756 100644 --- a/Content.Server/Chat/Systems/ChatSystem.cs +++ b/Content.Server/Chat/Systems/ChatSystem.cs @@ -196,6 +196,8 @@ public sealed partial class ChatSystem : SharedChatSystem if (!CanSendInGame(message, shell, player)) return; + ignoreActionBlocker = CheckIgnoreSpeechBlocker(source, ignoreActionBlocker); + // this method is a disaster // every second i have to spend working with this code is fucking agony // scientists have to wonder how any of this was merged @@ -239,7 +241,7 @@ public sealed partial class ChatSystem : SharedChatSystem { if (TryProccessRadioMessage(source, message, out var modMessage, out var channel)) { - SendEntityWhisper(source, modMessage, range, channel, nameOverride, ignoreActionBlocker); + SendEntityWhisper(source, modMessage, range, channel, nameOverride, hideLog, ignoreActionBlocker); return; } } @@ -734,6 +736,17 @@ public sealed partial class ChatSystem : SharedChatSystem return ev.Message; } + + public bool CheckIgnoreSpeechBlocker(EntityUid sender, bool ignoreBlocker) + { + if (ignoreBlocker) + return ignoreBlocker; + + var ev = new CheckIgnoreSpeechBlockerEvent(sender, ignoreBlocker); + RaiseLocalEvent(sender, ev, true); + + return ev.IgnoreBlocker; + } private IEnumerable GetDeadChatClients() { @@ -872,6 +885,18 @@ public sealed class TransformSpeechEvent : EntityEventArgs } } +public sealed class CheckIgnoreSpeechBlockerEvent : EntityEventArgs +{ + public EntityUid Sender; + public bool IgnoreBlocker; + + public CheckIgnoreSpeechBlockerEvent(EntityUid sender, bool ignoreBlocker) + { + Sender = sender; + IgnoreBlocker = ignoreBlocker; + } +} + /// /// Raised on an entity when it speaks, either through 'say' or 'whisper'. /// diff --git a/Content.Server/Speech/Components/UnblockableSpeechComponent.cs b/Content.Server/Speech/Components/UnblockableSpeechComponent.cs new file mode 100644 index 0000000000..48e2b9863a --- /dev/null +++ b/Content.Server/Speech/Components/UnblockableSpeechComponent.cs @@ -0,0 +1,7 @@ +namespace Content.Server.Speech.Components +{ + [RegisterComponent] + public sealed partial class UnblockableSpeechComponent : Component + { + } +} diff --git a/Content.Server/Speech/EntitySystems/UnblockableSpeechSystem.cs b/Content.Server/Speech/EntitySystems/UnblockableSpeechSystem.cs new file mode 100644 index 0000000000..35a77c31f6 --- /dev/null +++ b/Content.Server/Speech/EntitySystems/UnblockableSpeechSystem.cs @@ -0,0 +1,18 @@ +using Content.Server.Chat.Systems; +using Content.Server.Speech.Components; + +namespace Content.Server.Speech.EntitySystems +{ + public sealed class UnblockableSpeechSystem : EntitySystem + { + public override void Initialize() + { + SubscribeLocalEvent(OnCheck); + } + + private void OnCheck(EntityUid uid, UnblockableSpeechComponent component, CheckIgnoreSpeechBlockerEvent args) + { + args.IgnoreBlocker = true; + } + } +} diff --git a/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml b/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml index fe8e0b5345..fc2a75780a 100644 --- a/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml +++ b/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml @@ -124,6 +124,7 @@ - type: Speech speechVerb: Robotic speechSounds: Pai + - type: UnblockableSpeech - type: Construction graph: Cyborg containers: