Moth accent (#21910)
* :trollface: * :trollface: * :trollface: * Update moth.yml * Update animals.yml
This commit is contained in:
10
Content.Server/Speech/Components/MothAccentComponent.cs
Normal file
10
Content.Server/Speech/Components/MothAccentComponent.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace Content.Server.Speech.Components;
|
||||
|
||||
/// <summary>
|
||||
/// Buzzz!
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed partial class MothAccentComponent : Component
|
||||
{
|
||||
|
||||
}
|
||||
25
Content.Server/Speech/EntitySystems/MothAccentSystem.cs
Normal file
25
Content.Server/Speech/EntitySystems/MothAccentSystem.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System.Text.RegularExpressions;
|
||||
using Content.Server.Speech.Components;
|
||||
|
||||
namespace Content.Server.Speech.EntitySystems;
|
||||
|
||||
public sealed class MothAccentSystem : EntitySystem
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<MothAccentComponent, AccentGetEvent>(OnAccent);
|
||||
}
|
||||
|
||||
private void OnAccent(EntityUid uid, MothAccentComponent component, AccentGetEvent args)
|
||||
{
|
||||
var message = args.Message;
|
||||
|
||||
// buzzz
|
||||
message = Regex.Replace(message, "z+", "zzz");
|
||||
// buZZZ
|
||||
message = Regex.Replace(message, "Z+", "ZZZ");
|
||||
|
||||
args.Message = message;
|
||||
}
|
||||
}
|
||||
@@ -364,6 +364,7 @@
|
||||
- type: Speech
|
||||
speechVerb: Moth
|
||||
speechSounds: Squeak
|
||||
- type: MothAccent
|
||||
- type: Sprite
|
||||
sprite: Mobs/Animals/mothroach.rsi
|
||||
layers:
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
spawned:
|
||||
- id: FoodMeat
|
||||
amount: 5
|
||||
- type: MothAccent
|
||||
- type: Vocal
|
||||
sounds:
|
||||
Male: UnisexMoth
|
||||
|
||||
Reference in New Issue
Block a user