First, your AI proc is written wrong. It should look more like this:
mob/proc/AI()
while(src)
for(var/mob/M in oview(5,src))
if(M.client)
if(get_dist(src,M) > 1)
step_to(src,M)
else
src.attack(M)
break
sleep(2) |
I don't know what you want the AIdef() proc to be, so it just shouldn't exist really.
Second, you need to change oview(2) in your attack() proc to be oview(2,src). Though, probably it should be view().
Third, you are never actually calling your AI() proc. The line that you do have:
doesn't call the proc, it overrides it and replaces it with one that does nothing. To call it, you should put it in New(), like so:
mob
CircleDemon
New()
..()
spawn() AI() |
spawn() is used because we don't want to wait for AI() to finish (as it never will) before continuing with the New() proc. |
|