diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index 32b101518be..ecdfd40b84c 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -10,6 +10,7 @@ var/list/department_radio_keys = list( ":s" = "Security", "#s" = "Security", ".s" = "Security", ":w" = "whisper", "#w" = "whisper", ".w" = "whisper", ":b" = "binary", "#b" = "binary", ".b" = "binary", + ":d" = "drone", "#d" = "drone", ".d" = "drone", ":a" = "alientalk", "#a" = "alientalk", ".a" = "alientalk", ":t" = "Syndicate", "#t" = "Syndicate", ".t" = "Syndicate", ":u" = "Supply", "#u" = "Supply", ".u" = "Supply", @@ -27,6 +28,7 @@ var/list/department_radio_keys = list( ":E" = "Engineering", "#E" = "Engineering", ".E" = "Engineering", ":S" = "Security", "#S" = "Security", ".S" = "Security", ":W" = "whisper", "#W" = "whisper", ".W" = "whisper", + ":D" = "drone", "#D" = "drone", ".D" = "drone", ":B" = "binary", "#B" = "binary", ".B" = "binary", ":A" = "alientalk", "#A" = "alientalk", ".A" = "alientalk", ":T" = "Syndicate", "#T" = "Syndicate", ".T" = "Syndicate", diff --git a/code/modules/mob/living/silicon/robot/drone/drone.dm b/code/modules/mob/living/silicon/robot/drone/drone.dm index e8b249ee9cd..cb05233a350 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone.dm @@ -91,7 +91,6 @@ //Drones can only use binary and say emotes. NOTHING else. //TBD, fix up boilerplate. ~ Z /mob/living/silicon/robot/drone/say(var/message) - if (!message) return @@ -102,42 +101,65 @@ if (src.client.handle_spam_prevention(message,MUTE_IC)) return - message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN)) - if (stat == 2) + message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN)) return say_dead(message) - + + //Must be concious to speak + if (stat) + return + if(copytext(message,1,2) == "*") return emote(copytext(message,2)) - else if(length(message) >= 2) - - if(copytext(message, 1 ,3) == ":d" || copytext(message, 1 ,3) == ":D") - - if(!is_component_functioning("radio")) - src << "\red Your radio transmitter isn't functional." - return - - for (var/mob/living/S in living_mob_list) - if(istype(S, /mob/living/silicon/robot/drone)) - S << "Drone Talk, [name] transmits, \"[message]\"" - - for (var/mob/M in dead_mob_list) - if(!istype(M,/mob/new_player) && !istype(M,/mob/living/carbon/brain)) - M << "Drone Talk, [name] transmits, \"[trim(copytext(message,3))]\"" - + + if (length(message) >= 2) + var/prefix = copytext(message, 1, 3) + if (department_radio_keys[prefix] == "drone") + message = copytext(message, 3) + message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN)) + + if(istype(src, /mob/living/silicon/robot/drone)) + var/mob/living/silicon/robot/drone/R = src + if(!R.is_component_functioning("comms")) + src << "\red Your drone communications component isn't functional." + return + drone_talk(message) else - var/list/listeners = hearers(5,src) listeners |= src - - for(var/mob/living/silicon/robot/drone/D in listeners) - if(D.client) D << "[src] transmits, \"[message]\"" + message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN)) + for(var/mob/living/silicon/D in listeners) + if(D.client) + D << "[src] transmits, \"[message]\"" for (var/mob/M in player_list) + if (!M.client) + continue if (istype(M, /mob/new_player)) continue - else if(M.stat == 2 && M.client.prefs.toggles & CHAT_GHOSTEARS) - if(M.client) M << "[src] transmits, \"[message]\"" + else if(M.stat == 2 && (M.client.prefs.toggles & CHAT_GHOSTEARS) && src.client) + M << "[src] (Follow) transmits, \"[message]\"" + else if(M.stat == 2 && src.client && M in listeners) + M << "[src] (Follow) transmits, \"[message]\"" + +/mob/living/proc/drone_talk(var/message) + log_say("[key_name(src)] : [message]") + message = trim(message) + + if (!message) + return + + var/message_a = say_quote(message) + var/rendered = "Drone Talk, [name] [message_a]" + + for (var/mob/living/S in living_mob_list) + if(istype(S, /mob/living/silicon/robot/drone)) + S.show_message(rendered, 2) + + for (var/mob/S in dead_mob_list) + if(!istype(S,/mob/new_player) && !istype(S,/mob/living/carbon/brain)) + var/rendered2 = "Drone Talk, [name] (Follow) [message_a]" + S.show_message(rendered2, 2) //Drones cannot be upgraded with borg modules so we need to catch some items before they get used in ..(). /mob/living/silicon/robot/drone/attackby(obj/item/weapon/W as obj, mob/user as mob) @@ -316,7 +338,7 @@ full_law_reset() src << "
You are a maintenance drone, a tiny-brained robotic repair machine." src << "You have no individual will, no personality, and no drives or urges other than your laws." - src << "Use :b to talk to your fellow synthetics, :d to talk to other drones, and say to speak silently to your nearby fellows." + src << "Use :d to talk to other drones, and say to speak silently to your nearby fellows." src << "Remember, you are lawed against interference with the crew. Also remember, you DO NOT take orders from the AI." src << "Don't invade their worksites, don't steal their resources, don't tell them about the changeling in the toilets." src << "If a crewmember has noticed you, you are probably breaking your first law."