Skip to content

Commit

Permalink
HushedUpdate
Browse files Browse the repository at this point in the history
  • Loading branch information
Vonsant committed Jan 1, 2025
1 parent 19c520b commit 8e053ae
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 2 deletions.
52 changes: 52 additions & 0 deletions Content.Server/_CorvaxNext/Speech/EntitySystems/HushedSystem.cs
Original file line number Diff line number Diff line change
@@ -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<HushedComponent, ScreamActionEvent>(OnScreamAction, before: new[] { typeof(VocalSystem) });
SubscribeLocalEvent<HushedComponent, EmoteEvent>(OnEmote, before: new[] { 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))
{
_popupSystem.PopupEntity(Loc.GetString("speech-hushed-vocal-emote-blocked"), uid, uid);

args.Handled = true;
}
}
}
}
2 changes: 2 additions & 0 deletions Resources/Locale/ru-RU/_corvaxnext/speech/speech-effects.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
speech-hushed-scream-blocked = Вы слишком скромны для крика.
speech-hushed-vocal-emote-blocked = Вы чувствуете себя неуверенно.
2 changes: 1 addition & 1 deletion Resources/Locale/ru-RU/_corvaxnext/traits/traits.ftl
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
trait-hushed-name = Тихоня
trait-hushed-desc = Вы слишком скромны и можете говорить только шёпотом.
trait-hushed-desc = Вы слишком скромны и можете говорить только шёпотом.
3 changes: 2 additions & 1 deletion Resources/Prototypes/_CorvaxNext/Traits/speech.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
components:
- BorgChassis
components:
- type: Hushed
- type: Hushed

0 comments on commit 8e053ae

Please sign in to comment.