From 0ae79a9bb49d09515be592e9bab3abcb46c26d16 Mon Sep 17 00:00:00 2001 From: Yoshman29 <81191621+YoshiCrafter29@users.noreply.github.com> Date: Tue, 21 Feb 2023 01:29:28 +0100 Subject: [PATCH] sus --- buildnumber.txt | 2 +- source/funkin/game/Note.hx | 18 ++++++------------ source/funkin/game/StrumLine.hx | 12 +++++++++++- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/buildnumber.txt b/buildnumber.txt index feea2736..896f46ec 100644 --- a/buildnumber.txt +++ b/buildnumber.txt @@ -1 +1 @@ -2322 \ No newline at end of file +2328 \ No newline at end of file diff --git a/source/funkin/game/Note.hx b/source/funkin/game/Note.hx index 2c64282e..c7900a8a 100644 --- a/source/funkin/game/Note.hx +++ b/source/funkin/game/Note.hx @@ -72,7 +72,6 @@ class Note extends FlxSprite } public var sustainLength:Float = 0; - public var stepLength:Float = 0; public var isSustainNote:Bool = false; public var flipSustain:Bool = true; @@ -173,16 +172,6 @@ class Note extends FlxSprite if (PlayState.instance != null) PlayState.instance.scripts.event("onPostNoteCreation", event); - - if (!isSustainNote && noteData.sustainLength > Conductor.stepCrochet * 0.75) { - var len:Float = noteData.sustainLength; - var curLen:Float = 0; - while(len > 10) { - curLen = Math.min(len, Conductor.stepCrochet); - len -= curLen; - strumLine.notes.add(new Note(strumLine, noteData, true, curLen, noteData.sustainLength - len)); - } - } } public var lastScrollSpeed:Null = null; @@ -195,6 +184,11 @@ class Note extends FlxSprite */ public var strumRelativePos:Bool = true; + override function drawComplex(camera:FlxCamera) { + flipY = flipSustain && ((camera is HudCamera ? cast(camera, HudCamera).downscroll : false) != (__strum != null && __strum.getScrollSpeed(this) < 0)); + super.drawComplex(camera); + } + override function draw() { @:privateAccess var oldDefaultCameras = FlxCamera._defaultCameras; @:privateAccess if (__strumCameras != null) FlxCamera._defaultCameras = __strumCameras; @@ -244,7 +238,7 @@ class Note extends FlxSprite // is long sustain lastScrollSpeed = scrollSpeed; - scale.y = (stepLength * (0.45 * FlxMath.roundDecimal(scrollSpeed, 2))) / frameHeight; + scale.y = (sustainLength * (0.45 * FlxMath.roundDecimal(scrollSpeed, 2))) / frameHeight; updateHitbox(); if (useAntialiasingFix) { // dumbass antialiasing diff --git a/source/funkin/game/StrumLine.hx b/source/funkin/game/StrumLine.hx index 5a5e26b0..35395884 100644 --- a/source/funkin/game/StrumLine.hx +++ b/source/funkin/game/StrumLine.hx @@ -64,6 +64,16 @@ class StrumLine extends FlxTypedGroup { public function generate(strumLine:ChartStrumLine) { if (strumLine.notes != null) for(note in strumLine.notes) { notes.add(new Note(this, note, false)); + + if (note.sustainLength > Conductor.stepCrochet * 0.75) { + var len:Float = note.sustainLength; + var curLen:Float = 0; + while(len > 10) { + curLen = Math.min(len, Conductor.stepCrochet); + notes.add(new Note(this, note, true, curLen, note.sustainLength - len)); + len -= curLen; + } + } } notes.sortNotes(); } @@ -105,7 +115,7 @@ class StrumLine extends FlxTypedGroup { if (PlayState.instance.__updateNote_event.__autoCPUHit && cpu && !daNote.wasGoodHit && daNote.strumTime < Conductor.songPosition) PlayState.instance.goodNoteHit(this, daNote); - if (daNote.wasGoodHit && daNote.isSustainNote && daNote.strumTime + (daNote.stepLength) < Conductor.songPosition) { + if (daNote.wasGoodHit && daNote.isSustainNote && daNote.strumTime + (daNote.sustainLength) < Conductor.songPosition) { deleteNote(daNote); return; }