diff --git a/code/controllers/verbs.dm b/code/controllers/verbs.dm index 8e9fbf00701..fcd2c73012f 100644 --- a/code/controllers/verbs.dm +++ b/code/controllers/verbs.dm @@ -28,7 +28,7 @@ return -/client/proc/debug_controller(controller in list("Master","Failsafe","Ticker","Lighting","Air","Jobs","Sun","Radio","Supply Shuttle","Emergency Shuttle","Configuration","pAI")) +/client/proc/debug_controller(controller in list("Master","Failsafe","Ticker","Lighting","Air","Jobs","Sun","Radio","Supply Shuttle","Emergency Shuttle","Configuration","pAI", "Cameras")) set category = "Debug" set name = "Debug Controller" set desc = "Debug the various periodic loop controllers for the game (be careful!)" @@ -71,5 +71,8 @@ if("pAI") debug_variables(paiController) feedback_add_details("admin_verb","DpAI") + if("Cameras") + debug_variables(cameranet) + feedback_add_details("admin_verb","DCameras") message_admins("Admin [key_name_admin(usr)] is debugging the [controller] controller.", 1) return diff --git a/code/game/gamemodes/events.dm b/code/game/gamemodes/events.dm index 968fddd3e96..b9346b6dcc5 100644 --- a/code/game/gamemodes/events.dm +++ b/code/game/gamemodes/events.dm @@ -343,20 +343,16 @@ for (var/obj/machinery/power/apc/temp_apc in A) temp_apc.overload_lighting() - for(var/area/A in areas) for (var/obj/structure/closet/secure_closet/brig/temp_closet in A) temp_closet.locked = 0 temp_closet.icon_state = temp_closet.icon_closed - for(var/area/A in areas) for (var/obj/machinery/door/airlock/security/temp_airlock in A) - temp_airlock.prison_open() + spawn(0) temp_airlock.prison_open() - for(var/area/A in areas) for (var/obj/machinery/door/airlock/glass_security/temp_glassairlock in A) - temp_glassairlock.prison_open() + spawn(0) temp_glassairlock.prison_open() - for(var/area/A in areas) for (var/obj/machinery/door_timer/temp_timer in A) temp_timer.releasetime = 1 diff --git a/code/modules/mob/living/carbon/alien/alien.dm b/code/modules/mob/living/carbon/alien/alien.dm index 58e3527d74f..5f21569433c 100644 --- a/code/modules/mob/living/carbon/alien/alien.dm +++ b/code/modules/mob/living/carbon/alien/alien.dm @@ -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 diff --git a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm index 96aba8fbc2b..4cc5e858c1d 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm @@ -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() - diff --git a/code/modules/mob/living/carbon/alien/larva/life.dm b/code/modules/mob/living/carbon/alien/larva/life.dm index 7c59ebafc80..8c63041d644 100644 --- a/code/modules/mob/living/carbon/alien/larva/life.dm +++ b/code/modules/mob/living/carbon/alien/larva/life.dm @@ -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) diff --git a/code/modules/mob/living/silicon/ai/freelook/cameranet.dm b/code/modules/mob/living/silicon/ai/freelook/cameranet.dm index a8ad59844f6..79ca642942c 100644 --- a/code/modules/mob/living/silicon/ai/freelook/cameranet.dm +++ b/code/modules/mob/living/silicon/ai/freelook/cameranet.dm @@ -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. diff --git a/code/modules/mob/living/silicon/ai/freelook/chunk.dm b/code/modules/mob/living/silicon/ai/freelook/chunk.dm index 2a6c8e04a58..ec4d50bfa96 100644 --- a/code/modules/mob/living/silicon/ai/freelook/chunk.dm +++ b/code/modules/mob/living/silicon/ai/freelook/chunk.dm @@ -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 diff --git a/code/modules/mob/living/silicon/ai/freelook/update_triggers.dm b/code/modules/mob/living/silicon/ai/freelook/update_triggers.dm index a571838a770..0eba92cfeeb 100644 --- a/code/modules/mob/living/silicon/ai/freelook/update_triggers.dm +++ b/code/modules/mob/living/silicon/ai/freelook/update_triggers.dm @@ -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