| 357 | } |
| 358 | |
| 359 | bool SetStateRestrictedAction(Game_Enemy& source) { |
| 360 | if (!source.CanAct()) { |
| 361 | source.SetBattleAlgorithm(std::make_shared<Game_BattleAlgorithm::None>(&source)); |
| 362 | return true; |
| 363 | } |
| 364 | |
| 365 | if (source.GetSignificantRestriction() == lcf::rpg::State::Restriction_attack_ally) { |
| 366 | source.SetBattleAlgorithm(MakeAttackAllies(source, 1)); |
| 367 | return true; |
| 368 | } |
| 369 | |
| 370 | if (source.GetSignificantRestriction() == lcf::rpg::State::Restriction_attack_enemy) { |
| 371 | source.SetBattleAlgorithm(MakeAttack(source, 1)); |
| 372 | return true; |
| 373 | } |
| 374 | |
| 375 | if (source.IsCharged()) { |
| 376 | source.SetBattleAlgorithm(MakeAttack(source, 1)); |
| 377 | return true; |
| 378 | } |
| 379 | |
| 380 | return false; |
| 381 | } |
| 382 | |
| 383 | } // namespace EnemyAi |
no test coverage detected