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
@@ -117,9 +117,9 @@
var/datum/reagent/R = SSchemistry.chemical_reagents[reagent_ids[mode]]
to_chat(usr, "<span class='notice'>Synthesizer is now producing '[R.name]'.</span>")
/obj/item/reagent_containers/borghypo/examine(mob/user)
/obj/item/reagent_containers/borghypo/examine(mob/user, distance, infix, suffix)
. = ..()
if(get_dist(user, src) <= 2)
if(distance < 3)
var/datum/reagent/R = SSchemistry.chemical_reagents[reagent_ids[mode]]
. += "<span class='notice'>It is currently producing [R.name] and has [reagent_volumes[reagent_ids[mode]]] out of [volume] units left.</span>"
@@ -14,9 +14,9 @@
drop_sound = 'sound/items/drop/glass.ogg'
pickup_sound = 'sound/items/pickup/glass.ogg'
/obj/item/reagent_containers/dropper/examine(var/mob/user)
/obj/item/reagent_containers/dropper/examine(mob/user, distance, infix, suffix)
. = ..()
if(get_dist(user, src) <= 2)
if(distance < 3)
if(reagents && reagents.reagent_list.len)
. += "<span class='notice'>It contains [reagents.total_volume] units of liquid.</span>"
else
@@ -60,9 +60,9 @@
base_name = name
base_desc = desc
/obj/item/reagent_containers/glass/examine(var/mob/user)
/obj/item/reagent_containers/glass/examine(mob/user, distance, infix, suffix)
. = ..()
if(get_dist(user, src) <= 2)
if(distance < 3)
if(reagents && reagents.reagent_list.len)
. += "<span class='notice'>It contains [reagents.total_volume] units of liquid.</span>"
else
@@ -362,7 +362,7 @@
QDEL_NULL(holding)
return ..()
/obj/item/reagent_containers/glass/bucket/examine(mob/user)
/obj/item/reagent_containers/glass/bucket/examine(mob/user, distance, infix, suffix)
. = ..()
if(loc == user && holding)
. += "There is \a [holding] in \the [src]."
@@ -167,7 +167,7 @@
else
icon_state = "[initial(icon_state)]0"
/obj/item/reagent_containers/hypospray/autoinjector/examine(mob/user)
/obj/item/reagent_containers/hypospray/autoinjector/examine(mob/user, distance, infix, suffix)
. = ..()
if(reagents && reagents.reagent_list.len)
. += "<span class='notice'>It is currently loaded.</span>"
@@ -78,7 +78,7 @@
spray_size = next_in_list(spray_size, spray_sizes)
to_chat(user, "<span class='notice'>You adjusted the pressure nozzle. You'll now use [amount_per_transfer_from_this] units per spray.</span>")
/obj/item/reagent_containers/spray/examine(mob/user)
/obj/item/reagent_containers/spray/examine(mob/user, distance, infix, suffix)
. = ..()
if(loc == user)
. += "[round(reagents.total_volume)] units left."
@@ -132,9 +132,9 @@
. = ..()
reagents.add_reagent("condensedcapsaicin", volume)
/obj/item/reagent_containers/spray/pepper/examine(mob/user)
/obj/item/reagent_containers/spray/pepper/examine(mob/user, distance, infix, suffix)
. = ..()
if(Adjacent(user))
if(distance < 2)
. += "The safety is [safety ? "on" : "off"]."
/obj/item/reagent_containers/spray/pepper/attack_self(var/mob/user)