This commit is contained in:
Vi3trice
2022-11-02 14:22:04 +00:00
committed by GitHub
parent d00d53803f
commit 599221a602
2 changed files with 11 additions and 2 deletions
@@ -41,10 +41,16 @@
user.hud_used.lingstingdisplay.invisibility = 101
/datum/action/changeling/sting/can_sting(mob/user, mob/target)
if(!..() || !iscarbon(target) || !isturf(user.loc) || !length(get_path_to(user, target, max_distance = cling.sting_range, simulated_only = FALSE)))
if(!..() || !iscarbon(target) || !isturf(user.loc))
return FALSE
if(get_dist(user, target) > cling.sting_range) // Too far, don't bother pathfinding
to_chat(user, "<span class='warning'>Our target is too far for our sting!</span>")
return FALSE
if(!length(get_path_to(user, target, max_distance = cling.sting_range, simulated_only = FALSE, skip_first = FALSE)))
to_chat(user, "<span class='warning'>Our sting is blocked from reaching our target!</span>")
return FALSE
if(!cling.chosen_sting)
to_chat(user, "We haven't prepared our sting yet!")
to_chat(user, "<span class='warning'>We haven't prepared our sting yet!</span>")
return FALSE
if(ismachineperson(target))
to_chat(user, "<span class='warning'>This won't work on synthetics.</span>")