From f410396b47cfdf664b36db368c1d5e97cdcaf34a Mon Sep 17 00:00:00 2001 From: lunarcleint <88809950+lunarcleint@users.noreply.github.com> Date: Thu, 19 Jan 2023 19:34:40 -0700 Subject: [PATCH] start countdown is now useful!11 --- buildnumber.txt | 2 +- source/funkin/game/PlayState.hx | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/buildnumber.txt b/buildnumber.txt index 5c8f449e..e9ad4b45 100644 --- a/buildnumber.txt +++ b/buildnumber.txt @@ -1 +1 @@ -2092 \ No newline at end of file +2094 \ No newline at end of file diff --git a/source/funkin/game/PlayState.hx b/source/funkin/game/PlayState.hx index d75f617c..fce69b62 100644 --- a/source/funkin/game/PlayState.hx +++ b/source/funkin/game/PlayState.hx @@ -750,7 +750,9 @@ class PlayState extends MusicBeatState inCutscene = false; generateStrums(); - scripts.call("onStartCountdown"); + + var e = scripts.event("onStartCountdown", new CancellableEvent()); + if (e.cancelled) return; startedCountdown = true; Conductor.songPosition = 0; @@ -1209,7 +1211,7 @@ class PlayState extends MusicBeatState // RESET = Quick Game Over Screen - if (controls.RESET) + if (startedCountdown && controls.RESET) health = 0; // CHEAT = brandon's a pussy @@ -1218,11 +1220,12 @@ class PlayState extends MusicBeatState health += 1; trace("User is cheating!"); } - + if (health <= 0 && canDie) gameOver(); if (health >= maxHealth && canDadDie) gameOver(); + if (generatedMusic) { __updateNote_event = EventManager.get(NoteUpdateEvent); @@ -1233,7 +1236,7 @@ class PlayState extends MusicBeatState keyShit(); #if debug - if (FlxG.keys.justPressed.ONE) + if (generatedMusic && FlxG.keys.justPressed.ONE) endSong(); #end