]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Snore is a trait now (#26322)
authorlzk <124214523+lzk228@users.noreply.github.com>
Fri, 22 Mar 2024 07:00:57 +0000 (08:00 +0100)
committerGitHub <noreply@github.com>
Fri, 22 Mar 2024 07:00:57 +0000 (18:00 +1100)
Content.Server/Bed/Components/SnoringComponent.cs [new file with mode: 0644]
Content.Server/Bed/Sleep/SleepingSystem.cs
Resources/Locale/en-US/traits/traits.ftl
Resources/Prototypes/Traits/disabilities.yml

diff --git a/Content.Server/Bed/Components/SnoringComponent.cs b/Content.Server/Bed/Components/SnoringComponent.cs
new file mode 100644 (file)
index 0000000..09f8032
--- /dev/null
@@ -0,0 +1,10 @@
+namespace Content.Server.Bed.Sleep;
+
+/// <summary>
+/// This is used for the snoring trait.
+/// </summary>
+[RegisterComponent]
+public sealed partial class SnoringComponent : Component
+{
+
+}
index 685b1087d70010ff3d6c982817455226c1b8c0fb..b4972544338598ae1b01303f226b6c648c0dfc62 100644 (file)
@@ -67,7 +67,10 @@ namespace Content.Server.Bed.Sleep
                 if (TryComp<SleepEmitSoundComponent>(uid, out var sleepSound))
                 {
                     var emitSound = EnsureComp<SpamEmitSoundComponent>(uid);
-                    emitSound.Sound = sleepSound.Snore;
+                    if (HasComp<SnoringComponent>(uid))
+                    {
+                        emitSound.Sound = sleepSound.Snore;
+                    }
                     emitSound.PlayChance = sleepSound.Chance;
                     emitSound.RollInterval = sleepSound.Interval;
                     emitSound.PopUp = sleepSound.PopUp;
index 89f0e04f5a55c504b4b99ed4a18062543a7048fd..b82cb0033a768e361a7f0e5e61c868bc7292f86f 100644 (file)
@@ -32,3 +32,6 @@ trait-frontal-lisp-desc = You thpeak with a lithp
 
 trait-socialanxiety-name = Social Anxiety
 trait-socialanxiety-desc = You are anxious when you speak and stutter.
+
+trait-snoring-name = Snoring
+trait-snoring-desc = You will snore while sleeping.
index 53d481c37e811157180236a54a451b83dc803832..0f785c75c7eccb94950ec51c26ab051197972245 100644 (file)
   description: trait-frontal-lisp-desc
   components:
     - type: FrontalLisp
+
+- type: trait
+  id: Snoring
+  name: trait-snoring-name
+  description: trait-snoring-desc
+  components:
+    - type: Snoring