diff --git a/Content.Server/Chat/Systems/ChatSystem.cs b/Content.Server/Chat/Systems/ChatSystem.cs index 4c88e8cc5a..3b4eb5f801 100644 --- a/Content.Server/Chat/Systems/ChatSystem.cs +++ b/Content.Server/Chat/Systems/ChatSystem.cs @@ -8,6 +8,7 @@ using Content.Server.GameTicking; using Content.Server.Players.RateLimiting; using Content.Server.Speech.Components; using Content.Server.Speech.EntitySystems; +using Content.Shared.Speech.Hushing; // DeltaV using Content.Server.Nyanotrasen.Chat; using Content.Server.Speech.Components; using Content.Server.Speech.EntitySystems; @@ -221,6 +222,15 @@ public sealed partial class ChatSystem : SharedChatSystem message = message[1..]; } + // DeltaV - Hushed trait logic + // This needs to happen after prefix removal to avoid bug + if (desiredType == InGameICChatType.Speak && HasComp(source)) + { + // hushed players cannot speak on local chat so will be sent as whisper instead + desiredType = InGameICChatType.Whisper; + } + // DeltaV - End hushed trait logic + bool shouldCapitalize = (desiredType != InGameICChatType.Emote); bool shouldPunctuate = _configurationManager.GetCVar(CCVars.ChatPunctuation); // Capitalizing the word I only happens in English, so we check language here diff --git a/Content.Shared/DeltaV/Speech/HushedComponent.cs b/Content.Shared/DeltaV/Speech/HushedComponent.cs new file mode 100644 index 0000000000..db13e31438 --- /dev/null +++ b/Content.Shared/DeltaV/Speech/HushedComponent.cs @@ -0,0 +1,6 @@ +using Robust.Shared.GameStates; + +namespace Content.Shared.Speech.Hushing; + +[RegisterComponent, NetworkedComponent] +public sealed partial class HushedComponent : Component; diff --git a/Resources/Locale/en-US/deltav/traits/traits.ftl b/Resources/Locale/en-US/deltav/traits/traits.ftl index 489816a9c2..4c5444ec98 100644 --- a/Resources/Locale/en-US/deltav/traits/traits.ftl +++ b/Resources/Locale/en-US/deltav/traits/traits.ftl @@ -21,5 +21,8 @@ trait-deuteranopia-name = Deuteranopia trait-deuteranopia-desc = Whether through custom bionic eyes, random mutation, or being a Vulpkanin, you have red–green colour blindness. +trait-hushed-name = Hushed +trait-hushed-desc = You are unable to speak louder than a whisper. + trait-uncloneable-name = Uncloneable trait-uncloneable-desc = Cannot be cloned diff --git a/Resources/Prototypes/DeltaV/Traits/speech.yml b/Resources/Prototypes/DeltaV/Traits/speech.yml new file mode 100644 index 0000000000..4876edd53e --- /dev/null +++ b/Resources/Prototypes/DeltaV/Traits/speech.yml @@ -0,0 +1,11 @@ +- type: trait + id: Hushed + name: trait-hushed-name + description: trait-hushed-desc + category: SpeechTraits + cost: 0 + blacklist: + components: + - BorgChassis + components: + - type: Hushed