-
Notifications
You must be signed in to change notification settings - Fork 523
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'new-frontiers-14:master' into 2024-06-Wizard-NPCs-Rework
- Loading branch information
Showing
369 changed files
with
15,296 additions
and
8,760 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
Content.Server/_NF/Speech/Components/GoblinAccentComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
using Content.Server._NF.Speech.EntitySystems; | ||
|
||
namespace Content.Server._NF.Speech.Components; | ||
|
||
[RegisterComponent] | ||
[Access(typeof(GoblinAccentSystem))] | ||
public sealed partial class GoblinAccentComponent : Component | ||
{ } |
7 changes: 7 additions & 0 deletions
7
Content.Server/_NF/Speech/Components/StreetpunkAccentComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Content.Server._NF.Speech.Components | ||
{ | ||
[RegisterComponent] | ||
public sealed partial class StreetpunkAccentComponent : Component | ||
{ | ||
} | ||
} |
8 changes: 4 additions & 4 deletions
8
...peech/EntitySystems/GoblinAccentSystem.cs → ...peech/EntitySystems/GoblinAccentSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
Content.Server/_NF/Speech/EntitySystems/StreetpunkAccentSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using Content.Server._NF.Speech.Components; | ||
using Content.Server.Speech; | ||
using Content.Server.Speech.EntitySystems; | ||
using System.Text.RegularExpressions; | ||
|
||
namespace Content.Server._NF.Speech.EntitySystems; | ||
|
||
public sealed class StreetpunkAccentSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly ReplacementAccentSystem _replacement = default!; | ||
private static readonly Regex RegexIng = new(@"ing\b"); | ||
private static readonly Regex RegexAnd = new(@"\band\b"); | ||
private static readonly Regex RegexDve = new("d've"); | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<StreetpunkAccentComponent, AccentGetEvent>(OnAccentGet); | ||
} | ||
|
||
// converts left word when typed into the right word. For example typing you becomes ye. | ||
public string Accentuate(string message, StreetpunkAccentComponent component) | ||
{ | ||
var msg = message; | ||
|
||
//They shoulda started runnin' an' hidin' from me! <- bit from SouthernDrawl Accent | ||
msg = RegexIng.Replace(msg, "in'"); | ||
msg = RegexAnd.Replace(msg, "an'"); | ||
msg = RegexDve.Replace(msg, "da"); | ||
|
||
msg = _replacement.ApplyReplacements(msg, "streetpunk"); | ||
|
||
|
||
return msg; | ||
} | ||
|
||
private void OnAccentGet(EntityUid uid, StreetpunkAccentComponent component, AccentGetEvent args) | ||
{ | ||
args.Message = Accentuate(args.Message, component); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.