From 362e5ca2578bde38935b74d93724d8b0c2d7b507 Mon Sep 17 00:00:00 2001 From: lzk <124214523+lzk228@users.noreply.github.com> Date: Thu, 20 Jun 2024 00:09:05 +0200 Subject: [PATCH] Frontal lisp tweaks (#2264) --- .../Speech/EntitySystems/FrontalLispSystem.cs | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/Content.Server/Speech/EntitySystems/FrontalLispSystem.cs b/Content.Server/Speech/EntitySystems/FrontalLispSystem.cs index b442b6a8eae..954ad5b921b 100644 --- a/Content.Server/Speech/EntitySystems/FrontalLispSystem.cs +++ b/Content.Server/Speech/EntitySystems/FrontalLispSystem.cs @@ -33,12 +33,21 @@ private void OnAccent(EntityUid uid, FrontalLispComponent component, AccentGetEv 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", "ф"); + // с - ш + message = Regex.Replace(message, @"с", _random.Prob(0.90f) ? "ш" : "с"); + message = Regex.Replace(message, @"С", _random.Prob(0.90f) ? "Ш" : "С"); + // ч - ш + message = Regex.Replace(message, @"ч", _random.Prob(0.90f) ? "ш" : "ч"); + message = Regex.Replace(message, @"Ч", _random.Prob(0.90f) ? "Ш" : "Ч"); + // ц - ч + message = Regex.Replace(message, @"ц", _random.Prob(0.90f) ? "ч" : "ц"); + message = Regex.Replace(message, @"Ц", _random.Prob(0.90f) ? "Ч" : "Ц"); + // т - ч + message = Regex.Replace(message, @"\B[т](?![АЕЁИОУЫЭЮЯаеёиоуыэюя])", _random.Prob(0.90f) ? "ч" : "т"); + message = Regex.Replace(message, @"\B[Т](?![АЕЁИОУЫЭЮЯаеёиоуыэюя])", _random.Prob(0.90f) ? "Ч" : "Т"); + // з - ж + message = Regex.Replace(message, @"з", _random.Prob(0.90f) ? "ж" : "з"); + message = Regex.Replace(message, @"З", _random.Prob(0.90f) ? "Ж" : "З"); // Corvax-Localization End args.Message = message;