mob/NPC
New()
..()
Wander()
proc/Wander()
walk_rand(src,movedelay)
// Search()
proc/Search()
for(var/mob/M in oview(6))
walk(src,0)
walk_to(src,M,0,movedelay)
Move()
..()
Search()
Bump(mob/M in get_step(M,src.dir))
..()
if(!istype(M,/mob/NPC))
if(M.safe)
return
else
flick("attack",src)
var/extra = rand(1,4)
var/damage = src.strength + extra - M.endurance
M.HP -= damage
if(M.HP <= 0)
world << "[M] has been killed by [src]!"
M.loc=locate(0,0,0)
Problem description:
I want to make a wandering and attack proc for NPCs, but it doesn't work, why?
You know only one walk()/walk_rand() etc proc can be running at a time? If you attempt to run 2, the first one will get cancelled.