function scr_rhythmgame_load_song(arg0 = 0, arg1 = true, arg2 = true, arg3 = false) { scr_debug_print("song loading"); if (song_loaded && !arg3) scr_rhythmgame_song_reset(); song_id = arg0; notetime[0] = 0; notespeed = 150; loop = false; signature = 4; signature_count = 1; signature_change = [0]; signature_time = [0]; bpm_time = [0]; bpm_change = [0]; signature_index = 0; scr_debug_print("trying to load"); if (arg0 == 0) { track1_id = "ch3_karaoke_no_guitar.ogg"; track2_id = "ch3_karaoke_full.ogg"; oneAtATime = true; dynamic_solo = true; bpm = 230; startoffset = 0; track_length = 174.26; notespacing = 60 / bpm; meter = notespacing * 4; if ((scr_debug() && arg3) || (v_ex("debugsong") && debugsong)) trackstart = scr_round_to_beat(14.5, bpm); else trackstart = 0; timestamp[0] = scr_round_to_beat(37.56, bpm, 1) - notespacing; timestamp[1] = scr_round_to_beat(58.43, bpm, 1) - notespacing; timestamp[2] = scr_round_to_beat(79.3, bpm, 1) - notespacing; timestamp[3] = scr_round_to_beat(100.17, bpm, 1) - notespacing; scr_debug_print("Loading main song"); } else if (arg0 == 1) { track1_id = "ch3-practice_song_noguit.ogg"; track2_id = "ch3-practice_song_combined.ogg"; oneAtATime = true; bpm = 75; startoffset = 0; track_length = 24; trackstart = 0; notespeed = 90; scr_debug_print("Loading practice song"); } else if (arg0 == 2) { track1_id = "tenna_battle.ogg"; track2_id = "tenna_battle_guitar.ogg"; scr_debug_print("Loading tenna_battle"); oneAtATime = false; track_length = 165.405; bpm = 148; notespeed = 120; notespacing = 60 / bpm; meter = notespacing * 4; if (i_ex(obj_rhythmgame)) { if (obj_rhythmgame.tenna_boss) loop = true; else trackstart = 0 - (meter * 1); } } else if (arg0 == 3) { track1_id = "ch3_tvtime.ogg"; track2_id = "ch3_tvtime_guitar.ogg"; scr_debug_print("Tutorial time!"); trackstart = 0; oneAtATime = true; track_length = 32.842; bpm = 190; loop = true; notespacing = 60 / bpm; meter = notespacing * 4; trackstart = 0 - meter; } else if (arg0 == 4) { track1_id = "board4_rhythm.ogg"; track2_id = "board4_rhythm.ogg"; scr_debug_print("Loading very good board 4 song"); trackstart = (room == room_dw_rhythm || arg3) ? 8 : 0; oneAtATime = true; track_length = 15.265; notespeed = 30; bpm = 60; } else if (arg0 == 5) { track1_id = "rudebuster_boss.ogg"; track2_id = "rudebuster_boss.ogg"; scr_debug_print("Time to get FUNKY"); trackstart = 0; oneAtATime = true; track_length = 143.384; bpm = 140; } else if (arg0 == 6) { track1_id = "battle_vapor.ogg"; track2_id = "battle_vapor.ogg"; scr_debug_print("Loading battle_vapor"); trackstart = 7; oneAtATime = true; bpm = 200; } else if (arg0 == 7) { track1_id = "tenna_battle_old.ogg"; track2_id = "tenna_battle_old.ogg"; scr_debug_print("Loading tenna_battle_old"); trackstart = 0; oneAtATime = true; track_length = 127.92; bpm = 148; notespeed = 120; } else if (arg0 == 8) { track1_id = "battle.ogg"; track2_id = "battle.ogg"; scr_debug_print("Loading Rude Buster"); trackstart = 0; oneAtATime = true; track_length = 75.428; bpm = 140; notespeed = 120; } else if (arg0 == 9) { track1_id = "field_of_hopes.ogg"; track2_id = "field_of_hopes.ogg"; scr_debug_print("Loading Field of Hopes and Dreams"); trackstart = 0; oneAtATime = true; track_length = 161.28; bpm = 125; notespeed = 120; } else if (arg0 == 10) { track1_id = "rhythm_knockdown_no_guit.ogg"; track2_id = "rhythm_knockdown_combined.ogg"; scr_debug_print("Loading Knock You Down!!"); bpm = 195; notespacing = 60 / bpm; meter = notespacing * 4; trackstart = scr_round_to_beat(-2 * (240 / bpm), bpm); oneAtATime = true; track_length = 137.846; notespeed = 120; } else if (arg0 == 11) { track1_id = "rhythm_3rd_sanctuary_noguit.ogg"; track2_id = "rhythm_3rd_sanctuary_guit.ogg"; scr_debug_print("Loading Third Sanctuary"); bpm = 170; notespeed = 60; trackstart = scr_round_to_beat(-(405 / bpm), bpm); oneAtATime = true; track_length = 129; notespeed = 120; signature = 9; scr_rhythmgame_add_time_signature(5.5, 12.7); } else if (arg0 == 12) { track1_id = "Flowerman_Arrangement.ogg"; track2_id = "Flowerman_Arrangement.ogg"; scr_debug_print("Loading Flower Man"); bpm = 160; oneAtATime = true; track_length = 192.024; notespeed = 120; signature = 4; } else if (arg0 == 13) { track1_id = "pumpkin_boss.ogg"; track2_id = "pumpkin_boss.ogg"; scr_debug_print("Loading A DARK ZOAN..."); bpm = 150; notespeed = 60; oneAtATime = true; track_length = 138; notespeed = 120; signature = 3; scr_rhythmgame_add_time_signature(4, 20.4); scr_rhythmgame_add_bpm(200, 20.4); } else if (arg0 == 15) { track1_id = "4rd_sanctuary_noguit.ogg"; track2_id = "4rd_sanctuary.ogg"; scr_debug_print("Loading 4rd Sanctuary"); bpm = 200; notespeed = 120; oneAtATime = true; track_length = 79.2; notespeed = 180; signature = 9; trackstart = scr_round_to_beat(-(405 / bpm), bpm); scr_rhythmgame_add_time_signature(7, 10.8); scr_rhythmgame_add_time_signature(4.5, 12.9); scr_rhythmgame_add_time_signature(7, 14.25); scr_rhythmgame_add_time_signature(4.5, 16.35); scr_rhythmgame_add_time_signature(7, 17.7); scr_rhythmgame_add_time_signature(4.5, 19.8); scr_rhythmgame_add_time_signature(7, 21.15); scr_rhythmgame_add_time_signature(5, 23.25); scr_rhythmgame_add_time_signature(5.5, 24.75); scr_rhythmgame_add_time_signature(5, 29.7); scr_rhythmgame_add_time_signature(5.5, 31.2); scr_rhythmgame_add_time_signature(6, 37.8); scr_rhythmgame_add_time_signature(4.5, 39.6); scr_rhythmgame_add_time_signature(6, 40.95); scr_rhythmgame_add_time_signature(5.5, 42.75); scr_rhythmgame_add_time_signature(6, 44.4); scr_rhythmgame_add_time_signature(5.5, 46.2); scr_rhythmgame_add_time_signature(6, 47.85); scr_rhythmgame_add_time_signature(5.5, 49.65); scr_rhythmgame_add_time_signature(6, 51.3); scr_rhythmgame_add_time_signature(5, 53.1); scr_rhythmgame_add_time_signature(6, 54.6); scr_rhythmgame_add_time_signature(5.5, 56.4); scr_rhythmgame_add_time_signature(6, 58.05); scr_rhythmgame_add_time_signature(4, 59.85); scr_rhythmgame_add_time_signature(9, 61.05); scr_rhythmgame_add_time_signature(8.5, 66.45); scr_rhythmgame_add_time_signature(19, 69); scr_rhythmgame_add_time_signature(9, 74.7); } if (arg3) { notespacing = 60 / bpm; meter = notespacing * signature; } else if (arg0 >= 0) { with (obj_rhythmgame_chart) { signature_time = other.signature_time; signature_change = other.signature_change; signature_count = other.signature_count; bpm_count = other.bpm_count; bpm_change = other.bpm_change; bpm_time = other.bpm_time; } scr_debug_print("loading da other stuff"); notespacing = 60 / bpm; meter = notespacing * signature; if (arg0 == 2 || arg0 == 10) speed_modifier = 1.5; scr_rhythmgame_notechart_lead(arg0); if (tutorial > 0) scr_rhythmgame_toggle_notes(false); musicm.bpm = bpm; musicm.beat_offset += bpm / 2; if (arg1) { with (drums) { scr_rhythmgame_notechart_drums(arg0); bpm = other.bpm; signature = other.signature; notespacing = other.notespacing; meter = other.meter; loop = other.loop; } } if (arg2) { with (vocals) { scr_rhythmgame_notechart_vocals(arg0); bpm = other.bpm; signature = other.signature; notespacing = other.notespacing; meter = other.meter; loop = other.loop; if (i_ex(obj_rhythmgame) && obj_rhythmgame.tenna_boss) { if (maxnote == 0 || chart_start > notetime[0] || (chart_start + (meter * 2)) < notetime[0]) performer.sprite_index = spr_ralsei_sing_clap; } } } scr_rhythmgame_load_events(arg0); } } function scr_rhythmgame_song_reset() { timestamp = []; timestamp[0] = 0; dynamic_solo = false; track1_id = 0; track2_id = 0; song_id = -1; oneAtATime = false; bpm = 230; notespacing = 60 / bpm; meter = notespacing * 4; } function scr_rhythmgame_song_select(arg0) { if (arg0 == 0) { song_id = 8; vinyl_id = 0; preview = "battle_preview.ogg"; alt_preview = "battle_preview_crisp.ogg"; local_preview = snd_songpreview_knockdown; chapter = 1; bpm = 140; } if (arg0 == 1) { song_id = 9; vinyl_id = 0; preview = "field_of_hopes_preview.ogg"; alt_preview = "field_of_hopes_preview_crisp.ogg"; local_preview = snd_songpreview_knockdown; chapter = 1; bpm = 125; } if (arg0 == 2) { song_id = 10; vinyl_id = 1; preview = "boxing_boss_preview.ogg"; alt_preview = "boxing_boss_preview_crisp.ogg"; local_preview = snd_songpreview_knockdown; chapter = 2; bpm = 195; } if (arg0 == 3) { song_id = 0; vinyl_id = 1; preview = "ch3_karaoke_preview.ogg"; alt_preview = "ch3_karaoke_preview_crisp.ogg"; local_preview = snd_songpreview_video; chapter = 3; bpm = 230; } if (arg0 == 4) { song_id = 2; vinyl_id = 1; preview = "tenna_battle_preview.ogg"; alt_preview = "tenna_battle_preview_crisp.ogg"; local_preview = snd_songpreview_tenna; chapter = 3; bpm = 148; } if (arg0 == 5) { song_id = 11; chapter = 4; bpm = 170; } if (arg0 == 6) { song_id = 13; chapter = 4; bpm = 150; } if (arg0 == 7) { song_id = 12; chapter = 5; bpm = 160; } if (arg0 == 9) { song_id = 15; chapter = 4; bpm = 200; local_preview = snd_songpreview_4rd; } } function scr_rhythmgame_song_select_id(arg0) { if (arg0 == 0) return 8; else if (arg0 == 1) return 9; else if (arg0 == 2) return 10; else if (arg0 == 3) return 0; else if (arg0 == 4) return 2; else if (arg0 == 5) return 11; else if (arg0 == 6) return 13; else if (arg0 == 7) return 12; else if (arg0 == 8) return 14; else if (arg0 == 9) return 15; } function scr_rhythmgame_rank_scores(arg0, arg1 = 0) { var _rank_scores = [14500, 18000, 22000, 25000, 28000]; if (arg0 == 2) _rank_scores = [33500, 37000, 41000, 44000, 47000]; if (arg0 == 10) _rank_scores = [32500, 36000, 40000, 43000, 45000]; if (arg0 == 11) _rank_scores = [28000, 32000, 36500, 38500, 41000]; if (arg0 == 15) _rank_scores = [15500, 18500, 21000, 22500, 24000]; if (arg1 > 0) { for (var i = 0; i < 5; i++) _rank_scores[i] = (_rank_scores[i] * 1.1) - 1200; } return _rank_scores; } function scr_rhythmgame_get_rank(arg0, arg1) { var _rank_scores = scr_rhythmgame_rank_scores(arg0); var _rank = 0; if (arg1 >= _rank_scores[4]) return 5; for (i = 0; i < 5; i++) { if (arg1 < _rank_scores[i]) { _rank = i; break; } } return _rank; } function scr_rhythmgame_add_time_signature(arg0, arg1, arg2 = true) { if (signature_count == 1 && arg1 != 0) { signature_change[0] = signature; signature_time[0] = 0; } signature_change[signature_count] = arg0; var _bpm_check = scr_rhythmgame_get_bpm(arg1); signature_time[signature_count] = scr_round_to_beat(arg1, _bpm_check, 4, signature_time[signature_count - 1]); signature_count++; if (arg2) { } } function scr_rhythmgame_add_bpm(arg0, arg1, arg2 = true) { if (bpm_count == 1 && arg1 != 0) { bpm_change[0] = bpm; bpm_time[0] = 0; } bpm_change[bpm_count] = arg0; bpm_time[bpm_count] = scr_round_to_beat(arg1, bpm_change[bpm_count - 1], undefined, bpm_time[bpm_count - 1]); bpm_count++; if (arg2) { } } function scr_rhythmgame_get_bpm(arg0, arg1 = 0, arg2 = false) { if (bpm_count == 1) return bpm; for (var i = 1; i < bpm_count; i++) { if ((arg0 + arg1) < bpm_time[i]) return bpm_change[i - 1]; } return bpm_change[bpm_count - 1]; } function scr_rhythmgame_get_bpm_index(arg0, arg1 = 0) { if (bpm_count == 1) return bpm; for (var i = 1; i < bpm_count; i++) { if ((arg0 + arg1) < bpm_time[i]) return i - 1; } return bpm_change[bpm_count - 1]; } function scr_rhythmgame_get_signature(arg0, arg1 = 0) { if (signature_count == 1) return signature; for (var i = 1; i < signature_count; i++) { if ((arg0 + arg1) < signature_time[i]) return signature_change[i - 1]; } return signature_change[signature_count - 1]; } function scr_rhythmgame_get_signature_change(arg0, arg1 = true) { if (signature_count <= 1) return signature; if (arg1 && signature_index < (signature_count - 1) && arg0 > signature_time[signature_index + 1]) return signature_change[signature_index + 1]; else if (!arg1 && signature_index > 0 && arg0 < signature_time[signature_index]) return signature_change[signature_index - 1]; else return signature; } function scr_rhythmgame_get_bpm_change(arg0, arg1 = true) { if (bpm_count <= 1) return bpm; if (arg1 && bpm_index < (bpm_count - 1) && arg0 > bpm_time[bpm_index + 1]) return bpm_change[bpm_index + 1]; else if (!arg1 && bpm_index > 0 && arg0 < bpm_time[bpm_index]) return bpm_change[bpm_index - 1]; else return bpm; } function scr_rhythmgame_chart_update_info() { var _rg = 238; signature = _rg.signature; with (obj_rhythmgame) { other.signature_change = signature_change; other.signature_count = signature_count; other.signature_index = signature_index; } } function scr_rhythmgame_toggle_notes(arg0, arg1 = true) { if (arg0) { var _startpoint = scr_ceil_to_beat(trackpos + (meter * 1.5), bpm, 0.25); if (_startpoint > track_length) loop_start = _startpoint - track_length; for (i = 0; i < maxnote; i++) { if (notetime[i] < _startpoint) { continue; } else { notescore[i] = 0; notealive[i] = 1; } } } else { for (i = 0; i < maxnote; i++) { notescore[i] = arg1 ? 40 : 0; notealive[i] = 0; } } }