MCPcopy Create free account
hub / github.com/EasyRPG/Player / GetNumberOfAttacks

Function GetNumberOfAttacks

src/algo.cpp:336–347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

334}
335
336int 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

Callers 1

GetNumberOfAttacksMethod · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected