-Optimized freelooking a bit.

-Larva can now die, instead of staying in critical.
-Improved the prison break event.
-Added the cameranet to the list of debuggable controllers (I know it's not technically a controller but it seems like the best place to be).

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4858 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
giacomand@gmail.com
2012-10-13 19:52:41 +00:00
parent c4382905e5
commit 3dd4f8cbc5
8 changed files with 44 additions and 31 deletions
@@ -48,6 +48,15 @@
/mob/living/carbon/alien/eyecheck()
return 2
/mob/living/carbon/alien/updatehealth()
if(nodamage)
health = maxHealth
stat = CONSCIOUS
else
//oxyloss is only used for suicide
//toxloss isn't used for aliens, its actually used as alien powers!!
health = maxHealth - getOxyLoss() - getFireLoss() - getBruteLoss() - getCloneLoss()
/mob/living/carbon/alien/proc/handle_environment(var/datum/gas_mixture/environment)
//If there are alien weeds on the ground then heal if needed or give some toxins
@@ -524,13 +524,4 @@ In all, this is a lot like the monkey code. /N
onclose(user, "mob[name]")
return
/mob/living/carbon/alien/humanoid/updatehealth()
if(nodamage)
health = maxHealth
stat = CONSCIOUS
else
//oxyloss is only used for suicide
//toxloss isn't used for aliens, its actually used as alien powers!!
health = maxHealth - getOxyLoss() - getFireLoss() - getBruteLoss() - getCloneLoss()
@@ -222,17 +222,17 @@
blinded = 1
silent = 0
else //ALIVE. LIGHTS ARE ON
if(health < config.health_threshold_dead || brain_op_stage == 4.0)
if(health < -25 || brain_op_stage == 4.0)
death()
blinded = 1
silent = 0
return 1
//UNCONSCIOUS. NO-ONE IS HOME
if( (getOxyLoss() > 50) || (config.health_threshold_crit > health) )
if( health <= 20 && prob(1) )
spawn(0)
emote("gasp")
if( (getOxyLoss() > 50) || (0 > health) )
//if( health <= 20 && prob(1) )
// spawn(0)
// emote("gasp")
if(!reagents.has_reagent("inaprovaline"))
adjustOxyLoss(1)
Paralyse(3)
@@ -73,7 +73,8 @@ var/datum/cameranet/cameranet = new()
// Removes a camera from a chunk.
/datum/cameranet/proc/removeCamera(obj/machinery/camera/c)
majorChunkChange(c, 0)
if(c.can_use())
majorChunkChange(c, 0)
// Add a camera to a chunk.
@@ -81,15 +82,13 @@ var/datum/cameranet/cameranet = new()
if(c.can_use())
majorChunkChange(c, 1)
// Used for Cyborg cameras. It is the same as "add" but named differently for easier readability
// and to allow the user know what it is for. Since portable cameras can be in ANY chunk, we have to
// all it to be added to all chunks. If the camera is disabled, it will instead remove.
// Used for Cyborg cameras. Since portable cameras can be in ANY chunk.
/datum/cameranet/proc/updatePortableCamera(obj/machinery/camera/c)
if(c.can_use())
majorChunkChange(c, 1)
else
majorChunkChange(c, 0)
//else
// majorChunkChange(c, 0)
// Never access this proc directly!!!!
// This will update the chunk and all the surrounding chunks.
@@ -15,6 +15,9 @@
var/visible = 0
var/changed = 0
var/updating = 0
var/x = 0
var/y = 0
var/z = 0
// Add an AI eye to the chunk, then update if changed.
@@ -69,10 +72,16 @@
var/list/newVisibleTurfs = list()
for(var/obj/machinery/camera/c in cameras)
for(var/camera in cameras)
var/obj/machinery/camera/c = camera
if(!c.can_use())
continue
var/turf/point = locate(src.x + 8, src.y + 8, src.z)
if(get_dist(point, c) > 24)
continue
for(var/turf/t in c.can_see())
newVisibleTurfs += t
@@ -85,7 +94,6 @@
visibleTurfs = newVisibleTurfs
obscuredTurfs = turfs - newVisibleTurfs
for(var/turf in visAdded)
var/turf/t = turf
if(t.obscured)
@@ -116,16 +124,21 @@
/datum/camerachunk/New(loc, x, y, z)
set background = 1
// 0xf = 15
x &= ~0xf
y &= ~0xf
src.x = x
src.y = y
src.z = z
for(var/obj/machinery/camera/c in range(16, locate(x + 8, y + 8, z)))
if(c.can_use())
cameras += c
for(var/turf/t in range(10, locate(x + 8, y + 8, z)))
if(t.x >= x && t.y >= y && t.x < x + 16 && t.y < y + 16)
turfs += t
@@ -64,13 +64,15 @@
/mob/living/silicon/robot/var/updating = 0
/mob/living/silicon/robot/Move()
var/oldLoc = src.loc
. = ..()
if(.)
if(src.camera)
if(!updating)
updating = 1
spawn(BORG_CAMERA_BUFFER)
cameranet.updatePortableCamera(src.camera)
if(oldLoc != src.loc)
cameranet.updatePortableCamera(src.camera)
updating = 0
// CAMERA