Files
OldThink/Content.Server/Speech/EntitySystems/OwOAccentSystem.cs
ThereDrD 2b9e5e2437 Рандомфиксы (#590)
* remove brainrot from owo accent

* convert sounds to mono

* fix double cmo pants
2024-08-09 00:47:18 +03:00

41 lines
1.2 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using Content.Server.Speech.Components;
using Robust.Shared.Random;
namespace Content.Server.Speech.EntitySystems
{
public sealed class OwOAccentSystem : EntitySystem
{
private static readonly IReadOnlyDictionary<string, string> SpecialWords = new Dictionary<string, string>()
{
{ "you", "wu" },
{ "ты", "ти" } // WD
};
public override void Initialize()
{
SubscribeLocalEvent<OwOAccentComponent, AccentGetEvent>(OnAccent);
}
public string Accentuate(string message)
{
foreach (var (word, repl) in SpecialWords)
{
message = message.Replace(word, repl);
}
return message.Replace("r", "w").Replace("R", "W")
.Replace("l", "w").Replace("L", "W")
//WD-EDIT
.Replace("р", "в").Replace("Р", "В")
.Replace("л", "в").Replace("Л", "В");
//WD-EDIT
}
private void OnAccent(EntityUid uid, OwOAccentComponent component, AccentGetEvent args)
{
args.Message = Accentuate(args.Message);
}
}
}