diff --git a/code/__defines/dna.dm b/code/__defines/dna.dm index 1c0862f48c..29c924197d 100644 --- a/code/__defines/dna.dm +++ b/code/__defines/dna.dm @@ -177,3 +177,7 @@ var/SMALLSIZEBLOCK = 0 // Gene flags #define GENE_ALWAYS_ACTIVATE 1 #define MUTCHK_HIDEMSG 2 // Traitgenes (Hide gene activation/deactivation messages, mostly for resleeving so you don't get spammed) + +// Misc +#define TK_DENIED_MESSAGE span_warning("You are too distracted to focus your telekinesis.") +#define TK_OUTRANGED_MESSAGE span_notice("Your telekinesis won't reach that far.") diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index 37f3df50ce..632a163b15 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -221,6 +221,7 @@ LaserEyes(A) // moved into a proc below else if(has_telegrip()) if(get_dist(src, A) > tk_maxrange) + to_chat(src, TK_OUTRANGED_MESSAGE) return A.attack_tk(src) /* diff --git a/code/_onclick/other_mobs.dm b/code/_onclick/other_mobs.dm index 5b77af2f18..a2f9658bd0 100644 --- a/code/_onclick/other_mobs.dm +++ b/code/_onclick/other_mobs.dm @@ -57,8 +57,12 @@ if(istype(gloves,/obj/item/clothing/gloves/telekinetic)) var/obj/item/clothing/gloves/telekinetic/TKG = gloves TKG.use_grip_power(src,TRUE) - A.attack_tk(src) - + if(client.eye != src) // Extremely bad exploits if allowed to TK while remote viewing + to_chat(src, TK_DENIED_MESSAGE) + else if(get_dist(src, A) > tk_maxrange) + to_chat(src, TK_OUTRANGED_MESSAGE) + else + A.attack_tk(src) else if(spitting) //Only used by xenos right now, can be expanded. Spit(A) diff --git a/code/_onclick/telekinesis.dm b/code/_onclick/telekinesis.dm index cdcea216c6..f840c6e226 100644 --- a/code/_onclick/telekinesis.dm +++ b/code/_onclick/telekinesis.dm @@ -107,11 +107,15 @@ var/const/tk_maxrange = 15 if(isobj(target) && !isturf(target.loc)) return + if(user.client.eye != user) // Extremely bad exploits if allowed to TK while remote viewing + to_chat(user, TK_DENIED_MESSAGE) + return + var/d = get_dist(user, target) if(focus) d = max(d, get_dist(user, focus)) // whichever is further if(d > tk_maxrange) - to_chat(user, span_notice("Your mind won't reach that far.")) + to_chat(user, TK_OUTRANGED_MESSAGE) return if(!focus)