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
@@ -41,7 +41,7 @@ var/global/list/marker_beacon_colors = list(
. = ..()
update_icon()
/obj/item/stack/marker_beacon/examine(mob/user)
/obj/item/stack/marker_beacon/examine(mob/user, distance, infix, suffix)
. = ..()
. += "<span class='notice'>Use in-hand to place a [singular_name].</span>"
. += "<span class='notice'>Alt-click to select a color. Current color is [picked_color].</span>"
@@ -97,7 +97,7 @@ var/global/list/marker_beacon_colors = list(
picked_color = mapped_in_color
update_icon()
/obj/structure/marker_beacon/examine(mob/user)
/obj/structure/marker_beacon/examine(mob/user, distance, infix, suffix)
. = ..()
if(!perma)
. += "<span class='notice'>Alt-click to select a color. Current color is [picked_color].</span>"
+4 -5
View File
@@ -56,10 +56,9 @@
icon_state = "[initial(icon_state)]_3"
item_state = initial(icon_state)
/obj/item/stack/examine(mob/user)
/obj/item/stack/examine(mob/user, distance, infix, suffix)
. = ..()
if(Adjacent(user))
if(distance < 2)
if(!uses_charge)
. += "There [src.amount == 1? "is" : "are"] [src.amount] [src.singular_name]\s in the stack."
else
@@ -76,7 +75,7 @@
/obj/item/stack/tgui_data(mob/user, datum/tgui/ui, datum/tgui_state/state)
var/list/data = ..()
data["amount"] = get_amount()
return data
@@ -120,7 +119,7 @@
if(get_amount() < 1)
qdel(src)
return
var/datum/stack_recipe/R = locate(params["ref"])
if(!is_valid_recipe(R, recipes)) //href exploit protection
return FALSE