From 7c0c09775a70a2f14e47740b24681b16c8f8f2b7 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Tue, 20 Sep 2022 13:18:40 -0400 Subject: [PATCH] results ending variations --- source/funkin/play/ResultState.hx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/source/funkin/play/ResultState.hx b/source/funkin/play/ResultState.hx index 04931b211..a2f46d686 100644 --- a/source/funkin/play/ResultState.hx +++ b/source/funkin/play/ResultState.hx @@ -5,9 +5,18 @@ import flixel.text.FlxText; class ResultState extends MusicBeatSubstate { + var resultsVariation:ResultVariations; + override function create() { - FlxG.sound.playMusic(Paths.music("resultsNormal")); + if (Highscore.tallies.sick == Highscore.tallies.totalNotes && Highscore.tallies.maxCombo == Highscore.tallies.totalNotes) + resultsVariation = PERFECT; + else if (Highscore.tallies.missed + Highscore.tallies.bad + Highscore.tallies.shit >= Highscore.tallies.totalNotes * 0.50) + resultsVariation = SHIT; // if more than half of your song was missed, bad, or shit notes, you get shit ending! + else + resultsVariation = NORMAL; + + FlxG.sound.playMusic(Paths.music("results" + resultsVariation)); var bg:FlxSprite = new FlxSprite().makeGraphic(FlxG.width, FlxG.height, 0xFF000000); bg.alpha = 0.8; @@ -43,3 +52,10 @@ class ResultState extends MusicBeatSubstate super.update(elapsed); } } + +enum abstract ResultVariations(String) +{ + var PERFECT; + var NORMAL; + var SHIT; +}