Merge pull request #351 from Miniature/master

AI freelook finishing
This commit is contained in:
Albert Iordache
2012-02-03 10:01:41 -08:00
4 changed files with 44 additions and 0 deletions
+35
View File
@@ -7,6 +7,14 @@
/turf/proc/visibilityChanged()
cameranet.updateVisibility(src)
/turf/New()
..()
cameranet.updateVisibility(src)
/*
/turf/Del()
..()
cameranet.updateVisibility(src)
*/
/datum/camerachunk
var/list/obscuredTurfs = list()
var/list/visibleTurfs = list()
@@ -246,6 +254,21 @@ var/datum/cameranet/cameranet = new()
chunk.cameras += c
chunk.hasChanged()
/datum/cameranet/proc/removeCamera(obj/machinery/camera/c)
var/x1 = max(0, c.x - 16) & ~0xf
var/y1 = max(0, c.y - 16) & ~0xf
var/x2 = min(world.maxx, c.x + 16) & ~0xf
var/y2 = min(world.maxy, c.y + 16) & ~0xf
for(var/x = x1; x <= x2; x += 16)
for(var/y = y1; y <= y2; y += 16)
if(chunkGenerated(x, y, c.z))
var/datum/camerachunk/chunk = getCameraChunk(x, y, c.z)
if(!c)
chunk.hasChanged()
if(c in chunk.cameras)
chunk.cameras -= c
chunk.hasChanged()
/mob/living/silicon/ai/var/mob/aiEye/eyeobj = new()
@@ -318,6 +341,18 @@ var/datum/cameranet/cameranet = new()
..()
cameranet.addCamera(src)
/obj/machinery/camera/Del()
cameranet.removeCamera(src)
..()
/obj/machinery/camera/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
. = ..(W, user)
if(istype(W, /obj/item/weapon/wirecutters))
if(status)
cameranet.addCamera(src)
else
cameranet.removeCamera(src)
/proc/checkcameravis(atom/A)
for(var/obj/machinery/camera/C in view(A,7))
if(!C.status || C.stat == 2)
+1
View File
@@ -46,6 +46,7 @@
/turf/space/New()
// icon = 'space.dmi'
..()
icon_state = "[pick(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25)]"
/turf/simulated
+7
View File
@@ -132,6 +132,7 @@
for(var/obj/structure/lattice/L in locate(src.x, src.y, src.z))
del(L)
var/turf/simulated/floor/W = new /turf/simulated/floor( locate(src.x, src.y, src.z) )
W.New()
W.dir = old_dir
if(prior_icon) W.icon_state = prior_icon
@@ -151,6 +152,7 @@
for(var/obj/structure/lattice/L in locate(src.x, src.y, src.z))
del(L)
var/turf/simulated/floor/plating/W = new /turf/simulated/floor/plating( locate(src.x, src.y, src.z) )
W.New()
W.dir = old_dir
if(prior_icon) W.icon_state = prior_icon
@@ -166,6 +168,7 @@
for(var/obj/structure/lattice/L in locate(src.x, src.y, src.z))
del(L)
var/turf/simulated/floor/engine/E = new /turf/simulated/floor/engine( locate(src.x, src.y, src.z) )
E.New()
E.dir = old_dir
E.icon_state = "engine"
@@ -228,12 +231,14 @@
/turf/proc/ReplaceWithSpace()
var/old_dir = dir
var/turf/space/S = new /turf/space( locate(src.x, src.y, src.z) )
S.New()
S.dir = old_dir
return S
/turf/proc/ReplaceWithLattice()
var/old_dir = dir
var/turf/space/S = new /turf/space( locate(src.x, src.y, src.z) )
S.New()
S.dir = old_dir
new /obj/structure/lattice( locate(src.x, src.y, src.z) )
return S
@@ -241,6 +246,7 @@
/turf/proc/ReplaceWithWall()
var/old_icon = icon_state
var/turf/simulated/wall/S = new /turf/simulated/wall( locate(src.x, src.y, src.z) )
S.New()
S.icon_old = old_icon
S.opacity = 0
S.sd_NewOpacity(1)
@@ -249,6 +255,7 @@
/turf/proc/ReplaceWithRWall()
var/old_icon = icon_state
var/turf/simulated/wall/r_wall/S = new /turf/simulated/wall/r_wall( locate(src.x, src.y, src.z) )
S.New()
S.icon_old = old_icon
S.opacity = 0
S.sd_NewOpacity(1)
+1
View File
@@ -194,6 +194,7 @@
shroom.pixel_y = 0
W = new /turf/simulated/floor/plating/airless/asteroid( locate(src.x, src.y, src.z) )
W.New()
W.dir = old_dir
W.fullUpdateMineralOverlays()