ID:263705
 
Code:
mob
icon = 'person.dmi'
var
HP = 100
AP = 175

bug
icon = 'bug.dmi'

proc
DeathCheck()
if (HP <= 0 <= 4)
world << "[src] dies!"
del(src)

if(AP <= 5&up)
var/HP = 100

verb
attack(mob/M as mob in oview(1))
usr << "You attack [M]!"
oview() << "[usr] attacks [M]!"
var/damage = rand(1,10)
world << "[damage] damage!"
M:HP -= damage
M:AP -= damage
M:DeathCheck() >


Problem description:
In most games if your HP goto 0. you die
But I want it to be if your HP goto 0 but your AP are 5 or more you come back to life
But I can't get it to work

PLEASE HELP!!!!!!!
    proc
DeathCheck()
if(HP <= 0 && AP <= 4)
world << "[src] dies!"
del(src)
if(HP <= 0 && AP >= 5)
var/HP = 100
return
else
return


try that

also i noticed your using : (colon) thats a bad idea you should be using the . (decemal) cant remember why but other people will also say this.

btw..if the users HP reaches 0 the AP will be below 0 since they both lose the same amount and HP has more.