From: UBlueberry <161545003+UBlueberry@users.noreply.github.com> Date: Sun, 31 Mar 2024 04:39:40 +0000 (-0400) Subject: Southern accent (#26543) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=6b7427e3ee8a4453d30b585e0fc4fa734f5f46d5;p=space-station-14.git Southern accent (#26543) * 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> --- diff --git a/Content.Server/Speech/Components/SouthernAccentComponent.cs b/Content.Server/Speech/Components/SouthernAccentComponent.cs new file mode 100644 index 0000000000..0c44290086 --- /dev/null +++ b/Content.Server/Speech/Components/SouthernAccentComponent.cs @@ -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 index 0000000000..4d401367cc --- /dev/null +++ b/Content.Server/Speech/EntitySystems/SouthernAccentSystem.cs @@ -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(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 index 0000000000..7e1657a3ed --- /dev/null +++ b/Resources/Locale/en-US/accent/southern.ftl @@ -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 diff --git a/Resources/Locale/en-US/traits/traits.ftl b/Resources/Locale/en-US/traits/traits.ftl index b82cb0033a..98f0817f74 100644 --- a/Resources/Locale/en-US/traits/traits.ftl +++ b/Resources/Locale/en-US/traits/traits.ftl @@ -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. diff --git a/Resources/Prototypes/Accents/word_replacements.yml b/Resources/Prototypes/Accents/word_replacements.yml index abcfeded22..3fadc69010 100644 --- a/Resources/Prototypes/Accents/word_replacements.yml +++ b/Resources/Prototypes/Accents/word_replacements.yml @@ -367,6 +367,15 @@ 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 diff --git a/Resources/Prototypes/Traits/neutral.yml b/Resources/Prototypes/Traits/neutral.yml index 9e7f765507..ba9bd8d886 100644 --- a/Resources/Prototypes/Traits/neutral.yml +++ b/Resources/Prototypes/Traits/neutral.yml @@ -16,3 +16,10 @@ - type: MothAccent - type: ReplacementAccent accent: dwarf + +- type: trait + id: Southern + name: trait-southern-name + description: trait-southern-desc + components: + - type: SouthernAccent