if (killed) exit; if (movetype == 0) scr_lerpvar("gunspin", 0, 360, 30, -1, "out"); with (obj_plat_hbx) { if (!hit_check(other.id)) exit; } if (hp == maxhp) { with (obj_plat_enm_yellow_punishmentgun) { talkcon = 3; event_user(10); } } hp -= 2; hit = 1; if (hp > 0) stun(); spawn_hit_petals(8, point_direction(other.x, other.y, x, y), 1); shake = 8; with (obj_plat_hbx) do_hbx_hit(-4, 0); with (instance_create_depth(x, y, depth + 1, obj_plat_vfx)) { sprite_index = spr_hit_vfx; image_speed = 1; } with (instance_create_depth(x, y, depth + 1, obj_plat_vfx)) { sprite_index = spr_smokepuff; image_speed = 2; } flash_hurt(16711935); if (hp <= 0) { killed = true; spawn_death_coins(); if (chargesound != -4) snd_stop(chargesound); exit; } var pitch = 0.6 + ((hp / maxhp) * 0.3); snd_play(snd_metal_hit_strong, 1, 1.1); snd_play(snd_playablebell, 0.3, pitch + 1); snd_play(snd_playablebell, 0.6, pitch); var fx_anchor_x = x - lengthdir_x(60, image_angle); var fx_anchor_y = y - lengthdir_y(60, image_angle); if (hp <= 0 || (image_index < 5 && hp <= next_phase_hp[image_index])) { if (hp <= 0) scr_plat_cool_zoom(); snd_play(snd_playablebell, 1, pitch + 2); snd_play(snd_playablebell, 0.6, pitch * 0.5); if (image_index < 5) image_index++; scr_make_ripple(fx_anchor_x, fx_anchor_y, 30, 65535, 200, 8, 24, depth + 1, undefined, undefined, undefined, undefined, undefined, 1, 2, true); scr_make_ripple(fx_anchor_x, fx_anchor_y, 60, 65535, 400, 8, 16, depth + 1, undefined, undefined, undefined, undefined, undefined, 1, 2, true); chunks_particle_system.depth = depth + 2; chunks_particle_system.shader2_greyscale_fade = hp / maxhp; repeat (6) { chunks_particle_system.x = x + random_range(-40, 40); chunks_particle_system.y = y + random_range(-40, 40); chunks_particle_struct.image_index = choose(1, 2); var spd = random_range(16, 18); var dir = random_range(135, 405); chunks_particle_struct.hspeed = lengthdir_x(spd, dir); chunks_particle_struct.vspeed = lengthdir_y(spd, dir); chunks_particle_system.emit(chunks_particle_struct); } if (phase < 5) { phase++; scr_plat_hitstop_global(6); snd_play(snd_ultraswing); on_phase_change(phase); } }