Split examine verb and function, and improve it (#17251)

* Split examine verb and function, and include adjacency and distance checking in examine function

* Fix various issues

* Update code/modules/mob/examinations.dm

Co-authored-by: SleepyGemmy <99297919+SleepyGemmy@users.noreply.github.com>

* Add required define vars

* Update code/game/objects/items/stacks/wrap.dm

Co-authored-by: SleepyGemmy <99297919+SleepyGemmy@users.noreply.github.com>

---------

Co-authored-by: SleepyGemmy <99297919+SleepyGemmy@users.noreply.github.com>
This commit is contained in:
Cody Brittain
2023-09-09 08:07:36 +00:00
committed by GitHub
co-authored by SleepyGemmy
parent 39228d3a2c
commit ce5ac79e3c
241 changed files with 617 additions and 518 deletions
+4 -4
View File
@@ -95,14 +95,14 @@
if(new_text)
free_space -= length(strip_html_properly(new_text))
/obj/item/paper/examine(mob/user)
/obj/item/paper/examine(mob/user, distance, is_adjacent)
. = ..()
if (old_name && (icon_state == "paper_plane" || icon_state == "paper_swan"))
to_chat(user, SPAN_NOTICE("You're going to have to unfold it before you can read it."))
return
if(name != initial(name))
to_chat(user,"It's titled '[name]'.")
if(in_range(user, src) || isobserver(user) || in_slide_projector(user))
if(distance <= 1)
show_content(user)
else
to_chat(user, SPAN_NOTICE("You have to go closer if you want to read it."))
@@ -200,7 +200,7 @@
update_icon()
return
user.examinate(src)
examinate(user, src)
if(rigged && (Holiday == "April Fool's Day"))
if(last_honk <= world.time - 20) //Spam limiter.
last_honk = world.time
@@ -214,7 +214,7 @@
if(target_zone == BP_EYES)
user.visible_message(SPAN_NOTICE("You show \the [src] to [M]."), \
SPAN_NOTICE("[user] holds up \the [src] and shows it to [M]."))
M.examinate(src)
examinate(M, src)
else if(target_zone == BP_MOUTH && paper_like) // lipstick wiping
if(ishuman(M))
+3 -2
View File
@@ -91,8 +91,9 @@
else
to_chat(user, "<span class='warning'>You must hold \the [P] steady to burn \the [src].</span>")
/obj/item/paper_bundle/examine(mob/user)
if(..(user, 1))
/obj/item/paper_bundle/examine(mob/user, distance, is_adjacent)
. = ..()
if(is_adjacent)
src.show_content(user)
else
to_chat(user, "<span class='notice'>It is too far away.</span>")
+2 -2
View File
@@ -93,8 +93,8 @@
*/
/obj/item/paper_bin/examine(mob/user)
if(get_dist(src, user) <= 1)
/obj/item/paper_bin/examine(mob/user, distance, is_adjacent)
if(distance <= 1)
if(amount)
to_chat(user, "<span class='notice'>There " + (amount > 1 ? "are [amount] papers" : "is one paper") + " in the bin.</span>")
else
+6 -6
View File
@@ -44,7 +44,7 @@ var/global/photo_count = 0
id = photo_count++
/obj/item/photo/attack_self(mob/user as mob)
user.examinate(src)
examinate(user, src)
/obj/item/photo/attackby(obj/item/P as obj, mob/user as mob)
if(P.ispen())
@@ -53,9 +53,9 @@ var/global/photo_count = 0
scribble = txt
..()
/obj/item/photo/examine(mob/user)
/obj/item/photo/examine(mob/user, distance, is_adjacent)
. = ..()
if(in_range(user, src) || isobserver(user) || in_slide_projector(user))
if(distance <= 1)
show(user)
to_chat(user, "<span class='notice'>[picture_desc]</span>")
else
@@ -144,9 +144,9 @@ var/global/photo_count = 0
var/icon_off = "camera_off"
var/size = 3
/obj/item/device/camera/examine(mob/user, distance)
..()
if(Adjacent(user))
/obj/item/device/camera/examine(mob/user, distance, is_adjacent)
. = ..()
if(is_adjacent)
to_chat(user, SPAN_NOTICE("It has <b>[pictures_left]</b> photos left."))
/obj/item/device/camera/verb/change_size()