Hello.
Reason:
Currently i am balancing the game i am working on.
What i want to achieve:
i am trying to find a formula that will be more efficient then this peace of code
/* Example values
int calcRT = 0;
int statRT = 9;
*/
int tax = 0;
for(unsigned int n = 0; n < unit.statRT; n++)
{
unit.calcRT -= 100 - tax;
tax += 5;
}
What i want is for each statRT to reduce calcRT by 100, but each one after that to give by 5 less so.
If statRT = 1, calcRT = -100;(100)
if statRT = 2, calcRT = -195;(100 + 95)
If statRT = 3, calcRT = -285;(100 + 95 + 90)
if statRT = 10, calcRT = - ;(100 + 95 + 90... + 65 + 60 + 55)
What syntax i am looking for
/* Example values
int calcRT = 0;
int statRT = 9;
*/
calcRT = statRT * (100 - (5 * statRT));