From: lzk <124214523+lzk228@users.noreply.github.com>
Date: Fri, 22 Mar 2024 07:00:57 +0000 (+0100)
Subject: Snore is a trait now (#26322)
X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=3b3b874dd9222770da616ba07277842d6b7a09be;p=space-station-14.git
Snore is a trait now (#26322)
---
diff --git a/Content.Server/Bed/Components/SnoringComponent.cs b/Content.Server/Bed/Components/SnoringComponent.cs
new file mode 100644
index 0000000000..09f80327ba
--- /dev/null
+++ b/Content.Server/Bed/Components/SnoringComponent.cs
@@ -0,0 +1,10 @@
+namespace Content.Server.Bed.Sleep;
+
+///
+/// This is used for the snoring trait.
+///
+[RegisterComponent]
+public sealed partial class SnoringComponent : Component
+{
+
+}
diff --git a/Content.Server/Bed/Sleep/SleepingSystem.cs b/Content.Server/Bed/Sleep/SleepingSystem.cs
index 685b1087d7..b497254433 100644
--- a/Content.Server/Bed/Sleep/SleepingSystem.cs
+++ b/Content.Server/Bed/Sleep/SleepingSystem.cs
@@ -67,7 +67,10 @@ namespace Content.Server.Bed.Sleep
if (TryComp(uid, out var sleepSound))
{
var emitSound = EnsureComp(uid);
- emitSound.Sound = sleepSound.Snore;
+ if (HasComp(uid))
+ {
+ emitSound.Sound = sleepSound.Snore;
+ }
emitSound.PlayChance = sleepSound.Chance;
emitSound.RollInterval = sleepSound.Interval;
emitSound.PopUp = sleepSound.PopUp;
diff --git a/Resources/Locale/en-US/traits/traits.ftl b/Resources/Locale/en-US/traits/traits.ftl
index 89f0e04f5a..b82cb0033a 100644
--- a/Resources/Locale/en-US/traits/traits.ftl
+++ b/Resources/Locale/en-US/traits/traits.ftl
@@ -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.
diff --git a/Resources/Prototypes/Traits/disabilities.yml b/Resources/Prototypes/Traits/disabilities.yml
index 53d481c37e..0f785c75c7 100644
--- a/Resources/Prototypes/Traits/disabilities.yml
+++ b/Resources/Prototypes/Traits/disabilities.yml
@@ -60,3 +60,10 @@
description: trait-frontal-lisp-desc
components:
- type: FrontalLisp
+
+- type: trait
+ id: Snoring
+ name: trait-snoring-name
+ description: trait-snoring-desc
+ components:
+ - type: Snoring