maybe fix? idk

This commit is contained in:
KadeDev 2021-03-30 18:38:47 -07:00
parent 790d0f0d4c
commit ad7cbda055
3 changed files with 67 additions and 24 deletions

View File

@ -103,6 +103,8 @@ class GameplayCustomizeState extends MusicBeatState
sick.x = FlxG.save.data.changedHitX; sick.x = FlxG.save.data.changedHitX;
sick.y = FlxG.save.data.changedHitY; sick.y = FlxG.save.data.changedHitY;
sick.updateHitbox();
FlxG.mouse.visible = true; FlxG.mouse.visible = true;
} }

View File

@ -175,40 +175,23 @@ class Note extends FlxSprite
} }
} }
var oneTime:Bool = false;
override function update(elapsed:Float) override function update(elapsed:Float)
{ {
super.update(elapsed); super.update(elapsed);
if (mustPress) if (mustPress)
{ {
if (strumTime > Conductor.songPosition - Conductor.safeZoneOffset if ((strumTime > Conductor.songPosition - Conductor.safeZoneOffset
&& strumTime < Conductor.songPosition + Conductor.safeZoneOffset) && strumTime < Conductor.songPosition + Conductor.safeZoneOffset))
{
canBeHit = true; canBeHit = true;
}
else else
canBeHit = false; canBeHit = false;
var noteDiff:Float = Math.abs(strumTime - Conductor.songPosition); if (strumTime < Conductor.songPosition - Conductor.safeZoneOffset && !wasGoodHit)
if (canBeHit)
{
if (noteDiff > Conductor.safeZoneOffset * 0.96)
rating = "shit";
else if (noteDiff < Conductor.safeZoneOffset * -0.96)
rating = "shit";
else if (noteDiff > Conductor.safeZoneOffset * 0.50)
rating = "bad";
else if (noteDiff < Conductor.safeZoneOffset * -0.50)
rating = "bad";
else if (noteDiff > Conductor.safeZoneOffset * 0.45)
rating = "good";
else if (noteDiff < Conductor.safeZoneOffset * -0.45)
rating = "good";
else
rating = "sick";
FlxG.watch.addQuick("Note " + this.ID,rating);
}
if (strumTime < Conductor.songPosition - (Conductor.safeZoneOffset * 0.80) && !wasGoodHit)
{ {
tooLate = true; tooLate = true;
rating = "shit"; rating = "shit";

View File

@ -66,6 +66,8 @@ class PlayState extends MusicBeatState
public static var rep:Replay; public static var rep:Replay;
public static var loadRep:Bool = false; public static var loadRep:Bool = false;
public static var noteBools:Array<Bool> = [false, false, false, false];
var halloweenLevel:Bool = false; var halloweenLevel:Bool = false;
var songLength:Float = 0; var songLength:Float = 0;
@ -2378,6 +2380,7 @@ class PlayState extends MusicBeatState
{ {
for (coolNote in possibleNotes) for (coolNote in possibleNotes)
{ {
if (controlArray[coolNote.noteData]) if (controlArray[coolNote.noteData])
goodNoteHit(coolNote); goodNoteHit(coolNote);
else else
@ -2395,6 +2398,17 @@ class PlayState extends MusicBeatState
{ {
if (loadRep) if (loadRep)
{ {
var noteDiff:Float = Math.abs(daNote.strumTime - Conductor.songPosition);
if (noteDiff > Conductor.safeZoneOffset * 0.70 || noteDiff < Conductor.safeZoneOffset * -0.70)
daNote.rating = "shit";
else if (noteDiff > Conductor.safeZoneOffset * 0.50 || noteDiff < Conductor.safeZoneOffset * -0.50)
daNote.rating = "bad";
else if (noteDiff > Conductor.safeZoneOffset * 0.45 || noteDiff < Conductor.safeZoneOffset * -0.45)
daNote.rating = "good";
else if (noteDiff < Conductor.safeZoneOffset * 0.44 && noteDiff > Conductor.safeZoneOffset * -0.44)
daNote.rating = "sick";
if (NearlyEquals(daNote.strumTime,rep.replay.keyPresses[repPresses].time, 30)) if (NearlyEquals(daNote.strumTime,rep.replay.keyPresses[repPresses].time, 30))
{ {
goodNoteHit(daNote); goodNoteHit(daNote);
@ -2414,6 +2428,16 @@ class PlayState extends MusicBeatState
{ {
if (NearlyEquals(coolNote.strumTime,rep.replay.keyPresses[repPresses].time, 30)) if (NearlyEquals(coolNote.strumTime,rep.replay.keyPresses[repPresses].time, 30))
{ {
var noteDiff:Float = Math.abs(coolNote.strumTime - Conductor.songPosition);
if (noteDiff > Conductor.safeZoneOffset * 0.70 || noteDiff < Conductor.safeZoneOffset * -0.70)
coolNote.rating = "shit";
else if (noteDiff > Conductor.safeZoneOffset * 0.50 || noteDiff < Conductor.safeZoneOffset * -0.50)
coolNote.rating = "bad";
else if (noteDiff > Conductor.safeZoneOffset * 0.45 || noteDiff < Conductor.safeZoneOffset * -0.45)
coolNote.rating = "good";
else if (noteDiff < Conductor.safeZoneOffset * 0.44 && noteDiff > Conductor.safeZoneOffset * -0.44)
coolNote.rating = "sick";
goodNoteHit(coolNote); goodNoteHit(coolNote);
trace('force note hit'); trace('force note hit');
} }
@ -2431,6 +2455,17 @@ class PlayState extends MusicBeatState
{ {
if (NearlyEquals(daNote.strumTime,rep.replay.keyPresses[repPresses].time, 30)) if (NearlyEquals(daNote.strumTime,rep.replay.keyPresses[repPresses].time, 30))
{ {
var noteDiff:Float = Math.abs(daNote.strumTime - Conductor.songPosition);
if (noteDiff > Conductor.safeZoneOffset * 0.70 || noteDiff < Conductor.safeZoneOffset * -0.70)
daNote.rating = "shit";
else if (noteDiff > Conductor.safeZoneOffset * 0.50 || noteDiff < Conductor.safeZoneOffset * -0.50)
daNote.rating = "bad";
else if (noteDiff > Conductor.safeZoneOffset * 0.45 || noteDiff < Conductor.safeZoneOffset * -0.45)
daNote.rating = "good";
else if (noteDiff < Conductor.safeZoneOffset * 0.44 && noteDiff > Conductor.safeZoneOffset * -0.44)
daNote.rating = "sick";
goodNoteHit(daNote); goodNoteHit(daNote);
trace('force note hit'); trace('force note hit');
} }
@ -2711,6 +2746,17 @@ class PlayState extends MusicBeatState
function noteCheck(controlArray:Array<Bool>, note:Note):Void // sorry lol function noteCheck(controlArray:Array<Bool>, note:Note):Void // sorry lol
{ {
var noteDiff:Float = Math.abs(note.strumTime - Conductor.songPosition);
if (noteDiff > Conductor.safeZoneOffset * 0.70 || noteDiff < Conductor.safeZoneOffset * -0.70)
note.rating = "shit";
else if (noteDiff > Conductor.safeZoneOffset * 0.50 || noteDiff < Conductor.safeZoneOffset * -0.50)
note.rating = "bad";
else if (noteDiff > Conductor.safeZoneOffset * 0.45 || noteDiff < Conductor.safeZoneOffset * -0.45)
note.rating = "good";
else if (noteDiff < Conductor.safeZoneOffset * 0.44 && noteDiff > Conductor.safeZoneOffset * -0.44)
note.rating = "sick";
if (loadRep) if (loadRep)
{ {
if (controlArray[note.noteData]) if (controlArray[note.noteData])
@ -2735,6 +2781,7 @@ class PlayState extends MusicBeatState
if (mashing <= getKeyPresses(note) && mashViolations < 2) if (mashing <= getKeyPresses(note) && mashViolations < 2)
{ {
mashViolations++; mashViolations++;
goodNoteHit(note, (mashing <= getKeyPresses(note))); goodNoteHit(note, (mashing <= getKeyPresses(note)));
} }
else else
@ -2756,6 +2803,17 @@ class PlayState extends MusicBeatState
function goodNoteHit(note:Note, resetMashViolation = true):Void function goodNoteHit(note:Note, resetMashViolation = true):Void
{ {
var noteDiff:Float = Math.abs(note.strumTime - Conductor.songPosition);
if (noteDiff > Conductor.safeZoneOffset * 0.70 || noteDiff < Conductor.safeZoneOffset * -0.70)
note.rating = "shit";
else if (noteDiff > Conductor.safeZoneOffset * 0.50 || noteDiff < Conductor.safeZoneOffset * -0.50)
note.rating = "bad";
else if (noteDiff > Conductor.safeZoneOffset * 0.45 || noteDiff < Conductor.safeZoneOffset * -0.45)
note.rating = "good";
else if (noteDiff < Conductor.safeZoneOffset * 0.44 && noteDiff > Conductor.safeZoneOffset * -0.44)
note.rating = "sick";
if (resetMashViolation) if (resetMashViolation)
mashViolations--; mashViolations--;