clown mimimi sleeping sound (#18127)

* clown mimimi sleeping sound

* make its own component

* different sound (with attribution)

* oopsie

* back to mimimi (with attribution)
This commit is contained in:
Slava0135 2023-07-19 11:55:50 +03:00 committed by GitHub
parent 31ae0d332c
commit 2eb6689834
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 56 additions and 8 deletions

View File

@ -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<StunnedComponent>(uid);
EnsureComp<KnockedDownComponent>(uid);
var emitSound = EnsureComp<SpamEmitSoundComponent>(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<SleepEmitSoundComponent>(uid, out var sleepSound))
{
var emitSound = EnsureComp<SpamEmitSoundComponent>(uid);
emitSound.Sound = sleepSound.Snore;
emitSound.PlayChance = sleepSound.Chance;
emitSound.RollInterval = sleepSound.Interval;
emitSound.PopUp = sleepSound.PopUp;
}
if (wakeAction != null)
{

View File

@ -0,0 +1,31 @@
using Robust.Shared.Audio;
namespace Content.Shared.Bed.Sleep;
[RegisterComponent]
public sealed class SleepEmitSoundComponent : Component
{
/// <summary>
/// Sound to play when sleeping
/// </summary>
[DataField("snore"), ViewVariables(VVAccess.ReadWrite)]
public SoundSpecifier Snore = new SoundCollectionSpecifier("Snores", AudioParams.Default.WithVariation(0.2f));
/// <summary>
/// Interval between snore attempts in seconds
/// </summary>
[DataField("interval"), ViewVariables(VVAccess.ReadWrite)]
public float Interval = 5f;
/// <summary>
/// Chance for snore attempt to succeed
/// </summary>
[DataField("chance"), ViewVariables(VVAccess.ReadWrite)]
public float Chance = 0.33f;
/// <summary>
/// Popup for snore (e.g. Zzz...)
/// </summary>
[DataField("popUp"), ViewVariables(VVAccess.ReadWrite)]
public string PopUp = "sleep-onomatopoeia";
}

View File

@ -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"
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"

Binary file not shown.

Binary file not shown.

View File

@ -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

View File

@ -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 ]