using Content.Shared.Damage; using Content.Shared.DoAfter; using Content.Shared.Item.ItemToggle.Components; using Robust.Shared.Audio; using Robust.Shared.GameStates; using Robust.Shared.Serialization; namespace Content.Shared.Medical; /// /// This is used for defibrillators; a machine that shocks a dead /// person back into the world of the living. /// Uses /// [RegisterComponent, NetworkedComponent, AutoGenerateComponentState] public sealed partial class DefibrillatorComponent : Component { /// /// How much damage is healed from getting zapped. /// [DataField(required: true), AutoNetworkedField] public DamageSpecifier ZapHeal = default!; /// /// The electrical damage from getting zapped. /// [DataField, AutoNetworkedField] public int ZapDamage = 5; /// /// How long the victim will be electrocuted after getting zapped. /// [DataField, AutoNetworkedField] public TimeSpan WritheDuration = TimeSpan.FromSeconds(3); /// /// ID of the cooldown use delay. /// [DataField] public string DelayId = "defib-delay"; /// /// Cooldown after using the defibrillator. /// [DataField, AutoNetworkedField] public TimeSpan ZapDelay = TimeSpan.FromSeconds(5); /// /// How long the doafter for zapping someone takes. /// /// /// This is synced with the audio; do not change one but not the other. /// [DataField, AutoNetworkedField] public TimeSpan DoAfterDuration = TimeSpan.FromSeconds(3); /// /// If false cancels the doafter when moving. /// [DataField, AutoNetworkedField] public bool AllowDoAfterMovement = true; /// /// Can the defibrilator be used on mobs in critical mobstate? /// [DataField, AutoNetworkedField] public bool CanDefibCrit = true; /// /// The sound to play when someone is zapped. /// [DataField] public SoundSpecifier? ZapSound = new SoundPathSpecifier("/Audio/Items/Defib/defib_zap.ogg"); /// /// The sound to play when starting the doafter. /// [DataField] public SoundSpecifier? ChargeSound = new SoundPathSpecifier("/Audio/Items/Defib/defib_charge.ogg"); [DataField] public SoundSpecifier? FailureSound = new SoundPathSpecifier("/Audio/Items/Defib/defib_failed.ogg"); [DataField] public SoundSpecifier? SuccessSound = new SoundPathSpecifier("/Audio/Items/Defib/defib_success.ogg"); [DataField] public SoundSpecifier? ReadySound = new SoundPathSpecifier("/Audio/Items/Defib/defib_ready.ogg"); } /// /// DoAfterEvent for defibrilator use windup. /// [Serializable, NetSerializable] public sealed partial class DefibrillatorZapDoAfterEvent : SimpleDoAfterEvent;