mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-18 14:07:53 +03:00
* Scottish Accent Draft * Add Accent Component and Accent System * Fix System and Component Slightly * Fixed Accent and Component * Fixed capitalization * Added Plural Words * God given right to own bag pipes * Added Kilts * Added Scottish Clothes to Theater Vend * Updated Pricing * Fixed Pricing
33 lines
988 B
C#
33 lines
988 B
C#
using Content.Server.DeltaV.Speech.Components;
|
|
using Content.Server.Speech;
|
|
using Content.Server.Speech.EntitySystems;
|
|
using System.Text.RegularExpressions;
|
|
|
|
namespace Content.Server.DeltaV.Speech.EntitySystems;
|
|
|
|
public sealed class ScottishAccentSystem : EntitySystem
|
|
{
|
|
[Dependency] private readonly ReplacementAccentSystem _replacement = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<ScottishAccentComponent, AccentGetEvent>(OnAccentGet);
|
|
}
|
|
|
|
// converts left word when typed into the right word. For example typing you becomes ye.
|
|
public string Accentuate(string message, ScottishAccentComponent component)
|
|
{
|
|
var msg = message;
|
|
|
|
msg = _replacement.ApplyReplacements(msg, "scottish");
|
|
|
|
return msg;
|
|
}
|
|
|
|
private void OnAccentGet(EntityUid uid, ScottishAccentComponent component, AccentGetEvent args)
|
|
{
|
|
args.Message = Accentuate(args.Message, component);
|
|
}
|
|
} |