using Content.Shared.Weapons.Ranged.Components;
namespace Content.Shared.Weapons.Ranged.Events;
/// <summary>
/// Raised on a gun when someone is attempting to shoot it.
/// Cancel this event to prevent it from shooting.
/// </summary>
[ByRefEvent]
public record struct ShotAttemptedEvent
{
/// The user attempting to shoot the gun.
public EntityUid User;
/// The gun being shot.
public Entity<GunComponent> Used;
public bool Cancelled { get; private set; }
/// Prevent the gun from shooting
public void Cancel()
Cancelled = true;
}
/// Allow the gun to shoot again, only use if you know what you are doing
public void Uncancel()
Cancelled = false;