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. /// Uses ItemToggleComponent /// [RegisterComponent, NetworkedComponent] public sealed partial class DefibrillatorComponent : Component { /// /// 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); /// /// ID of the cooldown use delay. /// [DataField] public string DelayId = "defib-delay"; /// /// Cooldown after using the defibrillator. /// [DataField] 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("doAfterDuration"), ViewVariables(VVAccess.ReadWrite)] public TimeSpan DoAfterDuration = TimeSpan.FromSeconds(3); [DataField] public bool AllowDoAfterMovement = true; [DataField] public bool CanDefibCrit = true; /// /// The sound when someone is zapped. /// [ViewVariables(VVAccess.ReadWrite), DataField("zapSound")] public SoundSpecifier? ZapSound = new SoundPathSpecifier("/Audio/Items/Defib/defib_zap.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 sealed partial class DefibrillatorZapDoAfterEvent : SimpleDoAfterEvent { }