mob
monsters
Mic
furioku = 5000
maxfurioku = 5000
icon = 'spirits.dmi'
icon_state = "mic"
attack = 50
defense = 70
race = "mic"
furyC = 1
New()
walkloop
var/walky = rand(1,8)
var/mob/M
for(M as mob in get_step(src,src.dir))
if(!M.client){goto nxt}
var/damage = (attack - M.defense)
if(damage <= 0)
s_damage(src, 0, "#ff0000")
goto walkloop
else
if(M.furyU==1)
M.furioku -= damage
M.Die()
var/num = src.damage
s_damage(src, num, "#ff0000")
usr.Waiting = 1
sleep(10)
usr.Waiting = 0
goto walkloop
if(M.furyC==1)
M.furioku -= damage
M.Die()
var/num = src.damage
s_damage(src, num, "#ff0000")
usr.Waiting = 1
sleep(10)
usr.Waiting = 0
goto walkloop
else
M.hp -= damage
M.Die()
var/num = src.damage
s_damage(src, num, "#ff0000")
usr.Waiting = 1
sleep(10)
usr.Waiting = 0
goto walkloop
nxt
var/mob/P
for(P in oview(1))
if(P.client) {
dir = get_dir(src,P)
sleep(4)
goto walkloop
}
for(P in view())
if(P.client) {
step_to(src,P)
sleep(3)
goto walkloop
}
if(walky == 1) {
step(src,NORTH)
sleep(10)
goto walkloop
}
if(walky == 2) {
step(src,SOUTH)
sleep(10)
goto walkloop
}
if(walky == 3) {
step(src,EAST)
sleep(10)
goto walkloop
}
if(walky == 4) {
step(src,WEST)
sleep(10)
goto walkloop
}
if(walky == 5) {
step(src,NORTHWEST)
sleep(10)
goto walkloop
}
if(walky == 6) {
step(src,NORTHEAST)
sleep(10)
goto walkloop
}
if(walky == 7) {
step(src,SOUTHWEST)
sleep(10)
goto walkloop
}
if(walky == 8) {
step(src,SOUTHEAST)
sleep(10)
goto walkloop
}
Problem description:
monster keeps following same person without stopping, even if person out of sight
2. Change all the if(walky==blah) blocks to just step_rand(src)