event_inherited(); if (global.pause_plat) { scr_pause_alarms(); exit; } if (killed) { su_act.blocked = killed; phase = 999; orbsize = scr_approach(orbsize, 0, 0.1); exit; } if (!can_attack) exit; if (!init && scr_onscreen(self)) init = true; if (is_stunned) { if (stun_timer < (stun_duration - 10)) y = scr_approach(y, ystart + 176, 10); else y = scr_approach(y, ystart + 100, 10); } if (!killed && collision_circle(x, y, 20 * image_xscale, obj_plat_hbx, false, true)) { 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--; hit = 1; shake = 4; var fx_anchor_x = x - lengthdir_x(60, image_angle); var fx_anchor_y = y - lengthdir_y(60, image_angle); var pitch = 0.6 + ((hp / maxhp) * 0.3); with (obj_plat_hbx) { snd_play(snd_metal_hit_strong, 1, 1.1); snd_play(snd_playablebell, 0.3, pitch + 1); snd_play(snd_playablebell, 0.6, pitch); do_hbx_hit(-4, 0); } with (instance_create_depth(x, y, depth - 1, obj_plat_vfx)) { sprite_index = spr_hit_vfx; image_speed = 1; } var dir = 90 - (90 * sign(obj_plat_player.image_xscale)); if (movetype == 0) hit_angle_speed = 6 * sign(obj_plat_player.image_xscale); var hitamt = 5; if (hp <= 0 || (image_index < 5 && hp <= next_phase_hp[image_index])) hitamt = 12; repeat (hitamt) { sparks_particle_system.x = fx_anchor_x; sparks_particle_system.y = fx_anchor_y; sparks_particle_system.depth = depth + 2; var speedval = (random_range(1, 1.5) * hitamt) + 4; var dirval = random_range(135, 405); sparks_particle_struct.hspeed = lengthdir_x(speedval, dirval); sparks_particle_struct.vspeed = lengthdir_y(speedval, dirval); sparks_particle_struct.image_blend = merge_color(c_black, merge_color(c_orange, c_yellow, random_range(0, 1)), 0.5); var scale = random_range(1, 2); sparks_particle_struct.image_xscale = scale; sparks_particle_struct.image_yscale = scale; sparks_particle_system.emit(sparks_particle_struct); } if (hp <= 0 || (image_index < 5 && hp <= next_phase_hp[image_index])) { if (image_index < 5) image_index++; shake = 20; stun_timer = max(stun_timer, stun_duration - 11); scr_plat_hitstop_global(8); snd_stop(snd_punchmed); snd_play(snd_whack_absurdlyloud, 0.25, 1); snd_play(snd_ultraswing, 1, 2); snd_play(snd_playablebell, 1, pitch + 2); snd_play(snd_playablebell, 0.6, pitch * 0.5); with (instance_create(lerp(x, obj_plat_player.x, 0.5), lerp(y, obj_plat_player.y, 0.5), obj_vfx_parry)) { image_angle = 45; image_blend = c_white; } 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); 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); } hit_angle_speed *= 2; if (phase < 5) { phase++; on_phase_change(phase); } } else { scr_plat_hitstop_global(4); scr_make_ripple(fx_anchor_x, fx_anchor_y, 30, 65535, 150, 8, 16, depth + 1, undefined, undefined, undefined, undefined, undefined, 1, 2, true); } if (hp <= 0) { stun_timer = max(stun_timer, stun_duration - 11); killed = true; spawn_death_coins(); scr_plat_cool_zoom(); if (chargesound != -4) snd_stop(chargesound); exit; } } var last_fx_timer = floor(fx_timer); fx_timer += (charge_fx_speed * 0.2); if (floor(fx_timer) > last_fx_timer) spawn_charge_effects(); hit_angle_speed = scr_approach(hit_angle_speed, 0, abs(0.2 * hit_angle_speed) + 0.1); hit_angle_offset += hit_angle_speed; hit_angle_offset = scr_approach(hit_angle_offset, 0, clamp(2 - abs(hit_angle_speed), 0, 2)); if (hit > 0) exit; charge_fx_speed = (0.065 * (phase * phase)) + 0.2; if (con == 0) { if (chargesound == -4) { chargesound = snd_loop(snd_chargeshot_charge); snd_volume(chargesound, 0.15, 0); snd_pitch(chargesound, 0.2); } else { snd_volume(chargesound, lerp(0.15, 0.5, charge_seconds / charge_maxseconds), 0); snd_pitch(chargesound, lerp(0.2, 1.2, ease_in_quad(charge_seconds / charge_maxseconds, 0, 1, 1))); } orbsize = (charge_seconds / charge_maxseconds) * 2; var last_seconds = charge_seconds; charge_seconds += (1/30); if (floor(charge_seconds * 3.33333) > floor(last_seconds * 3.33333)) { var x_offset = 0; if (global.lang == "ja") x_offset = 30; var meter_bar_x = camerax() + 60 + 62 + x_offset; var meter_bar_y = cameray() + 30 + 2; with (obj_plat_punishmentgun_ui) { with (instance_create(meter_bar_x, meter_bar_y, obj_marker)) { sprite_index = spr_pxwhite; hspeed = 2; depth = other.depth - 1; image_blend = c_yellow; image_xscale = 2; image_yscale = 18; scr_lerpvar("image_xscale", image_xscale, 40, 30).respect_plat_pause = false; scr_lerpvar("image_alpha", 1, 0, 28).respect_plat_pause = false; scr_doom(self, 30).respects_platmode = false; } } } if (talkcon < 1 && charge_seconds >= 6) { talkcon = 1; event_user(10); } if (talkcon < 2 && charge_seconds >= 12) { talkcon = 2; event_user(10); } auraalph = ((charge_seconds / charge_maxseconds) - 0.5) * 2; if (charge_seconds >= charge_maxseconds) { con = 1; contimer = 0; } if (phase < 5 && charge_seconds > (charge_maxseconds - 10)) { phase = 5; on_phase_change(phase); } } contimer++; if (phase == 5) shake = max(shake, 2); if (con == 1) { orbsize = scr_approach(orbsize, 0, 0.2); x = lerp(x, xstart, 0.1); with (obj_dw_fcastle_yellow_combat) gun_moves = false; laser_width = contimer / 30; if (contimer == 10) { snd_play(snd_rocket); scr_lerpcol("image_blend", 16777215, 255, 20); var xx = x; var yy = y + (56 * image_yscale); var xmove = x - xstart; with (obj_plat_player) act_enabled = false; with (instance_create(xx, yy, obj_marker)) { depth = other.depth - 100; sprite_index = spr_vfx_parry_ring; image_xscale = 2; image_yscale = 2; image_alpha = 0; image_blend = c_yellow; image_angle = random_range(0, 360); scr_lerpvar("image_xscale", image_xscale, 0, 20, 1, "in"); scr_lerpvar("image_yscale", image_yscale, 0, 20, 1, "in"); scr_lerpvar("image_alpha", 0, 1, 20); scr_doom(self, 20); } } if (contimer == 30) { if (chargesound != -4) snd_stop(chargesound); laser_timer = 1; scr_lerpvar("y", y, y - 100, 1, "out"); with (obj_plat_camera) shakey = 24; with (instance_create(0, 0, obj_marker)) { sprite_index = spr_pxwhite; image_xscale = room_width; image_yscale = room_height; scr_doom(self, 24); image_alpha = 0.2; scr_lerpvar("image_alpha", image_alpha, 0, 24); } snd_play(snd_punchheavythunder); snd_play(snd_whack_absurdlyloud, 0.2, 0.4); con = 2; with (obj_slashpusher) { if (draw_yellow) yellow_index = 6; } } } if (con == 0) { if (instance_exists(obj_plat_playerheart)) { if (!player_hurt && obj_plat_playerheart.hurt) { hurt_counter++; if (hurt_counter == 1) { talkcon = 20; event_user(10); } if (hurt_counter == 5) { talkcon = 21; event_user(10); } if (hurt_counter == 10) { with (obj_dw_fcastle_yellow_combat) hurt_too_much(); con = 3; } } player_hurt = obj_plat_playerheart.hurt; } } if (con == 0 || (con == 1 && contimer < 10)) { for (var i = 0; i < array_length(orbs); i++) { if (instance_exists(orbs[i])) { orbs[i].x += x - lastx; orbs[i].y += y - lasty; } } lastx = x; lasty = y; if ((contimer % floor(20 - (16 * (charge_seconds / charge_maxseconds)))) == 0) { var ang = random_range(image_angle - 45, image_angle + 45); var cx = x + lengthdir_x(46 * image_xscale, image_angle); var cy = y + lengthdir_y(46 * image_xscale, image_angle); var xx = cx + lengthdir_x(110, ang); var yy = cy - lengthdir_y(110, ang); var col = merge_color(c_orange, c_red, charge_fx_speed * 0.3); with (instance_create(xx, yy, obj_animation)) { image_blend = col; depth = other.depth + 2; scr_darksize(); image_angle = point_direction(x, y, cx, cy); sprite_index = spr_plat_impact_splash; array_push(other.orbs, self); } } } if (laser_timer > 0 && con == 2) { laser_timer++; laser_width = max(0, 1 - (laser_timer * laser_timer * 0.002)); if (global.hp[global.char[0]] > 0) { global.tempflag[57] = 1; global.inv = 0; global.hp[global.char[0]] = 99; global.hp[global.char[1]] = 99; global.hp[global.char[2]] = 99; with (obj_plat_player) get_hurt(0, 0, 0, 999); global.hp[global.char[0]] = 0; global.hp[global.char[1]] = 0; global.hp[global.char[2]] = 0; with (obj_dmgwriter) damage = 999; with (obj_plat_player) { visible = 0; gravity = 0; entity_gravity = 0; vspeed = 0; hspeed = 0; with (instance_create(x, y, obj_marker)) { sprite_index = spr_kris_plat_hurt_air; gravity = 1.25; hspeed = 18; image_yscale = 2; image_xscale = -2; if (x < (camerax() + 320)) { hspeed = -18; image_xscale = 2; } vspeed = -26; } } with (obj_plat_playerheart) visible = 0; with (obj_plat_follower) { visible = 0; with (instance_create(x, y, obj_marker)) { if (other.name == "ralsei") { vspeed = -29; sprite_index = spr_ralsei_hurt; } else { sprite_index = spr_susie_shock; vspeed = -22; } image_yscale = 2; gravity = 1.25; hspeed = 20; image_xscale = -2; if (x < (camerax() + 320)) { hspeed = -20; image_xscale = 2; } } } scr_plat_cool_zoom(); global.interact = 1; } if (laser_timer >= 90) { laser_timer = 0; con = 99; with (obj_dw_fcastle_yellow_combat) lose(); } } su_act.newx = x - lengthdir_x(80, image_angle); su_act.newy = y - lengthdir_y(80, image_angle);