2010-10-16, 06:22 PM
A minor point... if I read the code right, it was flattening percentage based reductions down to the nearest percent. So 70.71% will become straight 70%.
As to why the formula works like that... the exact damage reduction is:
flat: def/4
percent: (def)^.5/200*atk
Solving for atk, such that flat=percent
def/4 = def^.5/200*atk
Rearrange a bit by multiplying by 200 and dividing by def^.5
50*def^.5 = atk
Throw it back into percentage form by extracting 10000
(50*200*def^.5/200) = atk
10000*perc = atk
noting that 70.71% is 0.7071, 10000*0.7071 = 7071 as expected.
As to why the formula works like that... the exact damage reduction is:
flat: def/4
percent: (def)^.5/200*atk
Solving for atk, such that flat=percent
def/4 = def^.5/200*atk
Rearrange a bit by multiplying by 200 and dividing by def^.5
50*def^.5 = atk
Throw it back into percentage form by extracting 10000
(50*200*def^.5/200) = atk
10000*perc = atk
noting that 70.71% is 0.7071, 10000*0.7071 = 7071 as expected.

