Create_0.gml 1.1 KB

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