diff --git a/src/game_battlealgorithm.cpp b/src/game_battlealgorithm.cpp index b24e32c4e51..f5782580e8f 100644 --- a/src/game_battlealgorithm.cpp +++ b/src/game_battlealgorithm.cpp @@ -1152,8 +1152,7 @@ bool Game_BattleAlgorithm::Skill::Execute() { return this->success; } - if (!(skill.type == lcf::rpg::Skill::Type_normal || - skill.type >= lcf::rpg::Skill::Type_subskill)) { + if (!Algo::IsNormalOrSubskill(skill)) { this->success = false; return this->success; } diff --git a/src/game_battler.cpp b/src/game_battler.cpp index 14565d2de0d..ea60a72a2c8 100644 --- a/src/game_battler.cpp +++ b/src/game_battler.cpp @@ -227,7 +227,7 @@ bool Game_Battler::UseSkill(int skill_id, const Game_Battler* source) { bool was_used = false; int revived = 0; - if (skill->type == lcf::rpg::Skill::Type_normal || skill->type >= lcf::rpg::Skill::Type_subskill) { + if (Algo::IsNormalOrSubskill(*skill)) { // Only takes care of healing skills outside of battle, // the other skill logic is in Game_BattleAlgorithm diff --git a/src/game_party.cpp b/src/game_party.cpp index 1c60f0beaf0..654050917e7 100644 --- a/src/game_party.cpp +++ b/src/game_party.cpp @@ -374,8 +374,7 @@ bool Game_Party::IsSkillUsable(int skill_id, const Game_Actor* target, bool from return !Game_Battle::IsBattleRunning() && Main_Data::game_system->GetAllowEscape() && Main_Data::game_targets->HasEscapeTarget() && !Main_Data::game_player->IsFlying(); } else if (skill->type == lcf::rpg::Skill::Type_teleport) { return !Game_Battle::IsBattleRunning() && Main_Data::game_system->GetAllowTeleport() && Main_Data::game_targets->HasTeleportTargets() && !Main_Data::game_player->IsFlying(); - } else if (skill->type == lcf::rpg::Skill::Type_normal || - skill->type >= lcf::rpg::Skill::Type_subskill) { + } else if (Algo::IsNormalOrSubskill(*skill)) { int scope = skill->scope; if (Game_Battle::IsBattleRunning()) { diff --git a/src/scene_battle.cpp b/src/scene_battle.cpp index 3e797913822..28cbd6d6572 100644 --- a/src/scene_battle.cpp +++ b/src/scene_battle.cpp @@ -436,8 +436,6 @@ void Scene_Battle::AssignSkill(const lcf::rpg::Skill* skill, const lcf::rpg::Ite ActionSelectedCallback(active_actor); return; } - case lcf::rpg::Skill::Type_normal: - case lcf::rpg::Skill::Type_subskill: default: break; } diff --git a/src/scene_skill.cpp b/src/scene_skill.cpp index 8f51bfd6afc..0040c388825 100644 --- a/src/scene_skill.cpp +++ b/src/scene_skill.cpp @@ -17,6 +17,7 @@ // Headers #include "scene_skill.h" +#include "algo.h" #include "game_map.h" #include "game_party.h" #include "game_player.h" @@ -65,7 +66,7 @@ void Scene_Skill::Update() { Main_Data::game_party->UseSkill(skill_id, actor, actor); Scene::PopUntil(Scene::Map); Game_Map::SetNeedRefresh(true); - } else if (skill->type == lcf::rpg::Skill::Type_normal || skill->type >= lcf::rpg::Skill::Type_subskill) { + } else if (Algo::IsNormalOrSubskill(*skill)) { Main_Data::game_system->SePlay(Main_Data::game_system->GetSystemSE(Main_Data::game_system->SFX_Decision)); Scene::Push(std::make_shared(skill_id, actor_index)); skill_index = skill_window->GetIndex();