ID:169672
 
I'm trying to make an algorith in a proc I need assistance. The two variables are HP and Vit. Every 3 vit you get 1 hp. This must be couculated every level or when ever they add a stat.

I was thinking, have a Vit Modifier. Every time you change Vit, Vit bonus is wiped and recouculated for vitmod=vit\3 HP+=vitmod. Then when ever it needs to be recouculated I can go HP-=vitmod and then vitmod=null. All I need to do after that is recouculate it.
if(!vit%3)hp++

It's that easy. :p
In response to Hell Ramen
Hell Ramen wrote:
if(!vit%3)hp++

It's that easy. :p

That only works if vit goes up one at a time, though. If it can be added to arbitrarily, then you'd have to use hp+=round(vit/3)-round(last_vit/3). I don't think it's quite possible to answer his question though without more understanding of the link between hp and vit.

Lummox JR
In response to Lummox JR
In my game, every time you raise Vit by 3, you get 1 more hp. That is the connection.
In response to InuTracy
InuTracy wrote:
In my game, every time you raise Vit by 3, you get 1 more hp. That is the connection.

I think Lummox is wondering how you raise it.
In response to Hell Ramen
You get stat points depending on your level.
If you try to raise vit, skill points used are dependant on how high VIT is.

Skill Point Gain Formula:
var/howmany=(M.level/5)+2
M.statpoints+=howmany

Formula to see how many stat points it takes to increase a stat:
[(VIT - 1)/ 10] + 2