mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-10-06 06:17:26 +00:00
* created the AccentComponent and the AccentSystem
* word replacement schtuhff
* made it a trait fr ongg!!1
* Update Content.Server/Speech/EntitySystems/SouthernAccentSystem.cs
---------
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
(cherry picked from commit 6b7427e3ee)
29 lines
919 B
C#
29 lines
919 B
C#
using System.Text.RegularExpressions;
|
|
using Content.Server.Speech.Components;
|
|
|
|
namespace Content.Server.Speech.EntitySystems;
|
|
|
|
public sealed class SouthernAccentSystem : EntitySystem
|
|
{
|
|
[Dependency] private readonly ReplacementAccentSystem _replacement = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
SubscribeLocalEvent<SouthernAccentComponent, AccentGetEvent>(OnAccent);
|
|
}
|
|
|
|
private void OnAccent(EntityUid uid, SouthernAccentComponent component, AccentGetEvent args)
|
|
{
|
|
var message = args.Message;
|
|
|
|
message = _replacement.ApplyReplacements(message, "southern");
|
|
|
|
//They shoulda started runnin' an' hidin' from me!
|
|
message = Regex.Replace(message, @"ing\b", "in'");
|
|
message = Regex.Replace(message, @"\band\b", "an'");
|
|
message = Regex.Replace(message, "d've", "da");
|
|
args.Message = message;
|
|
}
|
|
};
|