From afa1a9d13c9437f081d2897106465a4b6e544c0c Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Tue, 20 Sep 2022 02:37:43 -0400 Subject: [PATCH] better combo stuf --- source/funkin/Highscore.hx | 9 +++++++++ source/funkin/play/PlayState.hx | 6 +++++- source/funkin/play/ResultState.hx | 4 +++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/source/funkin/Highscore.hx b/source/funkin/Highscore.hx index e4f79ba40..dfaf44a5e 100644 --- a/source/funkin/Highscore.hx +++ b/source/funkin/Highscore.hx @@ -122,11 +122,20 @@ abstract Tallies(RawTallies) typedef RawTallies = { var combo:Int; + + /** + * How many notes you let scroll by. + */ var missed:Int; + var shit:Int; var bad:Int; var good:Int; var sick:Int; var maxCombo:Int; + + /** + * How many notes total that you hit. (NOT how many notes total in the song!) + */ var totalNotes:Int; } diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index dab495a47..990d918ee 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -1704,6 +1704,9 @@ class PlayState extends MusicBeatState implements IHook function noteMiss(note:Note):Void { + // a MISS is when you let a note scroll past you!! + Highscore.tallies.missed++; + var event:NoteScriptEvent = new NoteScriptEvent(ScriptEvent.NOTE_MISS, note, true); dispatchEvent(event); // Calling event.cancelEvent() skips all the other logic! Neat! @@ -1737,7 +1740,8 @@ class PlayState extends MusicBeatState implements IHook if (!note.isSustainNote) { - Highscore.tallies.combo += 1; + Highscore.tallies.combo++; + Highscore.tallies.totalNotes++; if (Highscore.tallies.combo > Highscore.tallies.maxCombo) Highscore.tallies.maxCombo = Highscore.tallies.combo; diff --git a/source/funkin/play/ResultState.hx b/source/funkin/play/ResultState.hx index 91969265e..5126309af 100644 --- a/source/funkin/play/ResultState.hx +++ b/source/funkin/play/ResultState.hx @@ -10,8 +10,10 @@ class ResultState extends MusicBeatSubstate var bg:FlxSprite = new FlxSprite().makeGraphic(FlxG.width, FlxG.height, 0xFF000000); bg.scrollFactor.set(); add(bg); - var results:FlxText = new FlxText(0, 0, 0, "RESULTS:", 32); + var results:FlxText = new FlxText(70, 70, 0, "RESULTS:", 32); + results.text += "\nTOTAL NOTES: "; + results.text += Highscore.tallies.totalNotes; results.text += "\nMISSED: "; results.text += Highscore.tallies.missed; results.text += "\nSHIT: ";