Files
Bubberstation/code/controllers/subsystem/communications.dm
SkyratBot 8dde23b4ef [MIRROR] Sends AI VOX messages over announcement instead of radio [MDB IGNORE] (#22290)
* Sends AI VOX messages over announcement instead of radio (#76327)

## About The Pull Request
Fixes #76310

`sound_override = TRUE` makes it so that no sound is played for the
announcement since "TRUE" isn't a sound file, but that might be bad code
let me know

## Why It's Good For The Game

Sending the message over the radio makes the AI "speak" it, so TTS plays
from AI at the same time as the VOX sounds, which makes the announcement
sound bad for the AI and anyone around them. This turns it from being
sent over the radio to an announcement so that TTS doesn't apply. It
also just makes more sense having the VOX announcement sent as an
announcement rather than just a normal radio message.
## Changelog
🆑
qol: AI VOX messages are sent over announcement instead of radio
fix: AI VOX messages work properly on multi-Z stations
/🆑

* Sends AI VOX messages over announcement instead of radio

---------

Co-authored-by: BlueMemesauce <47338680+BlueMemesauce@users.noreply.github.com>
2023-07-11 21:05:22 -04:00

62 lines
2.9 KiB
Plaintext

#define COMMUNICATION_COOLDOWN (30 SECONDS)
#define COMMUNICATION_COOLDOWN_AI (30 SECONDS)
#define COMMUNICATION_COOLDOWN_MEETING (5 MINUTES)
SUBSYSTEM_DEF(communications)
name = "Communications"
flags = SS_NO_INIT | SS_NO_FIRE
COOLDOWN_DECLARE(silicon_message_cooldown)
COOLDOWN_DECLARE(nonsilicon_message_cooldown)
/// Are we trying to send a cross-station message that contains soft-filtered words? If so, flip to TRUE to extend the time admins have to cancel the message.
var/soft_filtering = FALSE
/// A list of footnote datums, to be added to the bottom of the roundstart command report.
var/list/command_report_footnotes = list()
/// A counter of conditions that are blocking the command report from printing. Counter incremements up for every blocking condition, and de-incrememnts when it is complete.
var/block_command_report = 0
/// Has a special xenomorph egg been delivered?
var/xenomorph_egg_delivered = FALSE
/// The location where the special xenomorph egg was planted
var/area/captivity_area
/datum/controller/subsystem/communications/proc/can_announce(mob/living/user, is_silicon)
if(is_silicon && COOLDOWN_FINISHED(src, silicon_message_cooldown))
return TRUE
else if(!is_silicon && COOLDOWN_FINISHED(src, nonsilicon_message_cooldown))
return TRUE
else
return FALSE
/datum/controller/subsystem/communications/proc/make_announcement(mob/living/user, is_silicon, input, syndicate, list/players)
if(!can_announce(user, is_silicon))
return FALSE
if(is_silicon)
minor_announce(html_decode(input),"[user.name] announces:", players = players)
COOLDOWN_START(src, silicon_message_cooldown, COMMUNICATION_COOLDOWN_AI)
else
var/list/message_data = user.treat_message(input)
priority_announce(html_decode(message_data["message"]), null, ANNOUNCER_CAPTAIN, "[syndicate? "Syndicate " : ""]Captain", has_important_message = TRUE, players = players)
COOLDOWN_START(src, nonsilicon_message_cooldown, COMMUNICATION_COOLDOWN)
user.log_talk(input, LOG_SAY, tag="priority announcement")
message_admins("[ADMIN_LOOKUPFLW(user)] has made a priority announcement.")
/datum/controller/subsystem/communications/proc/send_message(datum/comm_message/sending,print = TRUE,unique = FALSE)
for(var/obj/machinery/computer/communications/C in GLOB.shuttle_caller_list)
if(!(C.machine_stat & (BROKEN|NOPOWER)) && is_station_level(C.z))
if(unique)
C.add_message(sending)
else //We copy the message for each console, answers and deletions won't be shared
var/datum/comm_message/M = new(sending.title,sending.content,sending.possible_answers.Copy())
C.add_message(M)
if(print)
var/obj/item/paper/printed_paper = new /obj/item/paper(C.loc)
printed_paper.name = "paper - '[sending.title]'"
printed_paper.add_raw_text(sending.content)
printed_paper.update_appearance()
#undef COMMUNICATION_COOLDOWN
#undef COMMUNICATION_COOLDOWN_AI
#undef COMMUNICATION_COOLDOWN_MEETING