mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-24 05:23:22 +01:00
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:
co-authored by
SleepyGemmy
parent
39228d3a2c
commit
ce5ac79e3c
@@ -30,7 +30,7 @@
|
||||
starting_maxhealth = maxhealth
|
||||
|
||||
/obj/structure/barricade/examine(mob/user)
|
||||
..()
|
||||
. = ..()
|
||||
to_chat(user, SPAN_INFO("It is recommended to stand flush to a barricade or one tile away for maximum efficiency."))
|
||||
if(is_wired)
|
||||
to_chat(user, SPAN_INFO("There is a length of wire strewn across the top of this barricade."))
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
var/build_state = BARRICADE_BSTATE_SECURED //Look at __game.dm for barricade defines
|
||||
|
||||
/obj/structure/barricade/metal/examine(mob/user)
|
||||
..()
|
||||
. = ..()
|
||||
switch(build_state)
|
||||
if(BARRICADE_BSTATE_SECURED)
|
||||
to_chat(user, SPAN_INFO("The protection panel is still tighly screwed in place."))
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
return 0
|
||||
|
||||
/obj/structure/barricade/plasteel/examine(mob/user)
|
||||
..()
|
||||
. = ..()
|
||||
|
||||
switch(build_state)
|
||||
if(BARRICADE_BSTATE_SECURED)
|
||||
|
||||
@@ -377,7 +377,7 @@ LINEN BINS
|
||||
|
||||
|
||||
/obj/structure/bedsheetbin/examine(mob/user)
|
||||
..(user)
|
||||
. = ..()
|
||||
|
||||
if(amount < 1)
|
||||
to_chat(user, "There are no bed sheets in the bin.")
|
||||
|
||||
@@ -32,9 +32,9 @@ var/global/list/total_active_bonfires = list()
|
||||
total_active_bonfires -= src
|
||||
. = ..()
|
||||
|
||||
/obj/structure/bonfire/examine(mob/user)
|
||||
..()
|
||||
if(get_dist(src, user) > 2)
|
||||
/obj/structure/bonfire/examine(mob/user, distance, is_adjacent)
|
||||
. = ..()
|
||||
if(distance > 2)
|
||||
return
|
||||
if(on_fire)
|
||||
switch(fuel)
|
||||
|
||||
@@ -100,8 +100,9 @@
|
||||
else
|
||||
to_chat(user, "\The [src] is full.")
|
||||
|
||||
/obj/structure/closet/examine(mob/user)
|
||||
if(!src.opened && (..(user, 1) || isobserver(user)))
|
||||
/obj/structure/closet/examine(mob/user, distance, is_adjacent)
|
||||
. = ..()
|
||||
if(distance <= 1 && !src.opened)
|
||||
var/content_size = 0
|
||||
for(var/obj/item/I in contents)
|
||||
if(!I.anchored)
|
||||
@@ -111,7 +112,7 @@
|
||||
if(!src.opened && isobserver(user))
|
||||
to_chat(user, "It contains: [counting_english_list(contents)]")
|
||||
|
||||
if(src.opened && linked_teleporter && (Adjacent(user) || isobserver(user)))
|
||||
if(src.opened && linked_teleporter && is_adjacent)
|
||||
to_chat(user, FONT_SMALL(SPAN_NOTICE("There appears to be a device attached to the interior backplate of \the [src]...")))
|
||||
|
||||
/obj/structure/closet/proc/stored_weight()
|
||||
|
||||
@@ -182,7 +182,7 @@
|
||||
/obj/structure/sign/flag/attack_hand(mob/user)
|
||||
switch(user.a_intent)
|
||||
if(I_HELP)
|
||||
user.examinate(src)
|
||||
examinate(user, src)
|
||||
if(I_DISARM)
|
||||
user.visible_message(SPAN_NOTICE("\The [user] begins to carefully fold up \the [src]."), SPAN_NOTICE("You begin to carefully fold up \the [src]."))
|
||||
if(do_after(user, 50))
|
||||
|
||||
@@ -13,8 +13,9 @@
|
||||
. = ..()
|
||||
health = maxHealth
|
||||
|
||||
/obj/structure/gore/examine(mob/user)
|
||||
if(..(user, 2))
|
||||
/obj/structure/gore/examine(mob/user, distance, is_adjacent)
|
||||
. = ..()
|
||||
if(distance <= 2)
|
||||
var/health_div = health / maxHealth
|
||||
if(health_div >= 0.9)
|
||||
to_chat(user, SPAN_NOTICE("\The [src] appears completely intact."))
|
||||
@@ -80,4 +81,4 @@
|
||||
return FALSE
|
||||
if(istype(mover) && mover.checkpass(PASSGLASS))
|
||||
return !opacity
|
||||
return !density
|
||||
return !density
|
||||
|
||||
@@ -13,8 +13,9 @@
|
||||
. = ..()
|
||||
health = maxHealth
|
||||
|
||||
/obj/structure/bed/nest/examine(mob/user)
|
||||
if(..(user, 2))
|
||||
/obj/structure/bed/nest/examine(mob/user, distance, is_adjacent)
|
||||
. = ..()
|
||||
if(distance <= 2)
|
||||
var/health_div = health / maxHealth
|
||||
if(health_div >= 0.9)
|
||||
to_chat(user, SPAN_NOTICE("\The [src] appears completely intact."))
|
||||
|
||||
@@ -88,8 +88,9 @@
|
||||
/obj/structure/janitorialcart/proc/get_short_status()
|
||||
return "Contents: [english_list(contents)]"
|
||||
|
||||
/obj/structure/janitorialcart/examine(mob/user)
|
||||
if(..(user, 1))
|
||||
/obj/structure/janitorialcart/examine(mob/user, distance, is_adjacent)
|
||||
. = ..()
|
||||
if(distance <= 1)
|
||||
if (mybucket)
|
||||
var/contains = mybucket.reagents.total_volume
|
||||
to_chat(user, "[icon2html(src, user)] The bucket contains [contains] unit\s of liquid!")
|
||||
|
||||
@@ -18,8 +18,9 @@
|
||||
janitorial_supplies -= src
|
||||
return ..()
|
||||
|
||||
/obj/structure/mopbucket/examine(mob/user)
|
||||
if(..(user, 1))
|
||||
/obj/structure/mopbucket/examine(mob/user, distance, is_adjacent)
|
||||
. = ..()
|
||||
if(distance <= 1)
|
||||
to_chat(user, "Contains [reagents.total_volume] unit\s of water.")
|
||||
|
||||
/obj/structure/mopbucket/attackby(obj/item/I, mob/user)
|
||||
|
||||
@@ -35,8 +35,7 @@
|
||||
// Since Topic() never seems to interact with usr on more than a superficial
|
||||
// level, it should be fine to let anyone mess with the board other than ghosts.
|
||||
/obj/structure/noticeboard/examine(var/mob/user)
|
||||
if(!user)
|
||||
user = usr
|
||||
. = ..()
|
||||
if(user.Adjacent(src))
|
||||
var/dat = "<B>Noticeboard</B><BR>"
|
||||
for(var/obj/item/paper/P in src)
|
||||
|
||||
@@ -72,7 +72,15 @@
|
||||
return ..()
|
||||
|
||||
/obj/structure/railing/examine(mob/user)
|
||||
..()
|
||||
. = ..()
|
||||
if(health < maxhealth)
|
||||
switch(health / maxhealth)
|
||||
if(0.0 to 0.5)
|
||||
to_chat(user, SPAN_WARNING("It looks severely damaged!"))
|
||||
if(0.25 to 0.5)
|
||||
to_chat(user, SPAN_WARNING("It looks damaged!"))
|
||||
if(0.5 to 1.0)
|
||||
to_chat(user, SPAN_NOTICE("It has a few scrapes and dents."))
|
||||
to_chat(user, FONT_SMALL(SPAN_NOTICE("\The [src] is <b>[density ? "closed" : "open"]</b> to passage.")))
|
||||
to_chat(user, FONT_SMALL(SPAN_NOTICE("\The [src] is <b>[anchored ? "" : "not"] screwed</b> to the floor.")))
|
||||
|
||||
@@ -87,17 +95,6 @@
|
||||
return !density
|
||||
return TRUE
|
||||
|
||||
/obj/structure/railing/examine(mob/user)
|
||||
..()
|
||||
if(health < maxhealth)
|
||||
switch(health / maxhealth)
|
||||
if(0.0 to 0.5)
|
||||
to_chat(user, SPAN_WARNING("It looks severely damaged!"))
|
||||
if(0.25 to 0.5)
|
||||
to_chat(user, SPAN_WARNING("It looks damaged!"))
|
||||
if(0.5 to 1.0)
|
||||
to_chat(user, SPAN_NOTICE("It has a few scrapes and dents."))
|
||||
|
||||
/obj/structure/railing/proc/take_damage(amount)
|
||||
health -= amount
|
||||
if(health <= 0)
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
var/open = FALSE
|
||||
|
||||
/obj/structure/sarcophagus/examine(mob/user)
|
||||
..()
|
||||
. = ..()
|
||||
if(!open)
|
||||
to_chat(user, "\The [src]'s lid is closed shut.")
|
||||
else
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
return ..()
|
||||
|
||||
/obj/structure/simple_door/examine(mob/user)
|
||||
..(user)
|
||||
. = ..()
|
||||
if(lock)
|
||||
to_chat(user, "<span class='notice'>It appears to have a lock.</span>")
|
||||
|
||||
|
||||
@@ -22,9 +22,9 @@
|
||||
playsound(src.loc, 'sound/weapons/blade_open.ogg', 50, 1)
|
||||
closed = !closed
|
||||
|
||||
/obj/item/pocketwatch/examine(mob/user)
|
||||
..()
|
||||
if (get_dist(src, user) <= 1)
|
||||
/obj/item/pocketwatch/examine(mob/user, distance, is_adjacent)
|
||||
. = ..()
|
||||
if (distance <= 1)
|
||||
checktime()
|
||||
|
||||
/obj/item/pocketwatch/verb/checktime(mob/user)
|
||||
@@ -214,4 +214,4 @@
|
||||
else
|
||||
ticktock = "Tick"
|
||||
to_chat(H, "<span class='notice'><i>[ticktock]. . .</i></span>")
|
||||
sound_to(H, 'sound/effects/singlebeat.ogg')
|
||||
sound_to(H, 'sound/effects/singlebeat.ogg')
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
return ..()
|
||||
|
||||
/obj/structure/bed/stool/chair/remote/examine(mob/user)
|
||||
..()
|
||||
. = ..()
|
||||
if(portable_type)
|
||||
to_chat(user, FONT_SMALL(SPAN_NOTICE("Can be packed up by using a wrench on it.")))
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
atmos_canpass = CANPASS_PROC
|
||||
|
||||
/obj/structure/window/examine(mob/user)
|
||||
. = ..(user)
|
||||
. = ..()
|
||||
|
||||
if(health == maxhealth)
|
||||
to_chat(user, SPAN_NOTICE("It looks fully intact."))
|
||||
|
||||
Reference in New Issue
Block a user