Files
tbd-station-14/Content.Shared/Weapons/Ranged/Events/ShotAttemptedEvent.cs
metalgearsloth bb0776c496 Revert "Cleanup ExecutionSystem (#24382)" (#25555)
* Revert "Cleanup ExecutionSystem (#24382)"

This reverts commit bcbe2ec1af.

* Revert "Executions (#24150)"

This reverts commit 2e83f5a0ec.

# Conflicts:
#	Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs
2024-02-25 22:36:17 +11:00

38 lines
821 B
C#

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
{
/// <summary>
/// The user attempting to shoot the gun.
/// </summary>
public EntityUid User;
/// <summary>
/// The gun being shot.
/// </summary>
public EntityUid Used;
public bool Cancelled { get; private set; }
/// </summary>
/// Prevent the gun from shooting
/// </summary>
public void Cancel()
{
Cancelled = true;
}
/// </summary>
/// Allow the gun to shoot again, only use if you know what you are doing
/// </summary>
public void Uncancel()
{
Cancelled = false;
}
}