Fixes changeling sting A* call, adds messages to let the changeling know what went wrong if it did

This commit is contained in:
GinjaNinja32
2015-02-06 09:52:01 +00:00
parent d847232692
commit 251e162a2c

View File

@@ -679,11 +679,16 @@ var/list/datum/dna/hivemind_bank = list()
//////////
/mob/proc/sting_can_reach(mob/M as mob, sting_range = 1)
if(M.loc == src.loc) return 1 //target and source are in the same thing
if(!isturf(src.loc) || !isturf(M.loc)) return 0 //One is inside, the other is outside something.
if(AStar(src.loc, M.loc, /turf/proc/AdjacentTurfs, /turf/proc/Distance, sting_range)) //If a path exists, good!
return 1
return 0
if(M.loc == src.loc)
return 1 //target and source are in the same thing
if(!isturf(src.loc) || !isturf(M.loc))
src << "<span class='warning'>We cannot reach \the [M] with a sting!</span>"
return 0 //One is inside, the other is outside something.
// Maximum queued turfs set to 25; I don't *think* anything raises sting_range above 2, but if it does the 25 may need raising
if(!AStar(src.loc, M.loc, /turf/proc/AdjacentTurfs, /turf/proc/Distance, max_nodes=25, max_node_depth=sting_range)) //If we can't find a path, fail
src << "<span class='warning'>We cannot find a path to sting \the [M] by!</span>"
return 0
return 1
//Handles the general sting code to reduce on copypasta (seeming as somebody decided to make SO MANY dumb abilities)
/mob/proc/changeling_sting(var/required_chems=0, var/verb_path)