Skip to content

Commit

Permalink
Mirror: Snore is a trait now (#299)
Browse files Browse the repository at this point in the history
## Mirror of PR #26322: [Snore is a trait
now](space-wizards/space-station-14#26322) from
<img src="https://avatars.githubusercontent.com/u/10567778?v=4"
alt="space-wizards" width="22"/>
[space-wizards](https://github.com/space-wizards)/[space-station-14](https://github.com/space-wizards/space-station-14)

###### `3b3b874dd9222770da616ba07277842d6b7a09be`

PR opened by <img
src="https://avatars.githubusercontent.com/u/124214523?v=4"
width="16"/><a href="https://github.com/lzk228"> lzk228</a> at
2024-03-21 23:18:00 UTC

---

PR changed 4 files with 24 additions and 1 deletions.

The PR had the following labels:


---

<details open="true"><summary><h1>Original Body</h1></summary>

> <!-- Please read these guidelines before opening your PR:
https://docs.spacestation14.io/en/getting-started/pr-guideline -->
> <!-- The text between the arrows are comments - they will not be
visible on your PR. -->
> 
> ## About the PR
> <!-- What did you change in this PR? -->
> Title.
> Snore sound is emitting with trait. Without trait not.
> 
> ## Why / Balance
> <!-- Why was it changed? Link any discussions or issues here. Please
discuss how this would affect game balance. -->
> Someone told me that snoring is a disease, and not every should have
it so i decided to do this pr.
> 
> ## Technical details
> <!-- If this is a code change, summarize at high level how your new
code works. This makes it easier to review. -->
> 
> ## Media
> <!-- 
> PRs which make ingame changes (adding clothing, items, new features,
etc) are required to have media attached that showcase the changes.
> Small fixes/refactors are exempt.
> Any media may be used in SS14 progress reports, with clear credit
given.
> 
> If you're unsure whether your PR will require media, ask a maintainer.
> 
> Check the box below to confirm that you have in fact seen this (put an
X in the brackets, like [X]):
> -->
> 
> - [ ] I have added screenshots/videos to this PR showcasing its
changes ingame, **or** this PR does not require an ingame showcase
> 
> ## Breaking changes
> <!--
> List any breaking changes, including namespace, public
class/method/field changes, prototype renames; and provide instructions
for fixing them. This will be pasted in #codebase-changes.
> -->
> 
> **Changelog**
> <!--
> Make players aware of new features and changes that could affect how
they play the game by adding a Changelog entry. Please read the
Changelog guidelines located at:
https://docs.spacestation14.io/en/getting-started/pr-guideline#changelog
> -->
> 
> 
> Make sure to take this Changelog template out of the comment block in
order for it to show up.
> 🆑
> - tweak: Snoring is now a trait in character preference menu.
> 
> 


</details>

Co-authored-by: SimpleStation14 <Unknown>
  • Loading branch information
SimpleStation14 authored May 29, 2024
1 parent 3b2a19d commit a58b815
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
10 changes: 10 additions & 0 deletions Content.Server/Bed/Components/SnoringComponent.cs
Original file line number Diff line number Diff line change
@@ -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
{

}
5 changes: 4 additions & 1 deletion Content.Server/Bed/Sleep/SleepingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ private void OnSleepStateChanged(EntityUid uid, MobStateComponent component, Sle
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;
Expand Down
3 changes: 3 additions & 0 deletions Resources/Locale/en-US/traits/traits.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,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.
7 changes: 7 additions & 0 deletions Resources/Prototypes/Traits/disabilities.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit a58b815

Please sign in to comment.