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 68be862d334..9e029cc8091 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -2901,6 +2901,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; @@ -2913,22 +2915,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: @@ -2940,7 +2939,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') { @@ -2973,7 +2973,7 @@ class PlayState extends MusicBeatState multiChangeEvents[1].shift(); } - final swagNote:PreloadedChartNote = cast { + swagNote = cast { strumTime: daStrumTime, noteData: daNoteData, mustPress: bothSides || gottaHitNote, @@ -2983,19 +2983,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); @@ -3009,6 +3004,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; @@ -3027,54 +3051,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 { @@ -4110,8 +4098,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++; } } @@ -4386,10 +4373,10 @@ class PlayState extends MusicBeatState case 'Credits Popup': { var string1:String = value1; - if (value1 == '') string1 = SONG.song; + if (value1.length < 1) string1 = SONG.song; var string2:String = value2; - if (value2 == '') string2 = SONG.songCredit; - var creditsPopup:CreditsPopUp = new CreditsPopUp(FlxG.width, 200, value1, value2); + if (value2.length < 1) string2 = SONG.songCredit; + var creditsPopup:CreditsPopUp = new CreditsPopUp(FlxG.width, 200, string1, string2); creditsPopup.camera = camHUD; creditsPopup.scrollFactor.set(); creditsPopup.x = creditsPopup.width * -1; diff --git a/source/StartupState.hx b/source/StartupState.hx index 0a0e7457451..82b9bc13baf 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 aa2497eba18..f71be6615f8 100644 --- a/source/editors/ChartingState.hx +++ b/source/editors/ChartingState.hx @@ -1144,7 +1144,6 @@ class ChartingState extends MusicBeatState { var strum = note[0] + Conductor.stepCrochet * (getSectionBeats(daSec) * 4 * value); - var copiedNote:Array = [strum, note[1], note[2], note[3]]; _song.notes[daSec].sectionNotes.push(copiedNote); } @@ -1288,6 +1287,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); @@ -1307,8 +1307,9 @@ class ChartingState extends MusicBeatState { var strum = note[0] + Conductor.stepCrochet * (getSectionBeats(daSec - value1) * 4 * value1); - - var copiedNote:Array = [strum, note[1], note[2], note[3]]; + var data = note[1]; + if (swapNotes) data = Std.int(note[1] + 4) % 8; + var copiedNote:Array = [strum, data, note[2], note[3]]; inline _song.notes[daSec].sectionNotes.push(copiedNote); } if (curSection - value1 < 0) @@ -1334,6 +1335,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; @@ -1345,15 +1347,16 @@ 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); - } + var data = note[1]; + if (swapNotes) data = Std.int(note[1] + 4) % 8; + var copiedNote:Array = [strum, data, 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 105deec9cfa..89034b3fe32 100644 --- a/source/editors/EditorPlayState.hx +++ b/source/editors/EditorPlayState.hx @@ -239,8 +239,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, @@ -254,8 +252,6 @@ class EditorPlayState extends MusicBeatState isSustainEnd: false, sustainLength: songNotes[2], sustainScale: 0, - parent: null, - prevNote: oldNote, hitHealth: 0.023, missHealth: 0.0475, wasHit: false, @@ -274,8 +270,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, @@ -289,8 +283,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 0751a23a4d8..950cf561c04 100644 --- a/source/editors/WeekEditorState.hx +++ b/source/editors/WeekEditorState.hx @@ -848,7 +848,7 @@ class WeekEditorFreeplayState extends MusicBeatState FlxG.sound.volumeUpKeys = TitleState.volumeUpKeys; if(virtualPad.buttonB.justPressed || 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(); } diff --git a/source/options/VisualsUISubState.hx b/source/options/VisualsUISubState.hx index 6696d60c746..35ef4cfb327 100644 --- a/source/options/VisualsUISubState.hx +++ b/source/options/VisualsUISubState.hx @@ -77,7 +77,7 @@ class VisualsUISubState extends BaseOptionsMenu "Which note splash would you like?", 'splashType', 'string', - 'Psych Engine', + 'Default', noteSplashList); addOption(option); }