Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
Co-authored-by: Paul <ritter.paul1@googlemail.com>
This commit is contained in:
Pancake
2021-12-21 12:31:20 -08:00
committed by GitHub
parent f4d8ec1b35
commit f334f4a4b9
9 changed files with 160 additions and 1 deletions

View File

@@ -0,0 +1,30 @@
using Robust.Shared.GameObjects;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.ViewVariables;
namespace Content.Server.Speech.Components
{
[Prototype("accent")]
public sealed class ReplacementAccentPrototype : IPrototype
{
[ViewVariables]
[DataField("id", required: true)]
public string ID { get; } = default!;
[DataField("words")]
public string[] Words = default!;
}
/// <summary>
/// Replaces any spoken sentences with a random word.
/// </summary>
[RegisterComponent]
[ComponentProtoName("ReplacementAccent")]
public class ReplacementAccentComponent : Component
{
[DataField("accent", customTypeSerializer: typeof(PrototypeIdSerializer<ReplacementAccentPrototype>), required: true)]
public string Accent = default!;
}
}