| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- get_hit = function(_info)
- {
- if has_ink
- {
- player_add_INK(1);
-
- var _dir = point_direction(0, 0, _info.kbFactorX, -abs(_info.kbFactorY));
- repeat(6)
- {
- var _pe = icl(oHitEnemyEffect);
- _pe.dir = random_range(_dir - 45, _dir + 45);
- _pe.x_spd = lengthdir_x(_pe.spd, _pe.dir);
- _pe.y_spd = lengthdir_y(_pe.spd, _pe.dir);
- }
- }
- else
- {
- var _struct = particle_get_info(peBladeHitHazard);
- var _part_type = _struct.emitters[0].parttype.ind;
- var _dir = point_direction(0, 0, _info.kbFactorX, -abs(_info.kbFactorY));
- part_type_direction(_part_type, _dir - 45, _dir + 45, 0, 5);
-
- var _part = part_system_create_layer("Effect", false, peBladeHitHazard);
- part_system_position(_part, x, y);
- }
-
- flash_timer = 6;
- flash_duration = 6;
-
- hp -= _info.damage;
-
- hitstun_timer = hitstun_max;
- x_spd_kb = _info.kbFactorX * kb_factor;
- y_spd_kb = _info.kbFactorY * kb_factor;
- if hp <= 0
- {
- is_dead = true;
- enemy_death();
- }
- };
- x_spd = 0;
- y_spd = 0;
- facing_x = 1;
- facing_y = 1;
- credit = 0;
- has_ink = true;
- hp = 1;
- hitstun_timer = 0;
- hitstun_max = 10;
- kb_factor = 1.0;
- collision_hitbox = noone;
- is_dead = false;
- state = undefined;
- enemy_ai = function(){};
- death_callback = function(){};
- animation_spd = 0.25;
- image_speed = 0;
- hitbox = noone;
- // shader
- flash_timer = 0;
- flash_duration = 0;
- u_flash_alpha = shader_get_uniform(sh_flash, "f_alpha");
|