mob
icon = 'player.dmi'
Login()
loc = locate(3,3,1)
world << "[usr] Has logged in."
proc
deathcheck()
if (HP <= 0)
usr << "[src] has been killed."
usr.HP += usr.hurt
usr.hurt -= usr.hurt
if (key)
loc = locate(3,3,1)
else
del(src)
Del()
var/obj/gold/G = new(loc)
G.amount = rand(1,10)
..()
verb
Smile()
world << "[usr] smiles."
Laugh()
world << "[usr] laughs."
Say(msg as text)
world << "[usr] says: [msg]"
Change_name(N as text)
set desc = "(\"new name\") Change your name."
name = N
world << "[usr] has changed \his name"
Whisper(M as mob,msg as text)
M << "[usr] Whispers : [msg]"
Punch(mob/M as mob in oview(1))
var/damage = rand(1,10)+ Strength
usr << "You attack [M] and do [damage] damage!"
M.HP -= damage
M.hurt += damage
M.deathcheck()
M << "You were punched by [src],you now have [M.HP] Health left!"
Change_Character_Blue()
icon = 'Blue mob.dmi'
Change_Character_Red()
icon = 'Red mob.dmi'
Change_Character_Yellow()
icon = 'Yellowmob.dmi'
Bug
icon = 'bug.dmi'
var
HP = 100
wealth
Strength = 10
hurt = 0
Problem description:
Ok what I want my code to do is that when a player is killed he gets sent back to the start and if its a NPC it just gets deleted,that works fine but I also want it that when you are hit it takes away HP and adds to your hurt,once you die your hurt is added to your health therefore healing you to your max health,it won't work though,idk why not I'm still kinda new to this but I've looked over it a thousand times and don't get whats wrong...
And in the death check you should put ur respawning code and add usr.Health = MaxHealth.
You would need to add a new variable called MaxHealth and it should work.