diff --git a/source/Note.hx b/source/Note.hx index e6ed00b2045..dfbe155b3ab 100644 --- a/source/Note.hx +++ b/source/Note.hx @@ -31,17 +31,15 @@ typedef PreloadedChartNote = { isSustainEnd:Bool, sustainLength:Float, sustainScale:Float, - parent:PreloadedChartNote, + parentST:Float, hitHealth:Float, missHealth:Float, hitCausesMiss:Null, wasHit:Bool, multSpeed:Float, noteDensity:Float, - wasSpawned:Bool, ignoreNote:Bool, lowPriority:Bool, - wasMissed:Bool } typedef NoteSplashData = { @@ -598,10 +596,9 @@ class Note extends FlxSprite doOppStuff = chartNoteData.oppNote; gfNote = chartNoteData.gfNote; isSustainNote = chartNoteData.isSustainNote; - sustainLength = chartNoteData.sustainLength; sustainScale = chartNoteData.sustainScale; lowPriority = chartNoteData.lowPriority; - if (isSustainNote) parentST = chartNoteData.parent.strumTime; + if (isSustainNote) parentST = chartNoteData.parentST; hitHealth = chartNoteData.hitHealth; missHealth = chartNoteData.missHealth; diff --git a/source/PlayState.hx b/source/PlayState.hx index 54ff8100927..873e3a58a5c 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -2894,6 +2894,8 @@ class PlayState extends MusicBeatState } var currentBPMLol:Float = Conductor.bpm; var currentMultiplier:Float = 1; + var gottaHitNote:Bool = false; + var swagNote:PreloadedChartNote; for (section in noteData) { if (section.changeBPM) currentBPMLol = section.bpm; @@ -2906,22 +2908,19 @@ class PlayState extends MusicBeatState firstNoteData = Std.int(songNotes[1] % 4); assignedFirstData = true; } - if (!randomMode && !flip && !stairs && !waves) { - daNoteData = Std.int(songNotes[1] % 4); - } - if (oneK) { - daNoteData = firstNoteData; - } - if (randomMode) { - daNoteData = FlxG.random.int(0, 3); - } - if (flip) { - daNoteData = Std.int(Math.abs((songNotes[1] % 4) - 3)); - } + if (!randomMode && !flip && !stairs && !waves) daNoteData = Std.int(songNotes[1] % 4); + + if (oneK) daNoteData = firstNoteData; + + if (randomMode) daNoteData = FlxG.random.int(0, 3); + + if (flip) daNoteData = Std.int(Math.abs((songNotes[1] % 4) - 3)); + if (stairs && !waves) { daNoteData = stair % 4; stair++; } + if (waves) { switch (stair % 6) { case 0 | 1 | 2 | 3: @@ -2933,7 +2932,8 @@ class PlayState extends MusicBeatState } stair++; } - final gottaHitNote:Bool = ((songNotes[1] < 4 && !opponentChart) + + gottaHitNote = ((songNotes[1] < 4 && !opponentChart) || (songNotes[1] > 3 && opponentChart) ? section.mustHitSection : !section.mustHitSection); if ((bothSides || gottaHitNote) && songNotes[3] != 'Hurt Note') { @@ -2966,7 +2966,7 @@ class PlayState extends MusicBeatState multiChangeEvents[1].shift(); } - final swagNote:PreloadedChartNote = cast { + swagNote = cast { strumTime: daStrumTime, noteData: daNoteData, mustPress: bothSides || gottaHitNote, @@ -2976,19 +2976,14 @@ class PlayState extends MusicBeatState noteskin: (gottaHitNote ? bfNoteskin : dadNoteskin), gfNote: songNotes[3] == 'GF Sing' || (section.gfSection && songNotes[1] < 4), noAnimation: songNotes[3] == 'No Animation', - isSustainNote: false, - isSustainEnd: false, + noMissAnimation: songNotes[3] == 'No Animation', sustainLength: songNotes[2], - sustainScale: 0, - parent: null, hitHealth: 0.023, missHealth: songNotes[3] != 'Hurt Note' ? 0.0475 : 0.3, wasHit: false, hitCausesMiss: songNotes[3] == 'Hurt Note', multSpeed: 1, noteDensity: currentMultiplier, - wasSpawned: false, - wasMissed: false, ignoreNote: songNotes[3] == 'Hurt Note' && gottaHitNote }; if (swagNote.noteskin.length > 0 && !Paths.noteSkinFramesMap.exists(swagNote.noteskin)) inline Paths.initNote(4, swagNote.noteskin); @@ -3002,6 +2997,35 @@ class PlayState extends MusicBeatState } inline unspawnNotes.push(swagNote); + + if (jackingtime > 0) { + for (i in 0...Std.int(jackingtime)) { + final jackNote:PreloadedChartNote = cast { + strumTime: swagNote.strumTime + (15000 / SONG.bpm) * (i + 1), + noteData: swagNote.noteData, + mustPress: swagNote.mustPress, + oppNote: swagNote.oppNote, + noteType: swagNote.noteType, + animSuffix: (songNotes[3] == 'Alt Animation' || section.altAnim ? '-alt' : ''), + noteskin: (gottaHitNote ? bfNoteskin : dadNoteskin), + gfNote: swagNote.gfNote, + isSustainNote: false, + isSustainEnd: false, + sustainScale: 0, + parentST: 0, + hitHealth: swagNote.hitHealth, + missHealth: swagNote.missHealth, + wasHit: false, + multSpeed: 1, + noteDensity: currentMultiplier, + hitCausesMiss: swagNote.hitCausesMiss, + ignoreNote: swagNote.ignoreNote + }; + inline unspawnNotes.push(jackNote); + } + } + + if (swagNote.sustainLength < 1) continue; var ratio:Float = Conductor.bpm / currentBPMLol; @@ -3020,54 +3044,18 @@ class PlayState extends MusicBeatState gfNote: songNotes[3] == 'GF Sing' || (section.gfSection && songNotes[1] < 4), noAnimation: songNotes[3] == 'No Animation', isSustainNote: true, - isSustainEnd: susNote == floorSus, - sustainLength: 0, + isSustainEnd: susNote == floorSus, sustainScale: 1 / ratio, - parent: swagNote, + parentST: swagNote.strumTime, hitHealth: 0.023, missHealth: songNotes[3] != 'Hurt Note' ? 0.0475 : 0.1, wasHit: false, multSpeed: 1, noteDensity: currentMultiplier, hitCausesMiss: songNotes[3] == 'Hurt Note', - wasSpawned: false, - canBeHit:false, - wasMissed: false, ignoreNote: songNotes[3] == 'Hurt Note' && swagNote.mustPress }; inline unspawnNotes.push(sustainNote); - //Sys.sleep(0.0001); - } - } - - if (jackingtime > 0) { - for (i in 0...Std.int(jackingtime)) { - final jackNote:PreloadedChartNote = cast { - strumTime: swagNote.strumTime + (15000 / SONG.bpm) * (i + 1), - noteData: swagNote.noteData, - mustPress: swagNote.mustPress, - oppNote: swagNote.oppNote, - noteType: swagNote.noteType, - animSuffix: (songNotes[3] == 'Alt Animation' || section.altAnim ? '-alt' : ''), - noteskin: (gottaHitNote ? bfNoteskin : dadNoteskin), - gfNote: swagNote.gfNote, - isSustainNote: false, - isSustainEnd: false, - sustainLength: swagNote.sustainLength, - sustainScale: 0, - parent: null, - hitHealth: swagNote.hitHealth, - missHealth: swagNote.missHealth, - wasHit: false, - multSpeed: 1, - noteDensity: currentMultiplier, - hitCausesMiss: swagNote.hitCausesMiss, - wasSpawned: false, - canBeHit:false, - wasMissed: false, - ignoreNote: swagNote.ignoreNote - }; - inline unspawnNotes.push(jackNote); } } } else { @@ -4103,8 +4091,7 @@ class PlayState extends MusicBeatState var noteIndex:Int = 0; while (unspawnNotes.length > 0 && unspawnNotes[noteIndex] != null) { - if (ClientPrefs.showNotes) unspawnNotes[noteIndex].wasSpawned = false; - else unspawnNotes[noteIndex].wasHit = false; + unspawnNotes[noteIndex].wasHit = false; noteIndex++; } } diff --git a/source/StartupState.hx b/source/StartupState.hx index 0fe4db54b54..912320a6cc9 100644 --- a/source/StartupState.hx +++ b/source/StartupState.hx @@ -75,6 +75,8 @@ class StartupState extends MusicBeatState vidSprite.playVideo(Paths.video('bambiStartup'), false, false); vidSprite.finishCallback = function() { + try { vidSprite.finishVideo(); } + catch (e) {} FlxG.switchState(TitleState.new); }; #else @@ -92,6 +94,8 @@ class StartupState extends MusicBeatState vidSprite.playVideo(Paths.video('broCopiedDenpa'), false, false); vidSprite.finishCallback = function() { + try { vidSprite.finishVideo(); } + catch (e) {} FlxG.switchState(TitleState.new); }; #else diff --git a/source/editors/ChartingState.hx b/source/editors/ChartingState.hx index a904e86126c..270e0732e5c 100644 --- a/source/editors/ChartingState.hx +++ b/source/editors/ChartingState.hx @@ -1274,6 +1274,7 @@ class ChartingState extends MusicBeatState copyMultiSectButton = new FlxButton(CopyFutureSectionCount.x, CopyLastSectionCount.y + 40, "Copy from the last " + Std.int(CopyFutureSectionCount.value) + " to the next " + Std.int(CopyFutureSectionCount.value) + " sections, " + Std.int(CopyLoopCount.value) + " times", function() { + var swapNotes:Bool = FlxG.keys.pressed.CONTROL; var daSec = FlxMath.maxInt(curSec, Std.int(CopyLastSectionCount.value)); var value1:Int = Std.int(CopyLastSectionCount.value); var value2:Int = Std.int(CopyFutureSectionCount.value) * Std.int(CopyLoopCount.value); @@ -1293,7 +1294,7 @@ class ChartingState extends MusicBeatState { var strum = note[0] + Conductor.stepCrochet * (getSectionBeats(daSec - value1) * 4 * value1); - + if (swapNotes) note[1] = (note[1] + 4) % 8; var copiedNote:Array = [strum, note[1], note[2], note[3]]; inline _song.notes[daSec].sectionNotes.push(copiedNote); } @@ -1320,6 +1321,7 @@ class ChartingState extends MusicBeatState var copyNextButton:FlxButton = new FlxButton(CopyNextSectionCount.x, CopyNextSectionCount.y + 20, "Copy to the next..", function() { + var swapNotes:Bool = FlxG.keys.pressed.CONTROL; var value:Int = Std.int(CopyNextSectionCount.value); if(value == 0) { return; @@ -1331,15 +1333,15 @@ class ChartingState extends MusicBeatState saveUndo(_song); //I don't even know why. for(i in 0...value) { - changeSection(curSec+1); - for (note in _song.notes[curSec-1].sectionNotes) - { - var strum = note[0] + Conductor.stepCrochet * (getSectionBeats(curSec-1) * 4); - + changeSection(curSec+1); + for (note in _song.notes[curSec-1].sectionNotes) + { + var strum = note[0] + Conductor.stepCrochet * (getSectionBeats(curSec-1) * 4); - var copiedNote:Array = [strum, note[1], note[2], note[3]]; - _song.notes[curSec].sectionNotes.push(copiedNote); - } + if (swapNotes) note[1] = (note[1] + 4) % 8; + var copiedNote:Array = [strum, note[1], note[2], note[3]]; + _song.notes[curSec].sectionNotes.push(copiedNote); + } } updateGrid(false); }); diff --git a/source/editors/EditorPlayState.hx b/source/editors/EditorPlayState.hx index 69efac75165..f1dfdd27c9d 100644 --- a/source/editors/EditorPlayState.hx +++ b/source/editors/EditorPlayState.hx @@ -229,8 +229,6 @@ class EditorPlayState extends MusicBeatState final gottaHitNote:Bool = (songNotes[1] < 4 ? section.mustHitSection : !section.mustHitSection); - var oldNote:PreloadedChartNote = unspawnNotes[unspawnNotes.length - 1]; - final swagNote:PreloadedChartNote = cast { strumTime: daStrumTime, noteData: daNoteData, @@ -244,8 +242,6 @@ class EditorPlayState extends MusicBeatState isSustainEnd: false, sustainLength: songNotes[2], sustainScale: 0, - parent: null, - prevNote: oldNote, hitHealth: 0.023, missHealth: 0.0475, wasHit: false, @@ -264,8 +260,6 @@ class EditorPlayState extends MusicBeatState final floorSus:Int = Math.floor(swagNote.sustainLength / Conductor.stepCrochet); if (floorSus > 0) { for (susNote in 0...floorSus + 1) { - oldNote = unspawnNotes[Std.int(unspawnNotes.length - 1)]; - final sustainNote:PreloadedChartNote = cast { strumTime: daStrumTime + (Conductor.stepCrochet * susNote), noteData: daNoteData, @@ -279,8 +273,7 @@ class EditorPlayState extends MusicBeatState isSustainEnd: susNote == floorSus, sustainLength: 0, sustainScale: 1 / ratio, - parent: swagNote, - prevNote: oldNote, + parentST: swagNote.strumTime, hitHealth: 0.023, missHealth: 0.0475, wasHit: false, diff --git a/source/editors/WeekEditorState.hx b/source/editors/WeekEditorState.hx index f18de6a0519..6afe09dfb66 100644 --- a/source/editors/WeekEditorState.hx +++ b/source/editors/WeekEditorState.hx @@ -840,7 +840,7 @@ class WeekEditorFreeplayState extends MusicBeatState FlxG.sound.volumeUpKeys = TitleState.volumeUpKeys; if(FlxG.keys.justPressed.ESCAPE) { FlxG.switchState(editors.MasterEditorMenu.new); - FlxG.sound.playMusic(Paths.music('freakyMenu')); + FlxG.sound.playMusic(Paths.music('freakyMenu-' + ClientPrefs.daMenuMusic)); if (music != null && music.music != null) music.destroy(); }