Pointing Filters (#9118)

Pointing at something now highlights it instead of making an arrow. Pointing at turfs unaffected.
This commit is contained in:
Geeves
2020-06-20 11:33:13 +03:00
committed by GitHub
parent 75712e03bb
commit 14e48172bd
2 changed files with 25 additions and 6 deletions
+19 -6
View File
@@ -10,16 +10,29 @@
//mob verbs are faster than object verbs. See above.
/mob/living/pointed(atom/A as mob|obj|turf in view())
if(!isturf(src.loc) || !(A in range(world.view, get_turf(src))))
return FALSE
if(src.stat || !src.canmove || src.restrained())
return 0
return FALSE
if(src.status_flags & FAKEDEATH)
return 0
if(!..())
return 0
return FALSE
src.visible_message("<b>[src]</b> points to [A].")
return 1
face_atom(A)
if(isturf(A))
if(pointing_effect)
clear_point()
pointing_effect = new /obj/effect/decal/point(A)
pointing_effect.invisibility = invisibility
addtimer(CALLBACK(src, .proc/clear_point), 20)
else
var/pointglow = filter(type = "drop_shadow", x = 0, y = -1, offset = 2, size = 1, color = "#F00")
LAZYADD(A.filters, pointglow)
addtimer(CALLBACK(src, .proc/remove_filter, A, pointglow), 20)
visible_message("<b>\The [src]</b> points to \the [A].")
return TRUE
/mob/living/proc/remove_filter(var/atom/A, var/filter_to_remove)
LAZYREMOVE(A.filters, filter_to_remove)
/*one proc, four uses
swapping: if it's 1, the mobs are trying to switch, if 0, non-passive is pushing passive