# Death Ward/Analysis

Let the player's current life points be defined as ${\text{LP}}_{\text{current}}$ , the player's maximum life points be ${\text{LP}}_{\text{max}}$ , and the base damage taken by the player be $D$ . Define the half life point threshold as ${\text{LP}}_{50\%}=\lfloor {\text{LP}}_{\text{max}}/2\rfloor$ and the quarter life point threshold as ${\text{LP}}_{25\%}=\lfloor {\text{LP}}_{\text{max}}/4\rfloor$ . The damage taken by the player due to the Death Ward relic power, $D_{\text{DW}}$ , is then
{\begin{aligned}D_{\text{DW}}&={\text{max}}\left[0,H\left({\text{LP}}_{\text{current}}-{\text{LP}}_{50\%}\right){\bigg \lceil }{\text{max}}{\big (}0,{\text{min}}\left({\text{LP}}_{\text{current}}-{\text{LP}}_{50\%},D\right){\big )}{\bigg \rceil }\right]\\&+{\text{max}}{\bigg [}0,{\text{max}}{\big (}H\left({\text{LP}}_{\text{current}}-{\text{LP}}_{50\%}\right),H\left({\text{LP}}_{\text{current}}-{\text{LP}}_{25\%}\right){\big )}\times \\&\qquad \qquad {\bigg \lceil }{\text{max}}{\bigg (}0,{\text{min}}{\bigg \{}{\text{min}}\left({\text{LP}}_{\text{current}},{\text{LP}}_{50\%}\right)-{\text{LP}}_{25\%},{\text{min}}{\bigg (}D,{\text{max}}{\big (}0,D-\left({\text{LP}}_{\text{current}}-{\text{LP}}_{50\%}\right){\big )}{\bigg )}{\bigg \}}{\bigg )}\cdot 0.95{\bigg \rceil }{\bigg ]}\\&+{\text{max}}{\bigg [}0,{\bigg \lceil }{\text{max}}{\bigg (}0,{\big (}D-{\text{max}}\left(0,{\text{LP}}_{\text{current}}-{\text{LP}}_{25\%}\right){\big )}{\bigg )}\cdot 0.90{\bigg \rceil }{\bigg ]}\end{aligned}} where $H(x-a)$ is the Heaviside step function with the step occurring at $a$ , with
$H(x-a)={\begin{cases}0&{\text{for}}~x 