forked from space-syndicate/space-station-14
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* HushedUpdate * Update Content.Server/_CorvaxNext/Speech/EntitySystems/HushedSystem.cs Co-authored-by: FN <[email protected]> * Update speech.yml * Update HushedSystem.cs * Update speech-effects.ftl * Update HushedSystem.cs * Update HushedSystem.cs --------- Co-authored-by: FN <[email protected]>
- Loading branch information
1 parent
5418be6
commit b695d6c
Showing
4 changed files
with
54 additions
and
2 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
Content.Server/_CorvaxNext/Speech/EntitySystems/HushedSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
using Content.Server.Popups; | ||
using Content.Server.Speech.EntitySystems; | ||
using Content.Server.Chat.Systems; | ||
using Content.Shared.Speech; | ||
using Content.Shared.Speech.Muting; | ||
using Content.Shared.Speech.Hushing; | ||
using Content.Shared.Chat.Prototypes; | ||
using Content.Shared.Puppet; | ||
using Content.Shared.Actions; | ||
using Robust.Shared.Player; | ||
|
||
namespace Content.Server._CorvaxNext.Speech.EntitySystems; | ||
|
||
public sealed class HushedSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly PopupSystem _popupSystem = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
SubscribeLocalEvent<HushedComponent, ScreamActionEvent>(OnScreamAction, before: [typeof(VocalSystem)]); | ||
SubscribeLocalEvent<HushedComponent, EmoteEvent>(OnEmote, before: [typeof(VocalSystem)]); | ||
} | ||
|
||
private void OnScreamAction(EntityUid uid, HushedComponent component, ScreamActionEvent args) | ||
{ | ||
if (args.Handled) | ||
return; | ||
|
||
if (HasComp<MutedComponent>(uid)) | ||
return; | ||
|
||
_popupSystem.PopupEntity(Loc.GetString("speech-hushed-scream-blocked"), uid, uid); | ||
args.Handled = true; | ||
} | ||
|
||
private void OnEmote(EntityUid uid, HushedComponent component, ref EmoteEvent args) | ||
{ | ||
if (args.Handled) | ||
return; | ||
|
||
if (HasComp<MutedComponent>(uid)) | ||
return; | ||
|
||
if (!args.Emote.Category.HasFlag(EmoteCategory.Vocal)) | ||
return; | ||
|
||
_popupSystem.PopupEntity(Loc.GetString("speech-hushed-vocal-emote-blocked"), uid, uid); | ||
args.Handled = true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
speech-hushed-scream-blocked = Вы слишком скромны для крика. | ||
speech-hushed-vocal-emote-blocked = Вы чувствуете себя некомфортно. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
trait-hushed-name = Тихоня | ||
trait-hushed-desc = Вы слишком скромны и можете говорить только шёпотом. | ||
trait-hushed-desc = Вы слишком скромны и можете говорить только шёпотом. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,4 @@ | |
components: | ||
- BorgChassis | ||
components: | ||
- type: Hushed | ||
- type: Hushed |