fish-station/Content.Shared/Medical/DefibrillatorEvents.cs
worstplayerever 3e4bbda502
Реворк Интердайн дефибриллятора. (#3249)
Co-authored-by: worstplayerever <worstplayerever912@gmail.com>
Co-authored-by: banumbas <banumbas1@gmail.com>
Co-authored-by: KaiserMaus <kaiser.ratte@gmail.com>
Co-authored-by: Vigers Ray <60344369+VigersRay@users.noreply.github.com>
2025-12-25 19:52:57 +03:00

51 lines
1.9 KiB
C#

using Content.Shared.Inventory;
namespace Content.Shared.Medical;
[ByRefEvent]
public readonly record struct TargetDefibrillatedEvent(EntityUid User, Entity<DefibrillatorComponent> Defibrillator);
public abstract class BeforeDefibrillatorZapsEvent : CancellableEntityEventArgs, IInventoryRelayEvent
{
public SlotFlags TargetSlots { get; } = SlotFlags.WITHOUT_POCKET;
public EntityUid EntityUsingDefib;
public readonly EntityUid Defib;
public EntityUid DefibTarget;
public BeforeDefibrillatorZapsEvent(EntityUid entityUsingDefib, EntityUid defib, EntityUid defibTarget)
{
EntityUsingDefib = entityUsingDefib;
Defib = defib;
DefibTarget = defibTarget;
}
}
/// <summary>
/// This event is raised on the user using the defibrillator before is actually zaps someone.
/// The event is triggered on the user and all their clothing.
/// </summary>
public sealed class SelfBeforeDefibrillatorZapsEvent : BeforeDefibrillatorZapsEvent
{
public SelfBeforeDefibrillatorZapsEvent(EntityUid entityUsingDefib, EntityUid defib, EntityUid defibtarget) : base(entityUsingDefib, defib, defibtarget) { }
}
/// <summary>
/// This event is raised on the target before it gets zapped with the defibrillator.
/// The event is triggered on the target itself and all its clothing.
/// </summary>
public sealed class TargetBeforeDefibrillatorZapsEvent : BeforeDefibrillatorZapsEvent
{
public TargetBeforeDefibrillatorZapsEvent(EntityUid entityUsingDefib, EntityUid defib, EntityUid defibtarget) : base(entityUsingDefib, defib, defibtarget) { }
}
// Sunrise-Start
/// <summary>
/// This event is raised to check if the defibrillator can be used.
/// Systems can cancel this event to prevent defibrillation.
/// </summary>
[ByRefEvent]
public record struct SunriseCanZapEvent(EntityUid Defibrillator, EntityUid Target, EntityUid? User)
{
public bool Cancelled = false;
}
// Sunrise-End