grunt.lua 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. grunt = {
  2. on_start = function(self)
  3. return 0;
  4. end;
  5. on_action = function(self)
  6. if is_self_in_front_row() == true then
  7. if math.random(2) == 1 then
  8. attack_id = 278; -- Beam Gun
  9. else
  10. attack_id = 277; -- Handclaw
  11. end;
  12. else
  13. if math.random(12) == 1 then
  14. attack_id = 277; -- Handclaw
  15. else
  16. attack_id = 278; -- Beam Gun
  17. end;
  18. end;
  19. set_random_enemy_as_target();
  20. battle:run_command(Battle.MONSTER_ACTION, attack_id);
  21. return 0;
  22. end;
  23. action_idle = function(self)
  24. fighter_self:play_animation("0");
  25. return 0;
  26. end;
  27. action_hurt = function(self)
  28. fighter_self:play_animation("1");
  29. return 0;
  30. end;
  31. action_handclaw = function(self)
  32. fighter_self:play_animation("2");
  33. fighter_self:play_animation("3");
  34. fighter_self:play_animation("4");
  35. fighter_self:play_animation("5");
  36. return 0;
  37. end;
  38. action_beam_gun = function(self)
  39. fighter_self:play_animation("6");
  40. fighter_self:play_animation("7");
  41. fighter_self:play_animation("8");
  42. fighter_self:play_animation("9");
  43. return 0;
  44. end;
  45. };