Southern accent (#26543)
* 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>
This commit is contained in:
28
Content.Server/Speech/EntitySystems/SouthernAccentSystem.cs
Normal file
28
Content.Server/Speech/EntitySystems/SouthernAccentSystem.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
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;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user