From e462b04b59e564ec5c10c1cd495484178736fcbf Mon Sep 17 00:00:00 2001 From: nebulazorua Date: Wed, 15 May 2024 20:46:08 +0800 Subject: [PATCH] does notesplash --- source/funkin/modding/events/ScriptEvent.hx | 13 ++++++++++--- source/funkin/play/PlayState.hx | 5 +++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/source/funkin/modding/events/ScriptEvent.hx b/source/funkin/modding/events/ScriptEvent.hx index ece7870fd..dd55de23b 100644 --- a/source/funkin/modding/events/ScriptEvent.hx +++ b/source/funkin/modding/events/ScriptEvent.hx @@ -141,7 +141,7 @@ class HitNoteScriptEvent extends NoteScriptEvent public var score:Int; /** - * Whether the judgement caused a combo break. + * If the hit causes a combo break. */ public var isComboBreak:Bool = false; @@ -150,19 +150,26 @@ class HitNoteScriptEvent extends NoteScriptEvent */ public var hitDiff:Float = 0; - public function new(note:NoteSprite, healthChange:Float, score:Int, judgement:String, isComboBreak:Bool, comboCount:Int = 0, hitDiff:Float = 0):Void + /** + * If the hit causes a notesplash + */ + public var doesNotesplash:Bool = false; + + public function new(note:NoteSprite, healthChange:Float, score:Int, judgement:String, isComboBreak:Bool, comboCount:Int = 0, hitDiff:Float = 0, + doesNotesplash:Bool = false):Void { super(NOTE_HIT, note, healthChange, comboCount, true); this.score = score; this.judgement = judgement; this.isComboBreak = isComboBreak; + this.doesNotesplash = doesNotesplash; this.hitDiff = hitDiff; } public override function toString():String { return 'HitNoteScriptEvent(note=' + note + ', comboCount=' + comboCount + ', judgement=' + judgement + ', score=' + score + ', isComboBreak=' - + isComboBreak + ', hitDiff=' + hitDiff + ')'; + + isComboBreak + ', hitDiff=' + hitDiff + ', doesNotesplash=' + doesNotesplash + ')'; } } diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index cdd8c7d71..f563c8d2e 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -2400,7 +2400,8 @@ class PlayState extends MusicBeatSubState } // Send the note hit event. - var event:HitNoteScriptEvent = new HitNoteScriptEvent(note, healthChange, score, daRating, isComboBreak, Highscore.tallies.combo + 1, noteDiff); + var event:HitNoteScriptEvent = new HitNoteScriptEvent(note, healthChange, score, daRating, isComboBreak, Highscore.tallies.combo + 1, noteDiff, + daRating == 'sick'); dispatchEvent(event); // Calling event.cancelEvent() skips all the other logic! Neat! @@ -2409,7 +2410,7 @@ class PlayState extends MusicBeatSubState Highscore.tallies.totalNotesHit++; // Display the hit on the strums playerStrumline.hitNote(note, !isComboBreak); - if (daRating == 'sick') playerStrumline.playNoteSplash(note.noteData.getDirection()); + if (event.doesNotesplash) playerStrumline.playNoteSplash(note.noteData.getDirection()); if (note.isHoldNote && note.holdNoteSprite != null) playerStrumline.playNoteHoldCover(note.holdNoteSprite); vocals.playerVolume = 1;