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.
ID:169672
![]() May 14 2005, 2:52 pm
|
|
Hell Ramen wrote:
if(!vit%3)hp++ 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 |
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. |
It's that easy. :p