mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-18 22:18:52 +03:00
* 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>
62 lines
1.7 KiB
C#
62 lines
1.7 KiB
C#
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;
|
||
}
|
||
}
|