added toggle for ghost tapping

This commit is contained in:
KadeDev 2021-04-27 14:03:39 -07:00
parent bd2bd59cca
commit 18034002c4
4 changed files with 42 additions and 1 deletions

View File

@ -60,6 +60,9 @@ class KadeEngineData
if (FlxG.save.data.watermark == null)
FlxG.save.data.watermark = true;
if (FlxG.save.data.ghost == null)
FlxG.save.data.ghost = true;
Conductor.recalculateTimings();
Main.watermarks = FlxG.save.data.watermark;

View File

@ -69,6 +69,8 @@ class Option
public function right():Bool { return throw "stub!"; }
}
class DFJKOption extends Option
{
private var controls:Controls;
@ -119,6 +121,27 @@ class DownscrollOption extends Option
}
}
class GhostTapOption extends Option
{
public function new(desc:String)
{
super();
description = desc;
}
public override function press():Bool
{
FlxG.save.data.ghost = !FlxG.save.data.ghost;
display = updateDisplay();
return true;
}
private override function updateDisplay():String
{
return FlxG.save.data.ghost ? "Ghost Tapping" : "No Ghost Tapping";
}
}
class AccuracyOption extends Option
{
public function new(desc:String)

View File

@ -22,6 +22,7 @@ class OptionsMenu extends MusicBeatState
var options:Array<OptionCatagory> = [
new OptionCatagory("Gameplay", [
new DFJKOption(controls),
new GhostTapOption("Ghost Tapping is when you tap a direction and it doesn't give you a miss."),
new Judgement("Customize your Hit Timings (LEFT or RIGHT)"),
#if desktop
new FPSCapOption("Cap your FPS (Left for -10, Right for +10. SHIFT to go faster)"),

View File

@ -3249,6 +3249,14 @@ class PlayState extends MusicBeatState
goodNoteHit(possibleNotes[0]);
else if (possibleNotes.length > 0 && !dontCheck)
{
if (!FlxG.save.data.ghost)
{
for (shit in 0...pressArray.length)
{ // if a direction is hit that shouldn't be
if (pressArray[shit] && !directionList.contains(shit))
noteMiss(shit, null);
}
}
for (coolNote in possibleNotes)
{
if (pressArray[coolNote.noteData])
@ -3260,8 +3268,14 @@ class PlayState extends MusicBeatState
}
}
}
else if (!FlxG.save.data.ghost)
{
for (shit in 0...pressArray.length)
if (pressArray[shit])
noteMiss(shit, null);
}
if (dontCheck && possibleNotes.length > 0)
if (dontCheck && possibleNotes.length > 0 && FlxG.save.data.ghost)
{
if (mashViolations > 4)
{