obj
bullet
icon = 'Bullet.dmi'
density = 1
New()
spawn(100)
del src
Bump(A)
if(ismob(A))
var/mob/M = A
if(M == src.owner)
del src
return
var/mob/O = src.owner
var/damage = O.Dex * rand(1.3,1.9) - M.def
if(damage < 1)
damage = 1
if(O.pvp == 1)
if(M.pvp == 0)
return
else
M.health -= damage
O << "<b><font size = -2><font color = blue>You hit <u>[M]</u>: with your bullet! Doing [round(damage)] damage."
M << "<b><font size = -2><font color = blue>You have been hit by <u>[usr]'s</u> bullet for [round(damage)] damage!"
if(O.hollow_protection == 1)
if(M.race == "Jedi" || M.race == "Sith" || M.race == "Merc")
O.Sith_protection = 0
if(O.Jedi_protection == 1)
if(M.race == "Jedi")
O.Jedi_protection = 0
M.Death()
del src
if(O.pvp == 0)
if(M.client)
return
else
M.health -= damage
O << "<b><font size = -2><font color = blue>You hit <u>[M]</u>: with your bullet! Doing [round(damage)] damage."
M << "<b><font size = -2><font color = blue>You have been hit by <u>[usr]'s</u> bullet for [round(damage)] damage!"
if(O.Sith_protection == 1)
if(M.race == "Jedi" || M.race == "Sith" || M.race == "Merc")
O.Sith_protection = 0
if(O.Jedi_protection == 1)
if(M.race == "Jedi")
O.Jedi_protection = 0
M.Death()
del src
if(istype(A,/turf/))
var/turf/T = A
if(T.density)
del src
if(istype(A,/obj/))
del src
Problem description:
Okay, my problem is this, I can kill a mob with attack or slashing fine, my death check runs and they die. When I happen to use a blaster or any powers, it deals the damage but won't kill them. Above is the bullet that is created when firing a blaster. Below is the error it runs in the game.
runtime error: Cannot read 0.Mercref
proc name: Death (/mob/proc/Death)
usr: 0
src: X a o c T r o o p (/mob/Xaoc_Trooper)
call stack:
X a o c T r o o p (/mob/Xaoc_Trooper): Death(null)
the bullet (/obj/bullet): Bump(X a o c T r o o p (/mob/Xaoc_Trooper))