First, Thank you for taking the time to read this. Although I love math, my skills are nowhere close to be able to solve my problem.
I am a hobby programmer, but all my education is in biology and medicine =(.
I need to find a way to write formula telling me what X is given Y.
Y = will always be from 0-1. (an expression of percentage)
X = is this bonus damage the player will receive.
I manually wrote out on paper what I thought were appropriate values for BonusDamage:
X----------Y
0----------1
5----------0.95
10----------0.25
15----------0.1
20----------0.05
Initially, the formula: X = Y^(-1) seemed like the right slope, but no matter how I manipulate it, I cannot get the values to come close to what I wrote on paper.
Thus, if I randomly chose Y. I could automatically find out what the bonus damage would be. Currently, I clamp X to 20, if Y < 0.05 because right now 20 is the maximum bonus damage.
As a bonus, let's say that I could make the bonus damage 30...or 40... or 50
I set this up as:
originalMax = 20
buffedMax = 20,30, or 50.
So later after calculating the first part. I could simply shift the values depending on how high the maximum bonus damage is:
updatedBonusDamage = updatedBonusDamage * (buffedMax / originalMax)