-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'space-sunrise:master' into Swapper-bye
- Loading branch information
Showing
94 changed files
with
1,159 additions
and
505 deletions.
There are no files selected for viewing
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
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
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
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
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
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.Speech.Components; | ||
|
||
/// <summary> | ||
/// Makes this entity speak like a sheep or a goat in all chat messages it sends. | ||
/// </summary> | ||
[RegisterComponent] | ||
public sealed partial class BleatingAccentComponent : Component { } |
28 changes: 28 additions & 0 deletions
28
Content.Server/Speech/EntitySystems/BleatingAccentSystem.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,28 @@ | ||
using System.Text.RegularExpressions; | ||
using Content.Server.Speech.Components; | ||
|
||
namespace Content.Server.Speech.EntitySystems; | ||
|
||
public sealed partial class BleatingAccentSystem : EntitySystem | ||
{ | ||
private static readonly Regex BleatRegex = new("([mbdlpwhrkcnytfo])([aiu])", RegexOptions.IgnoreCase); | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<BleatingAccentComponent, AccentGetEvent>(OnAccentGet); | ||
} | ||
|
||
private void OnAccentGet(Entity<BleatingAccentComponent> entity, ref AccentGetEvent args) | ||
{ | ||
args.Message = Accentuate(args.Message); | ||
} | ||
|
||
public static string Accentuate(string message) | ||
{ | ||
// Repeats the vowel in certain consonant-vowel pairs | ||
// So you taaaalk liiiike thiiiis | ||
return BleatRegex.Replace(message, "$1$2$2$2$2"); | ||
} | ||
} |
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
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.