using System.Numerics;
using Robust.Shared.GameStates;
using Robust.Shared.Physics.Components;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Shared.Weapons.Melee.Components;
///
/// This is used for a melee weapon that throws whatever gets hit by it in a line
/// until it hits a wall or a time limit is exhausted.
///
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
[Access(typeof(MeleeThrowOnHitSystem))]
public sealed partial class MeleeThrowOnHitComponent : Component
{
///
/// The speed at which hit entities should be thrown.
///
[DataField, AutoNetworkedField]
public float Speed = 10f;
///
/// The maximum distance the hit entity should be thrown.
///
[DataField, AutoNetworkedField]
public float Distance = 20f;
///
/// Whether or not anchorable entities should be unanchored when hit.
///
[DataField, AutoNetworkedField]
public bool UnanchorOnHit;
///
/// How long should this stun the target, if applicable?
///
[DataField, AutoNetworkedField]
public TimeSpan? StunTime;
///
/// Should this also work on a throw-hit?
///
[DataField, AutoNetworkedField]
public bool ActivateOnThrown;
}
///
/// Raised a weapon entity with to see if a throw is allowed.
///
[ByRefEvent]
public record struct AttemptMeleeThrowOnHitEvent(EntityUid Target, EntityUid? User, bool Cancelled = false, bool Handled = false);
///
/// Raised a target entity before it is thrown by .
///
[ByRefEvent]
public record struct MeleeThrowOnHitStartEvent(EntityUid Weapon, EntityUid? User);