Attack(mob/M)
set src in oview(1)
var/damage
damage = (M.attack - src.defence) * (M.level - src.level)
if(damage <= 0)
damage = 0
src << "[M.name] misses you!"
if(prob(10))
M << "You miss!"
src << "[M.name] misses you!"
else
M << "You attack [src.name] for [damage]!"
src << "[M.name] attacks you for [damage]!"
src.health -= damage
Dead()
Dead Code:
mob
proc
Dead(mob/M)
if(M.health <= 0)
oview() << "[M.name] died from [src.name]!"
if(client)
alert("Died")
if(!client)
del M
Problem description:
I get this Runtime error when I attack the mob:
runtime error: Cannot read null.health
proc name: Dead (/mob/proc/Dead)
usr: (/mob)
src: Demi Hollow (/mob/Demi_Hollow)
call stack:
Demi Hollow (/mob/Demi_Hollow): Dead(null)
Demi Hollow (/mob/Demi_Hollow): Attack(Demi Hollow (/mob/Demi_Hollow))
set src in oview(1) isn't used for that purpose. And that mob/M arg in the verb definition has no specifications so it can be ANY mob ANYWEHRE. I may be wrong about why it's bad, but it's bad nonetheless. If you want to attack anyone around the usr of the verb....
If you want to only attack a mob 1 step in FRONT of the usr...