diff --git a/buildnumber.txt b/buildnumber.txt index a6f32fc6..4c97b937 100644 --- a/buildnumber.txt +++ b/buildnumber.txt @@ -1 +1 @@ -2236 \ No newline at end of file +2239 \ No newline at end of file diff --git a/source/funkin/game/PlayState.hx b/source/funkin/game/PlayState.hx index 5d0d7c8c..3a0b97eb 100644 --- a/source/funkin/game/PlayState.hx +++ b/source/funkin/game/PlayState.hx @@ -131,6 +131,10 @@ class PlayState extends MusicBeatState * Whenever the player can die. */ public var canDie:Bool = !opponentMode && !coopMode; + /** + * Whenever Ghost Tapping is enabled. + */ + public var ghostTapping:Bool = Options.ghostTapping; /** * Whenever the opponent can die. */ @@ -277,7 +281,7 @@ class PlayState extends MusicBeatState /** * Whenever the misses should show "Combo Breaks" instead of "Misses" */ - public var comboBreaks:Bool = false; + public var comboBreaks:Bool = !Options.ghostTapping; /** * Health bar background. */ @@ -1458,6 +1462,10 @@ class PlayState extends MusicBeatState }); } + if (!p.ghostTapping) for(k=>p in __justPressed) if (p && notePerStrum[k] == null) { + // FUCK YOU + noteMiss(null, k, id); + } for(e in notePerStrum) if (e != null) goodNoteHit(e); p.forEach(function(str:Strum) { @@ -1470,14 +1478,21 @@ class PlayState extends MusicBeatState /** * Misses a note * @param note Note to miss. + * @param direction Specify a custom direction in case note is null. + * @param player Specify a custom player in case note is null. */ - public function noteMiss(note:Note):Void + public function noteMiss(note:Note, ?direction:Int, ?player:Int):Void { - var event:NoteHitEvent = scripts.event("onPlayerMiss", EventManager.get(NoteHitEvent).recycle(true, false, false, note, note.strumLine.characters, true, note.noteType, "", "", "", note.strumID, -10, 0, -0.04, "shit")); + var playerID:Null = note == null ? player : note.strumLineID; + var directionID:Null = note == null ? direction : note.strumID; + if (playerID == null || directionID == null) return; + + var event:NoteHitEvent = scripts.event("onPlayerMiss", EventManager.get(NoteHitEvent).recycle(true, false, false, note, players[player].characters, true, note != null ? note.noteType : null, "", "", "", directionID, -10, 0, -0.04, "shit")); if (event.cancelled) return; - if (event.note.strumLine != null) event.note.strumLine.addHealth(event.healthGain); + + if (event.note != null && event.note.strumLine != null) event.note.strumLine.addHealth(event.healthGain); if (gf != null && combo > 5 && gf.hasAnimation('sad')) gf.playAnim('sad', event.forceAnim, MISS); combo = 0; @@ -1500,7 +1515,7 @@ class PlayState extends MusicBeatState if (char == null) continue; char.stunned = true; - char.playSingAnim(note.strumID, "miss", MISS); + char.playSingAnim(directionID, "miss", MISS); } // boyfriend.stunned = true; @@ -1671,6 +1686,7 @@ class PlayState extends MusicBeatState * @param note Note to delete */ public function deleteNote(note:Note) { + if (note == null) return; var event:SimpleNoteEvent = scripts.event("onNoteDelete", EventManager.get(SimpleNoteEvent).recycle(note)); if (!event.cancelled) { scripts.call("onNoteDelete", [note]); diff --git a/source/funkin/game/StrumLine.hx b/source/funkin/game/StrumLine.hx index a70f2730..fa92dafd 100644 --- a/source/funkin/game/StrumLine.hx +++ b/source/funkin/game/StrumLine.hx @@ -24,7 +24,20 @@ class StrumLine extends FlxTypedGroup { * Controls assigned to this strumline. */ public var controls:Controls = null; + /** + * Whenever Ghost Tapping is enabled. + */ + @:isVar public var ghostTapping(get, set):Null = false; + private function get_ghostTapping() { + if (this.ghostTapping != null) return this.ghostTapping; + if (PlayState.instance != null) return PlayState.instance.ghostTapping; + return false; + } + + private inline function set_ghostTapping(b:Bool):Bool + return this.ghostTapping = b; + private var strumOffset:Float = 0.25; public function new(characters:Array, strumOffset:Float = 0.25, cpu:Bool = false, opponentSide:Bool = true, ?controls:Controls) { diff --git a/source/funkin/options/Options.hx b/source/funkin/options/Options.hx index 44478e85..b73f7c1b 100644 --- a/source/funkin/options/Options.hx +++ b/source/funkin/options/Options.hx @@ -17,6 +17,7 @@ class Options */ public static var naughtyness:Bool = true; public static var downscroll:Bool = false; + public static var ghostTapping:Bool = false; public static var flashingMenu:Bool = true; public static var camZoomOnBeat:Bool = true; public static var fpsCounter:Bool = true; diff --git a/source/funkin/system/Main.hx b/source/funkin/system/Main.hx index 9c457306..c5b4c304 100644 --- a/source/funkin/system/Main.hx +++ b/source/funkin/system/Main.hx @@ -262,7 +262,5 @@ class Main extends Sprite Paths.assetsTree.clearCache(); MemoryUtil.clearMajor(); - - // FlxG.bitmap.dumpCache(); } }