using Content.Shared._DV.Grappling.EntitySystems;
using Content.Shared.Alert;
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Shared._DV.Grappling.Components;
///
/// Marks this entity as a grappler.
///
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
[Access(typeof(SharedGrapplingSystem))]
public sealed partial class GrapplerComponent : Component
{
///
/// How much time is required to escape a grapple from this entity.
///
[DataField]
public TimeSpan EscapeTime = TimeSpan.FromSeconds(15);
///
/// The sound to play when the grapple action is successful on a target.
///
[DataField]
public SoundSpecifier GrappleSound = new SoundPathSpecifier("/Audio/_DV/Grappling/grapple_action.ogg");
///
/// Whether this entity can move by itself while grappling.
///
[DataField]
public bool CanMoveWhileGrappling = false;
///
/// Whether this entity should also lay prone when grappling.
///
[DataField]
public bool ProneOnGrapple = false;
///
/// Whether grapples from this entity should disable no, a random, or all hands of the victim.
///
[DataField]
public HandDisabling HandDisabling = HandDisabling.None;
///
/// What localized string is to be used for the body part in the grapple.
/// I.e. Jaws, Hands, Claws, etc.
///
[DataField(required: true)]
public LocId GrapplingPart;
///
/// The entity, if any, which this unit is grappling.
///
[DataField]
[AutoNetworkedField]
public EntityUid? ActiveVictim = null;
///
/// Cooldown for grappling to apply at the moment the grapple is broken.
///
[DataField]
public TimeSpan Cooldown = TimeSpan.FromSeconds(5);
///
/// Time when the cooldown for the grapple will be over.
///
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoNetworkedField]
public TimeSpan CooldownEnd;
///
/// Which alert to show when a victim is grappled.
///
[DataField]
public ProtoId GrappledAlert = "Grappled";
///
/// The joint ID used between the grappler and victim.
///
[DataField, AutoNetworkedField]
public string? PullJointId = null;
}
///
/// Whether hands should be disabled by the grappling.
///
public enum HandDisabling
{
None, // No hands to be disabled.
SingleRandom, // A single hand is disabled at random from available hands.
SingleActive, // The active hand is disabled.
All, // All hands are disabled.
}