* Remake gasp popup to emote (#27736) * fix * Silence ringtones on admin PDAs (#29801) * Silence ringtones on invisible PDAs * Revert "Silence ringtones on invisible PDAs" This reverts commit afc1041f31eebe82e83630a856a8856b877a9826. * Literally just this * Add an admin announcement for news article publishing * Fix invalid UI hover/click sounds breaking client (#30067) fixes #29561 * Display the administrator's title in ahelp and ahelp relay (#30075) * Adding the admin prefix to the ahelp * Updating the admin prefix * The second update of the admin prefix * Configuration correction * fix * Fix servers ambience sound (#30091) * Fix servers ambience * I'm silly * Clean up * Add pen clicking sound (#30531) * Add pen clicking sound * switch to OnUse and reduce distance a little * Fix exploding pen clicking (#30533) * fix pens * added a bunch more fox noises (#27578) * fuck it we ball * added recommended copyright information * revised copyright license * revised copyright license x2 * finalized the fops # reduced the number of audio clips # adjusted the volume of all fox sounds to be consistent with each other * added new sounds to the overall fox parent mob because we forgot oopsie --------- Co-authored-by: lzk <124214523+lzk228@users.noreply.github.com> Co-authored-by: Tayrtahn <tayrtahn@gmail.com> Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com> Co-authored-by: to4no_fix <156101927+chavonadelal@users.noreply.github.com> Co-authored-by: Winkarst <74284083+Winkarst-cpu@users.noreply.github.com> Co-authored-by: themias <89101928+themias@users.noreply.github.com> Co-authored-by: nao fujiwara <awkwarddryad@gmail.com>
98 lines
2.9 KiB
C#
98 lines
2.9 KiB
C#
using Content.Server.Body.Systems;
|
|
using Content.Shared.Chat.Prototypes;
|
|
using Content.Shared.Damage;
|
|
using Robust.Shared.Prototypes;
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
|
using Robust.Shared.Audio; // WD
|
|
|
|
namespace Content.Server.Body.Components
|
|
{
|
|
[RegisterComponent, Access(typeof(RespiratorSystem))]
|
|
public sealed partial class RespiratorComponent : Component
|
|
{
|
|
/// <summary>
|
|
/// The next time that this body will inhale or exhale.
|
|
/// </summary>
|
|
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
|
|
public TimeSpan NextUpdate;
|
|
|
|
/// <summary>
|
|
/// The interval between updates. Each update is either inhale or exhale,
|
|
/// so a full cycle takes twice as long.
|
|
/// </summary>
|
|
[DataField]
|
|
public TimeSpan UpdateInterval = TimeSpan.FromSeconds(2);
|
|
|
|
/// <summary>
|
|
/// Saturation level. Reduced by UpdateInterval each tick.
|
|
/// Can be thought of as 'how many seconds you have until you start suffocating' in this configuration.
|
|
/// </summary>
|
|
[DataField]
|
|
public float Saturation = 5.0f;
|
|
|
|
/// <summary>
|
|
/// At what level of saturation will you begin to suffocate?
|
|
/// </summary>
|
|
[DataField]
|
|
public float SuffocationThreshold;
|
|
|
|
[DataField]
|
|
public float MaxSaturation = 5.0f;
|
|
|
|
[DataField]
|
|
public float MinSaturation = -2.0f;
|
|
|
|
// TODO HYPEROXIA?
|
|
|
|
[DataField(required: true)]
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
public DamageSpecifier Damage = default!;
|
|
|
|
[DataField(required: true)]
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
public DamageSpecifier DamageRecovery = default!;
|
|
|
|
[DataField]
|
|
public TimeSpan GaspEmoteCooldown = TimeSpan.FromSeconds(8);
|
|
|
|
[ViewVariables]
|
|
public TimeSpan LastGaspEmoteTime;
|
|
|
|
/// <summary>
|
|
/// The emote when gasps
|
|
/// </summary>
|
|
[DataField]
|
|
public ProtoId<EmotePrototype> GaspEmote = "Gasp";
|
|
|
|
/// <summary>
|
|
/// How many cycles in a row has the mob been under-saturated?
|
|
/// </summary>
|
|
[ViewVariables]
|
|
public int SuffocationCycles = 0;
|
|
|
|
/// <summary>
|
|
/// How many cycles in a row does it take for the suffocation alert to pop up?
|
|
/// </summary>
|
|
[ViewVariables]
|
|
public int SuffocationCycleThreshold = 3;
|
|
|
|
[ViewVariables]
|
|
public RespiratorStatus Status = RespiratorStatus.Inhaling;
|
|
|
|
// WD start
|
|
[DataField("CPRSound")]
|
|
public SoundSpecifier CPRSound { get; set; } = new SoundPathSpecifier("/White/Audio/CPR.ogg");
|
|
|
|
public EntityUid? CPRPlayingStream;
|
|
|
|
public EntityUid? CPRPerformedBy = null;
|
|
// WD end
|
|
}
|
|
}
|
|
|
|
public enum RespiratorStatus
|
|
{
|
|
Inhaling,
|
|
Exhaling
|
|
}
|