ID:268394
 
OK what I want to happen is when the monster is attacked the monster repsonds and it attacks back, but that's the problem... Its not happening.. So what you need/want(this is at will you know ;))to help me with is it needs to attack back, here.. Take a look.



mob
verb
Attack(mob/M in get_step(src, dir))
if(recover==1) return
recover=1
spawn(10) recover=0
var/damage = rand(0, src.strength)
var/guard = rand(0, M.defense)
damage -= guard
if(damage < 0)
damage = 0
M.HP -= damage
s_damage(M, damage, "#FF0000")
M.DeathCheck()

proc
MonAttack(mob/M)
var/damage = rand(0, src.strength)
var/guard = rand(0, usr.defense)

damage -= guard
if(damage < 0)
damage = 0
usr.HP -= damage
s_damage(usr, damage, "#FF0000")
usr.DeathCheck()


PS. Noobies steal this I ono what will happen, this is not a coding for grabs -_-..
As you already know that is my whole battle system.. NO STEALING IT!!
You could look into using the Bump() command under /proc, so when the mob finally reaches the player it tries to bumb into them for an attack. If they can touch the player, that get an attack.

This may not work for ranged or flying mobs.