1st_ray.lua 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. first_ray = {
  2. --[[
  3. <enemy
  4. id="20"
  5. level="4"
  6. max_hp="28"
  7. current_hp="28"
  8. max_mp="28"
  9. current_mp="28"
  10. attack="10"
  11. defense="1"
  12. magic_attack="0"
  13. magic_defense="0"
  14. speed="40"
  15. status_death="false"
  16. status_death_immunity="false"
  17. status_darkness="false"
  18. status_darkness_immunity="false"
  19. action_idle="action_idle"
  20. action_hurt="action_hurt"
  21. >
  22. <action attack_id="279" action="action_laser_cannon" />
  23. </enemy>
  24. ]]
  25. turn = true;
  26. on_start = function(self)
  27. return 0;
  28. end;
  29. on_action = function(self)
  30. if self.turn == true then
  31. set_random_enemy_as_target();
  32. --set_random_enemy_with_highest_current_hp_as_target();
  33. battle:run_command(Battle.MONSTER_ACTION, 279);
  34. self.turn = false;
  35. else
  36. self.turn = true;
  37. end;
  38. return 0;
  39. end;
  40. action_idle = function(self)
  41. fighter_self:play_animation("0");
  42. return 0;
  43. end;
  44. action_hurt = function(self)
  45. fighter_self:play_animation("1");
  46. return 0;
  47. end;
  48. action_laser_cannon = function(self)
  49. fighter_self:play_animation("0");
  50. fighter_self:play_animation("2");
  51. fighter_self:play_animation("3");
  52. fighter_self:play_animation("4");
  53. fighter_self:play_animation("5");
  54. return 0;
  55. end;
  56. };