namespace Content.Server.Chat;
using Content.Server.Chat.Systems;
using Content.Shared.Chat.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Set;
///
/// 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("emoteChance"), ViewVariables(VVAccess.ReadWrite)]
public float EmoteChance = 0.5f;
///
/// A set of emotes that will be randomly picked from.
///
///
[DataField("emotes", customTypeSerializer: typeof(PrototypeIdHashSetSerializer)), ViewVariables(VVAccess.ReadWrite)]
public HashSet Emotes = new();
///
/// Also send the emote in chat.
///
[DataField("withChat"), ViewVariables(VVAccess.ReadWrite)]
public bool WithChat = false;
///
/// Hide the chat message from the chat window, only showing the popup.
/// This does nothing if WithChat is false.
///
[DataField("hiddenFromChatWindow")]
public bool HiddenFromChatWindow = false;
///
/// The simulation time of the last emote preformed due to taking damage.
///
[DataField("lastEmoteTime", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
[AutoPausedField]
public TimeSpan LastEmoteTime = TimeSpan.Zero;
///
/// The cooldown between emotes.
///
[DataField("emoteCooldown"), ViewVariables(VVAccess.ReadWrite)]
public TimeSpan EmoteCooldown = TimeSpan.FromSeconds(2);
}