using Content.Shared.Damage; using Content.Shared.DoAfter; using Robust.Shared.Audio; using Robust.Shared.GameStates; using Robust.Shared.Serialization; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; namespace Content.Shared.Medical; /// /// This is used for defibrillators; a machine that shocks a dead /// person back into the world of the living. /// [RegisterComponent, NetworkedComponent, AutoGenerateComponentPause] public sealed partial class DefibrillatorComponent : Component { /// /// Whether or not it's turned on and able to be used. /// [DataField("enabled"), ViewVariables(VVAccess.ReadWrite)] public bool Enabled; /// /// The time at which the zap cooldown will be completed /// [DataField("nextZapTime", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)] [AutoPausedField] public TimeSpan? NextZapTime; /// /// The minimum time between zaps /// [DataField("zapDelay"), ViewVariables(VVAccess.ReadWrite)] public TimeSpan ZapDelay = TimeSpan.FromSeconds(5); /// /// How much damage is healed from getting zapped. /// [DataField("zapHeal", required: true), ViewVariables(VVAccess.ReadWrite)] public DamageSpecifier ZapHeal = default!; /// /// The electrical damage from getting zapped. /// [DataField("zapDamage"), ViewVariables(VVAccess.ReadWrite)] public int ZapDamage = 5; /// /// How long the victim will be electrocuted after getting zapped. /// [DataField("writheDuration"), ViewVariables(VVAccess.ReadWrite)] public TimeSpan WritheDuration = TimeSpan.FromSeconds(3); /// /// How long the doafter for zapping someone takes /// /// /// This is synced with the audio; do not change one but not the other. /// [DataField("doAfterDuration"), ViewVariables(VVAccess.ReadWrite)] public TimeSpan DoAfterDuration = TimeSpan.FromSeconds(3); /// /// The sound when someone is zapped. /// [ViewVariables(VVAccess.ReadWrite), DataField("zapSound")] public SoundSpecifier? ZapSound = new SoundPathSpecifier("/Audio/Items/Defib/defib_zap.ogg"); /// /// The sound when the defib is powered on. /// [ViewVariables(VVAccess.ReadWrite), DataField("powerOnSound")] public SoundSpecifier? PowerOnSound = new SoundPathSpecifier("/Audio/Items/Defib/defib_safety_on.ogg"); [ViewVariables(VVAccess.ReadWrite), DataField("powerOffSound")] public SoundSpecifier? PowerOffSound = new SoundPathSpecifier("/Audio/Items/Defib/defib_safety_off.ogg"); [ViewVariables(VVAccess.ReadWrite), DataField("chargeSound")] public SoundSpecifier? ChargeSound = new SoundPathSpecifier("/Audio/Items/Defib/defib_charge.ogg"); [ViewVariables(VVAccess.ReadWrite), DataField("failureSound")] public SoundSpecifier? FailureSound = new SoundPathSpecifier("/Audio/Items/Defib/defib_failed.ogg"); [ViewVariables(VVAccess.ReadWrite), DataField("successSound")] public SoundSpecifier? SuccessSound = new SoundPathSpecifier("/Audio/Items/Defib/defib_success.ogg"); [ViewVariables(VVAccess.ReadWrite), DataField("readySound")] public SoundSpecifier? ReadySound = new SoundPathSpecifier("/Audio/Items/Defib/defib_ready.ogg"); } [Serializable, NetSerializable] public enum DefibrillatorVisuals : byte { Ready } [Serializable, NetSerializable] public sealed partial class DefibrillatorZapDoAfterEvent : SimpleDoAfterEvent { }