1
0

Create_0.gml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. get_hit = function(_info)
  2. {
  3. if has_ink
  4. {
  5. player_add_INK(1);
  6. var _dir = point_direction(0, 0, _info.kbFactorX, -abs(_info.kbFactorY));
  7. repeat(6)
  8. {
  9. var _pe = icl(oHitEnemyEffect);
  10. _pe.dir = random_range(_dir - 45, _dir + 45);
  11. _pe.x_spd = lengthdir_x(_pe.spd, _pe.dir);
  12. _pe.y_spd = lengthdir_y(_pe.spd, _pe.dir);
  13. }
  14. }
  15. else
  16. {
  17. var _struct = particle_get_info(peBladeHitHazard);
  18. var _part_type = _struct.emitters[0].parttype.ind;
  19. var _dir = point_direction(0, 0, _info.kbFactorX, -abs(_info.kbFactorY));
  20. part_type_direction(_part_type, _dir - 45, _dir + 45, 0, 5);
  21. var _part = part_system_create_layer("Effect", false, peBladeHitHazard);
  22. part_system_position(_part, x, y);
  23. }
  24. flash_timer = 6;
  25. flash_duration = 6;
  26. hp -= _info.damage;
  27. hitstun_timer = hitstun_max;
  28. x_spd_kb = _info.kbFactorX * kb_factor;
  29. y_spd_kb = _info.kbFactorY * kb_factor;
  30. if hp <= 0
  31. {
  32. is_dead = true;
  33. enemy_death();
  34. }
  35. };
  36. x_spd = 0;
  37. y_spd = 0;
  38. facing_x = 1;
  39. facing_y = 1;
  40. credit = 0;
  41. has_ink = true;
  42. hp = 1;
  43. hitstun_timer = 0;
  44. hitstun_max = 10;
  45. kb_factor = 1.0;
  46. collision_hitbox = noone;
  47. is_dead = false;
  48. state = undefined;
  49. enemy_ai = function(){};
  50. death_callback = function(){};
  51. animation_spd = 0.25;
  52. image_speed = 0;
  53. hitbox = noone;
  54. // shader
  55. flash_timer = 0;
  56. flash_duration = 0;
  57. u_flash_alpha = shader_get_uniform(sh_flash, "f_alpha");