ID:178586
 
I am I have an attack code that works and at the end does a DeathCheck() which is below I want it to when mob "M" dies the usr who killed them takes all of their "murder Points" and adds it to theirs then make M have 0 murder points I tried the code below and it doesnt work any ideas??I added my attack verb to make it easier if it helps


/mob/proc
DeathCheck()
if (HP <=0)
world<<"[src] has perished!"
src.murder_points += M.murder_points
M.murder_points=0
del(src)


murder(mob/M as mob in oview(1))
flick("attack",usr)
usr<<"You attack [M]"
damage=rand(1,10)
usr<<"doing [damage] points of damage"
M:HP -=damage
M:DeathCheck()
Kayuki48801 wrote:
/mob/proc
DeathCheck()
if (HP <=0)
world<<"[src] has perished!"
src.murder_points += M.murder_points
M.murder_points=0
del(src)


murder(mob/M as mob in oview(1))
flick("attack",usr)
usr<<"You attack [M]"
damage=rand(1,10)
usr<<"doing [damage] points of damage"
M:HP -=damage
M:DeathCheck()

Try changing it like this:

/mob/proc
DeathCheck(atom/D)
if (HP <=0)
world<<"[src] has perished!"
D.murder_points += src.murder_points
src.murder_points=0
del(src)

murder(mob/M as mob in oview(1))
flick("attack",usr)
usr<<"You attack [M]"
damage=rand(1,10)
usr<<"doing [damage] points of damage"
M:HP -=damage
M:DeathCheck(usr)