mob
verb
bugga()
var/obj/Thing/T = new /obj/Thing
walk(T,usr.dir)
T.loc = usr.loc
obj
Thing
icon = 'water.dmi'
icon_state = "water"
density = 1
var/magic = 5000
Bump(mob/M)
var/damage=src.magic*5
M.HP-=damgage
view()<<output("BAM","Battle")
M.deathcheck()
del(src)
Problem description:
when the object hits the mob it dissapears .. n nothing happens not even the view messages
or the damage thing
which is also wrong. You need to pass an argument to the proc, like so:
Then, when you call it,
assuming you're calling it from a verb, of course. In the case of your Thing, you're going to need to give it a variable to keep track of who fired it:
Then, you can call M.deathcheck(owner)
You also have messed up your Bump() proc. Writing Bump(mob/M) does NOT mean, "When I bump into a mob...", it means "When I bump into anything, call it a mob, and...". This leads you to treating turfs or objs as mobs, and then you run into an error when you try to access M.HP, when M is a wall without HP. You need an explicit ismob() check: