ID:1637600
 
(See the best response by LordAndrew.)
hey every one, Just getting into using DM and i have a problem. When my char. die's he respawn,but is not healed to MaxHp. would love help.. sick of being killed

mob/proc
LevelCheck()
if(src.Exp>=src.Nexp)
src.Exp=0
src.Nexp+=10
src.Level+=1 //Lvl Proc-adds lvl,HP,Stats
src.MaxHP+=rand(1,5)
src.Str+=1
src.Def+=1
src<<"You are now Level [src.Level]"

TakeDamage(var/Damage,var/mob/Attacker)
src.HP-=Damage
src.DeathCheck(Attacker)

DeathCheck(var/mob/Killer)
if(src.HP<=0)
if(src.client)
world<<"[Killer] Killed [src]!"
src.HP=src.MaxHP
src.loc=locate(5,5,1)
else
Killer<<"<b>You Killed [src] for [src.Exp] Exp"
Killer.Exp+=src.Exp
Killer.LevelCheck()
del src
Best response
Strange, src.HP = src.MaxHP should work, unless you aren't actually defining MaxHP anywhere (in which src.HP = src.MaxHP would effectively mean src.HP = 0).
this is in my vars.dm

 mob/var
Level=1
Exp=0
Nexp=100
HP=100
MaxHP=100 //starting stats
Str=10
Def=5
How are you viewing hp? Is it possible you're not updating your view of it?
idk.. i cant see my health in-game , i went off of the tutorials
In response to RavenGlass
Perhaps your enemies are doing far more damage than you think they are? Could you show us how you're handling attacking and calculating damage?
this is my Verbs.dm
mob/verb
say(t as text)
view()<<"[src] says: [t]"

World_Say(t as text)
world<<"<b>[src]:</b> [t]"
//verb's things that DO/ turn input msg to game text

Who()
var/counter=0
for(var/mob/Player/M in world)
counter+=1
src<<"[M]"
src<<"<b>[counter] Players Online"

Attack()
flick("Attack",src)
for(var/mob/M in get_step(src,src.dir))
var/Damage=max(0,src.Str-M.Def)
view(M)<<"[src] hit [M] for [Damage] Damage!"
M.TakeDamage(Damage,src)


mob/verb
save()
src.SaveProc() // In-game Save opptiorn
Add the following to check in-game:

mob/Stat()
stat("Health","[HP]/[MaxHP]")
..()


This should tell you if your problem is where you think it is.