Re-enables cyborg cameras through camera consoles and AI eye vision. (#52767)

* Better camera logic

* AI eye cameras can see through borgo cams

* Switch that to being able to see through any silicon's camera

* Switch that to being able to see through any silicon's camera

* Disable borgo camera at high damage

* Rohesie-proof some code
This commit is contained in:
Timberpoes
2020-08-08 16:52:00 +02:00
committed by GitHub
parent 09ef529108
commit c3f23edfc0
3 changed files with 24 additions and 8 deletions
+11 -7
View File
@@ -114,20 +114,24 @@
if(action == "switch_camera")
var/c_tag = params["name"]
var/list/cameras = get_available_cameras()
var/obj/machinery/camera/C = cameras[c_tag]
active_camera = C
var/obj/machinery/camera/selected_camera = cameras[c_tag]
active_camera = selected_camera
playsound(src, get_sfx("terminal_type"), 25, FALSE)
// Show static if can't use the camera
if(!active_camera?.can_use())
if(!selected_camera?.can_use())
show_camera_static()
return TRUE
var/list/visible_turfs = list()
for(var/turf/T in (C.isXRay() \
? range(C.view_range, C) \
: view(C.view_range, C)))
visible_turfs += T
// Is this camera located in or attached to a living thing? If so, assume the camera's loc is the living thing.
var/cam_location = isliving(selected_camera.loc) ? selected_camera.loc : selected_camera
var/list/visible_things = selected_camera.isXRay() ? range(selected_camera.view_range, cam_location) : view(selected_camera.view_range, cam_location)
for(var/turf/visible_turf in visible_things)
visible_turfs += visible_turf
var/list/bbox = get_bbox_of_atoms(visible_turfs)
var/size_x = bbox[3] - bbox[1] + 1
@@ -112,6 +112,10 @@
if(c.can_use())
cameras += c
for(var/mob/living/silicon/sillycone in urange(CHUNK_SIZE, locate(x + (CHUNK_SIZE / 2), y + (CHUNK_SIZE / 2), z)))
if(sillycone.builtInCamera?.can_use())
cameras += sillycone.builtInCamera
for(var/turf/t in block(locate(max(x, 1), max(y, 1), z), locate(min(x + CHUNK_SIZE - 1, world.maxx), min(y + CHUNK_SIZE - 1, world.maxy), z)))
turfs[t] = t
@@ -149,6 +149,11 @@
playsound(src, 'sound/machines/warning-buzzer.ogg', 75, TRUE, TRUE)
audible_message("<span class='warning'>[src] sounds an alarm! \"CRITICAL ERROR: ALL modules OFFLINE.\"</span>")
if(builtInCamera)
builtInCamera.status = FALSE
to_chat(src, "<span class='userdanger'>CRITICAL ERROR: Built in security camera OFFLINE.</span>")
to_chat(src, "<span class='userdanger'>CRITICAL ERROR: ALL modules OFFLINE.</span>")
if(2)
@@ -175,7 +180,6 @@
return TRUE
/**
* Breaks all of a cyborg's slots.
*/
@@ -200,6 +204,9 @@
inv1.icon_state = initial(inv1.icon_state)
disabled_modules &= ~BORG_MODULE_ALL_DISABLED
if(builtInCamera)
builtInCamera.status = TRUE
to_chat(src, "<span class='notice'>You hear your built in security camera focus adjust as it comes back online!</span>")
if(2)
if(!(disabled_modules & BORG_MODULE_TWO_DISABLED))
return FALSE
@@ -388,3 +395,4 @@
/mob/living/silicon/robot/swap_hand()
cycle_modules()