From 027b5c5601fa101599468ef0bec0a2275cb43a4e Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Sun, 9 Jan 2022 21:48:40 +0100 Subject: [PATCH] [MIRROR] TK no longer tries to interact with your hud [MDB IGNORE] (#10547) * TK no longer tries to interact with your hud (#63882) * fix tk by adding a blacklist * Update code/datums/mutations/telekinesis.dm Co-authored-by: Fikou <23585223+Fikou@ users.noreply.github.com> * god damn you fikou * TK no longer tries to interact with your hud Co-authored-by: Seth Scherer --- code/_onclick/telekinesis.dm | 4 +--- code/datums/mutations/telekinesis.dm | 5 ++++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/code/_onclick/telekinesis.dm b/code/_onclick/telekinesis.dm index d319a8c34c7..1e0f4e2b3e1 100644 --- a/code/_onclick/telekinesis.dm +++ b/code/_onclick/telekinesis.dm @@ -181,11 +181,9 @@ /proc/tkMaxRangeCheck(mob/user, atom/target) - if (istype(target, /atom/movable/screen)) - return var/d = get_dist(user, target) if(d > TK_MAXRANGE) - to_chat(user, span_warning("Your mind won't reach that far.")) + user.balloon_alert(user, "can't TK, too far!") return return TRUE diff --git a/code/datums/mutations/telekinesis.dm b/code/datums/mutations/telekinesis.dm index 427ff8bff64..05134457334 100644 --- a/code/datums/mutations/telekinesis.dm +++ b/code/datums/mutations/telekinesis.dm @@ -7,6 +7,8 @@ text_gain_indication = "You feel smarter!" limb_req = BODY_ZONE_HEAD instability = 30 + ///Typecache of atoms that TK shouldn't interact with + var/static/list/blacklisted_atoms = typecacheof(list(/atom/movable/screen)) /datum/mutation/human/telekinesis/New(class_ = MUT_OTHER, timer, datum/mutation/human/copymut) ..() @@ -31,8 +33,9 @@ ///Triggers on COMSIG_MOB_ATTACK_RANGED. Usually handles stuff like picking up items at range. /datum/mutation/human/telekinesis/proc/on_ranged_attack(mob/source, atom/target) SIGNAL_HANDLER + if(is_type_in_typecache(target, blacklisted_atoms)) + return if(!tkMaxRangeCheck(source, target) || source.z != target.z) - source.balloon_alert(source, "can't TK, too far!") return return target.attack_tk(source)