mob
verb
Attack(mob/M in oview(1))
M.deathcheck()
if(!M == src)
usr << "No target to attack!"
return
else
var/randumdmg = rand(1,3)
var/dmg = usr.atk * randumdmg - M.def
if(dmg <= 0)
if(prob(5))
usr << "You do [dmg] damage to [M]!"
M << "[usr] damages you for [dmg] damage!"
M.hp -= dmg
M.deathcheck()
else
usr << "You miss [M]!"
M << "[usr] misses you!"
return
else
if(rand(1,20) == 20)
usr << "Critical Hit!"
dmg *= 2
usr << "You do [dmg] damage to [M]!"
M << "[usr] damages you for [dmg] damage!"
M.hp -= dmg
M.deathcheck()
else
usr << "You do [dmg] damage to [M]!"
M << "[usr] damages you for [dmg] damage!"
M.hp -= dmg
M.deathcheck()
mob
proc
deathcheck(mob/M)
if(M.hp <= 0)
var/e = round(M.lvl * 25)
usr << "You kill [M]!"
usr << "You gain [e] Experince."
usr.exp += e
del M
..()
Problem description:
im trying to make it so whenever you attack it checks if the mob is dead (deathcheck) but its not working? anyway i could make it so it always checks even outside the attack verb... Thanks for any help