Skip to content

Commit

Permalink
Some changes to broadcasting (#7662)
Browse files Browse the repository at this point in the history
# About the pull request
I was writing this thing and accidentally closed my browser, so I'll be
brief.
1) You can use the camera with one hand. You still need to turn it on.
It keeps broadcasting even if dropped, but loses range. Xeno can turn
the camera off by slashing it.
2) You can unanchor TV with a wrench.
3) Broadcasting camera cant take photos anymore. But photo camera can be
used with one hand

# Explain why it's good for the game
1) More convenient.
2) If no MT is around you can still have an audience.
3) I don't think it was very convenient anyway, just use reg camera for
photos if you wanna.
# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>

Put screenshots and videos here with an empty line between the
screenshots and the `<details>` tags.

</details>


# Changelog
:cl: ihatethisengine
add: You can use the camera with one hand. You still need to turn it on.
It keeps broadcasting even if dropped, but loses range. Xeno can turn
the camera off by slashing it.
add: You can unanchor TV with a wrench
/:cl:
  • Loading branch information
ihatethisengine authored Nov 29, 2024
1 parent 1d784e0 commit 563f9eb
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 28 deletions.
2 changes: 1 addition & 1 deletion code/__DEFINES/dcs/signals/atom/signals_item.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#define COMSIG_ITEM_PICKUP "item_pickup"

///from /obj/item/device/camera/broadcasting
///from /obj/item/device/broadcasting
#define COMSIG_BROADCAST_GO_LIVE "broadcast_live"
#define COMSIG_BROADCAST_HEAR_TALK "broadcast_hear_talk"
#define COMSIG_BROADCAST_SEE_EMOTE "broadcast_see_emote"
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/camera/camera.dm
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,9 @@ GLOBAL_LIST_EMPTY_TYPED(all_cameras, /obj/structure/machinery/camera)
unslashable = TRUE
unacidable = TRUE
colony_camera_mapload = FALSE
var/obj/item/device/camera/broadcasting/linked_broadcasting
var/obj/item/device/broadcasting/linked_broadcasting

/obj/structure/machinery/camera/correspondent/Initialize(mapload, obj/item/device/camera/broadcasting/camera_item)
/obj/structure/machinery/camera/correspondent/Initialize(mapload, obj/item/device/broadcasting/camera_item)
. = ..()
if(!camera_item)
return INITIALIZE_HINT_QDEL
Expand Down
37 changes: 35 additions & 2 deletions code/game/machinery/computer/camera_console.dm
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,9 @@
desc = "An old TV hooked up to a video cassette recorder, you can even use it to time shift WOW."
network = list(CAMERA_NET_CORRESPONDENT)
stay_connected = TRUE
wrenchable = TRUE
circuit = /obj/item/circuitboard/computer/cameras/tv
var/obj/item/device/camera/broadcasting/broadcastingcamera = null
var/obj/item/device/broadcasting/broadcastingcamera = null

/obj/structure/machinery/computer/cameras/wooden_tv/broadcast/Destroy()
broadcastingcamera = null
Expand Down Expand Up @@ -243,12 +244,44 @@
if(!current)
clear_camera()

/obj/structure/machinery/computer/cameras/wooden_tv/broadcast/inoperable(additional_flags = 0)
return ..(MAINT|additional_flags)

/obj/structure/machinery/computer/cameras/wooden_tv/broadcast/attackby(obj/item/wrench, mob/user)
if(HAS_TRAIT(wrench, TRAIT_TOOL_WRENCH))
if(user.action_busy)
return TRUE
toggle_anchored(wrench, user)
return TRUE
..()

/obj/structure/machinery/computer/cameras/wooden_tv/broadcast/toggle_anchored(obj/item/wrench, mob/user)
. = ..()
if(!.)
return
if(!anchored)
stat |= MAINT
clear_camera()
current = null
SEND_SIGNAL(src, COMSIG_CAMERA_CLEAR)
else
stat &= ~MAINT
update_icon()

/obj/structure/machinery/computer/cameras/wooden_tv/broadcast/update_icon()
. = ..()
if(stat & BROKEN)
return
if(stat & MAINT)
icon_state = initial(icon_state)
icon_state += "0"

