mob
var
owner = ""
list
killlist = list()
pets
Licker
icon = 'Licker.dmi'
icon_state = "normal"
New()
..()
spawn() StartPetAI()
proc/StartPetAI()
var/gottarget = 0
for(var/mob/M in oview())
if(src.owner == M.key)
walk_to(src,M,1,5)
for(var/mob/H in oview())
if(H in src.killlist)
if(gottarget == 0)
gottarget = 1
walk_to(src,H,1,5)
if(H in oview(1))
step_towards(src,H)
spawn(5) StartPetAI()
verb
Pet_Attack(var/mob/M in oview())
set category = "Pet"
if(M.owner == src.key)
src<<"[M]: That's me, silly master!"
else
for(var/mob/H in oview())
if(H.owner == src.key)
H.killlist.Add(M) </b>
Problem description:I do not want to choose who to attack, the pet should know who to attack (zombies or other), and automatically after the enemy dies, he chooses another, and when I tell him to stop attacking, he follows me around