From cbc41cbaaf83c55f026def638cd6664341144950 Mon Sep 17 00:00:00 2001 From: "giacomand@gmail.com" Date: Mon, 3 Sep 2012 22:21:45 +0000 Subject: [PATCH] -Made tracking Cyborgs smoother by depending on their cameras first, and then checking to see if they're in camera vision. -Corrosive Acid will check it still has a target before performing a tick. Made them a tiny bit quicker too, I wish they would take the time depending on w_class and or if anchored. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4616 316c924e-a436-60f5-8080-3fe189b3f50e --- code/game/machinery/camera/tracking.dm | 22 ++++++++++++++-------- code/game/objects/effects/aliens.dm | 4 +++- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/code/game/machinery/camera/tracking.dm b/code/game/machinery/camera/tracking.dm index 23015c9751c..ac3ad6b68d3 100644 --- a/code/game/machinery/camera/tracking.dm +++ b/code/game/machinery/camera/tracking.dm @@ -45,10 +45,8 @@ if(!hood.canremove) continue - if(!isturf(M.loc)) - continue // Now, are they viewable by a camera? (This is last because it's the most intensive check) - if(!cameranet.checkCameraVis(M)) + if(!near_camera(M)) continue var/name = M.name @@ -105,11 +103,8 @@ U << "Follow camera mode ended." U.cameraFollow = null return - if (!isturf(target.loc)) //in a closet - U << "Target is not on or near any active cameras on the station. We'll check again in 5 seconds (unless you use the cancel-camera verb)." - sleep(50) //because we're sleeping another second after this (a few lines down) - continue - if(!cameranet.checkCameraVis(target)) + + if (!near_camera(target)) U << "Target is not on or near any active cameras on the station. We'll check again in 5 seconds (unless you use the cancel-camera verb)." sleep(50) //because we're sleeping another second after this (a few lines down) continue @@ -121,6 +116,17 @@ return sleep(10) +/proc/near_camera(var/mob/M) + if (!isturf(M.loc)) + return 0 + if(isrobot(M)) + var/mob/living/silicon/robot/R = M + if(!(R.camera && R.camera.can_use()) && !cameranet.checkCameraVis(M)) + return 0 + else if(!cameranet.checkCameraVis(M)) + return 0 + return 1 + /obj/machinery/camera/attack_ai(var/mob/living/silicon/ai/user as mob) if (!istype(user)) return diff --git a/code/game/objects/effects/aliens.dm b/code/game/objects/effects/aliens.dm index fc6eaac744b..4190664b92f 100644 --- a/code/game/objects/effects/aliens.dm +++ b/code/game/objects/effects/aliens.dm @@ -296,6 +296,8 @@ Alien plants should do something if theres a lot of poison var/ticks = 0 /obj/effect/alien/acid/proc/tick() + if(!target) + del(src) ticks += 1 for(var/mob/O in hearers(src, null)) O.show_message("\green [src.target] sizzles and begins to melt under the bubbling mess of acid!", 1) @@ -307,7 +309,7 @@ Alien plants should do something if theres a lot of poison del(target) del(src) return - spawn(rand(200, 600)) tick() + spawn(rand(200, 400)) tick() /* * Egg