Skip to content

Commit

Permalink
On-screen messages sounds (#4301)
Browse files Browse the repository at this point in the history
# 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
<details>
<summary>Screenshots & Videos</summary>

Put screenshots and videos here with an empty line between the
screenshots and the `<details>` tags.

</details>


# Changelog
:cl: ihatethisengine
add: On-screen messages now appear with sound. Radio static for marines,
distant roar for xenos.
/:cl:

---------

Co-authored-by: ihatethisengine <[email protected]>
Co-authored-by: Drathek <[email protected]>
  • Loading branch information
3 people committed Sep 9, 2023
1 parent 96ee47a commit 144b586
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
13 changes: 7 additions & 6 deletions code/game/jobs/job/marine/squads.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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("<span class='langchat' style=font-size:16pt;text-align:center valign='top'><u>[title_text]</u></span><br>" + 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("<span class='langchat' style=font-size:16pt;text-align:center valign='top'><u>[title_text]</u></span><br>" + 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("<span class='langchat' style=font-size:16pt;text-align:center valign='top'><u>[title_text]</u></span><br>" + 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("<span class='langchat' style=font-size:16pt;text-align:center valign='top'><u>[title_text]</u></span><br>" + 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)
Expand Down
11 changes: 6 additions & 5 deletions code/modules/mob/living/carbon/xenomorph/XenoProcs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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("<span class=\"[fontsize_style]\"> [message]</span>"))

//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("<span class='langchat' style=font-size:16pt;text-align:center valign='top'><u>[title_text]</u></span><br>" + 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("<span class='langchat' style=font-size:16pt;text-align:center valign='top'><u>[title_text]</u></span><br>" + text, /atom/movable/screen/text/screen_text/command_order, "#b491c8")

/proc/xeno_message_all(message = null, size = 3)
xeno_message(message, size)
Expand Down

0 comments on commit 144b586

Please sign in to comment.