TK exploits (#18302)

* tk range checks

* fixes

* spans
This commit is contained in:
Will
2025-08-19 22:38:16 +02:00
committed by GitHub
parent f453a10d6f
commit 8ef590f3fd
4 changed files with 16 additions and 3 deletions
+4
View File
@@ -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.")
+1
View File
@@ -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)
/*
+6 -2
View File
@@ -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)
+5 -1
View File
@@ -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)