examine signature changed to include distance

- distance is INFINITE, 0, or a positive integer based on get_dist() between
the examiner and examinee's turfs when they are on the same Z. When the
examiner is dead or a ghost, distance is always 0.
- also updates /examine( implementations to use it!
- adds w_class_to_name proc for reusing "It is a X item." examine behavior.
This commit is contained in:
Spookerton
2023-12-29 23:44:21 +00:00
parent e3393dc87b
commit 978f4511a5
240 changed files with 524 additions and 551 deletions
@@ -196,9 +196,9 @@
return 1
/obj/machinery/atmospherics/binary/dp_vent_pump/examine(mob/user)
/obj/machinery/atmospherics/binary/dp_vent_pump/examine(mob/user, distance, infix, suffix)
. = ..()
if(Adjacent(user))
if(distance < 2)
. += "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W"
+1 -1
View File
@@ -14,7 +14,7 @@ GLOBAL_LIST_EMPTY(shutoff_valves)
/obj/machinery/atmospherics/valve/shutoff/update_icon()
icon_state = "vclamp[open]"
/obj/machinery/atmospherics/valve/shutoff/examine(var/mob/user)
/obj/machinery/atmospherics/valve/shutoff/examine(mob/user, distance, infix, suffix)
. = ..()
. += "The automatic shutoff circuit is [close_on_leaks ? "enabled" : "disabled"]."
@@ -87,7 +87,7 @@
/obj/machinery/atmospherics/unary/freezer/tgui_act(action, params)
if(..())
return TRUE
. = TRUE
switch(action)
if("toggleStatus")
@@ -169,7 +169,7 @@
..()
/obj/machinery/atmospherics/unary/freezer/examine(mob/user)
/obj/machinery/atmospherics/unary/freezer/examine(mob/user, distance, infix, suffix)
. = ..()
if(panel_open)
. += "The maintenance hatch is open."
@@ -156,7 +156,7 @@
..()
/obj/machinery/atmospherics/unary/heater/examine(mob/user)
/obj/machinery/atmospherics/unary/heater/examine(mob/user, distance, infix, suffix)
. = ..()
if(panel_open)
. += "The maintenance hatch is open."
@@ -165,7 +165,7 @@
soundloop.stop()
return 0
if(!use_power)
soundloop.stop()
soundloop.stop()
return 0
if(welded)
soundloop.stop()
@@ -400,9 +400,9 @@
else
..()
/obj/machinery/atmospherics/unary/vent_pump/examine(mob/user)
/obj/machinery/atmospherics/unary/vent_pump/examine(mob/user, distance, infix, suffix)
. = ..()
if(Adjacent(user))
if(distance < 2)
. += "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W"
else
. += "You are too far away to read the gauge."
@@ -286,9 +286,9 @@
"You hear a ratchet.")
deconstruct()
/obj/machinery/atmospherics/unary/vent_scrubber/examine(mob/user)
/obj/machinery/atmospherics/unary/vent_scrubber/examine(mob/user, distance, infix, suffix)
. = ..()
if(Adjacent(user))
if(distance < 2)
. += "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W"
else
. += "You are too far away to read the gauge."
+1 -1
View File
@@ -306,6 +306,6 @@
"You hear a ratchet.")
deconstruct()
/obj/machinery/atmospherics/valve/examine(mob/user)
/obj/machinery/atmospherics/valve/examine(mob/user, distance, infix, suffix)
. = ..()
. += "It is [open ? "open" : "closed"]."