| 151 | } |
| 152 | |
| 153 | void Scene_ActorTarget::UpdateSkill() { |
| 154 | if (Input::IsTriggered(Input::DECISION)) { |
| 155 | Game_Actor* actor = &(*Main_Data::game_party)[actor_index]; |
| 156 | |
| 157 | if (actor->GetSp() < actor->CalculateSkillCost(id) || actor->GetHp() <= actor->CalculateSkillHpCost(id)) { |
| 158 | Main_Data::game_system->SePlay(Main_Data::game_system->GetSystemSE(Main_Data::game_system->SFX_Buzzer)); |
| 159 | return; |
| 160 | } |
| 161 | if (Main_Data::game_party->UseSkill(id, actor, target_window->GetActor())) { |
| 162 | lcf::rpg::Skill* skill = lcf::ReaderUtil::GetElement(lcf::Data::skills, id); |
| 163 | lcf::rpg::Animation* animation = lcf::ReaderUtil::GetElement(lcf::Data::animations, skill->animation_id); |
| 164 | if (animation) { |
| 165 | Main_Data::game_system->SePlay(*animation); |
| 166 | } |
| 167 | else { |
| 168 | Output::Warning("UpdateSkill: Skill {} references invalid animation {}", id, skill->animation_id); |
| 169 | } |
| 170 | } |
| 171 | else { |
| 172 | Main_Data::game_system->SePlay(Main_Data::game_system->GetSystemSE(Main_Data::game_system->SFX_Buzzer)); |
| 173 | } |
| 174 | |
| 175 | status_window->Refresh(); |
| 176 | target_window->Refresh(); |
| 177 | } |
| 178 | } |
nothing calls this directly
no test coverage detected