Anonymous user
Armor: Difference between revisions
m
→Protection: Change .99 to .01, hopefully the last math edit
imported>FG6 (→Protection: Fix/add to damage formula to more accurately reflect the current game code) |
imported>FG6 m (→Protection: Change .99 to .01, hopefully the last math edit) |
||
| (4 intermediate revisions by the same user not shown) | |||
| Line 33: | Line 33: | ||
Damage is calculated using this formula: | Damage is calculated using this formula: | ||
: <math> | : <math> | ||
\mathsf{damageTotal} = \mathsf{damageBase}\times\mathsf{max}\left(1-\frac{\mathsf{protectionType}}{100}, 0. | \begin{align} | ||
\mathsf{rand} = \mathsf{random}\left(\right)\\ | & \mathsf{damageTotal} = \mathsf{damageBase}\times\mathsf{max}\left(1-\frac{\mathsf{protectionType}}{100}, 0.01\right)\\ | ||
\mathsf{damageTaken} = \begin{cases} | & \mathsf{rand} = \mathsf{random}\left(\right)\\ | ||
\mathsf{floor}\left(\mathsf{damageTotal}\right)\text{ if } \mathsf{rand} | & \mathsf{damageTaken} = \begin{cases} | ||
\mathsf{floor}\left(\mathsf{damageTotal}\right)\text{ if } \mathsf{rand} > 0.5\\ | |||
\mathsf{ceil}\left(\mathsf{damageTotal}\right)\text{ if } \mathsf{rand} \leq 0.5\\ | \mathsf{ceil}\left(\mathsf{damageTotal}\right)\text{ if } \mathsf{rand} \leq 0.5\\ | ||
\end{cases} | \end{cases} | ||
\end{align} | |||
</math> | </math> | ||