Advertisement
leafbarrett

attack_update

Feb 22nd, 2020
325
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.55 KB | None | 0 0
  1. //B - Reversals
  2. if (attack == AT_NSPECIAL || attack == AT_FSPECIAL || attack == AT_DSPECIAL || attack == AT_USPECIAL){
  3. trigger_b_reverse();
  4. }
  5.  
  6. if (attack == AT_NSPECIAL)
  7. {
  8. if (window < 4) {
  9. can_fast_fall = false;
  10. }
  11. if (window > 1)
  12. { can_jump = true;
  13. can_wall_jump = true;
  14. }
  15. if (window == 1){
  16. if (window_timer == 1){
  17. times_through = 0;
  18. }
  19. else if (window_timer == get_window_value(attack, 1, AG_WINDOW_LENGTH))
  20. {
  21. if (free) {window = 3;}
  22. else {window = 2;}
  23. }
  24. }
  25. else if (window == 2 || window == 3){
  26. if (window_timer == 1){
  27. move_cooldown[AT_NSPECIAL] = 30;
  28. }
  29. if (window == 2 && free) {window = 3;}
  30. else if (window == 3 && !free) {window = 2;}
  31. if (window == 3){spr_angle = (-45 * spr_dir);}
  32. else {spr_angle = 0;}
  33. if (window_timer == get_window_value(attack, 2, AG_WINDOW_LENGTH)){
  34. times_through++;
  35. window_timer = 0;
  36. if (times_through >= 4)
  37. {
  38. window = 4;
  39. }
  40. }
  41. }
  42. else if (window >= 4 && window_timer >= 2)
  43. {
  44. {spr_angle = 0;}
  45. if ((left_down || right_down) && !free) {set_state(PS_DASH);}
  46. }
  47. }
  48.  
  49. if (attack == AT_FSPECIAL){
  50. if (window > 10 || has_hit_player) { can_wall_jump = true; }
  51. if (has_hit_player)
  52. {
  53. can_jump = true;
  54. move_cooldown[AT_FSPECIAL] = 20;
  55. if (window < 3){
  56. window = 4;
  57. window_timer = 0;
  58. times_through = 0;
  59. }
  60. else if (window == 4 && times_through < 1 && window_timer == (get_window_value(attack, 4, AG_WINDOW_LENGTH)-1)){
  61. window = 5;
  62. window_timer = 0;
  63. }
  64. else if (window == 5 && times_through < 1 && window_timer == (get_window_value(attack, 5, AG_WINDOW_LENGTH)-1)){
  65. window = 6;
  66. window_timer = 0;
  67. }
  68. else if (window == 6 && times_through < 10 && window_timer == (get_window_value(attack, 6, AG_WINDOW_LENGTH)-1) && free){
  69. times_through++;
  70. }
  71. else if (times_through >= 1 || !free){
  72. window = 10;
  73. window_timer = 1;
  74. }
  75. }
  76. else if (window > 1 && window < 7 && !free)
  77. {
  78. times_through = 0;
  79. if (hsp >= 1 || hsp <= -1)
  80. {
  81. window = 7;
  82. window_timer = 0;
  83. }
  84. else
  85. {
  86. state = PS_PRATLAND;
  87. state_timer = 0;
  88. }
  89. }
  90. else if (window == 7 && times_through < 1)
  91. {
  92. if (window_timer == 3)
  93. {
  94. spawn_hit_fx( x-(40*spr_dir), y-24, skid_dust );
  95. }
  96. if(window_timer == 6)
  97. {
  98. window = 8;
  99. window_timer = 0;
  100. }
  101. }
  102. else if (window == 8 && times_through < 1 && window_timer == 8){
  103. window = 9;
  104. window_timer = 0;
  105. }
  106. else if (window == 2 && free && hsp == 0)
  107. {
  108. take_damage(player, -1, 6);
  109. spawn_hit_fx( x+(12*spr_dir), y-38, wave_wall );
  110. window = 11;
  111. window_timer = 0;
  112. times_through = 0;
  113. move_cooldown[AT_FSPECIAL] = 60;
  114. destroy_hitboxes();
  115. }
  116. else if (window == 11 && window_timer == (get_window_value(attack, 11, AG_WINDOW_LENGTH)-1))
  117. {
  118. window = 12;
  119. window_timer = 0;
  120. }
  121. else if (window == 12 && window_timer == (get_window_value(attack, 11, AG_WINDOW_LENGTH)-1))
  122. {
  123. window = 13;
  124. window_timer = 0;
  125. }
  126. }
  127.  
  128. if (attack == AT_USPECIAL){
  129. if (window == 1 && window_timer == 1){
  130. times_through = 0;
  131. }
  132. if (window == 2){
  133. if (window_timer == get_window_value(attack, 2, AG_WINDOW_LENGTH)){
  134. if (times_through < 10){
  135. times_through++;
  136. window_timer = 0;
  137. }
  138. }
  139. if (!joy_pad_idle){
  140. hsp += lengthdir_x(1, joy_dir);
  141. vsp += lengthdir_y(1, joy_dir);
  142. } else {
  143. hsp *= .6;
  144. vsp *= .6;
  145. }
  146. var fly_dir = point_direction(0,0,hsp,vsp);
  147. var fly_dist = point_distance(0,0,hsp,vsp);
  148. var max_speed = 12;
  149. if (fly_dist > max_speed){
  150. hsp = lengthdir_x(max_speed, fly_dir);
  151. vsp = lengthdir_y(max_speed, fly_dir);
  152. }
  153. if (special_pressed && times_through > 0){
  154. window = 4;
  155. window_timer = 0;
  156. }
  157. if (shield_pressed){
  158. window = 3;
  159. window_timer = 0;
  160. }
  161. }
  162. if (window > 3 && window < 6 && window_timer == get_window_value(attack, window, AG_WINDOW_LENGTH)){
  163. window++;
  164. window_timer = 0;
  165. }
  166. }
  167.  
  168. if (attack == AT_DSPECIAL)
  169. {
  170. can_wall_jump = true;
  171. move_cooldown[AT_DSPECIAL] = 5;
  172.  
  173. if (window > 1 && !free)
  174. {
  175. hsp = 0;
  176. vsp = 0;
  177. set_state (PS_LANDING_LAG);
  178. spr_angle = 0;
  179. }
  180.  
  181. if (window == 2)
  182. {
  183. can_jump = true;
  184. if (window_timer > 8 && (special_pressed || attack_pressed))
  185. {
  186. if (left_down)
  187. {
  188. spr_dir = -1;
  189. hsp = spr_dir * 15;
  190. vsp = 1.6;
  191. spr_angle = (-15 * spr_dir);
  192. }
  193. else if (right_down)
  194. {
  195. spr_dir = 1
  196. hsp = spr_dir * 15;
  197. vsp = 1.6;
  198. spr_angle = (-15 * spr_dir);
  199. };
  200. else
  201. {hsp *= 0.5;}
  202. window = 3;
  203. window_timer = 0;
  204. }
  205. }
  206. if (window >= 3 && has_hit_player)
  207. {
  208. can_jump = true;
  209. }
  210. if (window == 3 && window_timer == 1)
  211. {
  212. sound_play(sound_get("vo_specd"));
  213. }
  214. if (window == 3 && window_timer == (get_window_value(attack, 3, AG_WINDOW_LENGTH))){
  215. window = 4;
  216. window_timer = 0;
  217. }
  218. if (window == 4 && window_timer == (get_window_value(attack, 4, AG_WINDOW_LENGTH))){
  219. window = 5;
  220. window_timer = 0;
  221. }
  222. if (window == 5 && window_timer == (get_window_value(attack, 5, AG_WINDOW_LENGTH))){
  223. window = 6;
  224. window_timer = 0;
  225. }
  226. }
  227.  
  228. if (attack == AT_JAB)
  229. {
  230. if (window == 1 && window_timer == 1){
  231. last_hit_stun = false;
  232. }
  233. if (was_parried && window < 4){
  234. was_parried = false;
  235. last_hit_stun = true;
  236. }
  237. if (window >= 4 && last_hit_stun){
  238. was_parried = true;
  239. }
  240. }
  241.  
  242. if (attack == AT_DATTACK)
  243. {
  244. if (window >= 3 && window_timer >= 2)
  245. {
  246. if ((left_down || right_down) && move_cooldown[AT_DATTACK] <= 0)
  247. {
  248. set_state(PS_DASH);
  249. for(i = 0; i < 50; i++) { move_cooldown[i] = 8; }
  250. move_cooldown[AT_DATTACK] = 18;
  251. }
  252. }
  253. }
  254.  
  255. if(attack == AT_USTRONG)
  256. {
  257. if (can_ustrong_cancel)
  258. {
  259. move_cooldown[AT_USTRONG] = 20;
  260. if (window > 7 && window < 11)
  261. {
  262. can_jump = true;
  263. can_move = true;
  264. can_shield = true;
  265. can_special = true;
  266. }
  267. if (window == 10)
  268. {
  269. window = 11;
  270. }
  271. }
  272. }
  273.  
  274. if(attack == AT_DAIR && can_dair_cancel)
  275. {
  276. can_jump = true;
  277. can_move = true;
  278. can_shield = true;
  279. can_special = true;
  280. can_attack = true;
  281. can_wall_jump = true;
  282. if (window > 4 && window < 8)
  283. {
  284. window = 8;
  285. window_timer = 0;
  286. }
  287. for(i = 8; i < 10; i++)
  288. {
  289. if (window == i && window_timer == (get_window_value(attack, i, AG_WINDOW_LENGTH)))
  290. {
  291. window = i+1;
  292. window_timer = 0;
  293. }
  294. }
  295. }
  296.  
  297. if (attack == AT_BAIR && can_bair_cancel)
  298. {
  299. can_jump = true;
  300. can_move = true;
  301. can_shield = true;
  302. can_special = true;
  303. can_attack = true;
  304. can_wall_jump = true;
  305.  
  306. if (!hitpause) {spr_dir *= -1;}
  307.  
  308. if (window < 6)
  309. {
  310. window = 6;
  311. window_timer = 0;
  312. }
  313. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement