mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-10 18:02:57 +00:00
* Refactors speech/communication logging and adds coordinates to speech logs * Update clockwork_slab.dm * Delete clockwork_slab.dm.rej * Update browserOutput.dm * Delete browserOutput.dm.rej
33 lines
1.1 KiB
Plaintext
33 lines
1.1 KiB
Plaintext
#define COMMUNICATION_COOLDOWN 600
|
|
#define COMMUNICATION_COOLDOWN_AI 600
|
|
|
|
SUBSYSTEM_DEF(communications)
|
|
name = "Communications"
|
|
flags = SS_NO_INIT | SS_NO_FIRE
|
|
|
|
var/silicon_message_cooldown
|
|
var/nonsilicon_message_cooldown
|
|
|
|
/datum/controller/subsystem/communications/proc/can_announce(mob/living/user, is_silicon)
|
|
if(is_silicon && silicon_message_cooldown > world.time)
|
|
. = FALSE
|
|
else if(!is_silicon && nonsilicon_message_cooldown > world.time)
|
|
. = FALSE
|
|
else
|
|
. = TRUE
|
|
|
|
/datum/controller/subsystem/communications/proc/make_announcement(mob/living/user, is_silicon, input)
|
|
if(!can_announce(user, is_silicon))
|
|
return FALSE
|
|
if(is_silicon)
|
|
minor_announce(html_decode(input),"[user.name] Announces:")
|
|
silicon_message_cooldown = world.time + COMMUNICATION_COOLDOWN_AI
|
|
else
|
|
priority_announce(html_decode(input), null, 'sound/misc/announce.ogg', "Captain")
|
|
nonsilicon_message_cooldown = world.time + COMMUNICATION_COOLDOWN
|
|
log_talk(user,"[key_name(user)] has made a priority announcement: [input]",LOGSAY)
|
|
message_admins("[key_name_admin(user)] has made a priority announcement.")
|
|
|
|
#undef COMMUNICATION_COOLDOWN
|
|
#undef COMMUNICATION_COOLDOWN_AI
|