ID:142365
 
Code:
mob
proc
shoot()
if(src.Rei<=30)
src<<"Not enoupgh Reiatsu To Cover This Technique- Need 30"
return
if(!src.fired) //if the usred fired is 0 (keeps the usr from holding down 5 for lots of shots)
src.fired = 1 //makes fired equal 1
spawn(15) //waits 1.5 seconds before going to the code underneath it
src.fired = 0 //makes the player's fired 0 so the player can shoot again
var/obj/H = new/obj/redbolt //set the bullet to H (H is the bullet)
H.dir = src.dir //the bullets(H) direction equals the player's direction
H.loc = src.loc //the bullets(H) location equals the player's location
while(H) //while the bullet is still "alive"
var nextLocation = get_step(H,H.dir) //grabs the location of H's next move
var/turf/T = nextLocation //for the turf that is in H's next location
for(var/mob/M as mob in T)
var/damage = rand(src.Mrei*5)
M.Health -= damage
if(M.Health <= 0)
Death(M)





===deathcheck
proc
Death(mob/M)
if(src.inko==1)
return
if(src.client&&src.Health<=0)
src<<"You got knocked out"
src.overlays+='ko.dmi'
src.move=0
src.Spirit+=40
src.inko=1
sleep(100)
src.inko=0
src.overlays-='ko.dmi'
src.Health=src.Mhealth
src.move=1
src<<"You gained concious" //death proc with M as usr or as the creature you killed
if(src.client&&src.Spirit>=99)
src<<"Good job, You got owned"
src.loc = locate(1,1,1) //sends M to 1,1,1 on map
src.Spirit=0
src.Health = src.Mhealth
src.Rei=src.Mrei


Problem description:
the technique works and everything but when it subtracts hp, i goes to like -2000/100 and it doesnt die. which means the if(M.Health<=0) isnt working. Can someone help me fix it
You're calling Death() on the wrong mob. That needs to be M.death(src)