Simple maths formula - help needed!
DigiChain
Member, PRO Posts: 1,288
I wonder if anyone with a better mathematical brain than mine can come up with a simple formula for this?…
I have 2 attributes (as percentages):
1) Poisoned - Real attribute (value can be between 0-100): 0= no poison, 100= max poison
2) Tolerance - Real attribute (value can be between 0-100): 0= no tolerence, 100 = max tolerence
From these I need a formula to calculate a 3rd Real Atrribute named ‘Health’ (also a percentage: 0 - no health, 100 full health)
So as an example:
If Poisoned = 50, Tolerence = 100, then Health Should = 100.
If Poisoned = 50, Tolerence = 0, then Health Should = 50.
If Poisoned = 50, Tolerence = 50, then Health Should = 75 (I think) etc etc.
Seems simple enough, but I’m struggling!
Thanks if anyone can help!!
Comments
Hmmmmm . . .
Thanks socks - but my problem is both P and T can vary in the game...
So with this equation if P and T were high it would deliver a Health figure above 100.
I now no longer feel stupid for not being able to come up with a formula myself did try...
Indeed. I've spent an entire day on this... it must be simple, but I can't see it!
P-((P/100)*T)
For the 3rd one it gives you 25 so you could do:
H-(P-((P/100)*T)) to get 75
The first formula returns the damage done to your health from the poison, not your final health
@KevinCross - great... I think you may have cracked it!
I'm going to have a play with some figures and see if I can catch it out!
Thanks
You're welcome! Hope it works with all the numbers you throw at it.
H = H-(P*(100-T)/100)?