From 144b586a91c42a8f924c924f4f17d7b0130dc7c2 Mon Sep 17 00:00:00 2001 From: ihatethisengine <115417687+ihatethisengine@users.noreply.github.com> Date: Sat, 9 Sep 2023 06:20:41 +0300 Subject: [PATCH] On-screen messages sounds (#4301) # About the pull request On-screen messages now appear with sound. Radio static for marines, distant roar for xenos. # Explain why it's good for the game Helps to draw attention to the message. Weather broadcast has sounds, but the rest of the messages for some reason do not. # Testing Photographs and Procedure
Screenshots & Videos Put screenshots and videos here with an empty line between the screenshots and the `
` tags.
# Changelog :cl: ihatethisengine add: On-screen messages now appear with sound. Radio static for marines, distant roar for xenos. /:cl: --------- Co-authored-by: ihatethisengine Co-authored-by: Drathek <76988376+Drulikar@users.noreply.github.com> --- code/game/jobs/job/marine/squads.dm | 13 +++++++------ .../mob/living/carbon/xenomorph/XenoProcs.dm | 11 ++++++----- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/code/game/jobs/job/marine/squads.dm b/code/game/jobs/job/marine/squads.dm index fb85be012d30..116de402104d 100644 --- a/code/game/jobs/job/marine/squads.dm +++ b/code/game/jobs/job/marine/squads.dm @@ -370,13 +370,14 @@ var/message_colour = chat_color if(only_leader) if(squad_leader) - var/mob/living/carbon/human/SL = squad_leader - if(!SL.stat && SL.client) - SL.play_screen_text("[title_text]
" + text, /atom/movable/screen/text/screen_text/command_order, message_colour) + if(!squad_leader.stat && squad_leader.client) + playsound_client(squad_leader.client, 'sound/effects/radiostatic.ogg', squad_leader.loc, 25, FALSE) + squad_leader.play_screen_text("[title_text]
" + text, /atom/movable/screen/text/screen_text/command_order, message_colour) else - for(var/mob/living/carbon/human/M in marines_list) - if(!M.stat && M.client) //Only living and connected people in our squad - M.play_screen_text("[title_text]
" + text, /atom/movable/screen/text/screen_text/command_order, message_colour) + for(var/mob/living/carbon/human/marine in marines_list) + if(!marine.stat && marine.client) //Only living and connected people in our squad + playsound_client(marine.client, 'sound/effects/radiostatic.ogg', marine.loc, 25, FALSE) + marine.play_screen_text("[title_text]
" + text, /atom/movable/screen/text/screen_text/command_order, message_colour) /// Displays a message to the squad members in chat /datum/squad/proc/send_message(text = "", plus_name = 0, only_leader = 0) diff --git a/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm b/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm index 37b0aa037cd1..fa9036bd8305 100644 --- a/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm +++ b/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm @@ -21,16 +21,17 @@ if(M && istype(M) && !M.stat && M.client && (!hivenumber || M.hivenumber == hivenumber)) //Only living and connected xenos to_chat(M, SPAN_XENODANGER(" [message]")) -//Sends a maptext alert to our currently selected squad. Does not make sound. +//Sends a maptext alert to xenos. /proc/xeno_maptext(text = "", title_text = "", hivenumber = XENO_HIVE_NORMAL) if(text == "" || !hivenumber) return //Logic if(SSticker.mode && SSticker.mode.xenomorphs.len) //Send to only xenos in our gamemode list. This is faster than scanning all mobs - for(var/datum/mind/L in SSticker.mode.xenomorphs) - var/mob/living/carbon/M = L.current - if(M && istype(M) && !M.stat && M.client && M.ally_of_hivenumber(hivenumber)) //Only living and connected xenos - M.play_screen_text("[title_text]
" + text, /atom/movable/screen/text/screen_text/command_order, "#b491c8") + for(var/datum/mind/living in SSticker.mode.xenomorphs) + var/mob/living/carbon/xenomorph/xeno = living.current + if(istype(xeno) && !xeno.stat && xeno.client && xeno.hivenumber == hivenumber) //Only living and connected xenos + playsound_client(xeno.client, 'sound/voice/alien_distantroar_3.ogg', xeno.loc, 25, FALSE) + xeno.play_screen_text("[title_text]
" + text, /atom/movable/screen/text/screen_text/command_order, "#b491c8") /proc/xeno_message_all(message = null, size = 3) xeno_message(message, size)