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

Method GetAnimationId

src/game_battlealgorithm.cpp:678–700  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

676}
677
678int 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
702bool Game_BattleAlgorithm::Normal::vExecute() {
703 const auto weapon = GetWeapon();

Callers

nothing calls this directly

Calls 6

IsNormalOrSubskillFunction · 0.85
GetWeaponsMethod · 0.80
GetTypeMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected