diff --git a/Content.Server/Body/Components/RespiratorComponent.cs b/Content.Server/Body/Components/RespiratorComponent.cs index 4045e21e26..a81062362a 100644 --- a/Content.Server/Body/Components/RespiratorComponent.cs +++ b/Content.Server/Body/Components/RespiratorComponent.cs @@ -1,5 +1,7 @@ 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; namespace Content.Server.Body.Components @@ -50,10 +52,16 @@ namespace Content.Server.Body.Components public DamageSpecifier DamageRecovery = default!; [DataField] - public TimeSpan GaspPopupCooldown = TimeSpan.FromSeconds(8); + public TimeSpan GaspEmoteCooldown = TimeSpan.FromSeconds(8); [ViewVariables] - public TimeSpan LastGaspPopupTime; + public TimeSpan LastGaspEmoteTime; + + /// + /// The emote when gasps + /// + [DataField] + public ProtoId GaspEmote = "Gasp"; /// /// How many cycles in a row has the mob been under-saturated? diff --git a/Content.Server/Body/Systems/RespiratorSystem.cs b/Content.Server/Body/Systems/RespiratorSystem.cs index c7266e2c46..a46294beb4 100644 --- a/Content.Server/Body/Systems/RespiratorSystem.cs +++ b/Content.Server/Body/Systems/RespiratorSystem.cs @@ -2,8 +2,8 @@ using Content.Server.Administration.Logs; using Content.Server.Atmos; using Content.Server.Atmos.EntitySystems; using Content.Server.Body.Components; +using Content.Server.Chat.Systems; using Content.Server.Chemistry.Containers.EntitySystems; -using Content.Server.Popups; using Content.Shared.Alert; using Content.Shared.Atmos; using Content.Shared.Body.Components; @@ -25,9 +25,9 @@ public sealed class RespiratorSystem : EntitySystem [Dependency] private readonly BodySystem _bodySystem = default!; [Dependency] private readonly DamageableSystem _damageableSys = default!; [Dependency] private readonly LungSystem _lungSystem = default!; - [Dependency] private readonly PopupSystem _popupSystem = default!; [Dependency] private readonly MobStateSystem _mobState = default!; [Dependency] private readonly SolutionContainerSystem _solutionContainerSystem = default!; + [Dependency] private readonly ChatSystem _chat = default!; public override void Initialize() { @@ -84,10 +84,10 @@ public sealed class RespiratorSystem : EntitySystem if (respirator.Saturation < respirator.SuffocationThreshold) { - if (_gameTiming.CurTime >= respirator.LastGaspPopupTime + respirator.GaspPopupCooldown) + if (_gameTiming.CurTime >= respirator.LastGaspEmoteTime + respirator.GaspEmoteCooldown) { - respirator.LastGaspPopupTime = _gameTiming.CurTime; - _popupSystem.PopupEntity(Loc.GetString("lung-behavior-gasp"), uid); + respirator.LastGaspEmoteTime = _gameTiming.CurTime; + _chat.TryEmoteWithChat(uid, respirator.GaspEmote, ignoreActionBlocker: true); } TakeSuffocationDamage((uid, respirator)); diff --git a/Resources/Audio/Effects/Gasp/attributions.yml b/Resources/Audio/Effects/Gasp/attributions.yml new file mode 100644 index 0000000000..fe8f817c5a --- /dev/null +++ b/Resources/Audio/Effects/Gasp/attributions.yml @@ -0,0 +1,26 @@ +- files: + - deathgasp_1.ogg + - deathgasp_2.ogg + - female_deathgasp_1.ogg + - female_deathgasp_2.ogg + - female_deathgasp_3.ogg + - female_deathgasp_4.ogg + - female_deathgasp_5.ogg + - male_deathgasp_1.ogg + - male_deathgasp_2.ogg + - male_deathgasp_3.ogg + - male_deathgasp_4.ogg + - male_deathgasp_5.ogg + license: "CC-BY-SA-3.0" + copyright: "Taken from Paradise at https://github.com/ParadiseSS13/Paradise/commit/4397f13c72998aa7e6ce192215c9f77b9d62eee2" + source: "https://github.com/ParadiseSS13/Paradise/tree/4397f13c72998aa7e6ce192215c9f77b9d62eee2/sound/goonstation/voice" + +- files: + - gasp_female1.ogg + - gasp_female2.ogg + - gasp_female3.ogg + - gasp_male1.ogg + - gasp_male2.ogg + license: "CC-BY-SA-3.0" + copyright: "Taken from tgstation at https://github.com/tgstation/tgstation/commit/f7a49c4068f1277e6857baf0892d355f1c055974" + source: "https://github.com/tgstation/tgstation/tree/f7a49c4068f1277e6857baf0892d355f1c055974/sound/voice/human" diff --git a/Resources/Audio/Effects/Gasp/deathgasp_1.ogg b/Resources/Audio/Effects/Gasp/deathgasp_1.ogg new file mode 100644 index 0000000000..d6e4f8a9e7 Binary files /dev/null and b/Resources/Audio/Effects/Gasp/deathgasp_1.ogg differ diff --git a/Resources/Audio/Effects/Gasp/deathgasp_2.ogg b/Resources/Audio/Effects/Gasp/deathgasp_2.ogg new file mode 100644 index 0000000000..77959ff8a8 Binary files /dev/null and b/Resources/Audio/Effects/Gasp/deathgasp_2.ogg differ diff --git a/Resources/Audio/Effects/Gasp/female_deathgasp_1.ogg b/Resources/Audio/Effects/Gasp/female_deathgasp_1.ogg new file mode 100644 index 0000000000..2139a26695 Binary files /dev/null and b/Resources/Audio/Effects/Gasp/female_deathgasp_1.ogg differ diff --git a/Resources/Audio/Effects/Gasp/female_deathgasp_2.ogg b/Resources/Audio/Effects/Gasp/female_deathgasp_2.ogg new file mode 100644 index 0000000000..713721d723 Binary files /dev/null and b/Resources/Audio/Effects/Gasp/female_deathgasp_2.ogg differ diff --git a/Resources/Audio/Effects/Gasp/female_deathgasp_3.ogg b/Resources/Audio/Effects/Gasp/female_deathgasp_3.ogg new file mode 100644 index 0000000000..eaf356db4b Binary files /dev/null and b/Resources/Audio/Effects/Gasp/female_deathgasp_3.ogg differ diff --git a/Resources/Audio/Effects/Gasp/female_deathgasp_4.ogg b/Resources/Audio/Effects/Gasp/female_deathgasp_4.ogg new file mode 100644 index 0000000000..b3c9a8045b Binary files /dev/null and b/Resources/Audio/Effects/Gasp/female_deathgasp_4.ogg differ diff --git a/Resources/Audio/Effects/Gasp/female_deathgasp_5.ogg b/Resources/Audio/Effects/Gasp/female_deathgasp_5.ogg new file mode 100644 index 0000000000..b9b45c92ad Binary files /dev/null and b/Resources/Audio/Effects/Gasp/female_deathgasp_5.ogg differ diff --git a/Resources/Audio/Effects/Gasp/gasp_female1.ogg b/Resources/Audio/Effects/Gasp/gasp_female1.ogg new file mode 100644 index 0000000000..ec9da07eba Binary files /dev/null and b/Resources/Audio/Effects/Gasp/gasp_female1.ogg differ diff --git a/Resources/Audio/Effects/Gasp/gasp_female2.ogg b/Resources/Audio/Effects/Gasp/gasp_female2.ogg new file mode 100644 index 0000000000..2db7d5109c Binary files /dev/null and b/Resources/Audio/Effects/Gasp/gasp_female2.ogg differ diff --git a/Resources/Audio/Effects/Gasp/gasp_female3.ogg b/Resources/Audio/Effects/Gasp/gasp_female3.ogg new file mode 100644 index 0000000000..af94ccba8f Binary files /dev/null and b/Resources/Audio/Effects/Gasp/gasp_female3.ogg differ diff --git a/Resources/Audio/Effects/Gasp/gasp_male1.ogg b/Resources/Audio/Effects/Gasp/gasp_male1.ogg new file mode 100644 index 0000000000..657a2739cd Binary files /dev/null and b/Resources/Audio/Effects/Gasp/gasp_male1.ogg differ diff --git a/Resources/Audio/Effects/Gasp/gasp_male2.ogg b/Resources/Audio/Effects/Gasp/gasp_male2.ogg new file mode 100644 index 0000000000..88ac0b77f4 Binary files /dev/null and b/Resources/Audio/Effects/Gasp/gasp_male2.ogg differ diff --git a/Resources/Audio/Effects/Gasp/male_deathgasp_1.ogg b/Resources/Audio/Effects/Gasp/male_deathgasp_1.ogg new file mode 100644 index 0000000000..341ac39fbc Binary files /dev/null and b/Resources/Audio/Effects/Gasp/male_deathgasp_1.ogg differ diff --git a/Resources/Audio/Effects/Gasp/male_deathgasp_2.ogg b/Resources/Audio/Effects/Gasp/male_deathgasp_2.ogg new file mode 100644 index 0000000000..15bab8b848 Binary files /dev/null and b/Resources/Audio/Effects/Gasp/male_deathgasp_2.ogg differ diff --git a/Resources/Audio/Effects/Gasp/male_deathgasp_3.ogg b/Resources/Audio/Effects/Gasp/male_deathgasp_3.ogg new file mode 100644 index 0000000000..c5107366e3 Binary files /dev/null and b/Resources/Audio/Effects/Gasp/male_deathgasp_3.ogg differ diff --git a/Resources/Audio/Effects/Gasp/male_deathgasp_4.ogg b/Resources/Audio/Effects/Gasp/male_deathgasp_4.ogg new file mode 100644 index 0000000000..b306297917 Binary files /dev/null and b/Resources/Audio/Effects/Gasp/male_deathgasp_4.ogg differ diff --git a/Resources/Audio/Effects/Gasp/male_deathgasp_5.ogg b/Resources/Audio/Effects/Gasp/male_deathgasp_5.ogg new file mode 100644 index 0000000000..0f175b4088 Binary files /dev/null and b/Resources/Audio/Effects/Gasp/male_deathgasp_5.ogg differ diff --git a/Resources/Locale/en-US/body/behavior/behavior.ftl b/Resources/Locale/en-US/body/behavior/behavior.ftl deleted file mode 100644 index 6870fdb894..0000000000 --- a/Resources/Locale/en-US/body/behavior/behavior.ftl +++ /dev/null @@ -1 +0,0 @@ -lung-behavior-gasp = Gasp \ No newline at end of file diff --git a/Resources/Locale/en-US/chat/emotes.ftl b/Resources/Locale/en-US/chat/emotes.ftl index 8a3a3b0680..cccb33a1f1 100644 --- a/Resources/Locale/en-US/chat/emotes.ftl +++ b/Resources/Locale/en-US/chat/emotes.ftl @@ -12,6 +12,7 @@ chat-emote-name-click = Click chat-emote-name-clap = Clap chat-emote-name-snap = Snap chat-emote-name-salute = Salute +chat-emote-name-gasp = Gasp chat-emote-name-deathgasp = Deathgasp chat-emote-name-buzz = Buzz chat-emote-name-weh = Weh @@ -43,6 +44,7 @@ chat-emote-msg-click = clicks. chat-emote-msg-clap = claps! chat-emote-msg-snap = snaps {POSS-ADJ($entity)} fingers. chat-emote-msg-salute = salutes. +chat-emote-msg-gasp = gasps. chat-emote-msg-deathgasp = seizes up and falls limp, {POSS-ADJ($entity)} eyes dead and lifeless... chat-emote-msg-deathgasp-monkey = lets out a faint chimper as {SUBJECT($entity)} collapses and stops moving... chat-emote-msg-buzz = buzzes! diff --git a/Resources/Prototypes/SoundCollections/deathgasp.yml b/Resources/Prototypes/SoundCollections/deathgasp.yml new file mode 100644 index 0000000000..28c33c1fb4 --- /dev/null +++ b/Resources/Prototypes/SoundCollections/deathgasp.yml @@ -0,0 +1,23 @@ +- type: soundCollection + id: MaleDeathGasp + files: + - /Audio/Effects/Gasp/male_deathgasp_1.ogg + - /Audio/Effects/Gasp/male_deathgasp_2.ogg + - /Audio/Effects/Gasp/male_deathgasp_3.ogg + - /Audio/Effects/Gasp/male_deathgasp_4.ogg + - /Audio/Effects/Gasp/male_deathgasp_5.ogg + +- type: soundCollection + id: FemaleDeathGasp + files: + - /Audio/Effects/Gasp/female_deathgasp_1.ogg + - /Audio/Effects/Gasp/female_deathgasp_2.ogg + - /Audio/Effects/Gasp/female_deathgasp_3.ogg + - /Audio/Effects/Gasp/female_deathgasp_4.ogg + - /Audio/Effects/Gasp/female_deathgasp_5.ogg + +- type: soundCollection + id: DeathGasp + files: + - /Audio/Effects/Gasp/deathgasp_1.ogg + - /Audio/Effects/Gasp/deathgasp_2.ogg diff --git a/Resources/Prototypes/SoundCollections/gasp.yml b/Resources/Prototypes/SoundCollections/gasp.yml new file mode 100644 index 0000000000..0f1ec51eda --- /dev/null +++ b/Resources/Prototypes/SoundCollections/gasp.yml @@ -0,0 +1,12 @@ +- type: soundCollection + id: MaleGasp + files: + - /Audio/Effects/Gasp/gasp_male1.ogg + - /Audio/Effects/Gasp/gasp_male2.ogg + +- type: soundCollection + id: FemaleGasp + files: + - /Audio/Effects/Gasp/gasp_female1.ogg + - /Audio/Effects/Gasp/gasp_female2.ogg + - /Audio/Effects/Gasp/gasp_female3.ogg diff --git a/Resources/Prototypes/Voice/speech_emote_sounds.yml b/Resources/Prototypes/Voice/speech_emote_sounds.yml index e86b05f4c8..3358d5be67 100644 --- a/Resources/Prototypes/Voice/speech_emote_sounds.yml +++ b/Resources/Prototypes/Voice/speech_emote_sounds.yml @@ -34,6 +34,10 @@ collection: Whistles Weh: collection: Weh + Gasp: + collection: MaleGasp + DefaultDeathgasp: + collection: MaleDeathGasp - type: emoteSounds id: FemaleHuman @@ -70,6 +74,10 @@ collection: Whistles Weh: collection: Weh + Gasp: + collection: FemaleGasp + DefaultDeathgasp: + collection: FemaleDeathGasp - type: emoteSounds id: MaleReptilian @@ -88,6 +96,10 @@ collection: MaleCry Weh: collection: Weh + Gasp: + collection: MaleGasp + DefaultDeathgasp: + collection: DeathGasp - type: emoteSounds id: FemaleReptilian @@ -142,6 +154,10 @@ collection: Whistles Weh: collection: Weh + Gasp: + collection: MaleGasp + DefaultDeathgasp: + collection: MaleDeathGasp params: variation: 0.125 @@ -180,6 +196,10 @@ collection: Whistles Weh: collection: Weh + Gasp: + collection: FemaleGasp + DefaultDeathgasp: + collection: FemaleDeathGasp params: variation: 0.125 @@ -205,6 +225,10 @@ collection: BikeHorn Weh: collection: Weh + Gasp: + collection: MaleGasp + DefaultDeathgasp: + collection: DeathGasp params: variation: 0.125 @@ -223,6 +247,10 @@ path: /Audio/Voice/Arachnid/arachnid_click.ogg Weh: collection: Weh + Gasp: + collection: MaleGasp + DefaultDeathgasp: + collection: DeathGasp - type: emoteSounds id: UnisexDwarf @@ -257,6 +285,10 @@ collection: Whistles Weh: collection: Weh + Gasp: + collection: MaleGasp + DefaultDeathgasp: + collection: MaleDeathGasp params: variation: 0.125 pitch: 0.75 @@ -294,6 +326,10 @@ collection: Whistles Weh: collection: Weh + Gasp: + collection: FemaleGasp + DefaultDeathgasp: + collection: FemaleDeathGasp params: variation: 0.125 pitch: 0.75 @@ -315,6 +351,10 @@ path: /Audio/Voice/Moth/moth_squeak.ogg Weh: collection: Weh + Gasp: + collection: MaleGasp + DefaultDeathgasp: + collection: DeathGasp - type: emoteSounds id: UnisexSilicon diff --git a/Resources/Prototypes/Voice/speech_emotes.yml b/Resources/Prototypes/Voice/speech_emotes.yml index 84e48c1c23..e571836976 100644 --- a/Resources/Prototypes/Voice/speech_emotes.yml +++ b/Resources/Prototypes/Voice/speech_emotes.yml @@ -1,4 +1,4 @@ -# vocal emotes +# vocal emotes - type: emote id: Scream name: chat-emote-name-scream @@ -338,6 +338,14 @@ - salutes. - salutes! +- type: emote + id: Gasp + name: chat-emote-name-gasp + whitelist: + components: + - Respirator + chatMessages: ["chat-emote-msg-gasp"] + - type: emote id: DefaultDeathgasp name: chat-emote-name-deathgasp