Enemy_Hunt()
while(src)
for(var/mob/player/M in view(5))
step_towards(src,M)
if(prob(100))
Ki_Blast()
sleep(5)
Problem description:Okay here is a code that makes my enemy NPC's go after someone if they step into view of them. The only problem: it doesn't skip over the Ki_Blast proc when they aren't moving. How do I change it so it only shoots after it has stepped towards someone?
P.S. Ignore the 100 probability. I will change that later. I only made it such so that I could test it.
This will check to see if NPC has a target, if it does and it's target is in it's view, it will step towards it. If the target isn't in view, it will pick a new target or just not do anything if there are no players around. If they don't have a target then it gets one for em.
Have fun.
-Exophus