Fix computer looping sounds and minor refactor of looping sounds (#17319)

* sdfas

* sdf
This commit is contained in:
Fluffy
2023-09-12 10:38:18 +00:00
committed by GitHub
parent c7a155fbc5
commit 784a08ea1d
5 changed files with 77 additions and 2 deletions
+32 -1
View File
@@ -16,27 +16,58 @@
*/
/datum/looping_sound
///A `/list` of `/atom`, destinations for the sound
var/list/atom/output_atoms = list()
/**
* A list with soundfiles, or a soundfile, to play for the intermediate steps
*
* Must contain at least one sound
*/
var/mid_sounds
///The length to wait between playing mid_sounds
var/mid_length
///Volume for the start sound
var/start_volume
///A soundfile, played before starting the mid_sounds loop
var/start_sound
///How long to wait before starting the main loop after playing start_sound
var/start_length
///Volume for the end sound
var/end_volume
///A soundfile, the sound played after the main loop has concluded
var/end_sound
///Chance per loop to play a mid_sound
var/chance
///Sound output volume
var/volume = 100
///Whether or not the sounds will vary in pitch when played
var/vary = FALSE
///The max amount of loops to run for
var/max_loops
var/direct
///The extra range of the sound in tiles, defaults to 0.
var/extra_range
var/falloff
///The ID of the timer that's used to loop the sounds.
var/timerid
/datum/looping_sound/New(list/_output_atoms=list(), start_immediately=FALSE, _direct=FALSE)
if(!mid_sounds)
WARNING("A looping sound datum was created without sounds to play.")
crash_with("A looping sound datum was created without sounds to play.")
return
output_atoms |= _output_atoms
@@ -82,9 +82,11 @@
start_sound = 'sound/machines/computer/computer_start.ogg'
start_length = 7.2 SECONDS
start_volume = 10
mid_sounds = list('sound/machines/computer/computer_mid1.ogg' = 1, 'sound/machines/computer/computer_mid2.ogg' = 1)
mid_length = 1.8 SECONDS
end_sound = 'sound/machines/computer/computer_end.ogg'
end_volume = 10
volume = 3
volume = 1
extra_range = -5.5
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -0,0 +1,42 @@
################################
# Example Changelog File
#
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
#
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
# When it is, any changes listed below will disappear.
#
# Valid Prefixes:
# bugfix
# wip (For works in progress)
# tweak
# soundadd
# sounddel
# rscadd (general adding of nice things)
# rscdel (general deleting of nice things)
# imageadd
# imagedel
# maptweak
# spellcheck (typo fixes)
# experiment
# balance
# admin
# backend
# security
# refactor
#################################
# Your name.
author: FluffyGhost
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
delete-after: True
# Any changes you've made. See valid prefix list above.
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
# SCREW THIS UP AND IT WON'T WORK.
# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
changes:
- bugfix: "Readded computer looping sounds at lower volume, as the mid_sounds are required for looping sounds."
- refactor: "Added some dmdoc to the looping sounds, and turned the warning+return to a crash_with to avoid further reintroduction of this kind of issues."
Binary file not shown.
Binary file not shown.