Fix muzzle accent (#34419)

This commit is contained in:
themias
2025-01-14 19:10:39 -05:00
committed by GitHub
parent e885a8f1ce
commit 771278df54
3 changed files with 33 additions and 2 deletions

View File

@@ -0,0 +1,7 @@
namespace Content.Server.Speech.Components;
[RegisterComponent]
public sealed partial class MumbleAccentComponent : Component
{
}

View File

@@ -0,0 +1,25 @@
using Content.Server.Speech.Components;
namespace Content.Server.Speech.EntitySystems;
public sealed class MumbleAccentSystem : EntitySystem
{
[Dependency] private readonly ReplacementAccentSystem _replacement = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<MumbleAccentComponent, AccentGetEvent>(OnAccentGet);
}
public string Accentuate(string message, MumbleAccentComponent component)
{
return _replacement.ApplyReplacements(message, "mumble");
}
private void OnAccentGet(EntityUid uid, MumbleAccentComponent component, AccentGetEvent args)
{
args.Message = Accentuate(args.Message, component);
}
}

View File

@@ -319,8 +319,7 @@
unequipDelay: 3
- type: IngestionBlocker
- type: AddAccentClothing
accent: ReplacementAccent
replacement: mumble
accent: MumbleAccent
- type: Construction
graph: Muzzle
node: muzzle