Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hushed trait #2106

Merged
merged 9 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Content.Server/Chat/Systems/ChatSystem.cs
deltanedas marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
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;
Expand Down Expand Up @@ -221,6 +222,15 @@ public void TrySendInGameICMessage(
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
Expand Down
6 changes: 6 additions & 0 deletions Content.Shared/DeltaV/Speech/HushedComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
using Robust.Shared.GameStates;

namespace Content.Shared.Speech.Hushing;

[RegisterComponent, NetworkedComponent]
public sealed partial class HushedComponent : Component;
3 changes: 3 additions & 0 deletions Resources/Locale/en-US/deltav/traits/traits.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 11 additions & 0 deletions Resources/Prototypes/DeltaV/Traits/speech.yml
Original file line number Diff line number Diff line change
@@ -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