mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-08-22 12:46:40 +01:00
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:
@@ -191,9 +191,9 @@
|
||||
icon_state = "envelope_empty"
|
||||
|
||||
|
||||
/obj/item/folder/envelope/examine(mob/user)
|
||||
/obj/item/folder/envelope/examine(mob/user, distance, infix, suffix)
|
||||
. = ..()
|
||||
if (get_dist(src, user) > 3 && !isobserver(user))
|
||||
if (distance > 3 && !isobserver(user))
|
||||
return
|
||||
if (envelope_seal)
|
||||
. += "It has an [SPAN_NOTICE("intact [envelope_seal] seal")]."
|
||||
|
||||
@@ -149,9 +149,9 @@
|
||||
|
||||
free_space -= length(strip_html_properly(new_text))
|
||||
|
||||
/obj/item/paper/examine(mob/user)
|
||||
/obj/item/paper/examine(mob/user, distance, infix, suffix)
|
||||
. = ..()
|
||||
if(in_range(user, src) || istype(user, /mob/observer/dead))
|
||||
if(distance < 2 || istype(user, /mob/observer/dead))
|
||||
show_content(usr)
|
||||
else
|
||||
. += "<span class='notice'>You have to go closer if you want to read it.</span>"
|
||||
|
||||
@@ -96,9 +96,9 @@
|
||||
else
|
||||
to_chat(user, "<font color='red'>You must hold \the [P] steady to burn \the [src].</font>")
|
||||
|
||||
/obj/item/paper_bundle/examine(mob/user)
|
||||
/obj/item/paper_bundle/examine(mob/user, distance, infix, suffix)
|
||||
. = ..()
|
||||
if(Adjacent(user))
|
||||
if(distance < 2)
|
||||
show_content(user)
|
||||
else
|
||||
. += "<span class='notice'>It is too far away.</span>"
|
||||
@@ -243,4 +243,4 @@
|
||||
if(photo)
|
||||
desc += "\nThere is a photo attached to it."
|
||||
add_overlay(image('icons/obj/bureaucracy.dmi', "clip"))
|
||||
return
|
||||
return
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/item/sticky_pad/examine(var/mob/user)
|
||||
/obj/item/sticky_pad/examine(mob/user, distance, infix, suffix)
|
||||
. = ..()
|
||||
if(.)
|
||||
to_chat(user, SPAN_NOTICE("It has [papers] [papername]\s left in the stack."))
|
||||
@@ -150,4 +150,4 @@
|
||||
if(dir_offset & NORTH)
|
||||
pixel_y += 32
|
||||
else if(dir_offset & SOUTH)
|
||||
pixel_y -= 32
|
||||
pixel_y -= 32
|
||||
|
||||
@@ -95,9 +95,9 @@
|
||||
amount++
|
||||
|
||||
|
||||
/obj/item/paper_bin/examine(mob/user)
|
||||
/obj/item/paper_bin/examine(mob/user, distance, infix, suffix)
|
||||
. = ..()
|
||||
if(Adjacent(user))
|
||||
if(distance < 2)
|
||||
if(amount)
|
||||
. += "<span class='notice'>There " + (amount > 1 ? "are [amount] papers" : "is one paper") + " in the bin.</span>"
|
||||
else
|
||||
|
||||
@@ -21,9 +21,9 @@
|
||||
. = ..()
|
||||
default_apply_parts()
|
||||
|
||||
/obj/machinery/photocopier/examine(mob/user as mob)
|
||||
/obj/machinery/photocopier/examine(mob/user, distance, infix, suffix)
|
||||
. = ..()
|
||||
if(Adjacent(user))
|
||||
if(distance < 2)
|
||||
. += "The screen shows there's [toner ? "[toner]" : "no"] toner left in the printer."
|
||||
|
||||
/obj/machinery/photocopier/attack_ai(mob/user as mob)
|
||||
|
||||
@@ -51,9 +51,9 @@ var/global/photo_count = 0
|
||||
scribble = txt
|
||||
..()
|
||||
|
||||
/obj/item/photo/examine(mob/user)
|
||||
/obj/item/photo/examine(mob/user, distance, infix, suffix)
|
||||
//This is one time we're not going to call parent, because photos are 'secret' unless you're close enough.
|
||||
if(in_range(user, src))
|
||||
if(distance < 2)
|
||||
show(user)
|
||||
return list(desc)
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user