fish-station/Content.Server/Speech/EntitySystems/OwOAccentSystem.cs
SplikZerys 73f4405ccf
Corrected Felinid Race (#242)
* FelinidAccent OWO comeback

* Revert min max Felinid age

* Update OwOAccentSystem.cs

* Update felinid.yml

* Update speech.yml

---------

Co-authored-by: Vigers Ray <60344369+VigersRay@users.noreply.github.com>
2024-07-26 04:29:49 +03:00

54 lines
1.7 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;
namespace Content.Server.Speech.EntitySystems
{
public sealed class OwOAccentSystem : EntitySystem
{
private static readonly IReadOnlyDictionary<string, string> SpecialWords = new Dictionary<string, string>()
{
{ "you", "wu" },
{ "You", "Wu"},
{ "cute", "kawaii" },
{ "Cute", "Kawaii" },
{ "cat", "kitty" },
{ "Cat", "Kitty" },
{ "kiss", "mwah" },
{ "Kiss", "Mwah" },
{ "good", "guwd" },
{ "Good", "Guwd" },
{ "no", "nuu" },
{ "No", "Nuu" },
{ "ты", "ти" }, // Russian-Localization
{ "Ты", "Ти" },
{ "маленький", "мавенки" },
{ "Маленький", "Мавенки" },
};
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
// Russian-Localization-Start
.Replace("р", "в").Replace("Р", "В")
.Replace("л", "в").Replace("Л", "В")
// Russian-Localization-End
.Replace("r", "w").Replace("R", "W")
.Replace("l", "w").Replace("L", "W");
}
private void OnAccent(EntityUid uid, OwOAccentComponent component, AccentGetEvent args)
{
args.Message = Accentuate(args.Message);
}
}
}