Add hushed trait (#2106)
* Add new speech trait: Hushed * Hushed entities' local messages will now be whispers * Sepeate Hushed check from prefix removal * Move to Delta-v Namespace * Minor refactoring * Bug fixes * Change to file scoped namespace * Change comments more in line to DeltaV
This commit is contained in:
parent
d7667f335f
commit
e06d593302
|
|
@ -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<HushedComponent>(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
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Shared.Speech.Hushing;
|
||||
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed partial class HushedComponent : Component;
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
Loading…
Reference in New Issue