Mouse Accent Fix (#5876)
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.Server.Speech.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
public class MouseAccentComponent : Component
|
||||
{
|
||||
public override string Name => "MouseAccent";
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -432,7 +432,9 @@
|
||||
reagents:
|
||||
- ReagentId: Nutriment
|
||||
Quantity: 5
|
||||
- type: MouseAccent
|
||||
- type: ReplacementAccent
|
||||
accent: mouse
|
||||
|
||||
|
||||
- type: entity
|
||||
parent: MobMouse
|
||||
|
||||
@@ -15,3 +15,11 @@
|
||||
- Woof!
|
||||
- Arf.
|
||||
- Grrr.
|
||||
|
||||
- type: accent
|
||||
id: mouse
|
||||
words:
|
||||
- Squeak!
|
||||
- Piep!
|
||||
- Chuu!
|
||||
- Eeee!
|
||||
|
||||
Reference in New Issue
Block a user