From 01d21e3391bc8892cc75a884ca6a530ae9446b8c Mon Sep 17 00:00:00 2001 From: CharlesCatYT Date: Fri, 29 Mar 2024 21:50:44 -0400 Subject: [PATCH] oh look updated input system --- source/objects/Note.hx | 1 + source/states/PlayState.hx | 240 +++++++++++------------ source/states/editors/EditorPlayState.hx | 226 +++++++++++---------- 3 files changed, 230 insertions(+), 237 deletions(-) diff --git a/source/objects/Note.hx b/source/objects/Note.hx index b873a12..016822b 100644 --- a/source/objects/Note.hx +++ b/source/objects/Note.hx @@ -37,6 +37,7 @@ class Note extends FlxSprite public var strumTime:Float = 0; public var noteData:Int = 0; + public var strumLine:Int = 0; public var mustPress:Bool = false; public var canBeHit:Bool = false; diff --git a/source/states/PlayState.hx b/source/states/PlayState.hx index ba02342..9b7f9d0 100644 --- a/source/states/PlayState.hx +++ b/source/states/PlayState.hx @@ -1398,10 +1398,10 @@ class PlayState extends MusicBeatState notes = new FlxTypedGroup(); add(notes); - var noteData:Array; + /*var noteData:Array; // NEW SHIT - noteData = songData.notes; + noteData = songData.notes;*/ var file:String = Paths.json(songName + '/events'); #if MODS_ALLOWED @@ -1410,95 +1410,119 @@ class PlayState extends MusicBeatState if(OpenFlAssets.exists(file)) { #end var eventsData:Array = Song.loadFromJson('events', songName).events; - for (event in eventsData) //Event Notes - for (i in 0...event[1].length) makeEvent(event, i); + for (event in eventsData) for (i in 0...event[1].length) makeEvent(event, i); //Event Notes } - for (section in noteData) + var ghostNotesCleared: Int = 0; + var noteDatas: Array = []; + + for (section in songData.notes) { - for (songNotes in section.sectionNotes) + for (i in 0...section.sectionNotes.length) { - var daStrumTime:Float = songNotes[0]; - var daNoteData:Int = Std.int(songNotes[1] % 4); - var gottaHitNote:Bool = section.mustHitSection; - - if(songNotes[1] > 3) gottaHitNote = !section.mustHitSection; - - var oldNote:Note; - if(unspawnNotes.length > 0) oldNote = unspawnNotes[Std.int(unspawnNotes.length - 1)]; - else oldNote = null; - - var swagNote:Note = new Note(daStrumTime, daNoteData, oldNote); - swagNote.mustPress = gottaHitNote; - swagNote.sustainLength = songNotes[2]; - swagNote.gfNote = (section.gfSection && (songNotes[1]<4)); - swagNote.noteType = songNotes[3]; - if(!Std.isOfType(songNotes[3], String)) swagNote.noteType = ChartingState.noteTypeList[songNotes[3]]; //Backward compatibility + compatibility with Week 7 charts - - swagNote.scrollFactor.set(); + final songNotes: Array = section.sectionNotes[i]; + if (songNotes[1] == -1) + continue; - unspawnNotes.push(swagNote); - - final susLength:Float = swagNote.sustainLength / Conductor.stepCrochet; - final floorSus:Int = Math.floor(susLength); - - if(floorSus > 0) { - for (susNote in 0...floorSus + 1) + var gottaHitNote:Bool = section.mustHitSection; + if (songNotes[1] > 3) gottaHitNote = !section.mustHitSection; + + final leNoteData: ChartNoteData = { + time: songNotes[0], + id: Std.int(songNotes[1] % 4), + sLen: songNotes[2], + strumLine: gottaHitNote ? 1 : 0, + isGfNote: (section.gfSection && (songNotes[1]<4)), + type: songNotes[3] + }; + if(!Std.isOfType(songNotes[3], String)) leNoteData.type = ChartingState.noteTypeList[songNotes[3]]; //Backwards compatibility + compatibility with Week 7/Funkin' Yarn charts and some other engines + + if (i != 0) { + // CLEAR ANY POSSIBLE JACKS + for (evilNoteData in noteDatas) { + if (evilNoteData.id == leNoteData.id // does its direction match? + && evilNoteData.strumLine == leNoteData.strumLine // does it strumline match? + && Math.abs(evilNoteData.time - leNoteData.time) < 1.0) { // is it in the same step? + evilNoteData.dispose(); + noteDatas.remove(evilNoteData); + ghostNotesCleared++; + //continue; + } + } + } + noteDatas.push(leNoteData); + } + } + + for (i in 0...noteDatas.length) { + var oldNote:Note = null; + if (unspawnNotes.length > 0) oldNote = unspawnNotes[Std.int(unspawnNotes.length - 1)]; + + var swagNote:Note = new Note(noteDatas[i].time, noteDatas[i].id, oldNote); + swagNote.mustPress = noteDatas[i].strumLine == 1; + swagNote.sustainLength = noteDatas[i].sLen; + swagNote.strumLine = noteDatas[i].strumLine; + swagNote.gfNote = noteDatas[i].isGfNote; + swagNote.noteType = noteDatas[i].type; + swagNote.scrollFactor.set(); + unspawnNotes.push(swagNote); + + final susLength:Float = swagNote.sustainLength / Conductor.stepCrochet; + final floorSus:Int = Math.floor(susLength); + + if(floorSus != 0) { + for (susNote in 0...floorSus + 1) { + oldNote = unspawnNotes[Std.int(unspawnNotes.length - 1)]; + + var sustainNote:Note = new Note(noteDatas[i].time + (Conductor.stepCrochet * susNote), noteDatas[i].id, oldNote, true); + sustainNote.mustPress = swagNote.mustPress; + sustainNote.gfNote = swagNote.gfNote; + sustainNote.strumLine = swagNote.strumLine; + sustainNote.noteType = swagNote.noteType; + sustainNote.scrollFactor.set(); + sustainNote.parent = swagNote; + unspawnNotes.push(sustainNote); + swagNote.tail.push(sustainNote); + + sustainNote.correctionOffset = swagNote.height / 2; + if(!PlayState.isPixelStage) { - oldNote = unspawnNotes[Std.int(unspawnNotes.length - 1)]; - - var sustainNote:Note = new Note(daStrumTime + (Conductor.stepCrochet * susNote), daNoteData, oldNote, true); - sustainNote.mustPress = gottaHitNote; - sustainNote.gfNote = (section.gfSection && (songNotes[1]<4)); - sustainNote.noteType = swagNote.noteType; - sustainNote.scrollFactor.set(); - sustainNote.parent = swagNote; - unspawnNotes.push(sustainNote); - swagNote.tail.push(sustainNote); - - sustainNote.correctionOffset = swagNote.height / 2; - if(!PlayState.isPixelStage) + if(oldNote.isSustainNote) { - if(oldNote.isSustainNote) - { - oldNote.scale.y *= Note.SUSTAIN_SIZE / oldNote.frameHeight; - oldNote.scale.y /= playbackRate; - oldNote.updateHitbox(); - } - - if(ClientPrefs.data.downScroll) sustainNote.correctionOffset = 0; - }else if(oldNote.isSustainNote){ + oldNote.scale.y *= Note.SUSTAIN_SIZE / oldNote.frameHeight; oldNote.scale.y /= playbackRate; oldNote.updateHitbox(); } - if (sustainNote.mustPress) sustainNote.x += FlxG.width / 2; // general offset - else if(ClientPrefs.data.middleScroll) - { - sustainNote.x += 310; - if(daNoteData > 1) //Up and Right - sustainNote.x += FlxG.width / 2 + 25; - } + if(ClientPrefs.data.downScroll) sustainNote.correctionOffset = 0; + } + else if(oldNote.isSustainNote) { + oldNote.scale.y /= playbackRate; + oldNote.updateHitbox(); } - } - if(swagNote.mustPress){ - swagNote.x += FlxG.width / 2; // general offset - }else if(ClientPrefs.data.middleScroll){ - swagNote.x += 310; - if(daNoteData > 1) //Up and Right - { - swagNote.x += FlxG.width / 2 + 25; + if (sustainNote.mustPress) sustainNote.x += FlxG.width / 2; // general offset + else if(ClientPrefs.data.middleScroll) { + sustainNote.x += 310; + if (noteDatas[i].id > 1) sustainNote.x += FlxG.width / 2 + 25; //Up and Right } } + } - if(!noteTypes.contains(swagNote.noteType)) noteTypes.push(swagNote.noteType); + if (swagNote.mustPress) swagNote.x += FlxG.width / 2; // general offset + else if(ClientPrefs.data.middleScroll) + { + swagNote.x += 310; + if (noteDatas[i].id > 1) swagNote.x += FlxG.width / 2 + 25; //Up and Right } + + if (!noteTypes.contains(swagNote.noteType)) noteTypes.push(swagNote.noteType); } for (event in songData.events) //Event Notes for (i in 0...event[1].length) makeEvent(event, i); - + trace('["${SONG.song.toUpperCase()}" CHART INFO]: Ghost Notes Cleared: $ghostNotesCleared'); unspawnNotes.sort(sortByTime); + generatedMusic = true; } @@ -2763,37 +2787,24 @@ class PlayState extends MusicBeatState private function keyPressed(key:Int) { - if(cpuControlled || paused || inCutscene || key < 0 || key >= playerStrums.length || !generatedMusic || endingSong || boyfriend.stunned) return; + if(cpuControlled || paused || inCutscene || key < 0 || key > playerStrums.length || !generatedMusic || endingSong || boyfriend.stunned) return; var ret:Dynamic = callOnScripts('onKeyPressPre', [key]); - if(ret == FunkinLua.Function_Stop) return; - + if(ret == LuaUtils.Function_Stop) return; // more accurate hit time for the ratings? var lastTime:Float = Conductor.songPosition; if(Conductor.songPosition >= 0) Conductor.songPosition = FlxG.sound.music.time; + // obtain notes that the player can hit - var plrInputNotes:Array = notes.members.filter(function(n:Note):Bool { - var canHit:Bool = !strumsBlocked[n.noteData] && n.canBeHit && n.mustPress && !n.tooLate && !n.wasGoodHit && !n.blockHit; - return n != null && canHit && !n.isSustainNote && n.noteData == key; + final plrInputNotes:Array = notes.members.filter(function(n:Note):Bool { + final noteIsHittable:Bool = strumsBlocked[n.noteData] == false && n.canBeHit && n.mustPress && !n.tooLate && !n.wasGoodHit && !n.blockHit; + return n != null && noteIsHittable && !n.isSustainNote && n.noteData == key; }); plrInputNotes.sort(sortHitNotes); - shouldMiss = !ClientPrefs.data.ghostTapping; - if (plrInputNotes.length != 0) { // slightly faster than doing `> 0` lol - var funnyNote:Note = plrInputNotes[0]; // front note - // trace('โœกโš๐Ÿ•†โ˜ผ ๐Ÿ’ฃโš๐Ÿ’ฃ'); - if (plrInputNotes.length > 1) { - var doubleNote:Note = plrInputNotes[1]; - if (doubleNote.noteData == funnyNote.noteData) { - // if the note has a 0ms distance (is on top of the current note), kill it - if (Math.abs(doubleNote.strumTime - funnyNote.strumTime) < 1.0) - invalidateNote(doubleNote); - else if (doubleNote.strumTime < funnyNote.strumTime) - { - // replace the note if its ahead of time (or at least ensure "doubleNote" is ahead) - funnyNote = doubleNote; - } - } - } + + final shouldMiss:Bool = !ClientPrefs.data.ghostTapping; + if (plrInputNotes.length != 0) { // nicer on the GPU usage than doing `> 0` lol + final funnyNote:Note = plrInputNotes[0]; // front note goodNoteHit(funnyNote); } else if(shouldMiss) @@ -2801,13 +2812,13 @@ class PlayState extends MusicBeatState callOnScripts('onGhostTap', [key]); noteMissPress(key); } - // Needed for the "Just the Two of Us" achievement. // - Shadow Mario if(!keysPressed.contains(key)) keysPressed.push(key); //more accurate hit time for the ratings? part 2 (Now that the calculations are done, go back to the time it was before for not causing a note stutter) Conductor.songPosition = lastTime; - var spr:StrumNote = playerStrums.members[key]; + + final spr:StrumNote = playerStrums.members[key]; if(strumsBlocked[key] != true && spr != null && spr.animation.curAnim.name != 'confirm') { spr.playAnim('pressed'); @@ -2935,15 +2946,13 @@ class PlayState extends MusicBeatState function noteMissCommon(direction:Int, note:Note = null) { - if(shakeOnMiss) FlxG.camera.shake(0.0075, 0.1, null, true, X); - // score and data var subtract:Float = 0.05; - if(note != null) subtract = note.missHealth; + if (note != null) subtract = note.missHealth; // GUITAR HERO SUSTAIN CHECK LOL!!!! if (note != null && guitarHeroSustains && note.parent == null) { - if(note.tail.length > 0) { + if(note.tail.length != 0) { note.alpha = 0.35; for(childNote in note.tail) { childNote.alpha = note.alpha; @@ -2954,22 +2963,18 @@ class PlayState extends MusicBeatState } note.missed = true; note.canBeHit = false; - //subtract += 0.385; // you take more damage if playing with this gameplay changer enabled. - // i mean its fair :p -Crow + // i mean its fair :P -Crow subtract *= note.tail.length + 1; // i think it would be fair if damage multiplied based on how long the sustain is -Tahir } - - if (note.missed) - return; + if (note.missed) return; } if (note != null && guitarHeroSustains && note.parent != null && note.isSustainNote) { - if (note.missed) - return; + if (note.missed) return; var parentNote:Note = note.parent; - if (parentNote.wasGoodHit && parentNote.tail.length > 0) { + if (parentNote.wasGoodHit && parentNote.tail.length != 0) { for (child in parentNote.tail) if (child != note) { child.missed = true; child.canBeHit = false; @@ -2978,35 +2983,28 @@ class PlayState extends MusicBeatState } } } - if(instakillOnMiss) { vocals.volume = 0; opponentVocals.volume = 0; doDeathCheck(true); } - var lastCombo:Int = combo; combo = 0; - health -= subtract * healthLoss; if(!practiceMode) songScore -= 10; if(!endingSong) songMisses++; totalPlayed++; RecalculateRating(true); - // play character anims var char:Character = boyfriend; if((note != null && note.gfNote) || (SONG.notes[curSection] != null && SONG.notes[curSection].gfSection)) char = gf; - if(char != null && (note == null || !note.noMissAnimation) && char.hasMissAnimations) { - var suffix:String = ''; - if(note != null) suffix = note.animSuffix; - - var animToPlay:String = singAnimations[Std.int(Math.abs(Math.min(singAnimations.length-1, direction)))] + 'miss' + suffix; + var postfix:String = ''; + if(note != null) postfix = note.animSuffix; + var animToPlay:String = singAnimations[Std.int(Math.abs(Math.min(singAnimations.length-1, direction)))] + 'miss' + postfix; char.playAnim(animToPlay, true); - if(char != gf && lastCombo > 5 && gf != null && gf.animOffsets.exists('sad')) { gf.playAnim('sad'); @@ -3564,10 +3562,10 @@ class PlayState extends MusicBeatState function fullComboUpdate() { - var sicks:Int = ratingsData[0].hits; - var goods:Int = ratingsData[1].hits; - var bads:Int = ratingsData[2].hits; - var shits:Int = ratingsData[3].hits; + final sicks:Int = ratingsData[0].hits; + final goods:Int = ratingsData[1].hits; + final bads:Int = ratingsData[2].hits; + final shits:Int = ratingsData[3].hits; ratingFC = 'Clear'; if(songMisses < 1){ diff --git a/source/states/editors/EditorPlayState.hx b/source/states/editors/EditorPlayState.hx index 7d0cae7..1cf38fe 100644 --- a/source/states/editors/EditorPlayState.hx +++ b/source/states/editors/EditorPlayState.hx @@ -422,101 +422,110 @@ class EditorPlayState extends MusicBeatSubstate notes = new FlxTypedGroup(); add(notes); - var noteData:Array; + var noteDatas: Array = []; - // NEW SHIT - noteData = songData.notes; - for (section in noteData) - { - for (songNotes in section.sectionNotes) - { - var daStrumTime:Float = songNotes[0]; - if(daStrumTime < startPos) continue; + for (section in songData.notes) { for (i in 0...section.sectionNotes.length) { + final songNotes: Array = section.sectionNotes[i]; + if (songNotes[1] == -1) + continue; - var daNoteData:Int = Std.int(songNotes[1] % 4); var gottaHitNote:Bool = section.mustHitSection; - - if (songNotes[1] > 3) - { - gottaHitNote = !section.mustHitSection; + if (songNotes[1] > 3) gottaHitNote = !section.mustHitSection; + + final leNoteData: ChartNoteData = { + time: songNotes[0], + id: Std.int(songNotes[1] % 4), + sLen: songNotes[2], + strumLine: gottaHitNote ? 1 : 0, + isGfNote: (section.gfSection && (songNotes[1]<4)), + type: songNotes[3] + }; + if(!Std.isOfType(songNotes[3], String)) leNoteData.type = ChartingState.noteTypeList[songNotes[3]]; //Backwards compatibility + compatibility with Week 7 charts + + if (i != 0) { + // CLEAR ANY POSSIBLE JACKS + for (evilNoteData in noteDatas) { + if (evilNoteData.id == leNoteData.id // does its direction match? + && evilNoteData.strumLine == leNoteData.strumLine // does it strumline match? + && Math.abs(evilNoteData.time - leNoteData.time) < 1.0) { // is it in the same step? + evilNoteData.dispose(); + noteDatas.remove(evilNoteData); + //continue; + } + } } + noteDatas.push(leNoteData); + } + } - var oldNote:Note; - if (unspawnNotes.length > 0) - oldNote = unspawnNotes[Std.int(unspawnNotes.length - 1)]; - else - oldNote = null; - - var swagNote:Note = new Note(daStrumTime, daNoteData, oldNote, this); - swagNote.mustPress = gottaHitNote; - swagNote.sustainLength = songNotes[2]; - //swagNote.gfNote = (section.gfSection && (songNotes[1]<4)); - swagNote.noteType = songNotes[3]; - if(!Std.isOfType(songNotes[3], String)) swagNote.noteType = ChartingState.noteTypeList[songNotes[3]]; //Backward compatibility + compatibility with Week 7 charts + for (i in 0...noteDatas.length) { + var oldNote:Note = null; + if (unspawnNotes.length > 0) oldNote = unspawnNotes[Std.int(unspawnNotes.length - 1)]; - swagNote.scrollFactor.set(); + var swagNote:Note = new Note(noteDatas[i].time, noteDatas[i].id, oldNote); + swagNote.mustPress = noteDatas[i].strumLine == 1; + swagNote.sustainLength = noteDatas[i].sLen; + swagNote.strumLine = noteDatas[i].strumLine; + swagNote.gfNote = noteDatas[i].isGfNote; + swagNote.noteType = noteDatas[i].type; + swagNote.scrollFactor.set(); + unspawnNotes.push(swagNote); - unspawnNotes.push(swagNote); + final susLength:Float = swagNote.sustainLength / Conductor.stepCrochet; + final floorSus:Int = Math.floor(susLength); - final susLength:Float = swagNote.sustainLength / Conductor.stepCrochet; - final floorSus:Int = Math.floor(susLength); + if(floorSus != 0) { + for (susNote in 0...floorSus + 1) + { + oldNote = unspawnNotes[Std.int(unspawnNotes.length - 1)]; - if(floorSus > 0) { - for (susNote in 0...floorSus + 1) + var sustainNote:Note = new Note(noteDatas[i].time + (Conductor.stepCrochet * susNote), noteDatas[i].id, oldNote, true); + sustainNote.mustPress = swagNote.mustPress; + sustainNote.gfNote = swagNote.gfNote; + sustainNote.strumLine = swagNote.strumLine; + sustainNote.noteType = swagNote.noteType; + sustainNote.scrollFactor.set(); + sustainNote.parent = swagNote; + unspawnNotes.push(sustainNote); + swagNote.tail.push(sustainNote); + + sustainNote.correctionOffset = swagNote.height / 2; + if(!PlayState.isPixelStage) { - oldNote = unspawnNotes[Std.int(unspawnNotes.length - 1)]; - - var sustainNote:Note = new Note(daStrumTime + (Conductor.stepCrochet * susNote), daNoteData, oldNote, true, this); - sustainNote.mustPress = gottaHitNote; - //sustainNote.gfNote = (section.gfSection && (songNotes[1]<4)); - sustainNote.noteType = swagNote.noteType; - sustainNote.scrollFactor.set(); - sustainNote.parent = swagNote; - unspawnNotes.push(sustainNote); - swagNote.tail.push(sustainNote); - - sustainNote.correctionOffset = swagNote.height / 2; - if(!PlayState.isPixelStage) - { - if(oldNote.isSustainNote) - { - oldNote.scale.y *= Note.SUSTAIN_SIZE / oldNote.frameHeight; - oldNote.scale.y /= playbackRate; - oldNote.updateHitbox(); - } - - if(ClientPrefs.data.downScroll) - sustainNote.correctionOffset = 0; - } - else if(oldNote.isSustainNote) + if(oldNote.isSustainNote) { + oldNote.scale.y *= Note.SUSTAIN_SIZE / oldNote.frameHeight; oldNote.scale.y /= playbackRate; oldNote.updateHitbox(); } - if (sustainNote.mustPress) sustainNote.x += FlxG.width / 2; // general offset - else if(ClientPrefs.data.middleScroll) - { - sustainNote.x += 310; - if(daNoteData > 1) //Up and Right - sustainNote.x += FlxG.width / 2 + 25; - } + if(ClientPrefs.data.downScroll) sustainNote.correctionOffset = 0; + } + else if(oldNote.isSustainNote) + { + oldNote.scale.y /= playbackRate; + oldNote.updateHitbox(); } - } - if (swagNote.mustPress) - { - swagNote.x += FlxG.width / 2; // general offset - } - else if(ClientPrefs.data.middleScroll) - { - swagNote.x += 310; - if(daNoteData > 1) //Up and Right + if (sustainNote.mustPress) sustainNote.x += FlxG.width / 2; // general offset + else if(ClientPrefs.data.middleScroll) { - swagNote.x += FlxG.width / 2 + 25; + sustainNote.x += 310; + if(noteDatas[i].id > 1) sustainNote.x += FlxG.width / 2 + 25; //Up and Right } } } + + if (swagNote.mustPress) + { + swagNote.x += FlxG.width / 2; // general offset + } + else if(ClientPrefs.data.middleScroll) + { + swagNote.x += 310; + if(noteDatas[i].id > 1) //Up and Right + swagNote.x += FlxG.width / 2 + 25; + } } unspawnNotes.sort(PlayState.sortByTime); @@ -617,8 +626,7 @@ class EditorPlayState extends MusicBeatSubstate note.rating = daRating.name; score = daRating.score; - if(daRating.noteSplash && !note.noteSplashData.disabled) - spawnNoteSplashOnNote(note); + if(daRating.noteSplash && !note.noteSplashData.disabled) spawnNoteSplashOnNote(note); if(!note.ratingDisabled) { @@ -770,13 +778,26 @@ class EditorPlayState extends MusicBeatSubstate private function keyPressed(key:Int) { - if(key < 0) return; + if(key < 0 || key > playerStrums.length) return; + + // more accurate hit time for the ratings? + var lastTime:Float = Conductor.songPosition; + if(Conductor.songPosition >= 0) Conductor.songPosition = FlxG.sound.music.time; // obtain notes that the player can hit - final inputNotes:Array = notes.members.filter(function(n:Note):Bool { - final isInputNote:Bool = n.canBeHit && n.mustPress && !n.isSustainNote; - return n != null && isInputNote && !n.wasGoodHit && !n.blockHit && !n.tooLate && n.noteData == key; + final plrInputNotes:Array = notes.members.filter(function(n:Note):Bool { + final noteIsHittable:Bool = n.canBeHit && n.mustPress && !n.tooLate && !n.wasGoodHit && !n.blockHit; + return n != null && noteIsHittable && !n.isSustainNote && n.noteData == key; }); + plrInputNotes.sort(PlayState.sortHitNotes); + + if (plrInputNotes.length != 0) { // nicer on the GPU usage than doing `> 0` lol + final funnyNote:Note = plrInputNotes[0]; // front note + goodNoteHit(funnyNote); + } + + //more accurate hit time for the ratings? part 2 (Now that the calculations are done, go back to the time it was before for not causing a note stutter) + Conductor.songPosition = lastTime; final spr:StrumNote = playerStrums.members[key]; if(spr != null && spr.animation.curAnim.name != 'confirm') @@ -784,33 +805,6 @@ class EditorPlayState extends MusicBeatSubstate spr.playAnim('pressed'); spr.resetAnim = 0; } - - if(inputNotes.length == 0) { - if (ClientPrefs.data.ghostTapping) - decreaseCombo(key); - } - else { - while (inputNotes.length != 0) { - var funnyNote:Note = inputNotes[0]; // front note - // trace('โœกโš๐Ÿ•†โ˜ผ ๐Ÿ’ฃโš๐Ÿ’ฃ'); - if(inputNotes.length > 1) { - inputNotes.sort(PlayState.sortHitNotes); - - final doubleNote:Note = inputNotes[1]; - if(doubleNote.noteData == funnyNote.noteData) { - // if the note has a 0ms distance (is on top of the current note), kill it - if (Math.abs(doubleNote.strumTime - funnyNote.strumTime) < 1.0) - invalidateNote(doubleNote); - else if (doubleNote.strumTime < funnyNote.strumTime) { - // replace the note if its ahead of time (or at least ensure "doubleNote" is ahead) - funnyNote = doubleNote; - } - } - } - goodNoteHit(funnyNote); - break; - } - } } private function onKeyRelease(event:KeyboardEvent):Void @@ -965,13 +959,13 @@ class EditorPlayState extends MusicBeatSubstate function noteMiss(daNote:Note):Void { //You didn't hit the key and let it go offscreen, also used by Hurt Notes //Dupe note remove - notes.forEachAlive((note:Note) -> { + notes.forEachAlive(function(note:Note) { if (daNote != note && daNote.mustPress && daNote.noteData == note.noteData && daNote.isSustainNote == note.isSustainNote && Math.abs(daNote.strumTime - note.strumTime) < 1) invalidateNote(daNote); }); if (daNote != null && guitarHeroSustains && daNote.parent == null) { - if(daNote.tail.length > 0) { + if(daNote.tail.length != 0) { daNote.alpha = 0.35; for(childNote in daNote.tail) { childNote.alpha = daNote.alpha; @@ -983,15 +977,15 @@ class EditorPlayState extends MusicBeatSubstate daNote.missed = true; daNote.canBeHit = false; } - - if (daNote.missed) return; + if (daNote.missed) + return; } - if (daNote != null && guitarHeroSustains && daNote.parent != null && daNote.isSustainNote) { - if (daNote.missed) return; - + if (daNote.missed) + return; + var parentNote:Note = daNote.parent; - if (parentNote.wasGoodHit && parentNote.tail.length > 0) { + if (parentNote.wasGoodHit && parentNote.tail.length != 0) { for (child in parentNote.tail) if (child != daNote) { child.missed = true; child.canBeHit = false; @@ -1000,7 +994,7 @@ class EditorPlayState extends MusicBeatSubstate } } } - + decreaseCombo(daNote.noteData); }