using Content.Shared.Dataset; using Robust.Shared.Prototypes; namespace Content.Server.Ghost.Components; /// /// Causes this entity to react to ghost player using the "Boo!" action by speaking /// a randomly chosen message from a specified set. /// [RegisterComponent, AutoGenerateComponentPause] public sealed partial class SpookySpeakerComponent : Component { /// /// ProtoId of the LocalizedDataset to use for messages. /// [DataField(required: true)] public ProtoId MessageSet; /// /// Probability that this entity will speak if activated by a Boo action. /// This is so whole banks of entities don't trigger at the same time. /// [DataField] public float SpeakChance = 0.5f; /// /// Minimum time that must pass after speaking before this entity can speak again. /// [DataField] public TimeSpan Cooldown = TimeSpan.FromSeconds(30); /// /// Time when the cooldown will have elapsed and the entity can speak again. /// [DataField, AutoPausedField] public TimeSpan NextSpeakTime; }