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

Обновление акцента "Тихоня" #213

Merged
merged 7 commits into from
Jan 1, 2025
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
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
Loading