diff --git a/code/game/objects/items/devices/radio/intercom.dm b/code/game/objects/items/devices/radio/intercom.dm index 9aa65bb54e..81e3227022 100644 --- a/code/game/objects/items/devices/radio/intercom.dm +++ b/code/game/objects/items/devices/radio/intercom.dm @@ -49,6 +49,12 @@ name = "entertainment intercom" frequency = ENT_FREQ +/obj/item/device/radio/intercom/omni + name = "global announcer" +/obj/item/device/radio/intercom/omni/initialize() + channels = radiochannels.Copy() + return ..() + /obj/item/device/radio/intercom/New() ..() processing_objects += src diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index b6f62f27dc..f5f85fe8f5 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -53,14 +53,13 @@ var/global/list/default_medbay_channels = list( var/const/FREQ_LISTENING = 1 var/list/internal_channels -/obj/item/device/radio var/datum/radio_frequency/radio_connection var/list/datum/radio_frequency/secure_radio_connections = new - proc/set_frequency(new_frequency) - radio_controller.remove_object(src, frequency) - frequency = new_frequency - radio_connection = radio_controller.add_object(src, frequency, RADIO_CHAT) +/obj/item/device/radio/proc/set_frequency(new_frequency) + radio_controller.remove_object(src, frequency) + frequency = new_frequency + radio_connection = radio_controller.add_object(src, frequency, RADIO_CHAT) /obj/item/device/radio/New() ..() diff --git a/code/global.dm b/code/global.dm index 3bf111ef4f..58836aac39 100644 --- a/code/global.dm +++ b/code/global.dm @@ -184,7 +184,7 @@ var/static/list/scarySounds = list( var/max_explosion_range = 14 // Announcer intercom, because too much stuff creates an intercom for one message then hard del()s it. -var/global/obj/item/device/radio/intercom/global_announcer = new /obj/item/device/radio/intercom{channels=list("Engineering")}(null) +var/global/obj/item/device/radio/intercom/omni/global_announcer = new /obj/item/device/radio/intercom/omni(null) var/list/station_departments = list("Command", "Medical", "Engineering", "Science", "Security", "Cargo", "Civilian") diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 61f2d174ac..a2d8eed8fa 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -380,7 +380,7 @@ proc/admin_notice(var/message, var/rights) if(3) dat+={" Creating new Feed Message... -
Receiving Channel: [src.admincaster_feed_channel.channel_name]
" //MARK +
Receiving Channel: [src.admincaster_feed_channel.channel_name]
Message Author: [src.admincaster_signature]
Message Body: [src.admincaster_feed_message.body]

Submit

Cancel
@@ -674,10 +674,7 @@ proc/admin_notice(var/message, var/rights) set desc = "Send an intercom message, like an arrivals announcement." if(!check_rights(0)) return - //This is basically how death alarms do it - var/obj/item/device/radio/headset/a = new /obj/item/device/radio/headset/omni(null) - - var/channel = input("Channel for message:","Channel", null) as null|anything in (list("Common") + a.keyslot2.channels) // + a.keyslot1.channels + var/channel = input("Channel for message:","Channel", null) as null|anything in radiochannels if(channel) //They picked a channel var/sender = input("Name of sender (max 75):", "Announcement", "Announcement Computer") as null|text @@ -688,11 +685,94 @@ proc/admin_notice(var/message, var/rights) if(message) //They put a message message = sanitize(message, 500, extra = 0) - a.autosay("[message]", "[sender]", "[channel == "Common" ? null : channel]") //Common is a weird case, as it's not a "channel", it's just talking into a radio without a channel set. + global_announcer.autosay("[message]", "[sender]", "[channel == "Common" ? null : channel]") //Common is a weird case, as it's not a "channel", it's just talking into a radio without a channel set. log_admin("Intercom: [key_name(usr)] : [sender]:[message]") - qdel(a) + feedback_add_details("admin_verb","IN") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! +/datum/admins/proc/intercom_convo() + set category = "Fun" + set name = "Intercom Convo" + set desc = "Send an intercom conversation, like several uses of the Intercom Msg verb." + set waitfor = FALSE //Why bother? We have some sleeps. You can leave tho! + if(!check_rights(0)) return + + var/channel = input("Channel for message:","Channel", null) as null|anything in radiochannels + + if(!channel) //They picked a channel + return + + to_chat(usr,"Intercom Convo Directions
Start the conversation with the sender, a pipe (|), and then the message on one line. Then hit enter to \ + add another line, and type a (whole) number of seconds to pause between that message, and the next message, then repeat the message syntax up to 20 times. For example:
\ + --- --- ---
\ + Some Guy|Hello guys, what's up?
\ + 5
\ + Other Guy|Hey, good to see you.
\ + 5
\ + Some Guy|Yeah, you too.
\ + --- --- ---
\ + The above will result in those messages playing, with a 5 second gap between each. Maximum of 20 messages allowed.
") + + var/list/decomposed + var/message = input(usr,"See your chat box for instructions. Keep a copy elsewhere in case it is rejected when you click OK.", "Input Conversation", "") as null|message + + if(!message) + return + + //Split on pipe or \n + decomposed = splittext(message,regex("\\||$","m")) + decomposed += "0" //Tack on a final 0 sleep to make 3-per-message evenly + + //Time to find how they screwed up. + //Wasn't the right length + if((decomposed.len) % 3) //+1 to accomidate the lack of a wait time for the last message + to_chat(usr,"You passed [decomposed.len] segments (senders+messages+pauses). You must pass a multiple of 3, minus 1 (no pause after the last message). That means a sender and message on every other line (starting on the first), separated by a pipe character (|), and a number every other line that is a pause in seconds.") + return + + //Too long a conversation + if((decomposed.len / 3) > 20) + to_chat(usr,"This conversation is too long! 20 messages maximum, please.") + return + + //Missed some sleeps, or sanitized to nothing. + for(var/i = 1; i < decomposed.len; i++) + + //Sanitize sender + var/clean_sender = sanitize(decomposed[i]) + if(!clean_sender) + to_chat(usr,"One part of your conversation was not able to be sanitized. It was the sender of the [(i+2)/3]\th message.") + return + decomposed[i] = clean_sender + + //Sanitize message + var/clean_message = sanitize(decomposed[++i]) + if(!clean_message) + to_chat(usr,"One part of your conversation was not able to be sanitized. It was the body of the [(i+2)/3]\th message.") + return + decomposed[i] = clean_message + + //Sanitize wait time + var/clean_time = text2num(decomposed[++i]) + if(!isnum(clean_time)) + to_chat(usr,"One part of your conversation was not able to be sanitized. It was the wait time after the [(i+2)/3]\th message.") + return + if(clean_time > 60) + to_chat(usr,"Max 60 second wait time between messages for sanity's sake please.") + return + decomposed[i] = clean_time + + log_admin("Intercom convo started by: [key_name(usr)] : [sanitize(message)]") + feedback_add_details("admin_verb","IN") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + + //Sanitized AND we still have a chance to send it? Wow! + if(LAZYLEN(decomposed)) + for(var/i = 1; i < decomposed.len; i++) + var/this_sender = decomposed[i] + var/this_message = decomposed[++i] + var/this_wait = decomposed[++i] + global_announcer.autosay("[this_message]", "[this_sender]", "[channel == "Common" ? null : channel]") //Common is a weird case, as it's not a "channel", it's just talking into a radio without a channel set. + sleep(this_wait SECONDS) + /datum/admins/proc/toggleooc() set category = "Server" set desc="Globally Toggles OOC" diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 04740237f1..d26ff66a9b 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -26,6 +26,7 @@ var/list/admin_verbs_admin = list( /datum/admins/proc/toggleguests, //toggles whether guests can join the current game, /datum/admins/proc/announce, //priority announce something to all clients., /datum/admins/proc/intercom, //send a fake intercom message, like an arrivals announcement, + /datum/admins/proc/intercom_convo, //send a fake intercom conversation, like an ATC exchange, /client/proc/colorooc, //allows us to set a custom colour for everythign we say in ooc, /client/proc/admin_ghost, //allows us to ghost/reenter body at will, /client/proc/toggle_view_range, //changes how far we can see,