sweeper.lua 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. sweeper = {
  2. count = math.random(3);
  3. on_start = function(self)
  4. return 0;
  5. end;
  6. on_action = function(self)
  7. local action_id;
  8. if self.count == 0 then
  9. if true then
  10. --if is_all_enemy_in_darkness_status() == false then
  11. set_random_enemy_as_target();
  12. --set_random_enemy_without_darkness_status_as_target();
  13. else
  14. set_random_enemy_as_target();
  15. end;
  16. action_id = 281; -- Smoke Shot
  17. self.count = 1;
  18. elseif self.count == 1 then
  19. set_random_enemy_as_target();
  20. --set_random_enemy_with_highest_current_hp_as_target();
  21. action_id = 272; -- Machine Gun
  22. self.count = 2;
  23. else
  24. set_random_enemy_as_target();
  25. --set_random_enemy_with_highest_current_hp_as_target();
  26. action_id = 280; -- W Machine Gun
  27. self.count = 0;
  28. end;
  29. battle:run_command(Battle.MONSTER_ACTION, action_id);
  30. return 0;
  31. end;
  32. action_idle = function(self)
  33. fighter_self:play_animation("0");
  34. return 0;
  35. end;
  36. action_hurt = function(self)
  37. fighter_self:play_animation("1");
  38. return 0;
  39. end;
  40. action_machine_gun = function(self)
  41. fighter_self:play_animation("2");
  42. fighter_self:play_animation("3");
  43. fighter_self:play_animation("4");
  44. fighter_self:play_animation("5");
  45. return 0;
  46. end;
  47. action_w_machine_gun = function(self)
  48. fighter_self:play_animation("6");
  49. fighter_self:play_animation("7");
  50. fighter_self:play_animation("8");
  51. fighter_self:play_animation("9");
  52. return 0;
  53. end;
  54. action_smoke_shot = function(self)
  55. fighter_self:play_animation("10");
  56. fighter_self:play_animation("11");
  57. fighter_self:play_animation("12");
  58. fighter_self:play_animation("13");
  59. return 0;
  60. end;
  61. };