Mouse Accent Fix (#5876)

This commit is contained in:
Pancake
2021-12-23 05:30:33 -08:00
committed by GitHub
parent 7e8e0df009
commit e2bcf619d1
4 changed files with 11 additions and 43 deletions

View File

@@ -1,10 +0,0 @@
using Robust.Shared.GameObjects;
namespace Content.Server.Speech.Components
{
[RegisterComponent]
public class MouseAccentComponent : Component
{
public override string Name => "MouseAccent";
}
}

View File

@@ -1,32 +0,0 @@
using System.Collections.Generic;
using Content.Server.Speech.Components;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Random;
namespace Content.Server.Speech.EntitySystems
{
// TODO: Code in-game languages and make this a language
public class MouseAccentSystem : EntitySystem
{
[Dependency] private readonly IRobustRandom _random = default!;
private static readonly IReadOnlyList<string> Squeek = new List<string>{ "Squeak!", "Piep!", "Chuu!" };
public override void Initialize()
{
SubscribeLocalEvent<MouseAccentComponent, AccentGetEvent>(OnAccent);
}
public string Accentuate(string message)
{
// TODO: Maybe add more than one squeek when there are more words?
return _random.Pick(Squeek);
}
private void OnAccent(EntityUid uid, MouseAccentComponent component, AccentGetEvent args)
{
args.Message = Accentuate(args.Message);
}
}
}

View File

@@ -432,7 +432,9 @@
reagents:
- ReagentId: Nutriment
Quantity: 5
- type: MouseAccent
- type: ReplacementAccent
accent: mouse
- type: entity
parent: MobMouse

View File

@@ -15,3 +15,11 @@
- Woof!
- Arf.
- Grrr.
- type: accent
id: mouse
words:
- Squeak!
- Piep!
- Chuu!
- Eeee!