ID:146946
 
the purpose of this code is to make opposing NPC's run directly at each other, they bump, and they attack. the problem is, they are not even moving because i cant figure out a way to make the charge proc to work. HELP!
mob/NPC
var/mob/NPC/m
proc/charge()
while(src)
for(var/mob/NPC/ptarget in oview(5,src))
if(src.colorofwar == ptarget.colorofwar)
continue
else
m = ptarget
break
if(m.colorofwar == src.colorofwar)
WalkAround(src)
else
Wander(src)
proc/Wander()
if(m in oview(5))
step_towards(src,m)
Bump(mob,n)
if(istype(n,/mob/NPC))
attack(n)
proc/attack()
sleep(2)
var/damage = Strength - m.Vitality
m.HP -= damage
view(src) << "[src] attacks [m]!"
view(src) << "[damage] damage."
if(m.HP < 0)
del(src)
proc/WalkAround()
step(src, pick(NORTH,NORTHEAST,NORTHWEST,SOUTH,SOUTHEAST,SOUTHWEST,EAST,WEST))