Skip to content

Commit

Permalink
Merge branch 'master' into tg-effects-part2-poc
Browse files Browse the repository at this point in the history
  • Loading branch information
fira committed Nov 20, 2023
2 parents 465f7c3 + 068b9f7 commit ba21d32
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 13 deletions.
34 changes: 21 additions & 13 deletions code/datums/looping_sounds/_looping_sound.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@
/// Has the looping started yet?
var/loop_started = FALSE

/**
* Let's you make a "loud" sound that "projects." IE you can hear this sound from a further distance away.
* Think of like an air raid siren. They're loud if you're close yeah... but you can hear them from mad far away, bruv
* with a longer "falloff distance." Fixes the extra_range stuff
*/
var/is_sound_projecting = FALSE
///only applicable to is_sound_projecting: max range till sound volume starts dropping as distance increases
var/falloff_distance = 50

/* // as of yet unused varen \\
/// How much the sound will be affected by falloff per tile.
Expand Down Expand Up @@ -130,19 +139,18 @@
sound_to_play.channel = get_free_channel()
sound_to_play.volume = volume_override || volume //Use volume as fallback if theres no override
SEND_SOUND(parent, sound_to_play)
else
playsound(
parent,
sound_to_play,
volume,
vary,
extra_range//,
// falloff_exponent = falloff_exponent,
// pressure_affected = pressure_affected,
// ignore_walls = ignore_walls,
// falloff_distance = falloff_distance,
// use_reverb = use_reverb
)
return
if (is_sound_projecting)
playsound(parent, sound_to_play, volume, vary, extra_range, VOLUME_SFX, 0, 0, falloff_distance)
return

playsound(
parent,
sound_to_play,
volume,
vary,
extra_range
)

/// Returns the sound we should now be playing.
/datum/looping_sound/proc/get_sound(_mid_sounds)
Expand Down
4 changes: 4 additions & 0 deletions html/changelogs/AutoChangeLog-pr-4857.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
author: "hislittlecuzingames"
delete-after: True
changes:
- code_imp: "Added ability to have looping sounds from further away"

0 comments on commit ba21d32

Please sign in to comment.