From 5698b6859d21e1d6b569de4c8676055dec619fec Mon Sep 17 00:00:00 2001 From: KadeDeveloper Date: Wed, 4 Aug 2021 13:51:44 -0700 Subject: [PATCH 1/8] updates to early window and health gain + work on waveform --- source/ChartingState.hx | 20 ++++++++ source/GameplayCustomizeState.hx | 16 +++++- source/KadeEngineData.hx | 3 ++ source/Note.hx | 19 +++---- source/PlayState.hx | 50 ++++++++++++------ source/PlayStateChangeables.hx | 1 + source/Ratings.hx | 2 +- source/Waveform.hx | 88 ++++++++++++++++++++++++++++++++ 8 files changed, 172 insertions(+), 27 deletions(-) create mode 100644 source/Waveform.hx diff --git a/source/ChartingState.hx b/source/ChartingState.hx index 6357545..880ad24 100644 --- a/source/ChartingState.hx +++ b/source/ChartingState.hx @@ -131,6 +131,8 @@ class ChartingState extends MusicBeatState var camFollow:FlxObject; + public var waveform:Waveform; + public static var latestChartVersion = "2"; override function create() @@ -313,6 +315,7 @@ class ChartingState extends MusicBeatState height = Math.floor(renderer.y); } + trace(height); @@ -385,6 +388,23 @@ class ChartingState extends MusicBeatState add(sectionRenderes); + + // fuckin stupid ass bitch ass fucking waveform + /*if (PlayState.isSM) + { + waveform = new Waveform(0,0,PlayState.pathToSm + "/" + PlayState.sm.header.MUSIC,height); + } + else + { + if (_song.needsVoices) + waveform = new Waveform(0,0,Paths.voices(_song.song),height); + else + waveform = new Waveform(0,0,Paths.inst(_song.song),height); + } + + waveform.drawWaveform(); + add(waveform); + */ add(dummyArrow); add(strumLine); add(lines); diff --git a/source/GameplayCustomizeState.hx b/source/GameplayCustomizeState.hx index 26e29e6..03f66d1 100644 --- a/source/GameplayCustomizeState.hx +++ b/source/GameplayCustomizeState.hx @@ -61,6 +61,8 @@ class GameplayCustomizeState extends MusicBeatState camHUD.bgColor.alpha = 0; FlxG.cameras.add(camHUD); + camHUD.zoom = FlxG.save.data.zoom; + background.scrollFactor.set(0.9,0.9); curt.scrollFactor.set(0.9,0.9); front.scrollFactor.set(0.9,0.9); @@ -116,7 +118,7 @@ class GameplayCustomizeState extends MusicBeatState generateStaticArrows(0); generateStaticArrows(1); - text = new FlxText(5, FlxG.height + 40, 0, "Click and drag around gameplay elements to customize their positions.\nPress R to reset.\nPress Escape to go back.", 12); + text = new FlxText(5, FlxG.height + 40, 0, "Click and drag around gameplay elements to customize their positions.\nPress R to reset. +/- to change zoom.\nPress Escape to go back.", 12); text.scrollFactor.set(); text.setFormat("VCR OSD Mono", 16, FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK); @@ -164,6 +166,18 @@ class GameplayCustomizeState extends MusicBeatState for (i in strumLineNotes) i.y = strumLine.y; + if (FlxG.keys.pressed.PLUS) + { + FlxG.save.data.zoom += 0.1; + camHUD.zoom = FlxG.save.data.zoom; + } + + if (FlxG.keys.pressed.MINUS) + { + FlxG.save.data.zoom -= 0.1; + camHUD.zoom = FlxG.save.data.zoom; + } + if (FlxG.mouse.overlaps(sick) && FlxG.mouse.justReleased) { FlxG.save.data.changedHitX = sick.x; diff --git a/source/KadeEngineData.hx b/source/KadeEngineData.hx index eb0b876..b6edf9d 100644 --- a/source/KadeEngineData.hx +++ b/source/KadeEngineData.hx @@ -111,6 +111,9 @@ class KadeEngineData if (FlxG.save.data.editor == null) FlxG.save.data.editor = true; + + if (FlxG.save.data.zoom == null) + FlxG.save.data.zoom = 1; var gamepad:FlxGamepad = FlxG.gamepads.lastActive; diff --git a/source/Note.hx b/source/Note.hx index 700c14e..428a505 100644 --- a/source/Note.hx +++ b/source/Note.hx @@ -83,12 +83,15 @@ class Note extends FlxSprite else { this.strumTime = strumTime; - rStrumTime = strumTime - (FlxG.save.data.offset + PlayState.songOffset); #if sys if (PlayState.isSM) { - rStrumTime = Math.round(rStrumTime + Std.parseFloat(PlayState.sm.header.OFFSET)); + rStrumTime = strumTime; } + else + rStrumTime = (strumTime - FlxG.save.data.offset + PlayState.songOffset); + #else + rStrumTime = (strumTime - FlxG.save.data.offset + PlayState.songOffset); #end } @@ -245,25 +248,23 @@ class Note extends FlxSprite if (mustPress) { - // ass if (isSustainNote) { - if (strumTime > Conductor.songPosition - (Conductor.safeZoneOffset * 1.5) - && strumTime < Conductor.songPosition + (Conductor.safeZoneOffset * 0.5)) + if (strumTime - Conductor.songPosition <= ((166 * Conductor.timeScale) * 0.5) + && strumTime - Conductor.songPosition >= (-166 * Conductor.timeScale)) canBeHit = true; else canBeHit = false; } else { - if (strumTime > Conductor.songPosition - Conductor.safeZoneOffset - && strumTime < Conductor.songPosition + Conductor.safeZoneOffset) + if (strumTime - Conductor.songPosition <= (166 * Conductor.timeScale) + && strumTime - Conductor.songPosition >= (-166 * Conductor.timeScale)) canBeHit = true; else canBeHit = false; } - - if (strumTime < Conductor.songPosition - Conductor.safeZoneOffset * Conductor.timeScale && !wasGoodHit) + if (strumTime - Conductor.songPosition < -166 && !wasGoodHit) tooLate = true; } else diff --git a/source/PlayState.hx b/source/PlayState.hx index e14b145..17beeaa 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -311,6 +311,7 @@ class PlayState extends MusicBeatState PlayStateChangeables.scrollSpeed = FlxG.save.data.scrollSpeed; PlayStateChangeables.botPlay = FlxG.save.data.botplay; PlayStateChangeables.Optimize = FlxG.save.data.optimize; + PlayStateChangeables.zoom = FlxG.save.data.zoom; // pre lowercasing the song name (create) var songLowercase = StringTools.replace(PlayState.SONG.song, " ", "-").toLowerCase(); @@ -397,6 +398,8 @@ class PlayState extends MusicBeatState FlxG.cameras.add(camSustains); FlxG.cameras.add(camNotes); + camHUD.zoom = PlayStateChangeables.zoom; + FlxCamera.defaultCameras = [camGame]; persistentUpdate = true; @@ -1613,6 +1616,9 @@ class PlayState extends MusicBeatState keys[data] = false; } + public var closestNotes:Array = []; + + private function handleInput(evt:KeyboardEvent):Void { // this actually handles press inputs @@ -1668,13 +1674,9 @@ class PlayState extends MusicBeatState var ana = new Ana(Conductor.songPosition, null, false, "miss", data); var dataNotes = []; - notes.forEachAlive(function(daNote:Note) - { - if (daNote.canBeHit && daNote.mustPress && !daNote.tooLate && !daNote.wasGoodHit && daNote.noteData == data) - dataNotes.push(daNote); - }); // Collect notes that can be hit - - dataNotes.sort((a, b) -> Std.int(a.strumTime - b.strumTime)); // sort by the earliest note + for(i in closestNotes) + if (i.noteData == data) + dataNotes.push(i); if (dataNotes.length != 0) { @@ -1724,7 +1726,7 @@ class PlayState extends MusicBeatState ana.hit = false; ana.hitJudge = "shit"; ana.nearestNote = []; - health -= 0.10; + health -= 0.30; } } @@ -2255,6 +2257,8 @@ class PlayState extends MusicBeatState perfectMode = false; #end + + if (updateFrame == 4) { TimingStruct.clearTimings(); @@ -2622,6 +2626,20 @@ class PlayState extends MusicBeatState if (generatedMusic && PlayState.SONG.notes[Std.int(curStep / 16)] != null) { + + closestNotes = []; + + notes.forEachAlive(function(daNote:Note) + { + if (daNote.canBeHit && daNote.mustPress && !daNote.tooLate && !daNote.wasGoodHit) + closestNotes.push(daNote); + }); // Collect notes that can be hit + + closestNotes.sort((a, b) -> Std.int(a.strumTime - b.strumTime)); + + if (closestNotes.length != 0) + FlxG.watch.addQuick("Current Note",closestNotes[0].strumTime - Conductor.songPosition); + // Make sure Girlfriend cheers only for certain songs if (allowedToHeadbang) { @@ -3140,13 +3158,13 @@ class PlayState extends MusicBeatState else { if (!daNote.isSustainNote) - health -= 0.10; + health -= 0.20; vocals.volume = 0; if (theFunne && !daNote.isSustainNote) noteMiss(daNote.noteData, daNote); if (daNote.isParent) { - health -= 0.20; // give a health punishment for failing a LN + health -= 0.30; // give a health punishment for failing a LN trace("hold fell over at the start"); for (i in daNote.children) { @@ -3161,7 +3179,7 @@ class PlayState extends MusicBeatState && daNote.sustainActive && daNote.spotInLine != daNote.parent.children.length) { - health -= 0.20; // give a health punishment for failing a LN + health -= 0.30; // give a health punishment for failing a LN trace("hold fell over at " + daNote.spotInLine); for (i in daNote.parent.children) { @@ -3178,14 +3196,14 @@ class PlayState extends MusicBeatState else { if (!daNote.isSustainNote) - health -= 0.10; + health -= 0.20; vocals.volume = 0; if (theFunne && !daNote.isSustainNote) noteMiss(daNote.noteData, daNote); if (daNote.isParent) { - health -= 0.20; // give a health punishment for failing a LN + health -= 0.30; // give a health punishment for failing a LN trace("hold fell over at the start"); for (i in daNote.children) { @@ -3201,7 +3219,7 @@ class PlayState extends MusicBeatState && daNote.sustainActive && daNote.spotInLine != daNote.parent.children.length) { - health -= 0.20; // give a health punishment for failing a LN + health -= 0.40; // give a health punishment for failing a LN trace("hold fell over at " + daNote.spotInLine); for (i in daNote.parent.children) { @@ -3457,7 +3475,7 @@ class PlayState extends MusicBeatState score = -300; combo = 0; misses++; - health -= 0.06; + health -= 0.1; ss = false; shits++; if (FlxG.save.data.accuracyMod == 0) @@ -3465,7 +3483,7 @@ class PlayState extends MusicBeatState case 'bad': daRating = 'bad'; score = 0; - health -= 0.03; + health -= 0.06; ss = false; bads++; if (FlxG.save.data.accuracyMod == 0) diff --git a/source/PlayStateChangeables.hx b/source/PlayStateChangeables.hx index 17a430a..2e42501 100644 --- a/source/PlayStateChangeables.hx +++ b/source/PlayStateChangeables.hx @@ -5,4 +5,5 @@ class PlayStateChangeables public static var scrollSpeed:Float; public static var botPlay:Bool; public static var Optimize:Bool; + public static var zoom:Float; } \ No newline at end of file diff --git a/source/Ratings.hx b/source/Ratings.hx index 758f8bf..23689a2 100644 --- a/source/Ratings.hx +++ b/source/Ratings.hx @@ -119,7 +119,7 @@ class Ratings public static function checkRating(ms:Float, ts:Float) { - var rating = "sick"; + var rating = "shit"; if (ms <= 166 * ts && ms >= 135 * ts) rating = "shit"; if (ms < 135 * ts && ms >= 90 * ts) diff --git a/source/Waveform.hx b/source/Waveform.hx new file mode 100644 index 0000000..4a282bf --- /dev/null +++ b/source/Waveform.hx @@ -0,0 +1,88 @@ +import flixel.util.FlxColor; +import flixel.FlxG; +import openfl.geom.Rectangle; +import haxe.io.Bytes; +import lime.media.AudioBuffer; +import flixel.FlxSprite; + +class Waveform extends FlxSprite +{ + + /// referenced from https://github.com/gedehari/HaxeFlixel-Waveform-Rendering/blob/master/source/PlayState.hx + /// by gedehari + + public var buffer:AudioBuffer; + public var data:Bytes; + + public function new(x:Int,y:Int, audioPath:String, height:Int) + { + super(x,y); + + var path = StringTools.replace(audioPath, "songs:",""); + + trace("loading " + path); + + buffer = AudioBuffer.fromFile(path); + + trace("BPS: " + buffer.bitsPerSample + " - Channels: " + buffer.channels); + + makeGraphic(height,350,FlxColor.TRANSPARENT); + + angle = 90; + + data = buffer.data.toBytes(); + } + + public function drawWaveform() + { + var index:Int = 0; + var drawIndex:Int = 0; + var samplesPerCollumn:Int = 600; + + var min:Float = 0; + var max:Float = 0; + + while ((index * 4) < (data.length - 1)) + { + var byte:Int = data.getUInt16(index * 4); + + if (byte > 65535 / 2) + byte -= 65535; + + var sample:Float = (byte / 65535); + + if (sample > 0) + { + if (sample > max) + max = sample; + } + else if (sample < 0) + { + if (sample < min) + min = sample; + } + + if ((index % samplesPerCollumn) == 0) + { + // trace("min: " + min + ", max: " + max); + + if (drawIndex > 350) + { + drawIndex = 0; + } + + var pixelsMin:Float = Math.abs(min * 300); + var pixelsMax:Float = max * 300; + + pixels.fillRect(new Rectangle(drawIndex, x, 1, height), 0xFF000000); + pixels.fillRect(new Rectangle(drawIndex, y - pixelsMin, 1, pixelsMin + pixelsMax), FlxColor.WHITE); + drawIndex += 1; + + min = 0; + max = 0; + } + + index += 1; + } + } +} \ No newline at end of file From 574d13eea89cf9e9ccd4b15d0d3d3d6b3b8e7a80 Mon Sep 17 00:00:00 2001 From: KadeDeveloper Date: Wed, 4 Aug 2021 13:53:45 -0700 Subject: [PATCH 2/8] fix a modchart bug with cameras --- source/PlayState.hx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/PlayState.hx b/source/PlayState.hx index 17beeaa..84a8a65 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -2387,6 +2387,15 @@ class PlayState extends MusicBeatState if (i <= playerStrums.length) playerStrums.members[i].visible = p2; } + + camNotes.zoom = camHUD.zoom; + camNotes.x = camHUD.x; + camNotes.y = camHUD.y; + camNotes.angle = camHUD.angle; + camSustains.zoom = camHUD.zoom; + camSustains.x = camHUD.x; + camSustains.y = camHUD.y; + camSustains.angle = camHUD.angle; } #end From bbd8599c4675b9f2581c31bba31da411ff6ae70b Mon Sep 17 00:00:00 2001 From: KadeDeveloper Date: Wed, 4 Aug 2021 15:07:26 -0700 Subject: [PATCH 3/8] fix crashing on tutorial --- source/PlayState.hx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/PlayState.hx b/source/PlayState.hx index 331c468..4f1237c 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -3232,6 +3232,7 @@ class PlayState extends MusicBeatState function endSong():Void { + endingSong = true; FlxG.stage.removeEventListener(KeyboardEvent.KEY_DOWN, handleInput); FlxG.stage.removeEventListener(KeyboardEvent.KEY_UP, releaseInput); if (useVideo) @@ -4442,7 +4443,7 @@ class PlayState extends MusicBeatState } #end - if (curSong == 'Tutorial' && dad.curCharacter == 'gf') + if (curSong == 'Tutorial' && dad.curCharacter == 'gf' && SONG.notes[Math.floor(curStep / 16)] != null) { if (SONG.notes[Math.floor(curStep / 16)].mustHitSection) dad.dance(); From ca0245d772e9acae46ef53437c5a3c6ca5a7bff9 Mon Sep 17 00:00:00 2001 From: KadeDeveloper Date: Wed, 4 Aug 2021 15:10:17 -0700 Subject: [PATCH 4/8] fix thorn man --- source/Character.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/Character.hx b/source/Character.hx index 36136c1..c99941c 100644 --- a/source/Character.hx +++ b/source/Character.hx @@ -345,7 +345,7 @@ class Character extends FlxSprite antialiasing = false; case 'spirit': - frames = Paths.getPackerAtlas('spirit','shared'); + frames = Paths.getPackerAtlas('spirit','shared',true); animation.addByPrefix('idle', "idle spirit_", 24, false); animation.addByPrefix('singUP', "up_", 24, false); animation.addByPrefix('singRIGHT', "right_", 24, false); From 78b7faf83a2a0988ae6d76074404edf186e65c1a Mon Sep 17 00:00:00 2001 From: KadeDeveloper Date: Wed, 4 Aug 2021 15:13:54 -0700 Subject: [PATCH 5/8] fix freeplay visual bug --- source/FreeplayState.hx | 1 + 1 file changed, 1 insertion(+) diff --git a/source/FreeplayState.hx b/source/FreeplayState.hx index 59509c0..93b0fdf 100644 --- a/source/FreeplayState.hx +++ b/source/FreeplayState.hx @@ -476,6 +476,7 @@ class FreeplayState extends MusicBeatState #end diffCalcText.text = 'RATING: ${DiffCalc.CalculateDiff(songData.get(songs[curSelected].songName)[curDifficulty])}'; + diffText.text = CoolUtil.difficultyFromInt(curDifficulty).toUpperCase(); #if PRELOAD_ALL if (songs[curSelected].songCharacter == "sm") From fa77122877ad915df2d3bbee997ac8251734104a Mon Sep 17 00:00:00 2001 From: KadeDeveloper Date: Wed, 4 Aug 2021 15:23:47 -0700 Subject: [PATCH 6/8] re add start section and result screen clean --- source/ChartingState.hx | 10 ++++++++++ source/ResultsScreen.hx | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/source/ChartingState.hx b/source/ChartingState.hx index e3a8bd7..bd4a4b9 100644 --- a/source/ChartingState.hx +++ b/source/ChartingState.hx @@ -1256,7 +1256,17 @@ class ChartingState extends MusicBeatState check_altAnim.checked = section.altAnim; }); + var startSection:FlxButton = new FlxButton(10, 85, "Play Here", function() { + PlayState.SONG = _song; + FlxG.sound.music.stop(); + if (!PlayState.isSM) + vocals.stop(); + PlayState.startTime = lastUpdatedSection.startTime; + LoadingState.loadAndSwitchState(new PlayState()); + }); + tab_group_section.add(refresh); + tab_group_section.add(startSection); tab_group_section.add(stepperCopy); tab_group_section.add(stepperCopyLabel); tab_group_section.add(check_mustHitSection); diff --git a/source/ResultsScreen.hx b/source/ResultsScreen.hx index be8371e..109af32 100644 --- a/source/ResultsScreen.hx +++ b/source/ResultsScreen.hx @@ -145,6 +145,11 @@ class ResultsScreen extends FlxSubState graph.addToHistory(diff, judge, obj3); } + if (sicks == Math.POSITIVE_INFINITY || sicks == Math.NaN) + sicks = 0; + if (goods == Math.POSITIVE_INFINITY || goods == Math.NaN) + goods = 0; + graph.update(); mean = HelperFunctions.truncateFloat(mean / PlayState.rep.replay.songNotes.length,2); From a9365239f0c34ee64b7f367963832a7b6e2d3cde Mon Sep 17 00:00:00 2001 From: KadeDeveloper Date: Fri, 6 Aug 2021 15:24:15 -0700 Subject: [PATCH 7/8] fix story mode desyncing ranking with combos --- source/PlayState.hx | 24 ++++++++++++++---------- source/ResultsScreen.hx | 7 ++++++- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/source/PlayState.hx b/source/PlayState.hx index 4f1237c..107576d 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -159,7 +159,10 @@ class PlayState extends MusicBeatState public static var misses:Int = 0; public static var campaignMisses:Int = 0; - + public static var campaignSicks:Int = 0; + public static var campaignGoods:Int = 0; + public static var campaignBads:Int = 0; + public static var campaignShits:Int = 0; public var accuracy:Float = 0.00; @@ -292,13 +295,11 @@ class PlayState extends MusicBeatState if (FlxG.sound.music != null) FlxG.sound.music.stop(); - if (!isStoryMode) - { - sicks = 0; - bads = 0; - shits = 0; - goods = 0; - } + sicks = 0; + bads = 0; + shits = 0; + goods = 0; + misses = 0; highestCombo = 0; @@ -3243,8 +3244,6 @@ class PlayState extends MusicBeatState PlayState.instance.remove(PlayState.instance.videoSprite); } - if (isStoryMode) - campaignMisses = misses; if (!loadRep) rep.SaveReplay(saveNotes, saveJudge, replayAna); @@ -3302,6 +3301,11 @@ class PlayState extends MusicBeatState if (isStoryMode) { campaignScore += Math.round(songScore); + campaignMisses += misses; + campaignSicks += sicks; + campaignGoods += goods; + campaignBads += bads; + campaignShits += shits; storyPlaylist.remove(storyPlaylist[0]); diff --git a/source/ResultsScreen.hx b/source/ResultsScreen.hx index 109af32..c066041 100644 --- a/source/ResultsScreen.hx +++ b/source/ResultsScreen.hx @@ -83,7 +83,12 @@ class ResultsScreen extends FlxSubState text.text = "Week Cleared!"; } - comboText = new FlxText(20,-75,0,'Judgements:\nSicks - ${PlayState.sicks}\nGoods - ${PlayState.goods}\nBads - ${PlayState.bads}\n\nCombo Breaks: ${(PlayState.isStoryMode ? PlayState.campaignMisses : PlayState.misses)}\nHighest Combo: ${PlayState.highestCombo + 1}\nScore: ${PlayState.instance.songScore}\nAccuracy: ${HelperFunctions.truncateFloat(PlayState.instance.accuracy,2)}%\n\n${Ratings.GenerateLetterRank(PlayState.instance.accuracy)}\n\n${!PlayState.loadRep ? "F1 - View replay\nF2 - Replay song" : ""} + var sicks = PlayState.isStoryMode ? PlayState.campaignSicks : PlayState.sicks; + var goods = PlayState.isStoryMode ? PlayState.campaignGoods : PlayState.goods; + var bads = PlayState.isStoryMode ? PlayState.campaignBads : PlayState.bads; + var shits = PlayState.isStoryMode ? PlayState.campaignShits : PlayState.shits; + + comboText = new FlxText(20,-75,0,'Judgements:\nSicks - ${PlayState.sicks}\nGoods - ${sicks}\nBads - ${bads}\n\nCombo Breaks: ${(PlayState.isStoryMode ? PlayState.campaignMisses : PlayState.misses)}\nHighest Combo: ${PlayState.highestCombo + 1}\nScore: ${PlayState.instance.songScore}\nAccuracy: ${HelperFunctions.truncateFloat(PlayState.instance.accuracy,2)}%\n\n${Ratings.GenerateLetterRank(PlayState.instance.accuracy)}\n\n${!PlayState.loadRep ? "F1 - View replay\nF2 - Replay song" : ""} '); comboText.size = 28; comboText.setBorderStyle(FlxTextBorderStyle.OUTLINE,FlxColor.BLACK,4,1); From b2bed6bcf026007553ec6fb1e5c151002426192f Mon Sep 17 00:00:00 2001 From: KadeDeveloper Date: Sat, 7 Aug 2021 19:14:10 -0700 Subject: [PATCH 8/8] fix animation shit --- source/PlayState.hx | 85 +++++++++++++++++++++++++++++++++------------ 1 file changed, 62 insertions(+), 23 deletions(-) diff --git a/source/PlayState.hx b/source/PlayState.hx index 107576d..f923bf5 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -3030,38 +3030,77 @@ class PlayState extends MusicBeatState } // Accessing the animation name directly to play it - var singData:Int = Std.int(Math.abs(daNote.noteData)); - dad.playAnim('sing' + dataSuffix[singData] + altAnim, true); - - if (FlxG.save.data.cpuStrums) + if (!daNote.isParent && daNote.parent != null) { - cpuStrums.forEach(function(spr:FlxSprite) + if (daNote.spotInLine != daNote.parent.children.length - 1) { - if (Math.abs(daNote.noteData) == spr.ID) + var singData:Int = Std.int(Math.abs(daNote.noteData)); + dad.playAnim('sing' + dataSuffix[singData] + altAnim, true); + + if (FlxG.save.data.cpuStrums) { - spr.animation.play('confirm', true); + cpuStrums.forEach(function(spr:FlxSprite) + { + if (Math.abs(daNote.noteData) == spr.ID) + { + spr.animation.play('confirm', true); + } + if (spr.animation.curAnim.name == 'confirm' && !curStage.startsWith('school')) + { + spr.centerOffsets(); + spr.offset.x -= 13; + spr.offset.y -= 13; + } + else + spr.centerOffsets(); + }); } - if (spr.animation.curAnim.name == 'confirm' && !curStage.startsWith('school')) - { - spr.centerOffsets(); - spr.offset.x -= 13; - spr.offset.y -= 13; - } - else - spr.centerOffsets(); - }); + + #if windows + if (luaModchart != null) + luaModchart.executeState('playerTwoSing', [Math.abs(daNote.noteData), Conductor.songPosition]); + #end + + dad.holdTimer = 0; + + if (SONG.needsVoices) + vocals.volume = 1; + } } + else + { + var singData:Int = Std.int(Math.abs(daNote.noteData)); + dad.playAnim('sing' + dataSuffix[singData] + altAnim, true); - #if windows - if (luaModchart != null) - luaModchart.executeState('playerTwoSing', [Math.abs(daNote.noteData), Conductor.songPosition]); - #end + if (FlxG.save.data.cpuStrums) + { + cpuStrums.forEach(function(spr:FlxSprite) + { + if (Math.abs(daNote.noteData) == spr.ID) + { + spr.animation.play('confirm', true); + } + if (spr.animation.curAnim.name == 'confirm' && !curStage.startsWith('school')) + { + spr.centerOffsets(); + spr.offset.x -= 13; + spr.offset.y -= 13; + } + else + spr.centerOffsets(); + }); + } - dad.holdTimer = 0; + #if windows + if (luaModchart != null) + luaModchart.executeState('playerTwoSing', [Math.abs(daNote.noteData), Conductor.songPosition]); + #end - if (SONG.needsVoices) - vocals.volume = 1; + dad.holdTimer = 0; + if (SONG.needsVoices) + vocals.volume = 1; + } daNote.active = false; daNote.kill();