mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 10:21:18 +03:00
* Defib Functionality let defib work with living creatures popup on defib attempt * remove unused using * remove now-unneeded CanDefibCrit datafield * Remove now-unused targetCanBeAlive function * maybe build it first * refactor: whitespaces! * refactor: extracted TryDoChainElectrocution * refactor: now defibbing entities with buckled other entities will defib and electrocute them too. Small defib system refactor. * remove not-implemented function * provide inanimate object message, make popup a caution * move the sound reading comprehension --------- Co-authored-by: Fildrance <fildrance@gmail.com>
44 lines
1.6 KiB
C#
44 lines
1.6 KiB
C#
using Content.Shared.Inventory;
|
|
|
|
namespace Content.Shared.Medical;
|
|
|
|
[ByRefEvent]
|
|
public readonly record struct TargetDefibrillatedEvent(
|
|
EntityUid User,
|
|
EntityUid Target,
|
|
Entity<DefibrillatorComponent> Defibrillator,
|
|
HashSet<EntityUid> ChainAffected
|
|
);
|
|
|
|
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) { }
|
|
}
|