ID:142827
 
Code:
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

First of all: you're using usr in procs, which you shouldn't do. view() should be view(src). You're also almost certainly making this mistake in deathcheck(), as evidenced by you not passing an argument, which means you're probably doing something like,

if(hp <= 0) world << "[usr] killed [src]!"


which is also wrong. You need to pass an argument to the proc, like so:

mob/proc/deathcheck(var/mob/M)
if(hp <= 0)
world << "[M] killed [src]
del(src)


Then, when you call it,

M.deathcheck(usr)


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:

mob/verb/thing()
var/obj/Thing/T = new()
T.owner = src
T.loc = loc
walk(T,dir)


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:

Bump(mob/M)
if(ismob(M))
//do stuff to M
//delete us whether it was a mob or not
del(src)
first on the death check proc the src will be null o__o also why you wrote 2 times the same obj path??
Also look at "damgage".