Entertainment monitor screen now changes if there is any video camera active (#20024)

* not live monitor sprite

* camera on controls monitor

* second try

* cooldown and update_overlays

* Apply suggestions from code review

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>

* feeds_on autodoc

* Apply suggestions from code review

Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>
This commit is contained in:
Henri215
2023-01-12 19:32:22 -05:00
committed by GitHub
co-authored by Luc Ryan
parent 47a146ed35
commit a5a05faadb
3 changed files with 24 additions and 1 deletions
+14
View File
@@ -543,6 +543,7 @@ GLOBAL_LIST_INIT(SpookyGhosts, list("ghost","shade","shade2","ghost-narsie","hor
/**************
*video camera *
***************/
#define CAMERA_STATE_COOLDOWN 2 SECONDS
/obj/item/videocam
name = "video camera"
@@ -553,6 +554,7 @@ GLOBAL_LIST_INIT(SpookyGhosts, list("ghost","shade","shade2","ghost-narsie","hor
w_class = WEIGHT_CLASS_NORMAL
materials = list(MAT_METAL = 1000, MAT_GLASS = 500)
var/on = FALSE
var/video_cooldown = 0
var/obj/machinery/camera/camera
var/icon_on = "videocam_on"
var/icon_off = "videocam"
@@ -571,8 +573,18 @@ GLOBAL_LIST_INIT(SpookyGhosts, list("ghost","shade","shade2","ghost-narsie","hor
camera.c_tag = null
QDEL_NULL(camera)
visible_message("<span class='notice'>The video camera has been turned [on ? "on" : "off"].</span>")
for(var/obj/machinery/computer/security/telescreen/entertainment/TV in GLOB.machines)
if(on)
TV.feeds_on++
else
TV.feeds_on--
TV.update_icon(UPDATE_OVERLAYS)
video_cooldown = world.time + CAMERA_STATE_COOLDOWN
/obj/item/videocam/attack_self(mob/user)
if(world.time < video_cooldown)
to_chat(user, "<span class='warning'>[src] is overheating, give it some time.</span>")
return
camera_state(user)
/obj/item/videocam/dropped()
@@ -606,6 +618,8 @@ GLOBAL_LIST_INIT(SpookyGhosts, list("ghost","shade","shade2","ghost-narsie","hor
desc = "This video camera allows you to send live feeds even when attached to a belt."
slot_flags = SLOT_BELT
#undef CAMERA_STATE_COOLDOWN
///hauntings, like hallucinations but more spooky
/obj/item/camera/proc/handle_haunt(mob/user as mob)