diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index fc2ee0a0b2..6fd38bb581 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -1317,21 +1317,27 @@ M.stuttering = 20 else if(href_list["CentcommReply"]) - var/mob/living/carbon/human/H = locate(href_list["CentcommReply"]) - if(!istype(H)) - usr << "This can only be used on instances of type /mob/living/carbon/human" - return - if(!istype(H.l_ear, /obj/item/device/radio/headset) && !istype(H.r_ear, /obj/item/device/radio/headset)) - usr << "The person you are trying to contact is not wearing a headset" + var/mob/living/L = locate(href_list["CentcommReply"]) + if(!istype(L)) + usr << "This can only be used on instances of type /mob/living/" return - var/input = sanitize(input(src.owner, "Please enter a message to reply to [key_name(H)] via their headset.","Outgoing message from Centcomm", "")) - if(!input) return + if(L.can_centcom_reply()) + var/input = input(src.owner, "Please enter a message to reply to [key_name(L)] via their headset.","Outgoing message from Centcomm", "") + if(!input) return + + src.owner << "You sent [input] to [L] via a secure channel." + log_admin("[src.owner] replied to [key_name(L)]'s Centcomm message with the message [input].") + message_admins("[src.owner] replied to [key_name(L)]'s Centcom message with: \"[input]\"") + if(!L.isAI()) + L << "You hear something crackle in your headset for a moment before a voice speaks." + L << "Please stand by for a message from Central Command." + L << "Message as follows." + L << "[input]" + L << "Message ends." + else + src.owner << "The person you are trying to contact does not have functional radio equipment." - src.owner << "You sent [input] to [H] via a secure channel." - log_admin("[src.owner] replied to [key_name(H)]'s Centcomm message with the message [input].") - message_admins("[src.owner] replied to [key_name(H)]'s Centcom message with: \"[input]\"") - H << "You hear something crackle in your headset for a moment before a voice speaks. \"Please stand by for a message from Central Command. Message as follows. \"[input]\" Message ends.\"" else if(href_list["SyndicateReply"]) var/mob/living/carbon/human/H = locate(href_list["SyndicateReply"]) @@ -2619,3 +2625,12 @@ if("list") PlayerNotesPage(text2num(href_list["index"])) return + +mob/living/proc/can_centcom_reply() + return 0 + +mob/living/carbon/human/can_centcom_reply() + return istype(l_ear, /obj/item/device/radio/headset) || istype(r_ear, /obj/item/device/radio/headset) + +mob/living/silicon/ai/can_centcom_reply() + return common_radio != null && !check_unable(2) \ No newline at end of file diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 66804f5bfa..a068aa374f 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -6,6 +6,7 @@ var/list/ai_verbs_default = list( /mob/living/silicon/ai/proc/ai_announcement, /mob/living/silicon/ai/proc/ai_call_shuttle, // /mob/living/silicon/ai/proc/ai_recall_shuttle, + /mob/living/silicon/ai/proc/ai_emergency_message, /mob/living/silicon/ai/proc/ai_camera_track, /mob/living/silicon/ai/proc/ai_camera_list, /mob/living/silicon/ai/proc/ai_goto_location, @@ -380,6 +381,27 @@ var/list/ai_verbs_default = list( if(confirm == "Yes") cancel_call_proc(src) +/mob/living/silicon/ai/var/emergency_message_cooldown = 0 +/mob/living/silicon/ai/proc/ai_emergency_message() + set category = "AI Commands" + set name = "Send Emergency Message" + + if(check_unable(AI_CHECK_WIRELESS)) + return + if(emergency_message_cooldown) + usr << "\red Arrays recycling. Please stand by." + return + var/input = input(usr, "Please choose a message to transmit to Centcomm via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response. There is a 30 second delay before you may send another message, be clear, full and concise.", "To abort, send an empty message.", "") + if(!input) + return + Centcomm_announce(input, usr) + usr << "\blue Message transmitted." + log_say("[key_name(usr)] has made an IA Centcomm announcement: [input]") + emergency_message_cooldown = 1 + spawn(300) + emergency_message_cooldown = 0 + + /mob/living/silicon/ai/check_eye(var/mob/user as mob) if (!camera) return null