Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes radio sounds not playing (fr) #176

Merged
merged 3 commits into from
Dec 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions code/__DEFINES/say.dm
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@
#define MODE_VOCALCORDS "cords"
#define MODE_KEY_VOCALCORDS "x"

/// Automatically playing a set of lines
#define MODE_SEQUENTIAL "sequential"

#define MODE_MAFIA "mafia"

/// Applies singing characters to the message
Expand Down
12 changes: 8 additions & 4 deletions code/game/objects/items/devices/radio/radio.dm
Original file line number Diff line number Diff line change
Expand Up @@ -348,10 +348,14 @@
signal.broadcast()
return

if(isliving(talking_movable)) //iris edit
if(isliving(talking_movable))
var/mob/living/talking_living = talking_movable
if(talking_living.client?.prefs.read_preference(/datum/preference/numeric/sound_radio_noise) && !HAS_TRAIT(talking_living, TRAIT_DEAF))
SEND_SOUND(talking_living, 'sound/items/radio/radio_talk.ogg')
var/volume_modifier = (talking_living.client?.prefs.read_preference(/datum/preference/numeric/sound_radio_noise))
if(radio_noise && talking_living.can_hear() && volume_modifier && signal.frequency != FREQ_COMMON && !LAZYACCESS(message_mods, MODE_SEQUENTIAL) && COOLDOWN_FINISHED(src, audio_cooldown))
COOLDOWN_START(src, audio_cooldown, 0.5 SECONDS)
var/sound/radio_noise = sound(sound('sound/items/radio/radio_talk.ogg', volume = volume_modifier))
radio_noise.frequency = get_rand_frequency_low_range()
SEND_SOUND(talking_living, radio_noise)

// All radios make an attempt to use the subspace system first
signal.send_to_receivers()
Expand Down Expand Up @@ -436,7 +440,7 @@
COOLDOWN_START(src, audio_cooldown, 0.5 SECONDS)
var/sound/radio_receive = sound('sound/items/radio/radio_receive.ogg', volume = volume_modifier)
radio_receive.frequency = get_rand_frequency_low_range()
SEND_SOUND(holder, radio_noise)
SEND_SOUND(holder, radio_receive)
if((SPAN_COMMAND in spans) && COOLDOWN_FINISHED(src, important_audio_cooldown))
COOLDOWN_START(src, important_audio_cooldown, 0.5 SECONDS)
var/sound/radio_important = sound('sound/items/radio/radio_important.ogg', volume = volume_modifier)
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/items/devices/taperecorder.dm
Original file line number Diff line number Diff line change
Expand Up @@ -262,15 +262,15 @@
balloon_alert(usr, "recording ended")
stoplag(1 SECONDS) //prevents multiple balloon alerts covering each other
break
say("[mytape.storedinfo[i]]", sanitize=FALSE)//We want to display this properly, don't double encode
say("[mytape.storedinfo[i]]", sanitize=FALSE, message_mods = list(MODE_SEQUENTIAL = TRUE))//We want to display this properly, don't double encode
if(mytape.storedinfo.len < i + 1)
playsleepseconds = 1
sleep(1 SECONDS)
else
playsleepseconds = mytape.timestamp[i + 1] - mytape.timestamp[i]
if(playsleepseconds > 14 SECONDS)
sleep(1 SECONDS)
say("Skipping [playsleepseconds/10] seconds of silence.")
say("Skipping [playsleepseconds/10] seconds of silence.", message_mods = list(MODE_SEQUENTIAL = TRUE))
playsleepseconds = 1 SECONDS
i++

Expand Down
10 changes: 5 additions & 5 deletions code/modules/mob/living/silicon/silicon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@

if (lawcache_zeroth)
if (force || (lawcache_zeroth in lawcache_lawcheck))
say("[radiomod] 0. [lawcache_zeroth]", forced = forced_log_message)
say("[radiomod] 0. [lawcache_zeroth]", forced = forced_log_message, message_mods = list(MODE_SEQUENTIAL = TRUE))
sleep(1 SECONDS)

for (var/index in 1 to length(lawcache_hacked))
Expand All @@ -273,7 +273,7 @@
if (length(law) <= 0)
continue
if (force || (law in lawcache_hackedcheck))
say("[radiomod] [num]. [law]", forced = forced_log_message)
say("[radiomod] [num]. [law]", forced = forced_log_message, message_mods = list(MODE_SEQUENTIAL = TRUE))
sleep(1 SECONDS)

for (var/index in 1 to length(lawcache_ion))
Expand All @@ -282,7 +282,7 @@
if (length(law) <= 0)
return
if (force || (law in lawcache_ioncheck))
say("[radiomod] [num]. [law]", forced = forced_log_message)
say("[radiomod] [num]. [law]", forced = forced_log_message, message_mods = list(MODE_SEQUENTIAL = TRUE))
sleep(1 SECONDS)

var/number = 1
Expand All @@ -291,7 +291,7 @@
if (length(law) <= 0)
continue
if (force || (law in lawcache_lawcheck))
say("[radiomod] [number]. [law]", forced = forced_log_message)
say("[radiomod] [number]. [law]", forced = forced_log_message, message_mods = list(MODE_SEQUENTIAL = TRUE))
number++
sleep(1 SECONDS)

Expand All @@ -301,7 +301,7 @@
if (length(law) <= 0)
continue
if (force || (law in lawcache_lawcheck))
say("[radiomod] [number]. [law]", forced = forced_log_message)
say("[radiomod] [number]. [law]", forced = forced_log_message, message_mods = list(MODE_SEQUENTIAL = TRUE))
number++
sleep(1 SECONDS)

Expand Down
Loading