diff --git a/Content.Server/_CorvaxNext/Speech/EntitySystems/HushedSystem.cs b/Content.Server/_CorvaxNext/Speech/EntitySystems/HushedSystem.cs new file mode 100644 index 00000000000..f403b77dac6 --- /dev/null +++ b/Content.Server/_CorvaxNext/Speech/EntitySystems/HushedSystem.cs @@ -0,0 +1,52 @@ +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(OnScreamAction, before: new[] { typeof(VocalSystem) }); + SubscribeLocalEvent(OnEmote, before: new[] { typeof(VocalSystem) }); + } + + private void OnScreamAction(EntityUid uid, HushedComponent component, ScreamActionEvent args) + { + if (args.Handled) + return; + + if (HasComp(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(uid)) + return; + + if (args.Emote.Category.HasFlag(EmoteCategory.Vocal)) + { + _popupSystem.PopupEntity(Loc.GetString("speech-hushed-vocal-emote-blocked"), uid, uid); + + args.Handled = true; + } + } + } +} diff --git a/Resources/Locale/ru-RU/_corvaxnext/speech/speech-effects.ftl b/Resources/Locale/ru-RU/_corvaxnext/speech/speech-effects.ftl new file mode 100644 index 00000000000..92f930e4cf2 --- /dev/null +++ b/Resources/Locale/ru-RU/_corvaxnext/speech/speech-effects.ftl @@ -0,0 +1,2 @@ +speech-hushed-scream-blocked = Вы слишком скромны для крика. +speech-hushed-vocal-emote-blocked = Вы чувствуете себя неуверенно. diff --git a/Resources/Locale/ru-RU/_corvaxnext/traits/traits.ftl b/Resources/Locale/ru-RU/_corvaxnext/traits/traits.ftl index 99234245842..ca416b903b0 100644 --- a/Resources/Locale/ru-RU/_corvaxnext/traits/traits.ftl +++ b/Resources/Locale/ru-RU/_corvaxnext/traits/traits.ftl @@ -1,2 +1,2 @@ trait-hushed-name = Тихоня -trait-hushed-desc = Вы слишком скромны и можете говорить только шёпотом. \ No newline at end of file +trait-hushed-desc = Вы слишком скромны и можете говорить только шёпотом. diff --git a/Resources/Prototypes/_CorvaxNext/Traits/speech.yml b/Resources/Prototypes/_CorvaxNext/Traits/speech.yml index b2bc2e907f8..18d678b2843 100644 --- a/Resources/Prototypes/_CorvaxNext/Traits/speech.yml +++ b/Resources/Prototypes/_CorvaxNext/Traits/speech.yml @@ -8,4 +8,5 @@ components: - BorgChassis components: - - type: Hushed \ No newline at end of file + - type: Hushed + \ No newline at end of file