| 102 | } |
| 103 | |
| 104 | static Game_Battler* GetRandomSkillTarget(Game_Party_Base& party, const lcf::rpg::Skill& skill, bool emulate_bugs) { |
| 105 | std::vector<Game_Battler*> battlers; |
| 106 | party.GetBattlers(battlers); |
| 107 | for (auto iter = battlers.begin(); iter != battlers.end();) { |
| 108 | if (IsSkillEffectiveOn(skill, **iter, emulate_bugs)) { |
| 109 | ++iter; |
| 110 | } else { |
| 111 | iter = battlers.erase(iter); |
| 112 | } |
| 113 | } |
| 114 | auto choice = Rand::GetRandomNumber(0, battlers.size() - 1); |
| 115 | return battlers[choice]; |
| 116 | } |
| 117 | |
| 118 | static std::shared_ptr<Game_BattleAlgorithm::AlgorithmBase> MakeSkillAction(Game_Enemy& enemy, const lcf::rpg::EnemyAction& action, bool emulate_bugs) { |
| 119 | const auto* skill = lcf::ReaderUtil::GetElement(lcf::Data::skills, action.skill_id); |
no test coverage detected