From b5ce584906215793e16c93f35de6757aea6d6d8d Mon Sep 17 00:00:00 2001
From: SkyratBot <59378654+SkyratBot@users.noreply.github.com>
Date: Fri, 7 Aug 2020 11:08:02 +0200
Subject: [PATCH] [MIRROR] Allows blind people to touch things to examine them
(#231)
* Merge pull request #52727 from MrMelbert/touchyfeely
Allows blind people to touch things to examine them
* Allows blind people to touch things to examine them
Co-authored-by: skoglol <33292112+kriskog@users.noreply.github.com>
---
code/game/objects/structures/displaycase.dm | 3 +-
.../objects/structures/plaques/_plaques.dm | 2 +-
code/game/objects/structures/signs/_signs.dm | 2 +-
code/modules/mining/laborcamp/laborstacker.dm | 2 +-
code/modules/mob/mob.dm | 38 +++++++++++++++++--
5 files changed, 40 insertions(+), 7 deletions(-)
diff --git a/code/game/objects/structures/displaycase.dm b/code/game/objects/structures/displaycase.dm
index 0254a3caa13..4305d089af3 100644
--- a/code/game/objects/structures/displaycase.dm
+++ b/code/game/objects/structures/displaycase.dm
@@ -190,7 +190,8 @@
if (!Adjacent(user))
return
if (user.a_intent == INTENT_HELP)
- user.examinate(src)
+ if(!user.is_blind())
+ user.examinate(src)
return
user.visible_message("[user] kicks the display case.", null, null, COMBAT_MESSAGE_RANGE)
log_combat(user, src, "kicks")
diff --git a/code/game/objects/structures/plaques/_plaques.dm b/code/game/objects/structures/plaques/_plaques.dm
index cec563be8f0..347ea016a3c 100644
--- a/code/game/objects/structures/plaques/_plaques.dm
+++ b/code/game/objects/structures/plaques/_plaques.dm
@@ -33,7 +33,7 @@
/obj/structure/plaque/attack_hand(mob/user)
. = ..()
- if(.)
+ if(. || user.is_blind())
return
user.examinate(src)
diff --git a/code/game/objects/structures/signs/_signs.dm b/code/game/objects/structures/signs/_signs.dm
index 7a1a1ab246a..61ba9a22e87 100644
--- a/code/game/objects/structures/signs/_signs.dm
+++ b/code/game/objects/structures/signs/_signs.dm
@@ -49,7 +49,7 @@
/obj/structure/sign/attack_hand(mob/user)
. = ..()
- if(.)
+ if(. || user.is_blind())
return
user.examinate(src)
diff --git a/code/modules/mining/laborcamp/laborstacker.dm b/code/modules/mining/laborcamp/laborstacker.dm
index e091f0ff906..c9510cdbd15 100644
--- a/code/modules/mining/laborcamp/laborstacker.dm
+++ b/code/modules/mining/laborcamp/laborstacker.dm
@@ -140,7 +140,7 @@ GLOBAL_LIST(labor_sheet_values)
/obj/machinery/mineral/labor_points_checker/attack_hand(mob/user)
. = ..()
- if(.)
+ if(. || user.is_blind())
return
user.examinate(src)
diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm
index 6dc39b323ec..1b2df2775ea 100644
--- a/code/modules/mob/mob.dm
+++ b/code/modules/mob/mob.dm
@@ -451,9 +451,41 @@
// shift-click catcher may issue examinate() calls for out-of-sight turfs
return
- if(is_blind())
- to_chat(src, "Something is there but you can't see it!")
- return
+ if(is_blind()) //blind people see things differently (through touch)
+ //need to be next to something and awake
+ if(!in_range(A, src) || incapacitated())
+ to_chat(src, "Something is there, but you can't see it!")
+ return
+ //also neeed an empty hand, and you can only initiate as many examines as you have hands
+ if(LAZYLEN(do_afters) >= get_num_arms() || get_active_held_item())
+ to_chat(src, "You don't have a free hand to examine this!")
+ return
+ //can only queue up one examine on something at a time
+ if(A in do_afters)
+ return
+
+ to_chat(src, "You start feeling around for something...")
+ visible_message(" [name] begins feeling around for \the [A.name]...")
+
+ /// 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[A]) //easier to find things we just touched
+ examine_delay_length = 0.5 SECONDS
+ else if(isobj(A))
+ examine_delay_length *= 1.5
+ else if(ismob(A) && A != src)
+ examine_delay_length *= 2
+
+ if(examine_delay_length > 0 && !do_after(src, examine_delay_length, target = A))
+ to_chat(src, "You can't get a good feel for what is there.")
+ return
+
+ //now we touch the thing we're examining
+ /// our current intent, so we can go back to it after touching
+ var/previous_intent = a_intent
+ a_intent = INTENT_HELP
+ A.attack_hand(src)
+ a_intent = previous_intent
face_atom(A)
var/list/result