...I need help with terms in equations.
Basically, I am trying to write down a formula that would work out the damage a player would take in a game but including bleed damage too. If a player gets damaged, they will initially take 20% of the attack damage off their health, but they bleed the other 80% of the damage over 10seconds. (You with me?) Here is a basic example I think I have right:
(HP - (20% of AP)) - (80% of AP over 10sec) = Health left after Attack
HP = Health, AP = Attack Power
So for example, if the player has 100 health and he is hit for 50, he would loose 10 health upon the hit and then bleed the other 40 health over an additional 10seconds. First of all, does that make sense and is my equation correct?
Now, lets say the player is hit again, but a few seconds later then the previous hit. I believe I have worked it out to be this:
(((HP - (20% of AP1)) - (8% per second of AP1, up to 10seconds or until second attack)) - (20% of AP2)) - ((80% of AP2) + remaining % of damage from AP1) over (10seconds + remaining time of AP1)) = HP left after Attacks
HP = Health, AP1 = First Attacks Power, AP2 = Second Attacks Power
As you can see, I want it so the bleed damage does not speed up but adds to itself. So 10seconds might become 15seconds with 2 hits of damage, the first 5seconds before the other.
On paper they both work out with whatever numbers I use, however as you can see the equations have a lot of text in them, but what formulas, expressions or symbols etc could I replace the text with?
I hope all that makes sense, maths has never been my strong point.
Thanks
Basically, I am trying to write down a formula that would work out the damage a player would take in a game but including bleed damage too. If a player gets damaged, they will initially take 20% of the attack damage off their health, but they bleed the other 80% of the damage over 10seconds. (You with me?) Here is a basic example I think I have right:
(HP - (20% of AP)) - (80% of AP over 10sec) = Health left after Attack
HP = Health, AP = Attack Power
So for example, if the player has 100 health and he is hit for 50, he would loose 10 health upon the hit and then bleed the other 40 health over an additional 10seconds. First of all, does that make sense and is my equation correct?
Now, lets say the player is hit again, but a few seconds later then the previous hit. I believe I have worked it out to be this:
(((HP - (20% of AP1)) - (8% per second of AP1, up to 10seconds or until second attack)) - (20% of AP2)) - ((80% of AP2) + remaining % of damage from AP1) over (10seconds + remaining time of AP1)) = HP left after Attacks
HP = Health, AP1 = First Attacks Power, AP2 = Second Attacks Power
As you can see, I want it so the bleed damage does not speed up but adds to itself. So 10seconds might become 15seconds with 2 hits of damage, the first 5seconds before the other.
On paper they both work out with whatever numbers I use, however as you can see the equations have a lot of text in them, but what formulas, expressions or symbols etc could I replace the text with?
I hope all that makes sense, maths has never been my strong point.
Thanks