mob/Attacking_NPCs/Cactnea
icon='Hoenn Pokemon.dmi'
icon_state = "cactnea"
name = "Wild Cactnea"
New()
//As New() must return, this spawn()s off
//movement_loop(), which is an infinite loop and
//will not end until src is deleted. To work around
//this replace the condition in the while loop
//below.
spawn() movement_loop()
proc/movement_loop()
while(1)
//This checks to find a /mob within eight tiles
//of the src.
var/mob/m = locate(/mob) in oview(src, 8)
//If m is found, step towards it. If not, just
//wander randomly.
if(m) step_towards(src, m)
else step_rand(src)
//Wait five ticks before iterating again.
sleep(5)
Bump(mob/m)
//This checks to see that m is, in fact, a /mob.
if(istype(m))
//If it is, attack.
attack(m)
Problem description:
The NPCs Will attack and kill each other, how do i fix it?