]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Southern accent (#26543)
authorUBlueberry <161545003+UBlueberry@users.noreply.github.com>
Sun, 31 Mar 2024 04:39:40 +0000 (00:39 -0400)
committerGitHub <noreply@github.com>
Sun, 31 Mar 2024 04:39:40 +0000 (15:39 +1100)
* created the AccentComponent and the AccentSystem

* word replacement schtuhff

* made it a trait fr ongg!!1

* Update Content.Server/Speech/EntitySystems/SouthernAccentSystem.cs

---------

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Content.Server/Speech/Components/SouthernAccentComponent.cs [new file with mode: 0644]
Content.Server/Speech/EntitySystems/SouthernAccentSystem.cs [new file with mode: 0644]
Resources/Locale/en-US/accent/southern.ftl [new file with mode: 0644]
Resources/Locale/en-US/traits/traits.ftl
Resources/Prototypes/Accents/word_replacements.yml
Resources/Prototypes/Traits/neutral.yml

diff --git a/Content.Server/Speech/Components/SouthernAccentComponent.cs b/Content.Server/Speech/Components/SouthernAccentComponent.cs
new file mode 100644 (file)
index 0000000..0c44290
--- /dev/null
@@ -0,0 +1,8 @@
+using Content.Server.Speech.EntitySystems;
+
+namespace Content.Server.Speech.Components;
+
+[RegisterComponent]
+[Access(typeof(SouthernAccentSystem))]
+public sealed partial class SouthernAccentComponent : Component
+{ }
diff --git a/Content.Server/Speech/EntitySystems/SouthernAccentSystem.cs b/Content.Server/Speech/EntitySystems/SouthernAccentSystem.cs
new file mode 100644 (file)
index 0000000..4d40136
--- /dev/null
@@ -0,0 +1,28 @@
+using System.Text.RegularExpressions;
+using Content.Server.Speech.Components;
+
+namespace Content.Server.Speech.EntitySystems;
+
+public sealed class SouthernAccentSystem : EntitySystem
+{
+    [Dependency] private readonly ReplacementAccentSystem _replacement = default!;
+    
+    public override void Initialize()
+    {
+        base.Initialize();
+        SubscribeLocalEvent<SouthernAccentComponent, AccentGetEvent>(OnAccent);
+    }
+
+    private void OnAccent(EntityUid uid, SouthernAccentComponent component, AccentGetEvent args)
+    {
+        var message = args.Message;
+
+        message = _replacement.ApplyReplacements(message, "southern");
+
+        //They shoulda started runnin' an' hidin' from me!
+        message = Regex.Replace(message, @"ing\b", "in'");
+        message = Regex.Replace(message, @"\band\b", "an'");
+        message = Regex.Replace(message, "d've", "da");
+        args.Message = message;
+    }
+};
diff --git a/Resources/Locale/en-US/accent/southern.ftl b/Resources/Locale/en-US/accent/southern.ftl
new file mode 100644 (file)
index 0000000..7e1657a
--- /dev/null
@@ -0,0 +1,17 @@
+accent-southern-words-1 = you all
+accent-southern-words-replace-1 = y'all
+
+accent-southern-words-2 = you guys
+accent-southern-words-replace-2 = y'all
+
+accent-southern-words-3 = isn't
+accent-southern-words-replace-3 = ain't
+
+accent-southern-words-4 = is not
+accent-southern-words-replace-4 = ain't
+
+accent-southern-words-5 = aren't
+accent-southern-words-replace-5 = ain't
+
+accent-southern-words-6 = are not
+accent-southern-words-replace-6 = ain't
index b82cb0033a768e361a7f0e5e61c868bc7292f86f..98f0817f744337e6d91b7559e197733cdb1903ca 100644 (file)
@@ -33,5 +33,8 @@ trait-frontal-lisp-desc = You thpeak with a lithp
 trait-socialanxiety-name = Social Anxiety
 trait-socialanxiety-desc = You are anxious when you speak and stutter.
 
+trait-southern-name = Southern Drawl
+trait-southern-desc = Are you wonderin' what this does?
+
 trait-snoring-name = Snoring
 trait-snoring-desc = You will snore while sleeping.
index abcfeded22b7e5131efd5119be975c8a25411b2b..3fadc69010aca066f5dcafc7db96c0f9f1fd3f3d 100644 (file)
     accent-cowboy-words-98: accent-cowboy-replacement-98
     accent-cowboy-words-99: accent-cowboy-replacement-99
 
+- type: accent
+  id: southern
+  wordReplacements:
+    accent-southern-words-1: accent-southern-words-replace-1
+    accent-southern-words-2: accent-southern-words-replace-2
+    accent-southern-words-3: accent-southern-words-replace-3
+    accent-southern-words-4: accent-southern-words-replace-4
+    accent-southern-words-5: accent-southern-words-replace-5
+    accent-southern-words-6: accent-southern-words-replace-6
 
 # For the chat sanitization system
 - type: accent
index 9e7f7655076f16c83231e09ab39536710672c619..ba9bd8d88682abf7cfb41f8a282c8bbe20f9821c 100644 (file)
     - type: MothAccent
     - type: ReplacementAccent
       accent: dwarf
+
+- type: trait
+  id: Southern
+  name: trait-southern-name
+  description: trait-southern-desc
+  components:
+    - type: SouthernAccent