]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix muzzle accent (#34419)
authorthemias <89101928+themias@users.noreply.github.com>
Wed, 15 Jan 2025 00:10:39 +0000 (19:10 -0500)
committerGitHub <noreply@github.com>
Wed, 15 Jan 2025 00:10:39 +0000 (01:10 +0100)
Content.Server/Speech/Components/MumbleAccentComponent.cs [new file with mode: 0644]
Content.Server/Speech/EntitySystems/MumbleAccentSystem.cs [new file with mode: 0644]
Resources/Prototypes/Entities/Clothing/Masks/masks.yml

diff --git a/Content.Server/Speech/Components/MumbleAccentComponent.cs b/Content.Server/Speech/Components/MumbleAccentComponent.cs
new file mode 100644 (file)
index 0000000..0681eba
--- /dev/null
@@ -0,0 +1,7 @@
+namespace Content.Server.Speech.Components;
+
+[RegisterComponent]
+public sealed partial class MumbleAccentComponent : Component
+{
+
+}
diff --git a/Content.Server/Speech/EntitySystems/MumbleAccentSystem.cs b/Content.Server/Speech/EntitySystems/MumbleAccentSystem.cs
new file mode 100644 (file)
index 0000000..757f31a
--- /dev/null
@@ -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);
+    }
+}
index 8317f8af897fddbd1e5e82fff54b1d26e4280063..5a742a20e7d16777ed529222872e932899f099c1 100644 (file)
     unequipDelay: 3
   - type: IngestionBlocker
   - type: AddAccentClothing
-    accent: ReplacementAccent
-    replacement: mumble
+    accent: MumbleAccent
   - type: Construction
     graph: Muzzle
     node: muzzle