diff --git a/code/game/objects/items/devices/radio/radio_objects.dm b/code/game/objects/items/devices/radio/radio_objects.dm index 9a83baf284d..fb8cb0f5373 100644 --- a/code/game/objects/items/devices/radio/radio_objects.dm +++ b/code/game/objects/items/devices/radio/radio_objects.dm @@ -272,7 +272,7 @@ GLOBAL_LIST_EMPTY(deadsay_radio_systems) /obj/item/radio/proc/ToggleReception() listening = !listening && !(wires.is_cut(WIRE_RADIO_RECEIVER) || wires.is_cut(WIRE_RADIO_SIGNAL)) -/obj/item/radio/proc/autosay(message, from, channel, follow_target_override) //BS12 EDIT +/obj/item/radio/proc/autosay(message, from, channel, follow_target_override, is_emote = FALSE, sender_job = null, vname = null) //BS12 EDIT var/datum/radio_frequency/connection = null if(channel && channels && length(channels) > 0) if(channel == "department") @@ -297,7 +297,11 @@ GLOBAL_LIST_EMPTY(deadsay_radio_systems) break if(jammed) message = Gibberish(message, 100) - var/list/message_pieces = message_to_multilingual(message) + var/list/message_pieces + if(is_emote) + message_pieces = list(new /datum/multilingual_say_piece(GLOB.all_languages["Noise"], message)) + else + message_pieces = message_to_multilingual(message) // Make us a message datum! var/datum/tcomms_message/tcm = new @@ -306,8 +310,8 @@ GLOBAL_LIST_EMPTY(deadsay_radio_systems) tcm.radio = src tcm.sender_name = from tcm.message_pieces = message_pieces - tcm.sender_job = "Automated Announcement" - tcm.vname = "synthesized voice" + tcm.sender_job = sender_job || "Automated Announcement" + tcm.vname = vname || "synthesized voice" tcm.signal_type = SIGNALTYPE_AINOTRACK // Datum radios dont have a location (obviously) if(loc && loc.z) diff --git a/code/modules/paperwork/desk_bell.dm b/code/modules/paperwork/desk_bell.dm index 85c533bd7cd..f4a36a9fdf3 100644 --- a/code/modules/paperwork/desk_bell.dm +++ b/code/modules/paperwork/desk_bell.dm @@ -18,6 +18,8 @@ var/ring_sound = 'sound/machines/bell.ogg' /// The remote signaller that we're gonna activate to this bell var/obj/item/assembly/signaler/attached_signaler + var/obj/item/radio/headset/attached_headset + var/radio_channel new_attack_chain = TRUE /obj/item/desk_bell/examine(mob/user) @@ -26,6 +28,8 @@ . += SPAN_NOTICE("It's anchored in place.") if(!isnull(attached_signaler)) . += SPAN_NOTICE("There seems to be an antenna sticking out of the base.") + if(!isnull(attached_headset)) + . += SPAN_NOTICE("There's a little microphone poking out of it. You can probably use a multitool to change the channel.") if(broken_ringer) . += SPAN_NOTICE("The clapper looks off. You can probably screw it back in place.") @@ -41,16 +45,24 @@ return ..() /obj/item/desk_bell/item_interaction(mob/living/user, obj/item/used, list/modifiers) - if(!istype(used, /obj/item/assembly/signaler)) - return ..() - // can only attach its on your person + if(istype(used, /obj/item/assembly/signaler)) + try_attach_signaler(user, used) + return ITEM_INTERACT_COMPLETE + if(istype(used, /obj/item/radio/headset)) + try_attach_headset(user, used) + return ITEM_INTERACT_COMPLETE + return ..() + +/obj/item/desk_bell/proc/try_attach_signaler(mob/living/user, obj/item/assembly/signaler/signal) + if(!istype(signal)) + return FALSE + // can only attach if it's on your person if(!in_inventory) - to_chat(user, SPAN_WARNING("[src] needs to be in your inventory if you want to attach [used] to it!")) - return ITEM_INTERACT_COMPLETE - if(!isnull(attached_signaler)) - to_chat(user, SPAN_NOTICE("There's already a signaler attached!")) - return ITEM_INTERACT_COMPLETE - var/obj/item/assembly/signaler/signal = used + to_chat(user, SPAN_WARNING("[src] needs to be in your inventory if you want to attach [signal] to it!")) + return FALSE + if(!isnull(attached_signaler) || !isnull(attached_headset)) + to_chat(user, SPAN_NOTICE("There's already something attached!")) + return FALSE user.transfer_item_to(signal, src) attached_signaler = signal if(signal.receiving) @@ -60,7 +72,32 @@ SPAN_NOTICE("You attach [signal] to [src].") ) add_fingerprint(user) - return ITEM_INTERACT_COMPLETE + return TRUE + +/obj/item/desk_bell/proc/try_attach_headset(mob/living/user, obj/item/radio/headset/radio) + if(!istype(radio)) + return FALSE + // can only attach if it's on your person + if(!in_inventory) + to_chat(user, SPAN_WARNING("[src] needs to be in your inventory if you want to attach [radio] to it!")) + return FALSE + if(!isnull(attached_signaler) || !isnull(attached_headset)) + to_chat(user, SPAN_NOTICE("There's already something attached!")) + return FALSE + + var/new_channel = tgui_input_list(user, "Select Radio Channel", "Desk Bell Headset", radio.channels - "Common") + if(!(new_channel && (new_channel in radio.channels))) + return FALSE + + radio_channel = new_channel + user.transfer_item_to(radio, src) + attached_headset = radio + user.visible_message( + SPAN_NOTICE("[user] attaches [radio] to [src]."), + SPAN_NOTICE("You attach [radio] to [src].") + ) + add_fingerprint(user) + return TRUE /obj/item/desk_bell/proc/on_signal() SIGNAL_HANDLER // COMSIG_ASSEMBLY_PULSED @@ -98,6 +135,18 @@ add_fingerprint(M) +// Change radio channel +/obj/item/desk_bell/multitool_act(mob/living/user, /obj/item/tool) + if(isnull(attached_headset)) + to_chat(user, SPAN_WARNING("[src] has no headset in it to adjust!")) + return FALSE + var/new_channel = tgui_input_list(user, "Select Radio Channel", "Desk Bell Headset", attached_headset.channels - "Common") + if(new_channel && (new_channel in attached_headset.channels)) + radio_channel = new_channel + add_fingerprint(user) + return TRUE + return FALSE + // Fix the clapper /obj/item/desk_bell/screwdriver_act(mob/living/user, obj/item/tool) . = TRUE @@ -143,6 +192,12 @@ user.put_in_hands(attached_signaler) UnregisterSignal(attached_signaler, COMSIG_ASSEMBLY_PULSED) attached_signaler = null + if(attached_headset) + if(!tool.use_tool(src, user, 0.5 SECONDS, volume = tool.tool_volume)) + return TRUE + to_chat(user, SPAN_NOTICE("You remove [attached_headset].")) + user.put_in_hands(attached_headset) + attached_headset = null /// Check if the clapper breaks, and if it does, break it /obj/item/desk_bell/proc/check_clapper(mob/living/user) @@ -162,6 +217,8 @@ flick("desk_bell_ring", src) if(attached_signaler && !from_signaler) attached_signaler.signal() + if(attached_headset) + attached_headset.autosay("dings!", "[name] in [get_location_name(src)]", radio_channel, is_emote = TRUE, sender_job = "Desk Bell", vname = "clear bell") times_rang++ return TRUE