event_inherited(); if (global.pause_plat) { scr_pause_alarms(); exit; } if (!can_attack) exit; if (!init && scr_onscreen(self)) init = true; if (init) { if (scr_onscreen_tolerance(self, -140)) despawn_timer++; else despawn_timer = min(despawn_timer, 5340); if (despawn_timer >= 5400 && con != 999) { hp = 999; hit = 0; con = 999; with (obj_dw_fcastle_yellow_miniboss) scr_script_delayed(pattern_expire, 80); with (__spawner) instance_destroy(); snd_play(snd_spearappear_choppy); clear_targets(); hspeed = 0; vspeed = 0; paused_spd = 0; auraalph = 0; flash_hurt(16777215); with (scr_afterimage_monochrome(16777215, 1)) { image_alpha = 0.3; scr_lerpvar("image_xscale", image_xscale, image_xscale + 0.5, 15, 1, "out"); scr_lerpvar("image_yscale", image_yscale, image_yscale + 0.5, 15, 1, "out"); } scr_lerpvar("image_alpha", image_alpha, 0, 30); scr_delay_var("y", y - 10000, 80); scr_doom(self, 80); exit; } } if (con != 99 && collision_circle(x, y, 20 * image_xscale, obj_plat_hbx, false, true) && hp < 990) { with (obj_plat_hbx) { if (!hit_check(other.id)) exit; } hp--; if (remaining_combo > 0) hp--; hit = 1; shake = 4; if (con == 0) on_flower_ruined(); with (obj_plat_hbx) { do_hbx_hit(-4, 0); with (other) spawn_hit_petals(3, point_direction(other.x, other.y, x, y), 1); } with (instance_create_depth(x, y, depth + 1, obj_plat_vfx)) { sprite_index = spr_hit_vfx; image_speed = 1; depth = other.depth - 1; } with (instance_create_depth(x, y, depth + 1, obj_plat_vfx)) { sprite_index = spr_smokepuff; image_speed = 2; depth = other.depth - 1; } if (remaining_combo > 0) { shake = 12; snd_play(snd_punchheavythunder, 0.6, 1.3); flash_hurt(); } if (remaining_combo > 0) { remaining_combo--; snd_play(snd_metalhit, 1, 2 - (remaining_combo / remaining_combo_max)); if (remaining_combo == 0) { scr_plat_cool_zoom(); con = 6; snd_play(snd_glove_launch); direction = image_angle + 180; speed = 6; contimer = 0; } } if (hp <= 0) { instance_destroy(); exit; } if (con == 6) { if (turnstun <= -2) event_user(9); } } if (hit > 0) exit; if (shaketimer > 0) { shake = 5; shaketimer--; hspeed = 0; vspeed = 0; paused_spd = 0; if (shaketimer <= 0) shake = 0; if ((shaketimer % 2) == 1) scr_plat_create_stunspark(); exit; } else { contimer += 1; } buff_timer++; if (con == 0) { if (y >= ystart) { vspeed = choose(-4, -6); image_angle = -choose(40, 45, 50); if (x > (xstart + 200)) hspeed = -abs(hspeed); else if (x < (xstart - 200)) hspeed = abs(hspeed); repeat (2) { var note = instance_create(x + random_range(-100, 100), y - random_range(80, 40), obj_marker); with (note) { depth = other.depth - 1; sprite_index = spr_musical_notes; scr_lerpvar("image_alpha", 1, 0, 16); } } } vspeed += 0.5; } else if (con == 1) { auraalph = scr_approach(auraalph, 1, 0.1); var xx = 0; var yy = 0; with (obj_genmarker) { if (extflag == ("guntop" + string(other.position_index + 1))) { xx = x; yy = y; } } x = lerp(x, xx, contimer / 35); y = lerp(y, yy, contimer / 35); if (contimer >= 35 && contimer <= 65) { if (contimer == 35) { snd_play(snd_angry_train_whistle); with (obj_plat_cam_clampzone) { if (y == 200) y = -200; } with (instance_create(0, 0, obj_plat_cam_clampzone)) { other.my_camzone = id; image_xscale = 100; image_yscale = 100; with (obj_plat_camera) { other.ymin = y - 240; other.ymax = y - 240; } } } if ((contimer % 2) == 0) { if ((contimer % 4) == 2) image_angle -= 5; else image_angle += 5; } var ang = random_range(-35, 35); xx = x + lengthdir_x(60, ang + 90); yy = y + lengthdir_y(20, ang + 90); with (instance_create(xx, yy, obj_animation)) { sprite_index = spr_yellow_gun_angry_steam; scr_darksize(); depth = other.depth - 1; image_speed = 0.25; image_angle = ang; direction = ang + 90; speed = random_range(1, 3); } } if (contimer >= 85) { con = 2; last_psi = position_index; image_angle += 360; contimer = 0; attackvolley = 0; } } else if (con == 2) { if (contimer == 1) { targetlist = []; attackvolley++; if (attackvolley >= 6) { con = 3; contimer = 0; attackvolley = 0; } } if (contimer >= 15) { if (array_length(targetlist) > 0) { var target = targetlist[0]; image_angle = lerp(image_angle, point_direction(x, y, target.x, target.y), 0.4); if ((contimer % 10) == 0) { spawn_cakesmoke(3); snd_play(snd_whack_absurdlyloud, 0.2, 0.75); with (target) instance_destroy(); array_delete(targetlist, 0, 1); var ang = image_angle; var xx = x + lengthdir_x(88, ang); var yy = y + lengthdir_y(88, ang); var bul = instance_create(xx, yy, obj_plat_bulletred); with (bul) { do_contact_kill = function() { with (scr_plat_vfx(3607)) { die_animend = 1; depth -= 1; } }; image_blend = c_red; sprite_index = spr_bullet_yellow_1; direction = ang; image_xscale = 1; image_yscale = 1; scr_lerpvar("image_xscale", 1, 3, 4); scr_lerpvar("image_yscale", 1, 4, 4); scr_delay_var("depth", depth, 4); scr_delay_var("damage", 60, 4); depth = other.depth + 20; damage = 0; speed = 12; image_angle = direction; } } } else { contimer = 0; } } else if (contimer > 0) { if (array_length(targetlist) < 3 && (contimer % 4) == 0) { snd_play(snd_bombfall); var xx = obj_plat_player.x + random_range(-90 + (10 * obj_plat_player.hspeed), 90 + (10 * obj_plat_player.hspeed)); var yy = random_range(other.y + 180, other.y + 320); var targ = instance_create(xx, yy, obj_marker_fancy); with (targ) { idx = array_length(other.targetlist); sprite_index = spr_baseball_reticle; depth = 2000; scr_darksize(); image_alpha = 0.5; step_func = function() { image_alpha = 0.65 + (sin((0.03 * current_time) + (idx * 0.15)) * 0.1); }; } array_push(targetlist, targ); } } } else if (con == 3) { if (contimer == 1) targetlist = []; if (contimer >= 30) { if (array_length(targetlist) > 0) { var target = targetlist[0]; image_angle = lerp(image_angle, point_direction(x, y, target.x, target.y), 0.8); if ((contimer % 5) == 0) { spawn_cakesmoke(3); snd_play(snd_whack_absurdlyloud, 0.2, 0.75); with (target) instance_destroy(); array_delete(targetlist, 0, 1); var ang = image_angle; var xx = x + lengthdir_x(88, ang); var yy = y + lengthdir_y(88, ang); var bul = instance_create(xx, yy, obj_plat_bulletred); with (bul) { do_contact_kill = function() { with (scr_plat_vfx(3607)) { die_animend = 1; depth -= 1; } }; image_blend = c_red; sprite_index = spr_bullet_yellow_1; direction = ang; image_xscale = 1; image_yscale = 1; scr_lerpvar("image_xscale", 1, 3, 4); scr_lerpvar("image_yscale", 1, 4, 4); scr_delay_var("depth", depth, 4); scr_delay_var("damage", 60, 4); depth = other.depth + 20; damage = 0; speed = 12; image_angle = direction; } } } else if (contimer >= 80) { contimer = 0; con = 4; } } else if (contimer > 0) { var dir = (position_index == 1) ? 1 : -1; image_angle = lerp(image_angle, 270 + (55 * dir), 0.3); if (array_length(targetlist) < 8 && (contimer % 2) == 0) { snd_play(snd_bombfall, 1, 1.3); var xx = 0; xx = (camerax() + (0.5 * camerawidth()) + (320 * dir)) - (dir * (-40 + (40 * contimer) + random_range(-10, 10))); var yy = random_range(other.y + 180, other.y + 320); var targ = instance_create(xx, yy, obj_marker_fancy); with (targ) { idx = array_length(other.targetlist); sprite_index = spr_baseball_reticle; depth = 2000; scr_darksize(); image_alpha = 0.5; step_func = function() { image_alpha = 0.65 + (sin((0.03 * current_time) + (idx * 0.15)) * 0.1); }; } array_push(targetlist, targ); } } } else if (con == 4) { if (simple) { con = 2; contimer = 0; } else { if (contimer == 1) scr_lerpvar("auraalph", 1, 0, 30); var can_sweat = (contimer % 20) == 0; with (obj_plat_follower) { if (is_platform_mode > 0) { other.contimer--; can_sweat = false; } } if (can_sweat) { with (instance_create(x + random_range(-100, 100), y + random_range(-30, 30), obj_marker)) { sprite_index = spr_yellow_miniboss_sweat; scr_darksize(); depth = other.depth - 1; vspeed = 2; friction = 0.1; scr_lerpvar("image_alpha", 1, 0, 30, 1, "out"); scr_doom(self, 30); } } if (contimer == 180) { con = 2; contimer = 0; scr_lerpvar("auraalph", 0, 1, 30); } } } else if (con == 5) { if (contimer == 1) { vspeed = 12; remaining_combo = remaining_combo_max; target_angle = image_angle; } vspeed = scr_approach(vspeed, 0, 0.6); } else if (con == 6) { var time = 150; stored_speed = speed; turnstun--; var maxspeed = 32; if (contimer > (time - 60)) maxspeed = lerp(32, 0, clamp01((contimer - (time - 60)) / 60)); if (turnstun > 0) speed = 0; else speed = scr_approach(speed, maxspeed, 3); if (turnstun <= -2) { event_user(9); if (turnstun == 2) contimer = time; } if ((target_angle % 360) != (image_angle % 360) && con != 7) { var diff = angle_difference(target_angle, image_angle); var maximum = clamp(abs(diff * 0.5), 5, 90); image_angle += clamp(diff, -maximum, maximum); } if ((contimer % 4) == 0) spawn_cakesmoke(4); if (contimer >= time) { con = 7; speed = 0; last_psi = position_index; position_index = (position_index + 1) % 2; contimer = 0; } } else if (con == 7) { if (contimer == 1) { snd_play(snd_grab); shake = 6; with (obj_plat_follower) drop_off_platform_mode(true); } if (contimer == 10) { var xx = 0; var yy = 0; with (obj_genmarker) { if (extflag == ("gunside" + string(other.position_index + 1))) { xx = x; yy = y; } } scr_lerpvar("image_angle", image_angle, 0, 20); scr_lerpvar("x", x, x + (600 * ((other.last_psi == 1) ? 1 : -1)), 22); scr_lerpvar("y", y, y + 60, 22); scr_delay_var("x", xx, 25); scr_delay_var("y", yy, 25); if (xx > x) scr_delay_var("image_xscale", -2, 25); else scr_delay_var("image_xscale", 2, 25); } if (contimer == 33) { var xx = 0; var yy = 0; with (obj_plat_camera) scr_pan_lerp(clamp(obj_plat_player.x, min_x, max_x) - 320, y - 240, 20); if ((last_psi % 2) == 0) { with (obj_plat_barrier) scr_lerpvar("leftlerp", 0, 1, 20); } else { with (obj_plat_barrier) scr_lerpvar("rightlerp", 0, 1, 20); } } if (contimer >= 33 && i_ex(obj_panner)) { with (obj_panner) finalx = clamp(obj_plat_player.x, obj_plat_camera.min_x, obj_plat_camera.max_x) - 320; } if (contimer >= 35) { contimer = 0; con = 8; hp = min(hp, 20); } } else if (con == 8) { if (instance_exists(obj_panner)) { with (obj_panner) finalx = clamp(obj_plat_player.x, obj_plat_camera.min_x, obj_plat_camera.max_x) - 320; } else { with (obj_plat_camera) cutscene = 0; } var interval = 45; if (difficulty == 0) interval = 45; if ((contimer % interval) == 1) { spawn_cakesmoke(3); var xx = x + (lengthdir_x(88, image_angle) * image_xscale * 0.5); var yy = y + lengthdir_y(88, image_angle); var bul = instance_create(xx, yy, obj_plat_bulletred_ring); with (bul) { image_angle = 180 - (90 * sign(other.image_xscale)); image_xscale = 1; image_yscale = 2; scr_lerpvar("image_xscale", image_xscale, 2.5, 16, -1, "out"); direction = 90 - (90 * sign(other.image_xscale)); speed = 8; damage = 0; scr_delay_var("original_damage", 60, 5); image_speed = 0; scr_doom(self, 200); var go_low = (other.contimer % (interval * 2)) == 1; y = scr_lerpvar("y", y, (y - 30) + (60 * go_low), 10, 2, "out"); } } with (obj_plat_camera) { if ((other.last_psi == 1 && x == max_x) || (other.last_psi != 1 && x == min_x)) { other.con = 1; other.contimer = 0; cutscene = 1; other.difficulty++; other.image_xscale = 2; with (obj_plat_barrier) { scr_lerpvar("leftlerp", leftlerp, 0, 25, 1, "out"); scr_lerpvar("rightlerp", rightlerp, 0, 25, 1, "out"); } } } } if (con == 99) { shake = 4; if (contimer == 30) { con = 100; contimer = 0; image_index = 2; snd_play(snd_badexplosion); var m = instance_create(x + lengthdir_x(90, image_angle), y + lengthdir_y(90, image_angle), obj_animation); m.sprite_index = spr_realisticexplosion; m.depth = other.depth - 1; with (m) scr_darksize(); } } else if (con == 100) { if (contimer == 60) { hp = 0; hit = 1; instance_destroy(); } } if (simple) { var glove = collision_circle(x + lengthdir_x(80, image_angle), y + lengthdir_y(80, image_angle), 8, obj_plat_enm_smallglove, false, true); if (glove != -4) { var ang = abs(angle_difference(image_angle, glove.image_angle)); scr_debug_print(string(ang)); if (ang > 150 && ang < 210) { con = 99; contimer = 0; with (glove) instance_destroy(); } } }