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
@@ -112,9 +112,9 @@ var/global/list/obj/item/communicator/all_communicators = list()
// Proc: examine()
// Parameters: user - the user doing the examining
// Description: Allows the user to click a link when examining to look at video if one is going.
/obj/item/communicator/examine(mob/user)
/obj/item/communicator/examine(mob/user, distance, infix, suffix)
. = ..()
if(Adjacent(user) && video_source)
if(distance < 2 && video_source)
. += "<span class='notice'>It looks like it's on a video call: <a href='?src=\ref[src];watchvideo=1'>\[view\]</a></span>"
// Proc: initialize_exonet()
@@ -135,12 +135,10 @@ var/global/list/obj/item/communicator/all_communicators = list()
// Proc: examine()
// Parameters: 1 (user - the person examining the device)
// Description: Shows all the voice mobs inside the device, and their status.
/obj/item/communicator/examine(mob/user)
/obj/item/communicator/examine(mob/user, distance, infix, suffix)
. = ..()
for(var/mob/living/voice/voice in contents)
. += "<span class='notice'>On the screen, you can see a image feed of [voice].</span>"
if(voice && voice.key)
switch(voice.stat)
if(CONSCIOUS)
@@ -82,7 +82,7 @@
icon_state = "[initial(icon_state)]"
set_light(0)
/obj/item/flashlight/examine(mob/user)
/obj/item/flashlight/examine(mob/user, distance, infix, suffix)
. = ..()
if(power_use && brightness_level)
. += "\The [src] is set to [brightness_level]."
@@ -113,7 +113,7 @@
else if(choice == "Colour")
choose_colour()
/obj/item/floor_painter/examine(mob/user)
/obj/item/floor_painter/examine(mob/user, distance, infix, suffix)
. = ..()
. += "It is configured to produce the '[decal]' decal with a direction of '[paint_dir]' using [paint_colour] paint."
+1 -1
View File
@@ -34,7 +34,7 @@
update_icon()
update_sound()
/obj/item/geiger/examine(mob/user)
/obj/item/geiger/examine(mob/user, distance, infix, suffix)
. = ..()
get_radiation()
. += "<span class='warning'>[scanning ? "Ambient" : "Stored"] radiation level: [radiation_count ? radiation_count : "0"]Bq.</span>"
@@ -13,11 +13,11 @@
var/datum/data/record/warrant/active
//look at it
/obj/item/holowarrant/examine(mob/user)
/obj/item/holowarrant/examine(mob/user, distance, infix, suffix)
. = ..()
if(active)
. += "It's a holographic warrant for '[active.fields["namewarrant"]]'."
if(in_range(user, src) || istype(user, /mob/observer/dead))
if(distance < 2 || istype(user, /mob/observer/dead))
show_content(user) //Opens a browse window, not chatbox related
else
. += "<span class='notice'>You have to go closer if you want to read it.</span>"
@@ -110,4 +110,4 @@
Vessel or habitat: _<u>[using_map.station_name]</u>____</br>
</BODY></HTML>
"}
show_browser(user, output, "window=Search warrant for [active.fields["namewarrant"]]")
show_browser(user, output, "window=Search warrant for [active.fields["namewarrant"]]")
@@ -63,9 +63,9 @@
failmsg = "The [name]'s refill light blinks red."
. = ..()
/obj/item/lightreplacer/examine(mob/user)
/obj/item/lightreplacer/examine(mob/user, distance, infix, suffix)
. = ..()
if(get_dist(user, src) <= 2)
if(distance < 3)
. += "It has [uses] lights remaining."
/obj/item/lightreplacer/attackby(obj/item/W, mob/user)
@@ -228,4 +228,4 @@
#undef LIGHT_OK
#undef LIGHT_EMPTY
#undef LIGHT_BROKEN
#undef LIGHT_BURNED
#undef LIGHT_BURNED
+1 -1
View File
@@ -65,7 +65,7 @@
user.drop_from_inventory(src)
qdel(src)
/obj/item/modkit/examine(mob/user)
/obj/item/modkit/examine(mob/user, distance, infix, suffix)
. = ..()
. += "It looks as though it modifies hardsuits to fit [target_species] users."
@@ -26,6 +26,6 @@
/obj/item/pipe_painter/attack_self(mob/user as mob)
mode = input("Which colour do you want to use?", "Pipe painter", mode) in modes
/obj/item/pipe_painter/examine(mob/user)
/obj/item/pipe_painter/examine(mob/user, distance, infix, suffix)
. = ..()
. += "It is in [mode] mode."
@@ -39,9 +39,8 @@
/obj/item/radio/headset/list_channels(var/mob/user)
return list_secure_channels()
/obj/item/radio/headset/examine(mob/user)
/obj/item/radio/headset/examine(mob/user, distance, infix, suffix)
. = ..()
if(radio_desc && Adjacent(user))
. += "The following channels are available:"
. += radio_desc
@@ -596,10 +596,9 @@ GLOBAL_DATUM(autospeaker, /mob/living/silicon/ai/announcer)
return get_mobs_or_objects_in_view(range, src)
/obj/item/radio/examine(mob/user)
/obj/item/radio/examine(mob/user, distance, infix, suffix)
. = ..()
if((in_range(src, user) || loc == user))
if(distance < 2 || loc == user)
if(b_stat)
. += "<span class='notice'>\The [src] can be attached and modified!</span>"
else
+5 -5
View File
@@ -83,9 +83,9 @@
origin_tech = list(TECH_DATA = 1, TECH_ENGINEERING = 1, TECH_ILLEGAL = 3)
camtype = /obj/machinery/camera/bug/spy
/obj/item/camerabug/examine(mob/user)
/obj/item/camerabug/examine(mob/user, distance, infix, suffix)
. = ..()
if(get_dist(user, src) == 0)
if(!distance)
. += "It has a tiny camera inside. Needs to be both configured and brought in contact with monitor device to be fully functional."
/obj/item/camerabug/update_icon()
@@ -234,9 +234,9 @@
item_state = "electronic"
origin_tech = list(TECH_DATA = 1, TECH_ENGINEERING = 1, TECH_ILLEGAL = 3)
/obj/item/bug_monitor/spy/examine(mob/user)
/obj/item/bug_monitor/spy/examine(mob/user, distance, infix, suffix)
. = ..()
if(Adjacent(user))
if(distance < 2)
. += "The time '12:00' is blinking in the corner of the screen and \the [src] looks very cheaply made."
/obj/machinery/camera/bug/check_eye(var/mob/user as mob)
@@ -275,4 +275,4 @@
canhear_range = 1
name = "spy device"
icon_state = "syn_cypherkey"
*/
*/
@@ -182,29 +182,25 @@
else
icon_state = "suitcooler0"
/obj/item/suit_cooling_unit/examine(mob/user)
/obj/item/suit_cooling_unit/examine(mob/user, distance, infix, suffix)
. = ..()
if(Adjacent(user))
if(distance < 2)
if (on)
if (attached_to_suit(src.loc))
if (attached_to_suit(loc))
. += "It's switched on and running."
else
. += "It's switched on, but not attached to anything."
else
. += "It is switched off."
if (cover_open)
if(cell)
. += "The panel is open, exposing the [cell]."
else
. += "The panel is open."
if (cell)
. += "The charge meter reads [round(cell.percent())]%."
else
. += "It doesn't have a power cell installed."
/obj/item/suit_cooling_unit/empty //No duplicating cells with autolathes any more.
starts_with_cell = FALSE
starts_with_cell = FALSE
+1 -2
View File
@@ -20,7 +20,7 @@
radio = null
..()
/obj/item/tvcamera/examine()
/obj/item/tvcamera/examine(mob/user, distance, infix, suffix)
. = ..()
. += "Video feed is [camera.status ? "on" : "off"]"
. += "Audio feed is [radio.broadcasting ? "on" : "off"]"
@@ -92,4 +92,3 @@
H.update_inv_r_hand()
H.update_inv_l_hand()
H.update_inv_belt()