monster movment in Developer Help
|
|
mob/Monsters scorpion icon = 'Monster.dmi' icon_state="scorpion" gold = 20 HP = 15 MHP = 15 player = 0 Str = 2 Expg = 7 level = 3 monster = 1 PK = 1 NPC = 0 New() . = ..() spawn() Wander() proc/Wander(var/mob/You/P) while(src) if(P in oview(5)) step_towards(src,P) for(P in oview(1)) break for(P in oview(2)) break for(P in oview(3)) break for(P in oview(4)) break else step_rand(src) sleep(5) for(P in oview(5)) break sleep(5) spawn(5) Wander() Bump(mob/M) if(M.player == 1) Fight(M) else return proc/Fight() for(var/mob/E in get_step(usr,usr.dir)) var/damage = src.Str E.HP -= damage E << "[src] attacks you for [damage] damage!!" src<<"You attack [E] for [damage] damage!!" UserDcheck(E)
mob proc/UserDcheck(mob/M) if(M.HP<=0) M<<"<I><small>You died!" M.HP=M.MHP M.MP=M.MMP M.loc=locate(2,2,1) M.PK=0 return
|
ok the only problem is that I don't want the wonster running around. I just want them chasing the people when they see them.
|
step_rand(src)This this part of the Wander() proc? It's telling the monster to run around randomly if it can't find a target. Remove it and it should work as you want it to.