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>
This commit is contained in:
beck-thompson
2024-12-20 13:26:56 -08:00
committed by GitHub
parent 0e850ab370
commit a0a405768a
6 changed files with 20 additions and 52 deletions

View File

@@ -12,22 +12,9 @@ namespace Content.Shared.Medical;
/// person back into the world of the living.
/// Uses <c>ItemToggleComponent</c>
/// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentPause]
[RegisterComponent, NetworkedComponent]
public sealed partial class DefibrillatorComponent : Component
{
/// <summary>
/// The time at which the zap cooldown will be completed
/// </summary>
[DataField("nextZapTime", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
[AutoPausedField]
public TimeSpan? NextZapTime;
/// <summary>
/// The minimum time between zaps
/// </summary>
[DataField("zapDelay"), ViewVariables(VVAccess.ReadWrite)]
public TimeSpan ZapDelay = TimeSpan.FromSeconds(5);
/// <summary>
/// How much damage is healed from getting zapped.
/// </summary>
@@ -46,6 +33,18 @@ public sealed partial class DefibrillatorComponent : Component
[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>
@@ -80,12 +79,6 @@ public sealed partial class DefibrillatorComponent : Component
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
{