]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Remake gasp popup to emote (#27736)
authorlzk <124214523+lzk228@users.noreply.github.com>
Tue, 28 May 2024 23:56:41 +0000 (01:56 +0200)
committerGitHub <noreply@github.com>
Tue, 28 May 2024 23:56:41 +0000 (19:56 -0400)
26 files changed:
Content.Server/Body/Components/RespiratorComponent.cs
Content.Server/Body/Systems/RespiratorSystem.cs
Resources/Audio/Effects/Gasp/attributions.yml [new file with mode: 0644]
Resources/Audio/Effects/Gasp/deathgasp_1.ogg [new file with mode: 0644]
Resources/Audio/Effects/Gasp/deathgasp_2.ogg [new file with mode: 0644]
Resources/Audio/Effects/Gasp/female_deathgasp_1.ogg [new file with mode: 0644]
Resources/Audio/Effects/Gasp/female_deathgasp_2.ogg [new file with mode: 0644]
Resources/Audio/Effects/Gasp/female_deathgasp_3.ogg [new file with mode: 0644]
Resources/Audio/Effects/Gasp/female_deathgasp_4.ogg [new file with mode: 0644]
Resources/Audio/Effects/Gasp/female_deathgasp_5.ogg [new file with mode: 0644]
Resources/Audio/Effects/Gasp/gasp_female1.ogg [new file with mode: 0644]
Resources/Audio/Effects/Gasp/gasp_female2.ogg [new file with mode: 0644]
Resources/Audio/Effects/Gasp/gasp_female3.ogg [new file with mode: 0644]
Resources/Audio/Effects/Gasp/gasp_male1.ogg [new file with mode: 0644]
Resources/Audio/Effects/Gasp/gasp_male2.ogg [new file with mode: 0644]
Resources/Audio/Effects/Gasp/male_deathgasp_1.ogg [new file with mode: 0644]
Resources/Audio/Effects/Gasp/male_deathgasp_2.ogg [new file with mode: 0644]
Resources/Audio/Effects/Gasp/male_deathgasp_3.ogg [new file with mode: 0644]
Resources/Audio/Effects/Gasp/male_deathgasp_4.ogg [new file with mode: 0644]
Resources/Audio/Effects/Gasp/male_deathgasp_5.ogg [new file with mode: 0644]
Resources/Locale/en-US/body/behavior/behavior.ftl [deleted file]
Resources/Locale/en-US/chat/emotes.ftl
Resources/Prototypes/SoundCollections/deathgasp.yml [new file with mode: 0644]
Resources/Prototypes/SoundCollections/gasp.yml [new file with mode: 0644]
Resources/Prototypes/Voice/speech_emote_sounds.yml
Resources/Prototypes/Voice/speech_emotes.yml

index 4045e21e26a72a682b5cd3fd566474a767d2971e..a81062362aebe326d4c27520659041447f5f06be 100644 (file)
@@ -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;
+
+        /// <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?
index c7266e2c463e93d41b179334de5607b593f94bd6..a46294beb4d93a643ffc68bb004fa553bb11a3af 100644 (file)
@@ -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 (file)
index 0000000..fe8f817
--- /dev/null
@@ -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 (file)
index 0000000..d6e4f8a
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 (file)
index 0000000..77959ff
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 (file)
index 0000000..2139a26
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 (file)
index 0000000..713721d
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 (file)
index 0000000..eaf356d
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 (file)
index 0000000..b3c9a80
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 (file)
index 0000000..b9b45c9
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 (file)
index 0000000..ec9da07
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 (file)
index 0000000..2db7d51
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 (file)
index 0000000..af94ccb
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 (file)
index 0000000..657a273
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 (file)
index 0000000..88ac0b7
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 (file)
index 0000000..341ac39
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 (file)
index 0000000..15bab8b
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 (file)
index 0000000..c510736
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 (file)
index 0000000..b306297
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 (file)
index 0000000..0f175b4
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 (file)
index 6870fdb..0000000
+++ /dev/null
@@ -1 +0,0 @@
-lung-behavior-gasp = Gasp
\ No newline at end of file
index 8a3a3b0680dc99fbfebf95ad1154f256d9e47df1..cccb33a1f17b4eed672c651f48f0a77ad74dacb2 100644 (file)
@@ -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 (file)
index 0000000..28c33c1
--- /dev/null
@@ -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 (file)
index 0000000..0f1ec51
--- /dev/null
@@ -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
index e86b05f4c88787961c83f11b949ad0549165a39d..3358d5be6786054e2c78f0f7c20258f36f9695c8 100644 (file)
       collection: Whistles
     Weh:
       collection: Weh
+    Gasp:
+      collection: MaleGasp
+    DefaultDeathgasp:
+      collection: MaleDeathGasp
 
 - type: emoteSounds
   id: FemaleHuman
       collection: Whistles
     Weh:
       collection: Weh
+    Gasp:
+      collection: FemaleGasp
+    DefaultDeathgasp:
+      collection: FemaleDeathGasp
 
 - type: emoteSounds
   id: MaleReptilian
       collection: MaleCry
     Weh:
       collection: Weh
+    Gasp:
+      collection: MaleGasp
+    DefaultDeathgasp:
+      collection: DeathGasp
 
 - type: emoteSounds
   id: FemaleReptilian
       collection: Whistles
     Weh:
       collection: Weh
+    Gasp:
+      collection: MaleGasp
+    DefaultDeathgasp:
+      collection: MaleDeathGasp
   params:
     variation: 0.125
 
       collection: Whistles
     Weh:
       collection: Weh
+    Gasp:
+      collection: FemaleGasp
+    DefaultDeathgasp:
+      collection: FemaleDeathGasp
   params:
     variation: 0.125
 
       collection: BikeHorn
     Weh:
       collection: Weh
+    Gasp:
+      collection: MaleGasp
+    DefaultDeathgasp:
+      collection: DeathGasp
   params:
     variation: 0.125
 
       path: /Audio/Voice/Arachnid/arachnid_click.ogg
     Weh:
       collection: Weh
+    Gasp:
+      collection: MaleGasp
+    DefaultDeathgasp:
+      collection: DeathGasp
 
 - type: emoteSounds
   id: UnisexDwarf
       collection: Whistles
     Weh:
       collection: Weh
+    Gasp:
+      collection: MaleGasp
+    DefaultDeathgasp:
+      collection: MaleDeathGasp
   params:
     variation: 0.125
     pitch: 0.75
       collection: Whistles
     Weh:
       collection: Weh
+    Gasp:
+      collection: FemaleGasp
+    DefaultDeathgasp:
+      collection: FemaleDeathGasp
   params:
     variation: 0.125
     pitch: 0.75
       path: /Audio/Voice/Moth/moth_squeak.ogg
     Weh:
       collection: Weh
+    Gasp:
+      collection: MaleGasp
+    DefaultDeathgasp:
+      collection: DeathGasp
 
 - type: emoteSounds
   id: UnisexSilicon
index 84e48c1c23e27ddfc7b69877664c16a67a34c175..e571836976414d65ccc45aaeeda904f0b7b8d47f 100644 (file)
@@ -1,4 +1,4 @@
-# vocal emotes
+# vocal emotes
 - type: emote
   id: Scream
   name: chat-emote-name-scream
     - 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