| 334 | } |
| 335 | |
| 336 | int GetNumberOfAttacks(int actor_id, const lcf::rpg::Item& weapon) { |
| 337 | assert(weapon.type == lcf::rpg::Item::Type_weapon); |
| 338 | int hits = weapon.dual_attack ? 2 : 1; |
| 339 | if (Player::IsRPG2k3()) { |
| 340 | auto& cba = weapon.animation_data; |
| 341 | if (actor_id >= 1 && actor_id <= static_cast<int>(cba.size())) { |
| 342 | int cba_hits = cba[actor_id - 1].attacks + 1; |
| 343 | hits *= cba_hits; |
| 344 | } |
| 345 | } |
| 346 | return hits; |
| 347 | } |
| 348 | |
| 349 | } // namespace Algo |
no test coverage detected