mob
verb
Attack(mob/M as mob in oview(1))
if (M.HP <= 15)
M.icon_state = "injured"
if (M.isdead == 1) //if the mob is dead
M.icon_state = null
if (M.isdead == 0) //otherwise...
var/damage = rand(1,10)
view() << "[usr] attacks [M] for [damage] damage!"
M.HP -= damage
if (M.HP <= 0)
src.exp += M.level*30
src.LevelCheck()
M.DeathCheck()
Problem description: In the current stage of this program I am able to attack as quickly as I can click (Or macro) the Attack verb. I would like for there to be a small delay between each attack so that spamming attack and getting an insta-kill isn't possible. With this delay in mind, how would I be able to make a speed stat that could determine how quick the delay was? Thanks for reading, and I apologize if it's a bit much to ask.
P.S. I am aware that I should change the damage system, but because I've been trying to work the delay thing out I left it as is. I do not need help with that part.