CatStation/Content.Shared/Speech/EntitySystems/RussianAccentSystem.cs
Pok 7a8fab78e3
Move Accents to Shared v2 (#44772)
* move-accents-to-shared

* Update AccentSystem.cs

* Update ListeningSystem.cs

* aaaaaa

* Update AccentSystem.cs

* oh god

* aaooao

* //

* review

* fix

* Update VocalSystem.cs
2026-07-25 22:29:39 +00:00

40 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 System.Text;
using Content.Shared.Speech.Components;
namespace Content.Shared.Speech.EntitySystems;
public sealed partial class RussianAccentSystem : RelayAccentSystem<RussianAccentComponent>
{
[Dependency] private ReplacementAccentSystem _replacement = default!;
public override string Accentuate(string message, Entity<RussianAccentComponent>? ent = null)
{
var accentedMessage = new StringBuilder(_replacement.ApplyReplacements(message, "russian", ent?.Owner));
for (var i = 0; i < accentedMessage.Length; i++)
{
var c = accentedMessage[i];
accentedMessage[i] = c switch
{
'A' => 'Д',
'b' => 'в',
'N' => 'И',
'n' => 'и',
'K' => 'К',
'k' => 'к',
'm' => 'м',
'h' => 'н',
't' => 'т',
'R' => 'Я',
'r' => 'я',
'Y' => 'У',
'W' => 'Ш',
'w' => 'ш',
_ => accentedMessage[i]
};
}
return accentedMessage.ToString();
}
}