ID:142325
 
Code:
mob
hitsu
verb
shooty()
set name = "Shoot Dragon"
set category = "Fighting"
if(usr.Rei <= 1400)
usr << "<b>Your reiatsu is too low!"
return
if(usr.fired == 0)
usr.fired = 1
usr.Rei -= 1400
var/K = new/obj/ice(usr.loc)
K:Gowner = usr
walk(K,usr.dir)

sleep(50)
usr.fired = 0



obj
ice
icon = 'Hitsuyaga.dmi'
icon_state = ""
density = 1
layer = 60
New()
spawn(100)
del src
Del()
for(var/obj/icetrail/X in world)
if(X.owner == src)
del X
..()
Move()
..()
var/obj/icetrail/K = new /obj/icetrail
if(src.dir == NORTH)
K.loc = locate(src.x,src.y-1,src.z)
if(src.dir == WEST)
K.loc = locate(src.x+1,src.y,src.z)
if(src.dir == EAST)
K.loc = locate(src.x-1,src.y,src.z)
if(src.dir == SOUTH)
K.loc = locate(src.x,src.y+1,src.z)
K.dir = src.dir
K.owner = src
Bump(A)
if(ismob(A))
var/mob/M = A
if(M == src.Gowner)
del src
return
if(M.ispedal)
del src
return
var/mob/O = src.Gowner
var/damage = round(O.Rei * 2.2 - M.Rei / 2)
if(damage >= 1)
M.Health -= damage
view(O,8) << "<b><font color = red>[O] hit [M] with his Ice Dragon for [damage] damage!"
del(src)
if(M.Health<0)
M.Death(M)
if(istype(A,/turf/))
var/turf/T = A
if(T.density)
del(src)
if(istype(A,/obj/))
del(src)
icetrail
icon = 'Hitsuyaga.dmi'
icon_state = "trail"
layer = 60
density = 0


Problem description:

ok so , i was trying to make a beam for along time now and now i think i got it, but its not calling the death proc now can anyone help me call it?
if(M.Health<0)
M.Death(M)

because you are searching if its below 0 try <=
In response to A.T.H.K
didint help, they both mean the same thing < and <=
In response to Agrey123
Agrey123 wrote:
didint help, they both mean the same thing < and <=

No it doesn't.

< means less then, which means that the HP must be less then 0 to work. If it has exactly 0, it won't work.

<= means less then or equal to, meaning that the HP must be either 0 or less then 0 in order to work.
In response to GhostAnime
thanks for clarifying lol can u help me with my code tho
In response to Agrey123
Nothing is sinking in is it?

You can't expect things to be give to you on a sliver plater otherwise you will fail at life.

Read the guide read the ref build your own then come back top us with some actual questions instead of GIVE ME CODEZORS!
The main problem is that you're deleting the beam before you call Death(). If you make this in a less spaghetti-code fashion it will be a lot easier on you. One way into the proc, one way out.

obj/ice/Bump(mob/M)
if(ismob(M) && M != src.Gowner && !M.ispedal) // Qualify instead of reject.
var/mob/O = src.Gowner
var/damage = round(O.Rei * 2.2 - M.Rei / 2)
if(damage >= 1)
M.Health -= damage
view(O,8) << "<b><font color = red>[O] hit [M] with his Ice Dragon for [damage] damage!"
if(M.Health<=0)
M.Death(M)

del src // The beam is deleted when it hits anything dense, but not
// before doing damage if needed.