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

TTS order announcements/hivemind #16662

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 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
8 changes: 7 additions & 1 deletion code/datums/jobs/squads.dm
Original file line number Diff line number Diff line change
Expand Up @@ -347,11 +347,12 @@
text = "<font size='3'><b>[text]<b></font>"
return "[nametext][text]"


/datum/squad/proc/message_squad(message, mob/living/carbon/human/sender)
if(is_ic_filtered(message) || NON_ASCII_CHECK(message))
to_chat(sender, span_boldnotice("Message invalid. Check your message does not contain filtered words or characters."))
return
var/list/treated_message = sender?.treat_message(message)
message = treated_message["message"]

var/header = "AUTOMATED CIC NOTICE:"
var/sound = "sound/misc/notice3.ogg"
Expand All @@ -366,6 +367,11 @@
for(var/mob/living/marine AS in marines_list)
marine.playsound_local(marine, sound, 35)
marine.play_screen_text("<span class='maptext' style=font-size:24pt;text-align:center valign='top'><u>[header]</u></span><br>" + message, message_type, message_color)
if(sender?.voice && SStts.tts_enabled)
var/list/extra_filters = list(TTS_FILTER_RADIO)
if(isrobot(sender))
extra_filters += TTS_FILTER_SILICON
INVOKE_ASYNC(SStts, TYPE_PROC_REF(/datum/controller/subsystem/tts, queue_tts_message), marines_list, treated_message["tts_message"], sender.get_default_language(), sender.voice, sender.voice_filter, local = TRUE, pitch = sender.pitch, special_filters = extra_filters.Join("|"), directionality = FALSE)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

marines_list should be the listeners arg, first arg is 'target' which seems to be the actual speaker. Same with the xeno annoucements

TiviPlus marked this conversation as resolved.
Show resolved Hide resolved

/datum/squad/proc/check_entry(datum/job/job)
if(!(job.title in current_positions))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@

/mob/living/carbon/xenomorph/hivemind/receive_hivemind_message(mob/living/carbon/xenomorph/speaker, message)
var/track = "<a href='?src=[REF(src)];hivemind_jump=[REF(speaker)]'>(F)</a>"
show_message("[track] [speaker.hivemind_start()] [span_message("hisses, '[message]'")][speaker.hivemind_end()]", 2)
return show_message("[track] [speaker.hivemind_start()] [span_message("hisses, '[message]'")][speaker.hivemind_end()]", 2)

/mob/living/carbon/xenomorph/hivemind/Topic(href, href_list)
. = ..()
Expand Down
6 changes: 0 additions & 6 deletions code/modules/mob/living/carbon/xenomorph/hive_datum.dm
Original file line number Diff line number Diff line change
Expand Up @@ -872,12 +872,6 @@ to_chat will check for valid clients itself already so no need to double check f

to_chat(X, "<span class='[span_class]'><font size=[size]> [message][report_distance ? " Distance: [get_dist(X, target)]" : ""]</font></span>")

// This is to simplify the process of talking in hivemind, this will invoke the receive proc of all xenos in this hive
/datum/hive_status/proc/hive_mind_message(mob/living/carbon/xenomorph/sender, message)
for(var/i in get_all_xenos())
var/mob/living/carbon/xenomorph/X = i
X.receive_hivemind_message(sender, message)

///Used for setting the trackers of all xenos in the hive, like when a nuke activates
/datum/hive_status/proc/set_all_xeno_trackers(atom/target)
for(var/mob/living/carbon/xenomorph/X AS in get_all_xenos())
Expand Down
19 changes: 12 additions & 7 deletions code/modules/mob/living/carbon/xenomorph/say.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,25 @@

log_talk(message, LOG_HIVEMIND)

for(var/i in GLOB.observer_list)
var/mob/dead/observer/S = i
if(!S?.client?.prefs || !(S.client.prefs.toggles_chat & CHAT_GHOSTHIVEMIND))
for(var/mob/dead/observer/ghost AS in GLOB.observer_list)
if(!ghost?.client?.prefs || !(ghost.client.prefs.toggles_chat & CHAT_GHOSTHIVEMIND))
continue
var/track = FOLLOW_LINK(S, src)
S.show_message("[track] [hivemind_start()] [span_message("hisses, <b>'[message]'</b>")][hivemind_end()]", 2)
var/track = FOLLOW_LINK(ghost, src)
ghost.show_message("[track] [hivemind_start()] [span_message("hisses, <b>'[message]'</b>")][hivemind_end()]", 2)

hive.hive_mind_message(src, message)
var/list/listened = list()
for(var/mob/living/carbon/xenomorph/sister AS in hive.get_all_xenos())
if(sister.receive_hivemind_message(src, message))
listened += sister
if(SStts.tts_enabled && length(listened) && voice)
var/list/treated_message = treat_message(message)
INVOKE_ASYNC(SStts, TYPE_PROC_REF(/datum/controller/subsystem/tts, queue_tts_message), listened, treated_message["tts_message"], get_default_language(), voice, voice_filter, local = TRUE, pitch = pitch, directionality = FALSE)
Lumipharon marked this conversation as resolved.
Show resolved Hide resolved

return TRUE

/mob/living/carbon/xenomorph/proc/receive_hivemind_message(mob/living/carbon/xenomorph/X, message)
var/follow_link = X != src ? "<a href='byond://?src=[REF(src)];watch_xeno_name=[REF(X)]'>(F)</a> " : ""
show_message("[follow_link][X.hivemind_start()][span_message(" hisses, <b>'[message]'</b>")][X.hivemind_end()]", 2)
return show_message("[follow_link][X.hivemind_start()][span_message(" hisses, <b>'[message]'</b>")][X.hivemind_end()]", 2)


/mob/living/carbon/xenomorph/get_saymode(message, talk_key)
Expand Down
Loading