Guest User

Untitled

a guest
Dec 2nd, 2021
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. //ai_update - called every frame for this character as a CPU
  2.  
  3. if (ai_recovering){
  4. distY = y-get_stage_data( SD_Y_POS);
  5. if (x<get_stage_data( SD_X_POS)) {
  6. distX=get_stage_data( SD_X_POS)-x;
  7. } else {
  8. distX = x-(get_stage_data( SD_X_POS)+get_stage_data( SD_WIDTH));
  9. }
  10. if (move_cooldown[AT_FSPECIAL] == 0 && distX>150 && special_pressed==false){
  11. joy_pad_idle=false;
  12. up_down=false;
  13. down_down=false;
  14. if (x<get_stage_data( SD_X_POS)) {
  15. right_down=true;
  16. left_down=false;
  17. } else {
  18. right_down=false;
  19. left_down=true;
  20. }
  21. special_pressed=true;
  22. } else if (distX<=150 && special_pressed==false && attack!=AT_FSPECIAL) {
  23. joy_pad_idle=false;
  24. up_down=true;
  25. special_pressed=true;
  26. special_pressed=false;
  27. }
  28. if (state==PS_ATTACK_AIR && attack==AT_FSPECIAL){
  29. special_pressed=false;
  30. joy_pad_idle=false;
  31. if (x<get_stage_data( SD_X_POS)) {
  32. if (distY <-70){
  33. right_down=true;
  34. left_down=false;
  35. }
  36. else {
  37. joy_dir=45;
  38. }
  39. } else {
  40. if (distY <-70){
  41. right_down=false;
  42. left_down=true;
  43. }
  44. else {
  45. joy_dir=135;
  46. }
  47. }
  48. if (has_walljump){
  49. jump_down=true;
  50. }
  51. if (distX <0 && y>get_stage_data(SD_Y_POS)){
  52. special_pressed=true;
  53. }
  54. up_down=distY>distX;
  55. up_pressed=distY>distX;
  56. down_down=false;
  57. special_pressed=false;
  58. }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment