Combat Formulas

Standard Attacking Formula.

1) @penalty = sum(ATK) / sum(DEF)

2) If @penalty > 1, @penalty = 1

3) @defenderDeathPercentage = (sum(ATK) * @penalty) / sum(Defender HP)

4) @attackerDeathPercentage = sum(DEF) / (sum(Attacker HP) * @penalty)

5) For each defender unit row, deadUnits = @defenderDeathPercentage * numUnits

6) For each attacker unit row, deadUnits = @attackerDeathPercentage * numUnits

7) Calculate steal amounts based on Carry ability of surviving attackers and total resources of defender.