client
Center()
if(usr.targetmarker<>"")
if(usr.targetmarker in oview(10))
usr.Enterfight(usr.targetmarker)
else
world<<"Not in oview."
else
world<<"No target."
mob/proc
Enterfight(mob/M)
if(istype(M,/mob/Player/))
src<<"You enter a fight with [M]!"
spawn() BeginBattle(M)
..()
BeginBattle(mob/M)
if(istype(M,/mob/Player/))
for(M in oview(src.cansee))
var/damage = src.str+rand(1,4)-M.def
// var/Critical = rand(1,100)
if(damage<=0)
damage = 0
M.Hp-=damage
src<<"You hit [M] for [damage] after [src.waitattack] time!"
if(M.Hp<=0)
deathcheck(M)
src<<"You killed [M]!"
else
spawn(src.waitattack)BeginBattle(M)
..()
mob/Player
var
waitattack = 12
Monster
Hp = 19
icon = 'Monster.dmi'
icon_state = "theif"
New()
walk_rand(src,10)
..()
Problem description:
It doesn't wait for the waitattack, which is 12. It usually goes through the whole thing around 19-22 times, but sometimes it only does it twice. Then I have to hit center each time I want to attack.