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
2024-01-31 13:49:52 +00:00
parent e3393dc87b
commit 978f4511a5
240 changed files with 524 additions and 551 deletions
@@ -113,9 +113,9 @@
/obj/item/chainsaw/proc/get_fuel()
return reagents.get_reagent_amount("fuel")
/obj/item/chainsaw/examine(mob/user)
/obj/item/chainsaw/examine(mob/user, distance, infix, suffix)
. = ..()
if(max_fuel && get_dist(user, src) == 0)
if(max_fuel && !distance)
. += "<span class = 'notice'>The [src] feels like it contains roughtly [get_fuel()] units of fuel left.</span>"
/obj/item/chainsaw/update_icon()
@@ -36,11 +36,11 @@
qdel(src)
..()
/obj/item/material/gravemarker/examine(mob/user)
/obj/item/material/gravemarker/examine(mob/user, distance, infix, suffix)
. = ..()
if(grave_name && get_dist(src, user) < 4)
if(grave_name && distance < 4)
. += "Here Lies [grave_name]"
if(epitaph && get_dist(src, user) < 2)
if(epitaph && distance < 2)
. += epitaph
/obj/item/material/gravemarker/update_icon()
@@ -76,4 +76,4 @@
G.add_fingerprint(usr)
G.dir = user.dir
QDEL_NULL(src)
return
return
@@ -10,7 +10,7 @@
w_class = ITEMSIZE_SMALL
var/repair_amount = 5
var/repair_time = 40
/obj/item/whetstone/attackby(obj/item/I, mob/user)
if(istype(I, /obj/item/stack/material))
var/obj/item/stack/material/M = I
@@ -40,7 +40,7 @@
var/sharpen_time = 100
var/uses = 0
/obj/item/material/sharpeningkit/examine(mob/user, distance)
/obj/item/material/sharpeningkit/examine(mob/user, distance, infix, suffix)
. = ..()
. += "There [uses == 1 ? "is" : "are"] [uses] [material] [uses == 1 ? src.material.sheet_singular_name : src.material.sheet_plural_name] left for use."
@@ -75,4 +75,4 @@
to_chat(user, "Not enough material to sharpen [M]. You need [M.w_class*2] [M.material.sheet_plural_name].")
return
else
to_chat(user, "You can't sharpen [W] with [src]!")
to_chat(user, "You can't sharpen [W] with [src]!")