| 676 | } |
| 677 | |
| 678 | int Game_BattleAlgorithm::Normal::GetAnimationId(int idx) const { |
| 679 | const auto weapon = GetWeapon(); |
| 680 | auto* source = GetSource(); |
| 681 | if (source->GetType() == Game_Battler::Type_Ally) { |
| 682 | Game_Actor* ally = static_cast<Game_Actor*>(source); |
| 683 | auto weapons = ally->GetWeapons(weapon); |
| 684 | auto* item = (idx >= 0 && idx < static_cast<int>(weapons.size())) |
| 685 | ? weapons[idx] : nullptr; |
| 686 | if (item) { |
| 687 | return item->animation_id; |
| 688 | } else if (idx == 0) { |
| 689 | return ally->GetUnarmedBattleAnimationId(); |
| 690 | } |
| 691 | return 0; |
| 692 | } |
| 693 | if (source->GetType() == Game_Battler::Type_Enemy |
| 694 | && Feature::HasRpg2k3BattleSystem() |
| 695 | && !lcf::Data::animations.empty()) { |
| 696 | Game_Enemy* enemy = static_cast<Game_Enemy*>(source); |
| 697 | return enemy->GetUnarmedBattleAnimationId(); |
| 698 | } |
| 699 | return 0; |
| 700 | } |
| 701 | |
| 702 | bool Game_BattleAlgorithm::Normal::vExecute() { |
| 703 | const auto weapon = GetWeapon(); |
nothing calls this directly
no test coverage detected