//slime uses this ai
mob
proc
simpleAI()
while(src)
if(!target)
look()
else
if(!ability(target))
if(get_dist(src, target) > 1)
step_to(src, target)
else
dir = get_dir(src, target)
attack(target)
sleep(4 - speed)
//slime's ability
mob
slime
ability(mob/m)
if(prob(20) && get_dist(src,m) == 1)
m.getCondition(src, /Condition/poison)
return 1
Problem description:
After a slime poisons you he waits until the poison ends to move or do anything else.
I thought I could handle this problem alone, but I was reading F_A's Enemy AI demo and he says some things about call stack, and now I think this problem has something to do with.
One extra how-to question: How I make somthing only visible to the player? (this question probably was answered before, but I lazy...)
other wise, i'm assuming that function returns immediately and the loop should carry on (if the ability was successful the next step would be that sleep(4 - speed) call you have.
If speed becomes a negative number somewhere in m.getCondition, then your sleep will be unusually long (4 - -5 = 9)