import funkin.play.song.Song; import funkin.play.PlayState; import funkin.Paths; import funkin.play.cutscene.VideoCutscene; import funkin.play.PlayStatePlaylist; class UghSong extends Song { var hasPlayedCutscene:Bool; public function new() { super('ugh'); hasPlayedCutscene = false; } public override function onCountdownStart(event:CountdownScriptEvent):Void { super.onCountdownStart(event); if (!PlayStatePlaylist.isStoryMode) hasPlayedCutscene = true; if (!hasPlayedCutscene) { trace('Pausing countdown to play a video cutscene (`ugh`)'); hasPlayedCutscene = true; event.cancel(); // CANCEL THE COUNTDOWN! startVideo(); } } function startVideo() { VideoCutscene.play(Paths.videos('ughCutscene')); } /** * Don't replay the cutscene between restarts. */ function onSongRetry(event:ScriptEvent) { super.onSongRetry(event); hasPlayedCutscene = true; } /** * Replay the cutscene after leaving the song. */ function onCreate(event:ScriptEvent):Void { super.onCreate(event); hasPlayedCutscene = false; } }