using Content.Server.Chat.Systems; using Content.Shared.Chat.Prototypes; using Robust.Shared.Prototypes; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; namespace Content.Server.Chat; /// /// Causes an entity to automatically emote when taking damage. /// [RegisterComponent, Access(typeof(EmoteOnDamageSystem)), AutoGenerateComponentPause] public sealed partial class EmoteOnDamageComponent : Component { /// /// Chance of preforming an emote when taking damage and not on cooldown. /// [DataField] public float EmoteChance = 0.5f; /// /// A set of emotes that will be randomly picked from. /// /// [DataField] public HashSet> Emotes = new(); /// /// Also send the emote in chat. /// [DataField] public bool WithChat = false; /// /// Hide the chat message from the chat window, only showing the popup. /// This does nothing if WithChat is false. /// [DataField] public bool HiddenFromChatWindow = false; /// /// The simulation time of the last emote preformed due to taking damage. /// [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))] [AutoPausedField] public TimeSpan LastEmoteTime = TimeSpan.Zero; /// /// The cooldown between emotes. /// [DataField] public TimeSpan EmoteCooldown = TimeSpan.FromSeconds(2); }