From 6d4bdb77763fec5e95f74adcbee84d704162ebef Mon Sep 17 00:00:00 2001
From: SkyratBot <59378654+SkyratBot@users.noreply.github.com>
Date: Wed, 2 Sep 2020 03:03:35 +0200
Subject: [PATCH] [MIRROR] Minor bugfixing/QoL for blind examining (#607)
* Minor bugfixing/QoL for blind examining (#53313)
Allows blind people to examine things they're directly holding in their hands, so they don't need to swap hands back and forth between empty hands to check their ID or whatever
Slightly lowered the recent examine delay to make it easier to trigger examine_more
attack_hands that waited for input or slept (such as apiaries or airlocks) delayed the examination until after the attack_hand input or sleep was finished, so it is now called async to prevent the weird pause.
Blind people could previously examine things with disabled/detached limbs, that's fixed as well, and replaced a range check with adjacent, cause shoving your arm through windoors is bad.
* Minor bugfixing/QoL for blind examining
Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
---
code/modules/mob/mob.dm | 23 +++++++++++++++++------
1 file changed, 17 insertions(+), 6 deletions(-)
diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm
index 14abd2e90da..423f42cdda1 100644
--- a/code/modules/mob/mob.dm
+++ b/code/modules/mob/mob.dm
@@ -479,14 +479,25 @@
/mob/living/blind_examine_check(atom/examined_thing)
//need to be next to something and awake
- if(!in_range(examined_thing, src) || incapacitated())
+ if(!Adjacent(examined_thing) || incapacitated())
to_chat(src, "Something is there, but you can't see it!")
return FALSE
- //also neeed an empty hand, and you can only initiate as many examines as you have hands
- if(LAZYLEN(do_afters) >= usable_hands || get_active_held_item())
+
+ //you can examine things you're holding directly, but you can't examine other things if your hands are full
+ /// the item in our active hand
+ var/active_item = get_active_held_item()
+ if(active_item && active_item != examined_thing)
+ to_chat(src, "Your hands are too full to examine this!")
+ return FALSE
+
+ //you can only initiate exaimines if you have a hand, it's not disabled, and only as many examines as you have hands
+ /// our active hand, to check if it's disabled/detatched
+ var/obj/item/bodypart/active_hand = has_active_hand()? get_active_hand() : null
+ if(!active_hand || active_hand.bodypart_disabled || LAZYLEN(do_afters) >= usable_hands)
to_chat(src, "You don't have a free hand to examine this!")
return FALSE
- //can only queue up one examine on something at a time
+
+ //you can only queue up one examine on something at a time
if(examined_thing in do_afters)
return FALSE
@@ -496,7 +507,7 @@
/// how long it takes for the blind person to find the thing they're examining
var/examine_delay_length = rand(1 SECONDS, 2 SECONDS)
if(client?.recent_examines && client?.recent_examines[examined_thing]) //easier to find things we just touched
- examine_delay_length = 0.5 SECONDS
+ examine_delay_length = 0.33 SECONDS
else if(isobj(examined_thing))
examine_delay_length *= 1.5
else if(ismob(examined_thing) && examined_thing != src)
@@ -510,7 +521,7 @@
/// our current intent, so we can go back to it after touching
var/previous_intent = a_intent
a_intent = INTENT_HELP
- examined_thing.attack_hand(src)
+ INVOKE_ASYNC(examined_thing, /atom/proc/attack_hand, src)
a_intent = previous_intent
return TRUE