mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-21 19:19:12 +01:00
An active AI core now provides camera coverage.
This commit is contained in:
@@ -24,6 +24,10 @@
|
||||
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)
|
||||
@@ -31,3 +35,15 @@
|
||||
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
|
||||
|
||||
/mob/living/silicon/ai/proc/seen_camera_turfs()
|
||||
return seen_turfs_in_range(src, world.view)
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
|
||||
// Update the portable camera everytime the Robot moves.
|
||||
// This might be laggy, comment it out if there are problems.
|
||||
/mob/living/silicon/robot/var/updating = 0
|
||||
/mob/living/silicon/var/updating = 0
|
||||
|
||||
/mob/living/silicon/robot/Move()
|
||||
var/oldLoc = src.loc
|
||||
. = ..()
|
||||
if(.)
|
||||
if(src.camera && src.camera.network.len)
|
||||
if(provides_camera_vision())
|
||||
if(!updating)
|
||||
updating = 1
|
||||
spawn(BORG_CAMERA_BUFFER)
|
||||
@@ -18,6 +18,21 @@
|
||||
cameranet.updatePortableCamera(src.camera)
|
||||
updating = 0
|
||||
|
||||
/mob/living/silicon/AI/Move()
|
||||
var/oldLoc = src.loc
|
||||
. = ..()
|
||||
if(.)
|
||||
if(provides_camera_vision())
|
||||
if(!updating)
|
||||
updating = 1
|
||||
spawn(BORG_CAMERA_BUFFER)
|
||||
if(oldLoc != src.loc)
|
||||
cameranet.updateVisibility(oldLoc, 0)
|
||||
cameranet.updateVisibility(loc, 0)
|
||||
updating = 0
|
||||
|
||||
#undef BORG_CAMERA_BUFFER
|
||||
|
||||
// CAMERA
|
||||
|
||||
// An addition to deactivate which removes/adds the camera from the chunk list based on if it works or not.
|
||||
@@ -42,8 +57,19 @@
|
||||
update_coverage(1)
|
||||
|
||||
/obj/machinery/camera/Destroy()
|
||||
cameranet.cameras -= src
|
||||
clear_all_networks()
|
||||
cameranet.cameras -= src
|
||||
..()
|
||||
|
||||
#undef BORG_CAMERA_BUFFER
|
||||
// Mobs
|
||||
/mob/living/silicon/ai/rejuvenate()
|
||||
var/was_dead = stat == DEAD
|
||||
..()
|
||||
if(was_dead && stat != DEAD)
|
||||
// Arise!
|
||||
cameranet.updateVisibility(src, 0)
|
||||
|
||||
/mob/living/silicon/ai/death(gibbed)
|
||||
if(..())
|
||||
// If true, the mob went from living to dead (assuming everyone has been overriding as they should...)
|
||||
cameranet.updateVisibility(src, 0)
|
||||
|
||||
@@ -41,12 +41,15 @@ mob/eye/Destroy()
|
||||
updateallghostimages()
|
||||
..()
|
||||
|
||||
// Movement code. Returns 0 to stop air movement from moving it.
|
||||
/mob/eye/Move(n, direct)
|
||||
if(owner == src)
|
||||
EyeMove(n, direct)
|
||||
return EyeMove(n, direct)
|
||||
return 0
|
||||
|
||||
/mob/eye/airflow_hit(atom/A)
|
||||
airflow_speed = 0
|
||||
airflow_dest = null
|
||||
|
||||
/mob/eye/examinate()
|
||||
set popup_menu = 0
|
||||
set src = usr.contents
|
||||
@@ -110,3 +113,4 @@ mob/eye/Destroy()
|
||||
sprint = min(sprint + 0.5, max_sprint)
|
||||
else
|
||||
sprint = initial
|
||||
return 1
|
||||
|
||||
@@ -11,27 +11,24 @@
|
||||
|
||||
/datum/chunk/cult/acquireVisibleTurfs(var/list/visible)
|
||||
for(var/mob/living/L in living_mob_list)
|
||||
for(var/turf/t in L.seen_turfs())
|
||||
for(var/turf/t in L.seen_cult_turfs())
|
||||
visible[t] = t
|
||||
|
||||
/mob/living/proc/seen_turfs()
|
||||
/mob/living/proc/seen_cult_turfs()
|
||||
return seen_turfs_in_range(src, 3)
|
||||
|
||||
/mob/living/carbon/human/seen_turfs()
|
||||
/*if(src.isSynthetic())
|
||||
return list()*/
|
||||
|
||||
/mob/living/carbon/human/seen_cult_turfs()
|
||||
if(mind in cult.current_antagonists)
|
||||
return seen_turfs_in_range(src, client ? client.view : 7)
|
||||
return seen_turfs_in_range(src, world.view)
|
||||
return ..()
|
||||
|
||||
/mob/living/silicon/seen_turfs()
|
||||
/mob/living/silicon/seen_cult_turfs()
|
||||
return list()
|
||||
|
||||
/mob/living/simple_animal/seen_turfs()
|
||||
/mob/living/simple_animal/seen_cult_turfs()
|
||||
return seen_turfs_in_range(src, 1)
|
||||
|
||||
/mob/living/simple_animal/shade/narsie/seen_turfs()
|
||||
/mob/living/simple_animal/shade/narsie/seen_cult_turfs()
|
||||
return view(2, src)
|
||||
|
||||
/proc/seen_turfs_in_range(var/source, var/range)
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
/mob/living/silicon/ai/SelfMove(turf/n, direct)
|
||||
return 0
|
||||
Reference in New Issue
Block a user