From 69ee9f0a0143e914dfc89ec5207cf9ebca8b255a Mon Sep 17 00:00:00 2001 From: KadeDev Date: Tue, 30 Mar 2021 09:39:08 -0700 Subject: [PATCH] shit fix :) --- source/Note.hx | 31 ++++++++++++-- source/PlayState.hx | 100 +++++++++++++++++--------------------------- 2 files changed, 66 insertions(+), 65 deletions(-) diff --git a/source/Note.hx b/source/Note.hx index 759c2a5..78118a9 100644 --- a/source/Note.hx +++ b/source/Note.hx @@ -33,6 +33,8 @@ class Note extends FlxSprite public static var BLUE_NOTE:Int = 1; public static var RED_NOTE:Int = 3; + public var rating:String = "shit"; + public function new(strumTime:Float, noteData:Int, ?prevNote:Note, ?sustainNote:Bool = false) { super(); @@ -178,15 +180,38 @@ class Note extends FlxSprite if (mustPress) { - // The * 0.5 is so that it's easier to hit them too late, instead of too early if (strumTime > Conductor.songPosition - Conductor.safeZoneOffset - && strumTime < Conductor.songPosition + (Conductor.safeZoneOffset * 0.5)) + && strumTime < Conductor.songPosition + Conductor.safeZoneOffset) canBeHit = true; else canBeHit = false; - if (strumTime < Conductor.songPosition - Conductor.safeZoneOffset && !wasGoodHit) + var noteDiff:Float = Math.abs(strumTime - Conductor.songPosition); + + if (canBeHit) + { + if (noteDiff > Conductor.safeZoneOffset * 0.95) + rating = "shit"; + else if (noteDiff < Conductor.safeZoneOffset * -0.95) + rating = "shit"; + else if (noteDiff > Conductor.safeZoneOffset * 0.70) + rating = "bad"; + else if (noteDiff < Conductor.safeZoneOffset * -0.75) + 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; + rating = "shit"; + } } else { diff --git a/source/PlayState.hx b/source/PlayState.hx index b3ba5b6..622b264 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -2009,14 +2009,15 @@ class PlayState extends MusicBeatState } } + var endingSong:Bool = false; var timeShown = 0; var currentTimingShown:FlxText = null; - private function popUpScore(strumtime:Float):Void + private function popUpScore(daNote:Note):Void { - var noteDiff:Float = Math.abs(strumtime - Conductor.songPosition); + var noteDiff:Float = Math.abs(daNote.strumTime - Conductor.songPosition); var wife:Float = EtternaFunctions.wife3(noteDiff, FlxG.save.data.etternaMode ? 1 : 1.7); // boyfriend.playAnim('hey'); vocals.volume = 1; @@ -2032,68 +2033,38 @@ class PlayState extends MusicBeatState var rating:FlxSprite = new FlxSprite(); var score:Float = 350; - - var daRating:String = "sick"; - + totalNotesHit += wife; - if (noteDiff > Conductor.safeZoneOffset * 1.25) - { - daRating = 'shit'; - score = -3000; - combo = 0; - misses++; - health -= 0.2; - ss = false; - shits++; - } - else if (noteDiff < Conductor.safeZoneOffset * -1.25) - { - daRating = 'shit'; - score = -3000; - combo = 0; - misses++; - health -= 0.2; - ss = false; - shits++; - } - else if (noteDiff < Conductor.safeZoneOffset * -0.45) - { - daRating = 'bad'; - score = 0; - health -= 0.03; - ss = false; - bads++; - } - else if (noteDiff > Conductor.safeZoneOffset * 0.45) - { - daRating = 'bad'; - score = 0; - health -= 0.03; - ss = false; - bads++; - } - else if (noteDiff < Conductor.safeZoneOffset * -0.25) - { - daRating = 'good'; - score = 200; - ss = false; - goods++; - } - else if (noteDiff > Conductor.safeZoneOffset * 0.35) - { - daRating = 'good'; - score = 200; - ss = false; - goods++; - } - if (daRating == 'sick') + var daRating = daNote.rating; + + switch(daRating) { - if (health < 2) - health += 0.1; - sicks++; + case 'shit': + score = -300; + combo = 0; + misses++; + health -= 0.2; + ss = false; + shits++; + case 'bad': + daRating = 'bad'; + score = 0; + health -= 0.06; + ss = false; + bads++; + case 'good': + daRating = 'good'; + score = 200; + ss = false; + goods++; + if (health < 2) + health += 0.04; + case 'sick': + if (health < 2) + health += 0.1; + sicks++; } - if (FlxG.save.data.etternaMode) etternaModeScore += Math.round(score / wife); @@ -2771,7 +2742,12 @@ class PlayState extends MusicBeatState } else { - playerStrums.members[note.noteData].animation.play('static'); + // this is bad but fuck you + playerStrums.members[0].animation.play('static'); + playerStrums.members[1].animation.play('static'); + playerStrums.members[2].animation.play('static'); + playerStrums.members[3].animation.play('static'); + health -= 0.2; trace('mash ' + mashing); } @@ -2790,7 +2766,7 @@ class PlayState extends MusicBeatState { if (!note.isSustainNote) { - popUpScore(note.strumTime); + popUpScore(note); combo += 1; } else