RuniwaR

Формула расчета урона



First, the variables:

A = Attack strength of the attacking unit
Ta = Terrain modifier for the attacking unit
D = Defense strength of the defending unit
Td = Terrain modifer for the defending unit
B = Gang up bonus
H = The attacking unit's health points.

Next, the formula:
p = 0.05 * (((A + Ta) - (D + Td)) + B) + 0.5
if p < 0 then p = 0
if p > 1 then p = 1

This is how to figure out the damage:
1. Pick one unit to be the attacker and the other to be the defender.
2. Use the formula above to obtain p.
3. Take H and multiply by 6. This is the number of random numbers (r) generated between 0 and 1. For every r < p a hit is counted.
4. The total number of hits divided by 6 is the number of damage the defending unit will receive.
5. Switch roles between the units (attacker becomes the defender and vice versa).
6. Use the same formula above.
7. Once both units have attacked the damage points are calculated into their health points.

I will use a quick example:
Underling vs Marauder both on Plains
If you use the formula you see that the Underling has a 30% probability of dealing damage for each of its health points whereas the Marauder has a 75% probability of dealing damage for each of its health points.

If the Underling were on a Mountain though, the numbers change to 40% for the Underling and 55% for the Marauder.

That's it!

The UniWar Team

http://www.uniwar.com/forum/posts/list/454.page
☆ Marqes ® 2012