ID:146178
 
Code:
mob/verb
Attack(mob/t in oview(1))//this makes it so the user has the verb attack but can only be used when someone is next to him/her
if (usr.z > 1)
set category = "Commands"//main tab
var/dmg = round((rand(usr.atk))+(usr.atk/2)+usr.plsdmg)-(t.plsdef+(rand(t.def))+(t.def/2))
if(dmg < 1)
dmg = 1
if((rand(usr.hit)+usr.plshit) > rand(t.evade))
usr << "[usr] attacks [t] for [dmg] hps."
t.hp -= dmg
else
usr << "You missed!"
if(t.hp >= 0)
t.Counterattack()
else
t.DeathCheck()
else
usr << "You cannot declare an attack in the newbie area."

mob/proc
Counterattack(mob/m)
var/dmg = round((rand(m.atk))+(m.atk/2)+m.plsdmg)-(usr.plsdef+(rand(usr.def))+(usr.def/2))
if(dmg < 1)
dmg = 1
if((rand(m.hit)+m.plshit) > rand(usr.evade))
usr << "[src] attacks [usr] for [dmg] hps."//sends a attack message to the user
usr.hp -= dmg// takes away the person there attackings health depending on the damage variable
usr.DeathCheck()//sends deathcheck which is right below this
else
usr << "He missed!"


mob/proc/global
DeathCheck(mob/m)
usr << "It died, which deletes it."
input("Press enter for self destruct ---->")
usr.exp += a
usr.crescents += b
if(usr == src)
if(usr.hp < 0)
usr.crescents = 0
var/savefile/F = new("players/[src.ckey].sav") // define the location of the save file
var/X
var/Y
var/Z
F["X"] >> X // Load the X variable from the savefile to the temporary X variable
F["Y"] >> Y // Load the Y variable from the savefile to the temporary Y variable
F["Z"] >> Z // Load the Z variable from the savefile to the temporary Z variable
usr.loc = locate(X,Y,Z) // Move the initialized mob to the last saved location
usr << alert("You have died. You will be placed back at the nearest save point, but now you have ZERO crescents.")
usr.hp = usr.hcp
else
del(m)


Problem description:

Now the problem is even worse. Whenever I try to eliminate a monster, it will not get deleted when I have depleted the hp value. It worked before I started using target, but now it simply will not be eiliminated.

problem discovered. deathcheck was global. BIG OOPS.
No put usr in proc. Ungh.