From aea4dc334487f4b3f34c399c3b92eb0b0d58ab45 Mon Sep 17 00:00:00 2001 From: Walter0o Date: Sat, 9 Aug 2014 21:46:44 +0200 Subject: [PATCH] meter improvements - can unwrench meters now without needing to unwrench the pipe beneath - AIs and ghosts can still click to examine - other mobs don't read meter instead of doing whatever it is they are clicking for, e.g. shooting a gun - 3 tile range check for non-AI/ghost still in place - added feedback when no power or broken --- code/game/machinery/atmoalter/meter.dm | 38 ++++++++++---------------- 1 file changed, 15 insertions(+), 23 deletions(-) diff --git a/code/game/machinery/atmoalter/meter.dm b/code/game/machinery/atmoalter/meter.dm index b73e2cbde2..88fa2a07ec 100644 --- a/code/game/machinery/atmoalter/meter.dm +++ b/code/game/machinery/atmoalter/meter.dm @@ -68,9 +68,16 @@ ) radio_connection.post_signal(src, signal) -/obj/machinery/meter/proc/status() - var/t = "" - if (src.target) +/obj/machinery/meter/examine() + var/t = "A gas flow meter. " + + if(get_dist(usr, src) > 3 && !(istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/dead))) + t += "\blue You are too far away to read it." + + else if(stat & (NOPOWER|BROKEN)) + t += "\red The display is off." + + else if(src.target) var/datum/gas_mixture/environment = target.return_air() if(environment) t += "The pressure gauge reads [round(environment.return_pressure(), 0.01)] kPa; [round(environment.temperature,0.01)]°K ([round(environment.temperature-T0C,0.01)]°C)" @@ -78,31 +85,16 @@ t += "The sensor error light is blinking." else t += "The connect error light is blinking." - return t - -/obj/machinery/meter/examine() - set src in view(3) - - var/t = "A gas flow meter. " - t += status() + usr << t - - /obj/machinery/meter/Click() - if(stat & (NOPOWER|BROKEN)) + if(istype(usr, /mob/living/silicon/ai)) // ghosts can call ..() for examine + usr << examine() return 1 - - var/t = null - if (get_dist(usr, src) <= 3 || istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/dead)) - t += status() - else - usr << "\blue You are too far away." - return 1 - - usr << t - return 1 + + return ..() /obj/machinery/meter/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) if (!istype(W, /obj/item/weapon/wrench))