Skip to content

Commit

Permalink
Frontal lisp tweaks (#2264)
Browse files Browse the repository at this point in the history
  • Loading branch information
lzk228 authored Jun 19, 2024
1 parent d2eb8a0 commit 362e5ca
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions Content.Server/Speech/EntitySystems/FrontalLispSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 362e5ca

Please sign in to comment.