mob
monsters
Move(var/turf/NewTurf,var/StepDir) //Move() is built-in
switch(StepDir)
if(NORTHWEST) pick(step(src,NORTH),step(src,WEST))
if(NORTHEAST) pick(step(src,NORTH),step(src,EAST))
if(SOUTHWEST) pick(step(src,SOUTH),step(src,WEST))
if(SOUTHEAST) pick(step(src,SOUTH),step(src,EAST))
else return ..(NewTurf,StepDir)
New(/**/)
spawn(-1) src.CombatAI(/**/)
return ..(/**/)
MouseEntered(/**/)
src.AddName(/**/)
MouseExited(/**/)
for(var/I in src.overlays)
src.overlays-=I
proc
CombatAI()
while(src)
for(var/mob/player/M in oview(/**/))
if(get_dist(src,M)<=1)
src.dir=get_dir(src,M)
else
step_to(src,M)
break
sleep(rand(4,8))
EarthMonsters
icon='Monsters_1.dmi'
Rabbit
icon_state = "Rabbit"
race = "Rabbit"
hp=10
maxhp=10
level = 11
exp = 172
dodge=1
Problem description:
My goal was to prevent AI from walking diagonally. But the problem is that when monster is facing client(player) it could be diagonally sometimes. Any help would be appreciated!
EDIT
I also, think it shud be placed under the Combat_AI() procedure