mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-16 17:44:25 +01:00
7c8bb85de3
* Update settings * Whitespace changes * Comment out merger hooks in gitattributes Corrupt maps would have to be resolved in repo before hooks could be updated * Revert "Whitespace changes" This reverts commitafbdd1d844. * Whitespace again minus example * Gitignore example changelog * Restore changelog merge setting * Keep older dmi hook attribute until hooks can be updated * update vscode settings too * Renormalize remaining * Revert "Gitignore example changelog" This reverts commitde22ad375d. * Attempt to normalize example.yml (and another file I guess) * Try again
49 lines
1.3 KiB
Plaintext
49 lines
1.3 KiB
Plaintext
// CAMERA CHUNK
|
|
//
|
|
// A 16x16 grid of the map with a list of turfs that can be seen, are visible and are dimmed.
|
|
// Allows the Eye to stream these chunks and know what it can and cannot see.
|
|
|
|
/datum/chunk/camera
|
|
var/list/cameras = list()
|
|
|
|
/datum/chunk/camera/acquireVisibleTurfs(var/list/visible)
|
|
for(var/obj/machinery/camera/c as anything in cameras)
|
|
|
|
if(!istype(c))
|
|
cameras -= c
|
|
continue
|
|
|
|
if(!c.can_use())
|
|
continue
|
|
|
|
var/turf/point = locate(src.x + 8, src.y + 8, src.z)
|
|
if(get_dist(point, c) > 24)
|
|
cameras -= c
|
|
|
|
for(var/turf/t in c.can_see())
|
|
visible[t] = t
|
|
|
|
for(var/mob/living/silicon/ai/AI in living_mob_list)
|
|
for(var/turf/t in AI.seen_camera_turfs())
|
|
visible[t] = t
|
|
|
|
// Create a new camera chunk, since the chunks are made as they are needed.
|
|
|
|
/datum/chunk/camera/New(loc, x, y, z)
|
|
for(var/obj/machinery/camera/c in range(16, locate(x + 8, y + 8, z)))
|
|
if(c.can_use())
|
|
cameras += c
|
|
..()
|
|
|
|
/mob/living/silicon/proc/provides_camera_vision()
|
|
return 0
|
|
|
|
/mob/living/silicon/ai/provides_camera_vision()
|
|
return stat != DEAD
|
|
|
|
/mob/living/silicon/robot/provides_camera_vision()
|
|
return src.camera && src.camera.network.len && (z in using_map.contact_levels) //VOREStation Edit
|
|
|
|
/mob/living/silicon/ai/proc/seen_camera_turfs()
|
|
return seen_turfs_in_range(src, world.view)
|