diff --git a/Content.Server/Speech/EntitySystems/BarkAccentSystem.cs b/Content.Server/Speech/EntitySystems/BarkAccentSystem.cs index 52387cf0ff8..06f4a647f06 100644 --- a/Content.Server/Speech/EntitySystems/BarkAccentSystem.cs +++ b/Content.Server/Speech/EntitySystems/BarkAccentSystem.cs @@ -38,10 +38,10 @@ public string Accentuate(string message) } return message.Replace("!", _random.Pick(Barks)) - .Replace("l", "r").Replace("L", "R") //Corvax-Localization-Start + .Replace("l", "r").Replace("L", "R") .Replace("л", "р").Replace("Л", "Р"); - //Corvax-Localization-End + //Corvax-Localization-End } private void OnAccent(EntityUid uid, BarkAccentComponent component, AccentGetEvent args) diff --git a/Content.Server/Speech/EntitySystems/FrontalLispSystem.cs b/Content.Server/Speech/EntitySystems/FrontalLispSystem.cs index 1508a8b2d43..b442b6a8eae 100644 --- a/Content.Server/Speech/EntitySystems/FrontalLispSystem.cs +++ b/Content.Server/Speech/EntitySystems/FrontalLispSystem.cs @@ -1,5 +1,6 @@ using System.Text.RegularExpressions; using Content.Server.Speech.Components; +using Robust.Shared.Random; // Corvax-Localization namespace Content.Server.Speech.EntitySystems; @@ -12,6 +13,8 @@ public sealed class FrontalLispSystem : EntitySystem private static readonly Regex RegexLowerEcks = new(@"[e]+[x]+[c]*|[x]+"); // @formatter:on + [Dependency] private readonly IRobustRandom _random = default!; // Corvax-Localization + public override void Initialize() { base.Initialize(); @@ -29,6 +32,15 @@ private void OnAccent(EntityUid uid, FrontalLispComponent component, AccentGetEv message = RegexUpperEcks.Replace(message, "EKTH"); message = RegexLowerEcks.Replace(message, "ekth"); + // Corvax-Localization Start + // с, в, ч, т in ф or ш + message = Regex.Replace(message, @"\B[СВЧТ]\B", _random.Prob(0.5f) ? "Ф" : "Ш"); + message = Regex.Replace(message, @"\B[свчт]\B", _random.Prob(0.5f) ? "ф" : "ш"); + // д in ф + message = Regex.Replace(message, @"\b[Д](?![ИЕЁЮЯЬ])\b|\B[Д]\B", "Ф"); + message = Regex.Replace(message, @"\b[Дд](?![ИиЕеЁёЮюЯяЬь])\b|\B[Дд]\B", "ф"); + // Corvax-Localization End + args.Message = message; } } diff --git a/Content.Server/Speech/EntitySystems/MonkeyAccentSystem.cs b/Content.Server/Speech/EntitySystems/MonkeyAccentSystem.cs index f2813d8245c..21cf3fe7364 100644 --- a/Content.Server/Speech/EntitySystems/MonkeyAccentSystem.cs +++ b/Content.Server/Speech/EntitySystems/MonkeyAccentSystem.cs @@ -28,23 +28,23 @@ public string Accentuate(string message) { foreach (var _ in word) { - accentedMessage.Append('O'); + accentedMessage.Append('У'); // Corvax-Localization } if (_random.NextDouble() >= 0.3) - accentedMessage.Append('K'); + accentedMessage.Append('К'); // Corvax-Localization } else - accentedMessage.Append('O'); + accentedMessage.Append('У'); // Corvax-Localization } else { foreach (var _ in word) { if (_random.NextDouble() >= 0.8) - accentedMessage.Append('H'); + accentedMessage.Append('Г'); // Corvax-Localization else - accentedMessage.Append('A'); + accentedMessage.Append('А'); // Corvax-Localization } } diff --git a/Content.Server/Speech/EntitySystems/OwOAccentSystem.cs b/Content.Server/Speech/EntitySystems/OwOAccentSystem.cs index 906da0713e5..619e1eacbc5 100644 --- a/Content.Server/Speech/EntitySystems/OwOAccentSystem.cs +++ b/Content.Server/Speech/EntitySystems/OwOAccentSystem.cs @@ -14,6 +14,7 @@ public sealed class OwOAccentSystem : EntitySystem private static readonly IReadOnlyDictionary SpecialWords = new Dictionary() { { "you", "wu" }, + { "ты", "ти" }, // Corvax-Localization }; public override void Initialize() diff --git a/Content.Server/Speech/EntitySystems/SlurredSystem.cs b/Content.Server/Speech/EntitySystems/SlurredSystem.cs index e396cd0b186..4a4a3af64ae 100644 --- a/Content.Server/Speech/EntitySystems/SlurredSystem.cs +++ b/Content.Server/Speech/EntitySystems/SlurredSystem.cs @@ -71,6 +71,12 @@ private string Accentuate(string message, float scale) 'a' => "ah", 'u' => "oo", 'c' => "k", + // Corvax-Localization Start + 'о' => "а", + 'к' => "кх", + 'щ' => "шч", + 'ц' => "тс", + // Corvax-Localization End _ => $"{character}", }; @@ -90,7 +96,7 @@ private string Accentuate(string message, float scale) } } - if (!_random.Prob(scale * 3/20)) + if (!_random.Prob(scale * 3 / 20)) { sb.Append(character); continue; diff --git a/Content.Server/Speech/EntitySystems/StutteringSystem.cs b/Content.Server/Speech/EntitySystems/StutteringSystem.cs index d6e3c0b749a..ef7ae505bf4 100644 --- a/Content.Server/Speech/EntitySystems/StutteringSystem.cs +++ b/Content.Server/Speech/EntitySystems/StutteringSystem.cs @@ -13,7 +13,7 @@ public sealed class StutteringSystem : SharedStutteringSystem [Dependency] private readonly IRobustRandom _random = default!; // Regex of characters to stutter. - private static readonly Regex Stutter = new(@"[b-df-hj-np-tv-wxyz]", + private static readonly Regex Stutter = new(@"[b-df-hj-np-tv-wxyz-б-вд-к-лмн-прст]", // Corvax-Localization RegexOptions.Compiled | RegexOptions.IgnoreCase); public override void Initialize()