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
@@ -15,10 +15,10 @@
// Associative list of paths and their chances. path = straws in the lot
var/list/harvest_results
/mob/living/simple_mob/examine(mob/user)
/mob/living/simple_mob/examine(mob/user, distance, infix, suffix)
. = ..()
if(user && (isobserver(user) || get_dist(user, src) <= 3))
if(user && (isobserver(user) || distance <= 3))
var/datum/gender/G = gender_datums[get_visible_gender()]
if(stat == DEAD)
@@ -89,7 +89,7 @@
to_chat(src, span("warning", "\The [user] takes your [my_headset.name] away! How cruel!"))
my_headset = null
/mob/living/simple_mob/animal/passive/bird/parrot/examine(mob/user)
/mob/living/simple_mob/animal/passive/bird/parrot/examine(mob/user, distance, infix, suffix)
. = ..()
if(my_headset)
. += "It is wearing \a [my_headset]."
@@ -250,4 +250,4 @@
if(holder.stat || !holder.say_list || !message || speaker == holder)
return
var/datum/say_list/S = holder.say_list
S.speak |= message
S.speak |= message
@@ -163,7 +163,7 @@ You can eat glowing tree fruit to fuel your <b>ranged spitting attack</b> and <b
reset_charisma()
/mob/living/simple_mob/animal/sif/grafadreka/examine(mob/living/user)
/mob/living/simple_mob/animal/sif/grafadreka/examine(mob/user, distance, infix, suffix)
. = ..()
if (istype(user, /mob/living/simple_mob/animal/sif/grafadreka) || isobserver(user))
var/datum/gender/G = gender_datums[get_visible_gender()]
@@ -24,7 +24,7 @@
// caps the amount drakes can heal with their sap wound tending interaction.
sap_heal_threshold = min(sap_heal_threshold, (round(health / getMaxHealth() / scarification_period)+1) * scarification_period)
/mob/living/simple_mob/animal/sif/examine(mob/user)
/mob/living/simple_mob/animal/sif/examine(mob/user, distance, infix, suffix)
. = ..()
if(stat != DEAD)
var/scarification = 1-sap_heal_threshold
@@ -39,9 +39,9 @@
// Because we can't perfectly duplicate some examine() output, we directly examine the AM it is copying. It's messy but
// this is to prevent easy checks from the opposing force.
/mob/living/simple_mob/illusion/examine(mob/user)
/mob/living/simple_mob/illusion/examine(mob/user, distance, infix, suffix)
if(copying)
return copying.examine(user)
return copying.examine(user, distance, infix, suffix)
else
return list("???")
@@ -113,4 +113,4 @@
/mob/living/simple_mob/illusion/get_catalogue_delay()
if(copying)
return copying.get_catalogue_delay()
return copying.get_catalogue_delay()
@@ -132,7 +132,7 @@
return
return ..()
/mob/living/simple_mob/construct/examine(mob/user)
/mob/living/simple_mob/construct/examine(mob/user, distance, infix, suffix)
. = ..(user)
var/max = getMaxHealth()
if (health < max)
@@ -73,7 +73,7 @@
..()
/mob/living/simple_mob/slime/xenobio/examine(mob/user)
/mob/living/simple_mob/slime/xenobio/examine(mob/user, distance, infix, suffix)
. = ..()
if(hat)
. += "It is wearing \a [hat]."