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
+1 -1
View File
@@ -113,7 +113,7 @@
. = ..()
name = "den" // to remove mapping identifiers.
/obj/structure/animal_den/ghost_join/examine(mob/user, infix, suffix)
/obj/structure/animal_den/ghost_join/examine(mob/user, distance, infix, suffix)
var/list/output = ..()
if(isobserver(user))
if(critter)
+1 -1
View File
@@ -15,7 +15,7 @@
if(initial)
. -= "Off"
/obj/structure/sign/double/barsign/examine(mob/user)
/obj/structure/sign/double/barsign/examine(mob/user, distance, infix, suffix)
. = ..()
switch(icon_state)
if("Off")
+1 -1
View File
@@ -172,7 +172,7 @@ LINEN BINS
var/obj/item/hidden = null
/obj/structure/bedsheetbin/examine(mob/user)
/obj/structure/bedsheetbin/examine(mob/user, distance, infix, suffix)
. = ..()
if(amount < 1)
@@ -82,9 +82,9 @@
. = ..()
QDEL_NULL(door_obj)
/obj/structure/closet/examine(mob/user)
/obj/structure/closet/examine(mob/user, distance, infix, suffix)
. = ..()
if(Adjacent(user) || isobserver(user))
if(distance < 2 || isobserver(user))
var/content_size = 0
for(var/obj/item/I in contents)
if(!I.anchored)
@@ -539,4 +539,4 @@
M.Translate(-door_hinge, 0)
M.Multiply(matrix(cos(angle), 0, 0, -sin(angle) * door_anim_squish, 1, 0))
M.Translate(door_hinge, 0)
return M
return M
@@ -8,7 +8,7 @@
var/my_vehicle_type
var/paint_color = "#666666"
/obj/structure/vehiclecage/examine(mob/user)
/obj/structure/vehiclecage/examine(mob/user, distance, infix, suffix)
. = ..()
if(my_vehicle)
. += "<span class='notice'>It seems to contain \the [my_vehicle].</span>"
+2 -2
View File
@@ -27,7 +27,7 @@
update_cut_status()
return ..()
/obj/structure/fence/examine(mob/user)
/obj/structure/fence/examine(mob/user, distance, infix, suffix)
. = ..()
switch(hole_size)
@@ -176,4 +176,4 @@
#undef NO_HOLE
#undef MEDIUM_HOLE
#undef LARGE_HOLE
#undef MAX_HOLE_SIZE
#undef MAX_HOLE_SIZE
+3 -3
View File
@@ -36,7 +36,7 @@
if(randomize_harvest_count)
max_harvests = max(0, rand(min_harvests, max_harvests)) // Incase you want to weight it more toward 'not harvestable', set min_harvests to a negative value.
/obj/structure/flora/examine(mob/user)
/obj/structure/flora/examine(mob/user, distance, infix, suffix)
. = ..()
if(harvest_count < max_harvests)
. += get_harvestable_desc()
@@ -277,9 +277,9 @@
plane = OBJ_PLANE
var/obj/item/stored_item
/obj/structure/flora/pottedplant/examine(mob/user)
/obj/structure/flora/pottedplant/examine(mob/user, distance, infix, suffix)
. = ..()
if(in_range(user, src) && stored_item)
if(distance < 2 && stored_item)
. += "<span class='filter_notice'><i>You can see something in there...</i></span>"
/obj/structure/flora/pottedplant/attackby(obj/item/I, mob/user)
+4 -4
View File
@@ -29,11 +29,11 @@
return
color = material.icon_colour
/obj/structure/gravemarker/examine(mob/user)
/obj/structure/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/structure/gravemarker/CanPass(atom/movable/mover, turf/target)
@@ -126,4 +126,4 @@
return
src.set_dir(turn(src.dir, 270))
return
return
+3 -3
View File
@@ -31,7 +31,7 @@ GLOBAL_LIST_BOILERPLATE(all_janitorial_carts, /obj/structure/janitorialcart)
QDEL_NULL(mybucket)
return ..()
/obj/structure/janitorialcart/examine(mob/user)
/obj/structure/janitorialcart/examine(mob/user, distance, infix, suffix)
. = ..(user)
if(istype(mybucket))
var/contains = mybucket.reagents.total_volume
@@ -317,9 +317,9 @@ GLOBAL_LIST_BOILERPLATE(all_janitorial_carts, /obj/structure/janitorialcart)
update_layer()
/obj/structure/bed/chair/janicart/examine(mob/user)
/obj/structure/bed/chair/janicart/examine(mob/user, distance, infix, suffix)
. = ..()
if(Adjacent(user))
if(distance < 2)
. += "This [callme] contains [reagents.total_volume] unit\s of water!"
if(mybag)
. += "\A [mybag] is hanging on the [callme]."
+2 -2
View File
@@ -16,9 +16,9 @@ GLOBAL_LIST_BOILERPLATE(all_mopbuckets, /obj/structure/mopbucket)
create_reagents(300)
. = ..()
/obj/structure/mopbucket/examine(mob/user)
/obj/structure/mopbucket/examine(mob/user, distance, infix, suffix)
. = ..()
if(Adjacent(user))
if(distance < 2)
. += "It contains [reagents.total_volume] unit\s of water!"
/obj/structure/mopbucket/attackby(obj/item/I, mob/user)
+1 -1
View File
@@ -45,7 +45,7 @@
return !density
return TRUE
/obj/structure/railing/examine(mob/user)
/obj/structure/railing/examine(mob/user, distance, infix, suffix)
. = ..()
if(health < maxhealth)
switch(health / maxhealth)
+2 -2
View File
@@ -1119,7 +1119,7 @@
desc = "A basic wall clock, synced to the current system time."
icon_state = "clock"
/obj/structure/sign/clock/examine(mob/user)
/obj/structure/sign/clock/examine(mob/user, distance, infix, suffix)
. = ..()
. += "The clock shows that the time is [stationtime2text()]."
@@ -1128,7 +1128,7 @@
desc = "It's an old-school, NanoTrasen branded wall calendar. Sure, it might be obsolete with modern technology, but it's still hard to imagine an office without one."
icon_state = "calendar"
/obj/structure/sign/calendar/examine(mob/user)
/obj/structure/sign/calendar/examine(mob/user, distance, infix, suffix)
. = ..()
. += "The calendar shows that the date is [stationdate2text()]."
if (Holiday.len)
+1 -1
View File
@@ -24,7 +24,7 @@
var/silicate = 0 // number of units of silicate
var/fulltile = FALSE // Set to true on full-tile variants.
/obj/structure/window/examine(mob/user)
/obj/structure/window/examine(mob/user, distance, infix, suffix)
. = ..()
if(health == maxhealth)