diff --git a/Content.Server/Bed/Sleep/SleepingSystem.cs b/Content.Server/Bed/Sleep/SleepingSystem.cs index b349b02065..93286fa3bc 100644 --- a/Content.Server/Bed/Sleep/SleepingSystem.cs +++ b/Content.Server/Bed/Sleep/SleepingSystem.cs @@ -19,6 +19,7 @@ using Robust.Shared.Player; using Robust.Shared.Prototypes; using Robust.Shared.Random; using Robust.Shared.Timing; +using Content.Shared.Interaction.Components; namespace Content.Server.Bed.Sleep { @@ -62,13 +63,14 @@ namespace Content.Server.Bed.Sleep EnsureComp(uid); EnsureComp(uid); - var emitSound = EnsureComp(uid); - - // TODO WTF is this, these should a data fields and not hard-coded. - emitSound.Sound = new SoundCollectionSpecifier("Snores", AudioParams.Default.WithVariation(0.2f)); - emitSound.PlayChance = 0.33f; - emitSound.RollInterval = 5f; - emitSound.PopUp = "sleep-onomatopoeia"; + if (TryComp(uid, out var sleepSound)) + { + var emitSound = EnsureComp(uid); + emitSound.Sound = sleepSound.Snore; + emitSound.PlayChance = sleepSound.Chance; + emitSound.RollInterval = sleepSound.Interval; + emitSound.PopUp = sleepSound.PopUp; + } if (wakeAction != null) { diff --git a/Content.Shared/Bed/Sleep/SleepEmitSoundComponent.cs b/Content.Shared/Bed/Sleep/SleepEmitSoundComponent.cs new file mode 100644 index 0000000000..b48d3b239c --- /dev/null +++ b/Content.Shared/Bed/Sleep/SleepEmitSoundComponent.cs @@ -0,0 +1,31 @@ +using Robust.Shared.Audio; + +namespace Content.Shared.Bed.Sleep; + +[RegisterComponent] +public sealed class SleepEmitSoundComponent : Component +{ + /// + /// Sound to play when sleeping + /// + [DataField("snore"), ViewVariables(VVAccess.ReadWrite)] + public SoundSpecifier Snore = new SoundCollectionSpecifier("Snores", AudioParams.Default.WithVariation(0.2f)); + + /// + /// Interval between snore attempts in seconds + /// + [DataField("interval"), ViewVariables(VVAccess.ReadWrite)] + public float Interval = 5f; + + /// + /// Chance for snore attempt to succeed + /// + [DataField("chance"), ViewVariables(VVAccess.ReadWrite)] + public float Chance = 0.33f; + + /// + /// Popup for snore (e.g. Zzz...) + /// + [DataField("popUp"), ViewVariables(VVAccess.ReadWrite)] + public string PopUp = "sleep-onomatopoeia"; +} diff --git a/Resources/Audio/Voice/Misc/attributions.yml b/Resources/Audio/Voice/Misc/attributions.yml index d9e11b3f0c..f6066bcb1e 100644 --- a/Resources/Audio/Voice/Misc/attributions.yml +++ b/Resources/Audio/Voice/Misc/attributions.yml @@ -5,4 +5,14 @@ - "lowHiss4.ogg" license: "CC-BY-SA-3.0" copyright: "Taken from tgstation" - source: "https://github.com/tgstation/tgstation/tree/ae9767664701396501af5dcef8e34c4b5add3d47/sound/ambience" \ No newline at end of file + source: "https://github.com/tgstation/tgstation/tree/ae9767664701396501af5dcef8e34c4b5add3d47/sound/ambience" + +- files: ["cute_snore.ogg"] + license: "CC-BY-4.0" + copyright: "Created by Trogg, converted to mono and ogg by slava0135" + source: "https://freesound.org/people/Trogg/sounds/489478/" + +- files: ["silly_snore.ogg"] + license: "CC0-1.0" + copyright: "Created by Snore Man, converted to mono and ogg by slava0135" + source: "https://soundbible.com/1683-Silly-Snoring.html" diff --git a/Resources/Audio/Voice/Misc/cute_snore.ogg b/Resources/Audio/Voice/Misc/cute_snore.ogg new file mode 100644 index 0000000000..d1e83b9e97 Binary files /dev/null and b/Resources/Audio/Voice/Misc/cute_snore.ogg differ diff --git a/Resources/Audio/Voice/Misc/silly_snore.ogg b/Resources/Audio/Voice/Misc/silly_snore.ogg new file mode 100644 index 0000000000..7b3d82ce39 Binary files /dev/null and b/Resources/Audio/Voice/Misc/silly_snore.ogg differ diff --git a/Resources/Prototypes/Entities/Mobs/Species/base.yml b/Resources/Prototypes/Entities/Mobs/Species/base.yml index 0e47f883a6..664103c543 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/base.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/base.yml @@ -302,6 +302,7 @@ price: 1500 # Kidnapping a living person and selling them for cred is a good move. deathPenalty: 0.01 # However they really ought to be living and intact, otherwise they're worth 100x less. - type: ContentEye + - type: SleepEmitSound - type: entity save: false diff --git a/Resources/Prototypes/Roles/Jobs/Civilian/clown.yml b/Resources/Prototypes/Roles/Jobs/Civilian/clown.yml index 63ec8271fb..8958163ee0 100644 --- a/Resources/Prototypes/Roles/Jobs/Civilian/clown.yml +++ b/Resources/Prototypes/Roles/Jobs/Civilian/clown.yml @@ -19,6 +19,10 @@ Piercing: 4 groups: Burn: 3 + - type: SleepEmitSound + snore: /Audio/Voice/Misc/silly_snore.ogg + interval: 10 + chance: 1.0 - !type:AddImplantSpecial implants: [ SadTromboneImplant ]