> For the complete documentation index, see [llms.txt](https://tidal-flats.gitbook.io/tidal-flats-whitepaper-en/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tidal-flats.gitbook.io/tidal-flats-whitepaper-en/whitepaper/black-market-2-road-to-fidelia/looting-battle/battle-logic.md).

# Battle Logic

Each account's HP, Attack power, and Defense Power are determined by the sum of the stats and boosts of its deployed combatants.

When account A attempts to loot B, the rates of A winning are calculated as follows.

$$
Rate,of,win,for,A=\frac{q}{p+q}
$$

$$
p=\lceil \frac{HP,of,B}{(Attack,Power,of,A)(1-Damage,reduction,rate,of,B)} \rceil
$$

$$
q=\lceil \frac{HP,of,A}{(Attack,Power,of,B)(1-Damage,reduction,rate,of,A)} \rceil
$$

$$
Damage,reduction,rate=6\cdot 10^{-11}\cdot(Defense,Power+100000)^2-0.6
$$
