From 22db95faaa645f077fd82ac3668c532a90c72b97 Mon Sep 17 00:00:00 2001 From: Kara Date: Sun, 2 Apr 2023 20:28:49 -0700 Subject: [PATCH] Dwarf minor content (#15082) * alcohol & body stuff * vocal changes * accent * dumb --- .../Speech/Components/DwarfAccentComponent.cs | 9 ++ .../Speech/EntitySystems/DwarfAccentSystem.cs | 83 +++++++++++++++++++ Resources/Prototypes/Body/Organs/dwarf.yml | 33 ++++++++ .../Prototypes/Body/Prototypes/dwarf.yml | 49 +++++++++++ .../Chemistry/metabolizer_types.yml | 5 +- .../Entities/Mobs/Species/dwarf.yml | 22 ++++- .../Reagents/Consumable/Drink/alcohol.yml | 23 +++++ .../Prototypes/Voice/speech_emote_sounds.yml | 11 +++ 8 files changed, 233 insertions(+), 2 deletions(-) create mode 100644 Content.Server/Speech/Components/DwarfAccentComponent.cs create mode 100644 Content.Server/Speech/EntitySystems/DwarfAccentSystem.cs create mode 100644 Resources/Prototypes/Body/Organs/dwarf.yml create mode 100644 Resources/Prototypes/Body/Prototypes/dwarf.yml diff --git a/Content.Server/Speech/Components/DwarfAccentComponent.cs b/Content.Server/Speech/Components/DwarfAccentComponent.cs new file mode 100644 index 0000000000..87609384f9 --- /dev/null +++ b/Content.Server/Speech/Components/DwarfAccentComponent.cs @@ -0,0 +1,9 @@ +namespace Content.Server.Speech.Components; + +/// +/// Used for replacing words for dwarves (pseudo-scottish) +/// +[RegisterComponent] +public sealed class DwarfAccentComponent : Component +{ +} diff --git a/Content.Server/Speech/EntitySystems/DwarfAccentSystem.cs b/Content.Server/Speech/EntitySystems/DwarfAccentSystem.cs new file mode 100644 index 0000000000..4231f26968 --- /dev/null +++ b/Content.Server/Speech/EntitySystems/DwarfAccentSystem.cs @@ -0,0 +1,83 @@ +using System.Text.RegularExpressions; +using Content.Server.Speech.Components; + +namespace Content.Server.Speech.EntitySystems; + +public sealed class DwarfAccentSystem : EntitySystem +{ + // TODO: + // these are pretty bad to have as static dicts in systems, ideally these all get moved to prototypes + // these can honestly stay unlocalized in prototypes? -- most of these word-replacers make zero sense to localize into other languages + // since they're so english-specific + // all of the 'word-replacers' should also probably respect capitalization when transformed, so all caps -> all caps + // and first letter capitalized -> first letter capitalized, at the very least + + // these specifically mostly come from examples of specific scottish-english (not necessarily scots) verbiage + // https://en.wikipedia.org/wiki/Scotticism + // https://en.wikipedia.org/wiki/Scottish_English + // https://www.cs.stir.ac.uk/~kjt/general/scots.html + private static readonly Dictionary DirectReplacements = new() + { + { "girl", "lassie" }, + { "boy", "laddie" }, + { "man", "lad" }, + { "woman", "lass" }, + { "do", "dae" }, + { "don't", "dinnae" }, + { "dont", "dinnae" }, + { "i'm", "A'm" }, + { "im", "am"}, + { "going", "gaun" }, + { "know", "ken"}, + { "i", "Ah" }, + { "you're", "ye're"}, + { "youre", "yere"}, + { "you", "ye" }, + { "i'll", "A'll" }, + { "ill", "all"}, + { "of", "ae" }, + { "was", "wis" }, + { "can't", "cannae" }, + { "cant", "cannae" }, + { "yourself", "yersel" }, + { "where", "whaur" }, + { "oh", "ach" }, + { "little", "wee" }, + { "small", "wee" }, + { "shit", "shite" }, + { "yeah", "aye" }, + { "yea", "aye"}, + { "yes", "aye" }, + { "too", "tae" }, + { "my", "ma" }, + { "not", "nae" }, + { "dad", "da" }, + { "mom", "maw" }, + }; + + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnAccentGet); + } + + public string Accentuate(string message) + { + // this is just word replacements right now, + // but leaving it open to more intelligent phonotactic manipulations at some point which are probably possible + var msg = message; + + foreach (var (first, replace) in DirectReplacements) + { + msg = Regex.Replace(msg, $@"(?