/obj/structure/machinery/computer/cameras/wooden_tv/broadcast/proc/clear_camera()
SIGNAL_HANDLER
UnregisterSignal(broadcastingcamera, list(COMSIG_BROADCAST_GO_LIVE, COMSIG_PARENT_QDELETING, COMSIG_COMPONENT_ADDED, COMSIG_BROADCAST_HEAR_TALK, COMSIG_BROADCAST_SEE_EMOTE))
broadcastingcamera = null

/obj/structure/machinery/computer/cameras/wooden_tv/broadcast/proc/go_back_live(obj/item/device/camera/broadcasting/broadcastingcamera)
/obj/structure/machinery/computer/cameras/wooden_tv/broadcast/proc/go_back_live(obj/item/device/broadcasting/broadcastingcamera)
SIGNAL_HANDLER
if(current.c_tag == broadcastingcamera.get_broadcast_name())
current = broadcastingcamera.linked_cam
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ GLOBAL_LIST_INIT(cm_vending_clothing_combat_correspondent, list(
list("STANDARD EQUIPMENT (TAKE ALL)", 0, null, null, null),
list("Essential Reporter's Set", 0, /obj/effect/essentials_set/cc, MARINE_CAN_BUY_ESSENTIALS, VENDOR_ITEM_MANDATORY),
list("Leather Satchel", 0, /obj/item/storage/backpack/satchel, MARINE_CAN_BUY_BACKPACK, VENDOR_ITEM_REGULAR),
list("Press Broadcasting Camera", 0, /obj/item/device/camera/broadcasting, MARINE_CAN_BUY_SECONDARY, VENDOR_ITEM_RECOMMENDED),
list("Press Broadcasting Camera", 0, /obj/item/device/broadcasting, MARINE_CAN_BUY_SECONDARY, VENDOR_ITEM_RECOMMENDED),

list("CIVILIAN EQUIPMENT (TAKE ALL)", 0, null, null, null),
list("Portable Press Fax Machine", 0, /obj/item/device/fax_backpack, CIVILIAN_CAN_BUY_BACKPACK, VENDOR_ITEM_RECOMMENDED),
Expand Down
83 changes: 61 additions & 22 deletions code/modules/paperwork/photography.dm
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,7 @@
return
if(ismob(target.loc) || isstorage(target.loc) || user.contains(target) || istype(target, /atom/movable/screen))
return
if(!(flags_item & WIELDED))
to_chat(user, SPAN_WARNING("You need to wield the [src] with both hands to take a photo!"))
return

playsound(loc, pick('sound/items/polaroid1.ogg', 'sound/items/polaroid2.ogg'), 15, 1)
pictures_left--
to_chat(user, SPAN_NOTICE("[pictures_left] photos left."))
Expand Down Expand Up @@ -348,67 +346,108 @@
icon_state = "oldcamera"
pictures_left = 30

/obj/item/device/camera/broadcasting
/obj/item/device/broadcasting
name = "Broadcasting Camera"
desc = "Actively document everything you see, from the mundanity of shipside to the brutal battlefields below. Has a built-in printer for action shots."
desc = "Actively document everything you see, from the mundanity of shipside to the brutal battlefields below."
icon = 'icons/obj/items/items.dmi'
icon_state = "broadcastingcamera"
item_state = "broadcastingcamera"
unacidable = TRUE
explo_proof = TRUE
pictures_left = 20
pictures_max = 20
w_class = SIZE_HUGE
flags_item = NO_FLAGS
flags_equip_slot = NO_FLAGS //cannot be equiped
var/active = FALSE
var/obj/structure/machinery/camera/correspondent/linked_cam

/obj/item/device/camera/broadcasting/Initialize(mapload, ...)
/obj/item/device/broadcasting/Initialize(mapload, ...)
. = ..()
linked_cam = new(loc, src)
linked_cam.status = FALSE
RegisterSignal(src, COMSIG_COMPONENT_ADDED, PROC_REF(handle_rename))

/obj/item/device/camera/broadcasting/Destroy()
/obj/item/device/broadcasting/Destroy()
clear_broadcast()
return ..()

/obj/item/device/camera/broadcasting/wield(mob/user)
/obj/item/device/broadcasting/update_icon()
if(active)
item_state = "broadcastingcamera_w"
else
item_state = "broadcastingcamera"
. = ..()
if(!.)
return


/obj/item/device/broadcasting/proc/turn_on(mob/user)
active = TRUE
flags_atom |= (USES_HEARING|USES_SEEING)
handle_move()
SEND_SIGNAL(src, COMSIG_BROADCAST_GO_LIVE)
RegisterSignal(src, COMSIG_MOVABLE_MOVED, PROC_REF(handle_move))
to_chat(user, SPAN_NOTICE("[src] begins to buzz softly as you go live."))
update_icon()

/obj/item/device/broadcasting/proc/turn_off(mob/user)
active = FALSE
flags_atom &= ~(USES_HEARING|USES_SEEING)
linked_cam.status = FALSE
UnregisterSignal(src, COMSIG_MOVABLE_MOVED)
to_chat(user, SPAN_NOTICE("[src] goes silent as the broadcast stops."))
update_icon()

/obj/item/device/broadcasting/proc/handle_move()
if(!linked_cam || QDELETED(linked_cam))
linked_cam = new(loc, src)
else
linked_cam.status = TRUE
linked_cam.forceMove(loc)
SEND_SIGNAL(src, COMSIG_BROADCAST_GO_LIVE)
to_chat(user, SPAN_NOTICE("[src] begins to buzz softly as you go live."))

/obj/item/device/camera/broadcasting/unwield(mob/user)
/obj/item/device/broadcasting/dropped(mob/user)
. = ..()
flags_atom &= ~(USES_HEARING|USES_SEEING)
linked_cam.status = FALSE
linked_cam.view_range = 4

/obj/item/device/broadcasting/pickup(mob/user, silent)
. = ..()
linked_cam.view_range = 7

/obj/item/device/broadcasting/attack_self(mob/user)
. = ..()
if(active)
turn_off(user)
else
turn_on(user)

/obj/item/device/camera/broadcasting/proc/handle_rename(obj/item/camera, datum/component/label)
/obj/item/device/broadcasting/attack_alien(mob/living/carbon/xenomorph/xeno)
. = ..()
if(!active)
return
xeno.animation_attack_on(src)
playsound(src, 'sound/effects/metalhit.ogg', 25, 1)
xeno.visible_message(SPAN_DANGER("[xeno] [xeno.slashes_verb] [src]!"), \
SPAN_DANGER("We [xeno.slash_verb] [src]!"), null, 5, CHAT_TYPE_XENO_COMBAT)
turn_off(xeno)
return XENO_ATTACK_ACTION

/obj/item/device/broadcasting/proc/handle_rename(obj/item/camera, datum/component/label)
SIGNAL_HANDLER
if(!istype(label, /datum/component/label))
return
linked_cam.c_tag = get_broadcast_name()

/obj/item/device/camera/broadcasting/proc/clear_broadcast()
/obj/item/device/broadcasting/proc/clear_broadcast()
if(!QDELETED(linked_cam))
QDEL_NULL(linked_cam)

/obj/item/device/camera/broadcasting/proc/get_broadcast_name()
/obj/item/device/broadcasting/proc/get_broadcast_name()
var/datum/component/label/src_label_component = GetComponent(/datum/component/label)
if(src_label_component)
return src_label_component.label_name
return "Broadcast [serial_number]"

/obj/item/device/camera/broadcasting/hear_talk(mob/living/sourcemob, message, verb = "says", datum/language/language, italics = FALSE)
/obj/item/device/broadcasting/hear_talk(mob/living/sourcemob, message, verb = "says", datum/language/language, italics = FALSE)
SEND_SIGNAL(src, COMSIG_BROADCAST_HEAR_TALK, sourcemob, message, verb, language, italics, get_dist(sourcemob, src) < 3)

/obj/item/device/camera/broadcasting/see_emote(mob/living/sourcemob, emote, audible = FALSE)
/obj/item/device/broadcasting/see_emote(mob/living/sourcemob, emote, audible = FALSE)
SEND_SIGNAL(src, COMSIG_BROADCAST_SEE_EMOTE, sourcemob, emote, audible, get_dist(sourcemob, src) < 3 && audible)

/obj/item/photo/proc/construct(datum/picture/P)
Expand Down

0 comments on commit 563f9eb

Please sign in to comment.