Skip to content

Commit

Permalink
Обновление акцента "Тихоня" (#213)
Browse files Browse the repository at this point in the history
* 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
Vonsant and FireNameFN authored Jan 1, 2025
1 parent 5418be6 commit b695d6c
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 2 deletions.
50 changes: 50 additions & 0 deletions Content.Server/_CorvaxNext/Speech/EntitySystems/HushedSystem.cs
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;
}
}
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 = Вы слишком скромны и можете говорить только шёпотом.
2 changes: 1 addition & 1 deletion Resources/Prototypes/_CorvaxNext/Traits/speech.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
components:
- BorgChassis
components:
- type: Hushed
- type: Hushed

0 comments on commit b695d6c

Please sign in to comment.