if (drown) { visible = 0; speed = 0; exit; } t++; shake = max(0, shake - 1); shake_angle = scr_wrap(shake_angle + 80 + irandom(40), 0, 360); var _mainchara = -4; var impact = false; if (instance_exists(obj_mainchara_dash)) { _mainchara = 1660; impact = _mainchara.impacted; stopping = obj_mainchara_dash.stopping; } if (!impact) scr_depth_alt(); if (wraparound) { if (x > (room_width + (sprite_width / 2))) { x -= (room_width + (sprite_width / 2)); x = 0; } if (x < (-sprite_width / 2)) x += (room_width + (sprite_width / 2)); } if (impact) { if (bonkstate == 0) { if ((image_xscale < 0 && x <= bonk_x) || (image_xscale > 0 && x >= bonk_x)) { shake = 10; if (name == "susie") { sprite_index = spr_susie_dw_jump_ball; if (instance_exists(obj_mainchara_dash)) depth = obj_mainchara_dash.depth + 400; } else { sprite_index = spr_ralsei_jump_ball; if (scr_flag_get(1311) == 1) sprite_index = spr_ralsei_jump_ball_hat; } image_speed = 0.25; hspeed = -image_xscale * 3; vspeed = 1; if (name == "susie") vspeed = -1; jumping = 1; jumpspd = bonkheight; jumpgravity = 1.25; bonkstate = 1; snd_play_pitch(snd_cymbal, 1.2); snd_play(snd_punchmed); with (instance_create(x + (20 * image_xscale), y, obj_plat_vfx)) { sprite_index = spr_smack_vfx; alarm[0] = 2; image_angle = 90 * irandom(3); } } } } if (!impacted && !impact) { if ((t % 2) == 0 && (make_afterimages || jumping)) { afterimage = scr_afterimage_monochrome(afterimagecolor, true); with (afterimage) { y = other.y - other.jumppos; image_alpha = 0.25; fadeSpeed = 0.04; scr_depth_alt(); depth += 1000; } } if (instance_exists(_mainchara)) { if (_mainchara.hitstop <= 0) { var _xgoal = _mainchara.x - (followdist * image_xscale); var _ygoal = _mainchara.y + followy; var _distx = abs(x - _xgoal); var _disty = abs(y - _ygoal); y = scr_approach(y, _ygoal, _disty * yadjust); move_towards_point(_xgoal, y, _distx * 0.3); } else { hspeed = 0; vspeed = 0; } } if (!jumping) sprite_index = spr_run; else if (jumpspd >= 0) sprite_index = spr_jump; else sprite_index = spr_fall; } if (stopping) { speed *= 0.5; sprite_index = spr_stop; image_index = 0; if (!jumping && abs(hspeed) > 0 && (t % 2) == 0) { with (scr_vfx_above(5966)) { depth = other.depth + 2; y = other.bbox_bottom; image_xscale = other.image_xscale; } } } if (impact) scr_depth(self); var _can_drown = 1; if (jumping) { _can_drown = 0; jumppos += jumpspd; jumpspd -= jumpgravity; if (jumppos <= 0) { jumppos = 0; jumping = 0; if (impact) { if (bounces > 0) { _can_drown = 1; bounces--; jumping = 1; jumpspd = bonkheight; hspeed *= 0.75; snd_play_pitch(snd_punchmed, 0.9); shake = 4; sprite_index = spr_kris_plat_slash_airland; image_index = 0; image_speed = 0; } else { hspeed = 0; vspeed = 0; x -= 24; y -= 46; if (image_xscale < 0) x -= sprite_width; if (name == "susie") { sprite_index = spr_susie_dw_landed; image_index = 0; } else if (global.flag[1311] == 1) { sprite_index = spr_ralsei_getup_hat; } else { sprite_index = spr_ralsei_kneel_serious; } } } } } if (!instance_place(x, y, obj_solidblock)) { last_openX = x; last_openY = y; } spawn_water_splash = false; if (_can_drown && collision_line(x, bbox_bottom - 6, x, bbox_bottom, obj_waterpit, 0, 0) && !drown) { var pit = instance_place(x, y + 6, obj_waterpit); if (pit.dash_across && !impacted) { spawn_water_splash = pit.ripple_palette + 1; if ((current_time % 10) == 0) { } } else { audio_stop_sound(snd_punchmed); snd_play(snd_splash); drown = 1; with (scr_vfx_above(7962)) die_animend = 1; visible = 0; with (obj_plat_dashlines) owner = -4; alarm[0] = 20; alarm[1] = 40; exit; } } if (instance_place(x, y - abs(vspeed) - 2, obj_solidblock) && vspeed <= 0) vspeed = 0; if (instance_place(x, y + abs(vspeed) + 4, obj_solidblock) && vspeed >= 0) vspeed = 0;