gravvy

Take Fall Damage

Jun 24th, 2016
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. //Take Fall Damage
  2. fall = collision_line(x, y, x, room_height, obj_all_parent, false, true);
  3.  
  4. if(distance_to_object(fall) >= 128)
  5. {
  6. freefall = true;
  7. startfalling = true;
  8.  
  9. if(startfalling)
  10. {
  11. falling++;
  12. }
  13. }
  14. else
  15. {
  16.  
  17. if(startfalling)
  18. {
  19. fallcount = 14;
  20. }
  21.  
  22. startfalling = false;
  23. freefall = false;
  24. falling = falling;
  25.  
  26. if(fallcount >= 1)
  27. {
  28. fallcount--;
  29. }
  30.  
  31. if(fallcount <= 0)
  32. {
  33. fallcount = 0;
  34. }
  35.  
  36. if(!startfalling && fallcount == 0)
  37. {
  38. start_dmg = true;
  39.  
  40. if(start_dmg)
  41. {
  42. if(set_dmg)
  43. {
  44. damage_amt = falling;
  45. set_dmg = false;
  46. }
  47.  
  48. if(!set_dmg)
  49. {
  50. falling = 0;
  51. }
  52.  
  53. scr_minushp(damage_amt);
  54. start_dmg = false;
  55. }
  56.  
  57. }
  58. }
Add Comment
Please, Sign In to add comment