Files
wwdpublic/Content.Server/_White/Speech/EntitySystems/ResomiAccentSystem.cs
PuroSlavKing 7ce954bd87 [Port] Resomi (#172)
* Resomi (#27)

* resomi

* locale + fix sprites

* displacements

* add sprites (not full (need to check up)) + agillity skill

* some stuff

* -_-

* фыф

* add

* fix

* Add sprites

* localisation

* fix

* вы нахуй меня дрочите?!!

---------

Co-authored-by: AwareFoxy <135021509+AwareFoxy@users.noreply.github.com>

* Create species.ftl

* first (#116)

* fix null

* fixiki

* more fixikov

* outer metas

* migrate

* fix rsi validation

* fix yaml linter

* build fix

* more migrate

* one more migrate

---------

Co-authored-by: pofitlo <kuzminvladislav237@gmail.com>
Co-authored-by: AwareFoxy <135021509+AwareFoxy@users.noreply.github.com>
2024-12-24 19:52:58 +07:00

62 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 System.Text.RegularExpressions;
using Content.Server._White.Speech.Components;
using Content.Server.Speech;
using Robust.Shared.Random;
namespace Content.Server._White.Speech.EntitySystems;
public sealed class ResomiAccentSystem : EntitySystem
{
[Dependency] private readonly IRobustRandom _random = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<ResomiAccentComponent, AccentGetEvent>(OnAccent);
}
private void OnAccent(EntityUid uid, ResomiAccentComponent component, AccentGetEvent args)
{
var message = args.Message;
// ш => шшш
message = Regex.Replace(
message,
"ш+",
_random.Pick(new List<string>() { "шш", "шшш" })
);
// Ш => ШШШ
message = Regex.Replace(
message,
"Ш+",
_random.Pick(new List<string>() { "ШШ", "ШШШ" })
);
// ч => щщщ
message = Regex.Replace(
message,
"ч+",
_random.Pick(new List<string>() { "щщ", "щщщ" })
);
// Ч => ЩЩЩ
message = Regex.Replace(
message,
"Ч+",
_random.Pick(new List<string>() { "ЩЩ", "ЩЩЩ" })
);
// р => ррр
message = Regex.Replace(
message,
"р+",
_random.Pick(new List<string>() { "рр", "ррр" })
);
// Р => РРР
message = Regex.Replace(
message,
"Р+",
_random.Pick(new List<string>() { "РР", "РРР" })
);
args.Message = message;
}
}