mob
var
stamina = /mob/stamina
stamina
var
current
max
level
experience_current
experience_max
proc
add_experience(value)
if(value)
while(value >= experience_max)
level_up()
experience_current -= 100 // 100 resembles 100%
printl(world.log, "[src].stamina leveled up!")
level_up()
level++
verb
levelup()
usr.stamina.add_experience(200)//should bring out 2 levels
//this doesn't work, which makes me confused
Problem description:
I'm sorry, but i think i need some help understanding what exactly i am doing here. I don't even know if this works, or how it's supposed to be done.
What i am trying to achieve here, is a system which involves each stat having it's own path with unique proc's and var's, for example:
mob/stamina/proc/add_experience(value)
mob/stamina/var
current
max
level
experience
experience_max
You can see where i am going with this.
I am having trouble undestanding how to use individual paths like this in a scenario where I need to actually use them, for example how to level up src.stamina. I think the code above explains what i mean.
Please help me. I cannot figure out how this works.
Disclaimer
I didn't really intend to use individual path's for each stat, but i thought it was good practice and that i could apply a structure like this elsewhere.