1
0

DefibrillatorEvents.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using Content.Shared.Inventory;
  2. namespace Content.Shared.Medical;
  3. [ByRefEvent]
  4. public readonly record struct TargetDefibrillatedEvent(EntityUid User, Entity<DefibrillatorComponent> Defibrillator);
  5. public abstract class BeforeDefibrillatorZapsEvent : CancellableEntityEventArgs, IInventoryRelayEvent
  6. {
  7. public SlotFlags TargetSlots { get; } = SlotFlags.WITHOUT_POCKET;
  8. public EntityUid EntityUsingDefib;
  9. public readonly EntityUid Defib;
  10. public EntityUid DefibTarget;
  11. public BeforeDefibrillatorZapsEvent(EntityUid entityUsingDefib, EntityUid defib, EntityUid defibTarget)
  12. {
  13. EntityUsingDefib = entityUsingDefib;
  14. Defib = defib;
  15. DefibTarget = defibTarget;
  16. }
  17. }
  18. /// <summary>
  19. /// This event is raised on the user using the defibrillator before is actually zaps someone.
  20. /// The event is triggered on the user and all their clothing.
  21. /// </summary>
  22. public sealed class SelfBeforeDefibrillatorZapsEvent : BeforeDefibrillatorZapsEvent
  23. {
  24. public SelfBeforeDefibrillatorZapsEvent(EntityUid entityUsingDefib, EntityUid defib, EntityUid defibtarget) : base(entityUsingDefib, defib, defibtarget) { }
  25. }
  26. /// <summary>
  27. /// This event is raised on the target before it gets zapped with the defibrillator.
  28. /// The event is triggered on the target itself and all its clothing.
  29. /// </summary>
  30. public sealed class TargetBeforeDefibrillatorZapsEvent : BeforeDefibrillatorZapsEvent
  31. {
  32. public TargetBeforeDefibrillatorZapsEvent(EntityUid entityUsingDefib, EntityUid defib, EntityUid defibtarget) : base(entityUsingDefib, defib, defibtarget) { }
  33. }