BeforeGunShootEvent.cs 781 B

1234567891011121314151617181920
  1. using Content.Shared.Inventory;
  2. using Content.Shared.Weapons.Ranged.Components;
  3. namespace Content.Shared.Weapons.Ranged.Events;
  4. /// <summary>
  5. /// This event is triggered on an entity right before they shoot a gun.
  6. /// </summary>
  7. public sealed partial class SelfBeforeGunShotEvent : CancellableEntityEventArgs, IInventoryRelayEvent
  8. {
  9. public SlotFlags TargetSlots { get; } = SlotFlags.WITHOUT_POCKET;
  10. public readonly EntityUid Shooter;
  11. public readonly Entity<GunComponent> Gun;
  12. public readonly List<(EntityUid? Entity, IShootable Shootable)> Ammo;
  13. public SelfBeforeGunShotEvent(EntityUid shooter, Entity<GunComponent> gun, List<(EntityUid? Entity, IShootable Shootable)> ammo)
  14. {
  15. Shooter = shooter;
  16. Gun = gun;
  17. Ammo = ammo;
  18. }
  19. }