var cam = scr_getcam(); if (handoff == 0) { handoff = 1; snd_free_all(); var camx = 220; if (instance_exists(obj_ch5_LW20W)) { var no = -4; with (obj_actor) { if (name == "noelle") no = id; } actor = scr_marker_frominstance(no); with (obj_actor) visible = false; with (obj_ch5_LW20W) { _shadow_kris.visible = false; _shadow_noelle.visible = false; } with (obj_stickto) instance_destroy(); } else { with (obj_mainchara) cutscene = true; global.interact = 1; actor = scr_marker_ext(370, 98, spr_kris_noelle_beach_walk_silo, 1, 1, 0, undefined, c_white, 98560); } with (actor) { camxoff = x - camx; camera_setxy(round(x - camxoff)); } with (obj_ch5_LW20W_blur) instance_destroy(); } with (bgwhite) x = cam.x - 5; with (failwhite) x = cam.x - 5; var _prog = wprog(22, 23) * 0.5; if (textind > 23) _prog = (wprog(23, 28) * 0.5) + 0.5; if (textind > 28) _prog = 1 - wprog(28, 44); c_border = merge_color(c_white, c_red, _prog); _prog = wprog(28, 44); c_inner = merge_color(c_black, c_white, _prog); highlightCol = merge_color(c_yellow, c_white, _prog); _prog = wprog(44, 70) * 0.9; heartCol = merge_color(c_red, c_white, _prog); _prog = wprog(19, 28); with (bgwhite) image_alpha = lerp(image_alpha, _prog, 1/120); var failprog = 0; if (textind >= drownindex && !failed) { faillimit = 450; if (textind > 22) faillimit = lerp(150, 30, wprog(23, 40)); if (textind == 35 || textind == 29 || textind == 24 || textind == 17 || textind == 15) faillimit += 45; var canfail = false; if (instance_exists(obj_writer)) canfail = true; if (i_ex(obj_choicer_neo)) canfail = true; if (canfail == true) { failtimer++; if (failtimer >= faillimit && !failed) { k_d(); con = 99; timer = 0; failed = 1; } } else { failtimer = 0; } var prog = failtimer / (faillimit * 0.4); failprog = prog; with (failwhite) { if (!other.failed) { if (image_alpha < prog) image_alpha = lerp(image_alpha, prog, 1/30); else image_alpha = lerp(image_alpha, prog, 1/30); } } } _prog = wprog(14, 40); _prog = 0; var high = 1453; var low = 940; with (obj_ch5_LW20W_submerge) { if ((high - low) != 0) _prog = (x - low) / (high - low); } blurstrength = lerp(blurstrength, _prog, 0.016666666666666666); _prog = blurstrength; with (obj_ch5_LW20W_blur2) { if (_prog > 0) { ind = _prog; visible = true; baseblur = lerp_out_cubic(0, 3, _prog) + failprog; blurstrength = lerp(1, 2, _prog); } } if (musicstart) { var maxvol = 3; var notextpostdrown = 17; var horriblesound = 30; var basePitch = 0.4; var lowMod = 0.98; var higMod = 1.05; var targpitch = wprog(0, drownindex) * basePitch; if (bgm_submerge && textind < notextpostdrown) { _bgm_pitch = basePitch; targpitch = _bgm_pitch; } if (textind >= notextpostdrown && textind < horriblesound) { _bgm_pitch = basePitch * power(lowMod, textind - (notextpostdrown - 1)); targpitch = _bgm_pitch; } if (textind >= horriblesound) { var _lowest_pitch = basePitch * power(lowMod, horriblesound - 1 - (notextpostdrown - 1)); _bgm_pitch = _lowest_pitch * power(higMod, textind - (horriblesound - 1)); } _bgm_pitch = lerp(_bgm_pitch, targpitch, 0.025); var targvol = lerp(0, 0.2 * maxvol, scr_xprog(textind, 0, drownindex, true)); if (bgm_submerge) targvol = maxvol; if (textind >= (endind - 20)) targvol = lerp(maxvol, 0, scr_xprog(textind, endind - 19, endind, true)); if (failed) targvol = -1; _bgm_volume = lerp(_bgm_volume, targvol, 1/30); if (!failed && bgm_submerge == false) { if (obj_ch5_LW20W_submerge.submerged) { _bgm_volume = maxvol; _bgm_pitch = 0.4; bgm_submerge = true; } } audio_sound_pitch(_bgm_track[1], _bgm_pitch); audio_sound_gain(_bgm_track[1], _bgm_volume, 0); } var dampen = 1 - (wprog(20, endind) * 0.9); if (textind >= drownindex && con < 95 && !failed) { _prog = wprog(drownindex - 1, endind - 20); hurtsoundreset = round(lerp(60, 2, _prog)); var hurtsndvol = lerp(0.5, 1, wprog(drownindex - 1, 44)) * dampen; hurtsoundtimer++; if (textind >= 28) { var h2 = round(hurtsoundtimer + (hurtsoundreset / 2)); h2 = scr_wrap(h2, 0, hurtsoundreset); if (h2 == hurtsoundreset) { var hurtsndvol2 = lerp(0.3, 0.8, wprog(28, 44)) * dampen; hurtsound2 = snd_play(snd_hurt_muffled_2x, hurtsndvol2); } hurtsoundtimer2++; if ((hurtsoundtimer2 % 2) == 0) { low = lerp(0.9, 0.3, _prog); high = lerp(1, 1.2, _prog); snd_pitch(hurtsound2, random_range(low, high)); } } if (hurtsoundtimer >= hurtsoundreset) { scr_shakescreen(); hurtsoundtimer = 0; hurtsound = snd_play(snd_hurt_muffled_2x, hurtsndvol); } } if (staticinit == 0 && textind >= drownindex) { staticinit = 1; staticsnd = snd_loop(snd_static_loop); } if (staticinit == 1) { var maxpitch = lerp(0.7, 0.4, wprog(drownindex, endind)); var prog = failtimer / (faillimit * 0.4); var pitchtarg = lerp_out_cubic(0.2, 0.7, prog); var voltarg = lerp_out_quint(0, 0.7, prog); staticpitch = lerp(staticpitch, pitchtarg, 0.125); staticvol = lerp(staticvol, voltarg, 0.1); snd_volume(staticsnd, staticvol, 0); snd_pitch(staticsnd, staticpitch); } if (!failed) { var _shake = 0; if (textind >= 14) _shake = lerp(0.26, 3, scr_xprog(textind, 14, 34, true)); with (obj_writer) shake = _shake; } lowpitch = lerp(1, 0.8, scr_xprog(textind, 14, 34, true)); highpitch = lerp(1, 0.98, scr_xprog(textind, 14, 34, true)); with (obj_dialoguer) { c_border = other.c_border; c_inner = other.c_inner; } with (obj_writer_stay) { c_border = other.c_border; c_inner = other.c_inner; } with (obj_choicer_neo) { heartCol = other.heartCol; highlightCol = other.highlightCol; } if (actorhandoff == 0) { if (actor.sprite_index == spr_noelle_kris_pull_walk_water) { actor.image_alpha = 0; submergeactor.image_alpha = 1; actorhandoff = 1; } } with (obj_ch5_LW20W_submerge) { x = other.actor.x; y = other.actor.y; depth = other.actor.depth - 1; animindex = other.actor.image_index; }