ID:267338
 
I have an object called "Firebaneshot". WHen it bumps an atom, that is not a mob, it suddenly bursts beside it. When it hits a mob, it steps forward a step and explodes on the mob. How am I able to add the person that shot the "firebaneshot" to the DeathCheck?

Here is the Firebaneshot:
firebaneshot icon_state = "fire shot" density = 1 Bump(mob/M) if(src.inbumping) return src.inbumping = 1 src.inuse = 1 if(ismob(M)) src.loc = M.loc if(istype(M,/atom)) {src.density = 0; src.icon_state = ""} var/obj/battle/firebane/A var/obj/battle/firebane/B var/obj/battle/firebane/C if(src.dir == SOUTH || src.dir == NORTH) A = new (get_step(src,EAST)) B = new (src.loc) C = new (get_step(src,WEST)) A.dir = src.dir B.dir = src.dir C.dir = src.dir if(src.dir == WEST || src.dir == EAST) A = new (get_step(src,NORTH)) B = new (src.loc) C = new (get_step(src,SOUTH)) A.dir = src.dir B.dir = src.dir C.dir = src.dir sleep(5) del(A) del(B) del(C) src.inuse = 0 del(src)

Thanks in Advanced!
When you create the shot, you need to tell it who fired it. So the projectile needs to have a var that will keep track of that information:
obj/firebaneshot
var/mob/owner
density=1

New(newloc,firedby)
owner=firedby
loc=owner.loc // redundant but it can't hurt
walk(src,owner.dir)
Then when it hits someone, it can call target.DeathCheck(owner).

Lummox JR
In response to Lummox JR
That gives me a runtime error that has null.loc. I am not sure why that is happening.
In response to Unknown Person
Unknown Person wrote:
That gives me a runtime error that has null.loc. I am not sure why that is happening.

It's because you're not creating the projectile properly. The new() proc now takes two arguments, not just one.
new/obj/firebaneshot(usr.loc, usr)
The second argument is the player who fired.

Lummox JR