Files
tbd-station-14/Content.Shared/Medical/DefibrillatorComponent.cs
beck-thompson a0a405768a Add clearer defib cooldowns! (#31251)
* First commit

* Fix silly test

* Swiched stuff up

* Update Content.Shared/Medical/DefibrillatorComponent.cs

* remove unneeded visuals

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
2024-12-20 22:26:56 +01:00

87 lines
2.9 KiB
C#

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;
/// <summary>
/// This is used for defibrillators; a machine that shocks a dead
/// person back into the world of the living.
/// Uses <c>ItemToggleComponent</c>
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed partial class DefibrillatorComponent : Component
{
/// <summary>
/// How much damage is healed from getting zapped.
/// </summary>
[DataField("zapHeal", required: true), ViewVariables(VVAccess.ReadWrite)]
public DamageSpecifier ZapHeal = default!;
/// <summary>
/// The electrical damage from getting zapped.
/// </summary>
[DataField("zapDamage"), ViewVariables(VVAccess.ReadWrite)]
public int ZapDamage = 5;
/// <summary>
/// How long the victim will be electrocuted after getting zapped.
/// </summary>
[DataField("writheDuration"), ViewVariables(VVAccess.ReadWrite)]
public TimeSpan WritheDuration = TimeSpan.FromSeconds(3);
/// <summary>
/// ID of the cooldown use delay.
/// </summary>
[DataField]
public string DelayId = "defib-delay";
/// <summary>
/// Cooldown after using the defibrillator.
/// </summary>
[DataField]
public TimeSpan ZapDelay = TimeSpan.FromSeconds(5);
/// <summary>
/// How long the doafter for zapping someone takes
/// </summary>
/// <remarks>
/// This is synced with the audio; do not change one but not the other.
/// </remarks>
[DataField("doAfterDuration"), ViewVariables(VVAccess.ReadWrite)]
public TimeSpan DoAfterDuration = TimeSpan.FromSeconds(3);
[DataField]
public bool AllowDoAfterMovement = true;
[DataField]
public bool CanDefibCrit = true;
/// <summary>
/// The sound when someone is zapped.
/// </summary>
[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
{
}