| 167 | } |
| 168 | |
| 169 | int Game_BattleAlgorithm::AlgorithmBase::ApplyHpEffect() { |
| 170 | auto* target = GetTarget(); |
| 171 | assert(target); |
| 172 | |
| 173 | if (target->IsDead()) { |
| 174 | return 0; |
| 175 | } |
| 176 | int hp = GetAffectedHp(); |
| 177 | if (hp != 0) { |
| 178 | hp = target->ChangeHp(hp, true); |
| 179 | if (IsAbsorbHp()) { |
| 180 | // Only absorb the hp that were left |
| 181 | source->ChangeHp(-hp, true); |
| 182 | } |
| 183 | } |
| 184 | return hp; |
| 185 | } |
| 186 | |
| 187 | int Game_BattleAlgorithm::AlgorithmBase::ApplySpEffect() { |
| 188 | auto* target = GetTarget(); |
no test coverage detected