Asking a question and for some help...
That code is just how far I've gotten.
It's not manipulating the damage how I want to.
Say....
I do 75 damage on a player with 100hp and 100ap.
It should calculate 70% of the damage (75*0.7 = 52.5).
This is the damage absorbed.
The remaining 30% of the damage (75*0.3 = 22.5) should minus the players hp. (100 - 22.5 = 77.5)
With the damage absorbed values, it should half it (52.5 / 2 = 26.25) and deduct it from the player's armor. (100 - 26.26 = 73.75)
If player A with 100hp and 100ap gets damaged by 75. Player A should be left with 77.5hp and 73.75ap.
(I know the Engine will round the values in the end so I don't bother with it within the code)