| 1301 | } |
| 1302 | |
| 1303 | bool Game_BattleAlgorithm::Skill::ActionIsPossible() const { |
| 1304 | auto* source = GetSource(); |
| 1305 | if (item) { |
| 1306 | return Main_Data::game_party->GetItemTotalCount(item->ID) > 0; |
| 1307 | } |
| 1308 | if (!source->IsSkillUsable(skill.ID)) { |
| 1309 | return false; |
| 1310 | } |
| 1311 | // RPG_RT performs this check only for enemies and if skill is single target |
| 1312 | const auto* target = GetOriginalSingleTarget(); |
| 1313 | if (source->GetType() == Game_Battler::Type_Enemy && target && target->GetType() == source->GetType()) { |
| 1314 | if (!EnemyAi::IsSkillEffectiveOn(skill, *target, true)) { |
| 1315 | return false; |
| 1316 | } |
| 1317 | } |
| 1318 | return true; |
| 1319 | } |
| 1320 | |
| 1321 | Game_BattleAlgorithm::Item::Item(Game_Battler* source, Game_Battler* target, const lcf::rpg::Item& item) : |
| 1322 | AlgorithmBase(Type::Item, source, target), item(item) { |
nothing calls this directly
no test coverage detected