HyposprayEvents.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using Content.Shared.Inventory;
  2. namespace Content.Shared.Chemistry.Hypospray.Events;
  3. public abstract partial class BeforeHyposprayInjectsTargetEvent : CancellableEntityEventArgs, IInventoryRelayEvent
  4. {
  5. public SlotFlags TargetSlots { get; } = SlotFlags.WITHOUT_POCKET;
  6. public EntityUid EntityUsingHypospray;
  7. public readonly EntityUid Hypospray;
  8. public EntityUid TargetGettingInjected;
  9. public string? InjectMessageOverride;
  10. public BeforeHyposprayInjectsTargetEvent(EntityUid user, EntityUid hypospray, EntityUid target)
  11. {
  12. EntityUsingHypospray = user;
  13. Hypospray = hypospray;
  14. TargetGettingInjected = target;
  15. InjectMessageOverride = null;
  16. }
  17. }
  18. /// <summary>
  19. /// This event is raised on the user using the hypospray before the hypospray is injected.
  20. /// The event is triggered on the user and all their clothing.
  21. /// </summary>
  22. public sealed class SelfBeforeHyposprayInjectsEvent : BeforeHyposprayInjectsTargetEvent
  23. {
  24. public SelfBeforeHyposprayInjectsEvent(EntityUid user, EntityUid hypospray, EntityUid target) : base(user, hypospray, target) { }
  25. }
  26. /// <summary>
  27. /// This event is raised on the target before the hypospray is injected.
  28. /// The event is triggered on the target itself and all its clothing.
  29. /// </summary>
  30. public sealed class TargetBeforeHyposprayInjectsEvent : BeforeHyposprayInjectsTargetEvent
  31. {
  32. public TargetBeforeHyposprayInjectsEvent(EntityUid user, EntityUid hypospray, EntityUid target) : base(user, hypospray, target) { }
  33. }