Howdy all. As we all know, HP and SP regen rates (passive rates) are horrid. Even at 1000% regen, people get very little bonus compared to other boosts in battle (give me 1000 defense over 1000% regen any day). I'm working on fixing this, and I'm coming close to finishing it. I'm just asking for help with some of the coding tweaks. First, how do I cap hprecov at 1000%? I know it looks something like this (possibly), but what I have below hasn't seemed to work for me yet:
Edit: There was a lovely "underflow protection" section for this first part in status.cpp, so I just used the same concept to create an "overflow" or max cap for the regen.
Second- Is there a way to make the following pattern into one formula (it goes from 1000% regen at rate .1 all the way down to 200% regen at rate .9):
Spoiler
if (sd && sd->hprecov_rate >= 1000. && ud && ud->walktimer == INVALID_TIMER )
rate /= .1;
else if (sd && sd->hprecov_rate >= 900. && ud && ud->walktimer == INVALID_TIMER )
rate /= .2;
else if (sd && sd->hprecov_rate >= 800. && ud && ud->walktimer == INVALID_TIMER )
rate /= .3;
Thanks! EDIT: Still haven't figured out how to make this into one simple formula, but at least I have it down to about 9 per HP and SP section. Regen is working as desired for me.
Question
Humble_Bee
Howdy all. As we all know, HP and SP regen rates (passive rates) are horrid. Even at 1000% regen, people get very little bonus compared to other boosts in battle (give me 1000 defense over 1000% regen any day). I'm working on fixing this, and I'm coming close to finishing it. I'm just asking for help with some of the coding tweaks. First, how do I cap hprecov at 1000%? I know it looks something like this (possibly), but what I have below hasn't seemed to work for me yet:
sd->hprecov_rate = cap_value(sd->hprecov_rate, 1000., SHRT_MAX);
Edit: There was a lovely "underflow protection" section for this first part in status.cpp, so I just used the same concept to create an "overflow" or max cap for the regen.
Second- Is there a way to make the following pattern into one formula (it goes from 1000% regen at rate .1 all the way down to 200% regen at rate .9):
if (sd && sd->hprecov_rate >= 1000. && ud && ud->walktimer == INVALID_TIMER )
rate /= .1;
else if (sd && sd->hprecov_rate >= 900. && ud && ud->walktimer == INVALID_TIMER )
rate /= .2;
else if (sd && sd->hprecov_rate >= 800. && ud && ud->walktimer == INVALID_TIMER )
rate /= .3;
Thanks! EDIT: Still haven't figured out how to make this into one simple formula, but at least I have it down to about 9 per HP and SP section. Regen is working as desired for me.
Edited by Humble_BeePart of it figured out
Link to comment
Share on other sites
0 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.