mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-11 16:14:08 +01:00
f750fea396
On all maps, the captain will find a brand new green screen and camera set up in their quarters This is used to cast the captain's (or anyone's who breaks in) face to all status displays across the station (It will also relay your voice to them)  NOTE: Some maps have a stunning lack of evac displays Noticeably **Wawa** has like 10. So these will be less effective on those maps. Gives Captains a more personable way of addressing the crew for impromptu announcements rather than resorting to the announcement computer. Also opens up shenanigans. 🆑 Melbert, Wallem add: Adds recording setups to the Captain's office on all maps, allowing them to project their face to all status displays on the station add: Centcom now has a soundstage for broadcasting to the station. It's besides the Thunderdome. /🆑 --------- Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
129 lines
4.4 KiB
Plaintext
129 lines
4.4 KiB
Plaintext
// Unique broadcast camera given to the first Curator
|
|
// Only one should exist ideally, if other types are created they must have different camera_networks
|
|
// Broadcasts its surroundings to entertainment monitors and its audio to entertainment radio channel
|
|
/obj/item/broadcast_camera
|
|
name = "broadcast camera"
|
|
desc = "A large camera that streams its live feed and audio to entertainment monitors across the station, allowing everyone to watch the broadcast."
|
|
desc_controls = "Right-click to change the broadcast name. Alt-click to toggle microphone."
|
|
icon = 'icons/obj/service/broadcast.dmi'
|
|
icon_state = "broadcast_cam0"
|
|
base_icon_state = "broadcast_cam"
|
|
lefthand_file = 'icons/mob/inhands/items/devices_lefthand.dmi'
|
|
righthand_file = 'icons/mob/inhands/items/devices_righthand.dmi'
|
|
force = 8
|
|
throwforce = 12
|
|
w_class = WEIGHT_CLASS_NORMAL
|
|
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
|
|
slot_flags = NONE
|
|
light_system = OVERLAY_LIGHT
|
|
light_color = COLOR_SOFT_RED
|
|
light_range = 1
|
|
light_power = 0.3
|
|
light_on = FALSE
|
|
/// Is camera streaming
|
|
var/active = FALSE
|
|
/// Is the microphone turned on
|
|
var/active_microphone = TRUE
|
|
/// The name of the broadcast
|
|
var/broadcast_name = "Curator News"
|
|
/// The networks it broadcasts to, default is CAMERANET_NETWORK_CURATOR
|
|
var/list/camera_networks = list(CAMERANET_NETWORK_CURATOR)
|
|
/// The "virtual" security camera inside of the physical camera
|
|
var/obj/machinery/camera/internal_camera
|
|
/// The "virtual" radio inside of the the physical camera, a la microphone
|
|
var/obj/item/radio/entertainment/microphone/internal_radio
|
|
|
|
/obj/item/broadcast_camera/Initialize(mapload)
|
|
. = ..()
|
|
|
|
AddElement(/datum/element/empprotection, EMP_PROTECT_ALL)
|
|
|
|
/obj/item/broadcast_camera/Destroy(force)
|
|
QDEL_NULL(internal_radio)
|
|
QDEL_NULL(internal_camera)
|
|
return ..()
|
|
|
|
/obj/item/broadcast_camera/update_icon_state()
|
|
icon_state = "[base_icon_state][active]"
|
|
return ..()
|
|
|
|
/obj/item/broadcast_camera/attack_self(mob/user, modifiers)
|
|
. = ..()
|
|
active = !active
|
|
if(active)
|
|
on_activating()
|
|
else
|
|
on_deactivating()
|
|
|
|
/obj/item/broadcast_camera/attack_self_secondary(mob/user, modifiers)
|
|
. = ..()
|
|
broadcast_name = tgui_input_text(user = user, title = "Broadcast Name", message = "What will be the name of your broadcast?", default = "[broadcast_name]", max_length = MAX_CHARTER_LEN)
|
|
|
|
/obj/item/broadcast_camera/examine(mob/user)
|
|
. = ..()
|
|
. += span_notice("Broadcast name is <b>[broadcast_name]</b>")
|
|
. += span_notice("The microphone is <b>[active_microphone ? "On" : "Off"]</b>")
|
|
|
|
/obj/item/broadcast_camera/on_enter_storage(datum/storage/master_storage)
|
|
. = ..()
|
|
if(active)
|
|
on_deactivating()
|
|
|
|
/obj/item/broadcast_camera/dropped(mob/user, silent)
|
|
. = ..()
|
|
if(active)
|
|
on_deactivating()
|
|
|
|
/// When activating the camera
|
|
/obj/item/broadcast_camera/proc/on_activating()
|
|
if(!iscarbon(loc))
|
|
return
|
|
active = TRUE
|
|
update_icon_state()
|
|
/// The carbon who wielded the camera, allegedly
|
|
var/mob/living/carbon/wielding_carbon = loc
|
|
|
|
// INTERNAL CAMERA
|
|
internal_camera = new(wielding_carbon) // Cameras for some reason do not work inside of obj's
|
|
internal_camera.internal_light = FALSE
|
|
internal_camera.network = camera_networks
|
|
internal_camera.c_tag = "LIVE: [broadcast_name]"
|
|
start_broadcasting_network(camera_networks, "[broadcast_name] is now LIVE!")
|
|
|
|
// INTERNAL RADIO
|
|
internal_radio = new(src)
|
|
/// Sets the state of the microphone
|
|
set_microphone_state()
|
|
|
|
set_light_on(TRUE)
|
|
playsound(source = src, soundin = 'sound/machines/terminal/terminal_processing.ogg', vol = 20, vary = FALSE, ignore_walls = FALSE)
|
|
balloon_alert_to_viewers("live!")
|
|
|
|
/// When deactivating the camera
|
|
/obj/item/broadcast_camera/proc/on_deactivating()
|
|
active = FALSE
|
|
update_icon_state()
|
|
QDEL_NULL(internal_camera)
|
|
QDEL_NULL(internal_radio)
|
|
|
|
stop_broadcasting_network(camera_networks)
|
|
|
|
set_light_on(FALSE)
|
|
playsound(source = src, soundin = 'sound/machines/terminal/terminal_prompt_deny.ogg', vol = 20, vary = FALSE, ignore_walls = FALSE)
|
|
balloon_alert_to_viewers("offline")
|
|
|
|
/obj/item/broadcast_camera/click_alt(mob/user)
|
|
active_microphone = !active_microphone
|
|
|
|
/// Text popup for letting the user know that the microphone has changed state
|
|
balloon_alert(user, "microphone [active_microphone ? "" : "de"]activated")
|
|
|
|
///If the radio exists as an object, set its state accordingly
|
|
if(active)
|
|
set_microphone_state()
|
|
|
|
return CLICK_ACTION_SUCCESS
|
|
|
|
/obj/item/broadcast_camera/proc/set_microphone_state()
|
|
internal_radio.set_broadcasting(active_microphone)
|