From fb55d993e1ee50c4ff7b220aa9f804e55da9b181 Mon Sep 17 00:00:00 2001 From: KadeDev Date: Sun, 4 Apr 2021 18:08:19 -0700 Subject: [PATCH] funny commit --- source/Conductor.hx | 11 ++++++++++- source/KadeEngineData.hx | 3 +-- source/MainMenuState.hx | 4 ++-- source/Note.hx | 4 ++-- source/Options.hx | 28 ++++++++++++++++++---------- source/OptionsMenu.hx | 2 +- source/PlayState.hx | 8 +++++--- source/Ratings.hx | 22 +++++++++++----------- 8 files changed, 50 insertions(+), 32 deletions(-) diff --git a/source/Conductor.hx b/source/Conductor.hx index 4248c9d..68634a3 100644 --- a/source/Conductor.hx +++ b/source/Conductor.hx @@ -1,6 +1,7 @@ package; import Song.SwagSong; +import flixel.FlxG; /** * ... @@ -24,7 +25,8 @@ class Conductor public static var offset:Float = 0; public static var safeFrames:Int = 10; - public static var safeZoneOffset:Float = (safeFrames / 60) * 1000; // is calculated in create(), is safeFrames in milliseconds + public static var safeZoneOffset:Float = Math.floor((safeFrames / 60) * 1000); // is calculated in create(), is safeFrames in milliseconds + public static var timeScale:Float = Conductor.safeZoneOffset / 166; public static var bpmChangeMap:Array = []; @@ -32,6 +34,13 @@ class Conductor { } + public static function recalculateTimings() + { + Conductor.safeFrames = FlxG.save.data.frames; + Conductor.safeZoneOffset = Math.floor((Conductor.safeFrames / 60) * 1000); + Conductor.timeScale = Conductor.safeZoneOffset / 166; + } + public static function mapBPMChanges(song:SwagSong) { bpmChangeMap = []; diff --git a/source/KadeEngineData.hx b/source/KadeEngineData.hx index da31db7..8229c19 100644 --- a/source/KadeEngineData.hx +++ b/source/KadeEngineData.hx @@ -54,8 +54,7 @@ class KadeEngineData if (FlxG.save.data.frames == null) FlxG.save.data.frames = 10; - Conductor.safeFrames = FlxG.save.data.frames; - Conductor.safeZoneOffset = (Conductor.safeFrames / 60) * 1000; + Conductor.recalculateTimings(); (cast (Lib.current.getChildAt(0), Main)).setFPSCap(FlxG.save.data.fpsCap); } diff --git a/source/MainMenuState.hx b/source/MainMenuState.hx index fb24034..f33ad95 100644 --- a/source/MainMenuState.hx +++ b/source/MainMenuState.hx @@ -36,9 +36,9 @@ class MainMenuState extends MusicBeatState var newGaming2:FlxText; var newInput:Bool = true; - public static var nightly:String = ""; + public static var nightly:String = "-Nightly2"; - public static var kadeEngineVer:String = "1.4" + nightly; + public static var kadeEngineVer:String = "1.4.1" + nightly; public static var gameVer:String = "0.2.7.1"; var magenta:FlxSprite; diff --git a/source/Note.hx b/source/Note.hx index fa88315..699b9bc 100644 --- a/source/Note.hx +++ b/source/Note.hx @@ -48,7 +48,7 @@ class Note extends FlxSprite x += 50; // MAKE SURE ITS DEFINITELY OFF SCREEN? y -= 2000; - this.strumTime = strumTime + FlxG.save.data.offset; + this.strumTime = strumTime; if (this.strumTime < 0 ) this.strumTime = 0; @@ -172,7 +172,7 @@ class Note extends FlxSprite prevNote.animation.play('redhold'); } - prevNote.scale.y *= Conductor.stepCrochet / 100 * 1.8 * PlayState.SONG.speed; + prevNote.scale.y *= Conductor.stepCrochet / 100 * 1.8 * FlxG.save.data.scrollSpeed; prevNote.updateHitbox(); // prevNote.setGraphicSize(); } diff --git a/source/Options.hx b/source/Options.hx index 771d548..85dd530 100644 --- a/source/Options.hx +++ b/source/Options.hx @@ -181,31 +181,39 @@ class Judgement extends Option } override function left():Bool { + + if (Conductor.safeFrames == 1) + return false; + Conductor.safeFrames -= 1; FlxG.save.data.frames = Conductor.safeFrames; - Conductor.safeZoneOffset = (Conductor.safeFrames / 60) * 1000; + Conductor.recalculateTimings(); OptionsMenu.versionShit.text = "Current Safe Frames: " + Conductor.safeFrames + " - Description - " + description + - " - SIK: " + OptionsMenu.truncateFloat(Conductor.safeZoneOffset * 0.25, 0) + - "ms GD: " + OptionsMenu.truncateFloat(Conductor.safeZoneOffset * 0.40, 0) + - "ms BD: " + OptionsMenu.truncateFloat(Conductor.safeZoneOffset * 0.50, 0) + - "ms SHT: " + OptionsMenu.truncateFloat(Conductor.safeZoneOffset * 0.70, 0) + + " - SIK: " + OptionsMenu.truncateFloat(45 * Conductor.timeScale, 0) + + "ms GD: " + OptionsMenu.truncateFloat(90 * Conductor.timeScale, 0) + + "ms BD: " + OptionsMenu.truncateFloat(135 * Conductor.timeScale, 0) + + "ms SHT: " + OptionsMenu.truncateFloat(155 * Conductor.timeScale, 0) + "ms TOTAL: " + OptionsMenu.truncateFloat(Conductor.safeZoneOffset,0) + "ms"; return true; } override function right():Bool { + + if (Conductor.safeFrames == 20) + return false; + Conductor.safeFrames += 1; FlxG.save.data.frames = Conductor.safeFrames; - Conductor.safeZoneOffset = (Conductor.safeFrames / 60) * 1000; + Conductor.recalculateTimings(); OptionsMenu.versionShit.text = "Current Safe Frames: " + Conductor.safeFrames + " - Description - " + description + - " - SIK: " + OptionsMenu.truncateFloat(Conductor.safeZoneOffset * 0.25, 0) + - "ms GD: " + OptionsMenu.truncateFloat(Conductor.safeZoneOffset * 0.40, 0) + - "ms BD: " + OptionsMenu.truncateFloat(Conductor.safeZoneOffset * 0.50, 0) + - "ms SHT: " + OptionsMenu.truncateFloat(Conductor.safeZoneOffset * 0.70, 0) + + " - SIK: " + OptionsMenu.truncateFloat(45 * Conductor.timeScale, 0) + + "ms GD: " + OptionsMenu.truncateFloat(90 * Conductor.timeScale, 0) + + "ms BD: " + OptionsMenu.truncateFloat(135 * Conductor.timeScale, 0) + + "ms SHT: " + OptionsMenu.truncateFloat(155 * Conductor.timeScale, 0) + "ms TOTAL: " + OptionsMenu.truncateFloat(Conductor.safeZoneOffset,0) + "ms"; return true; } diff --git a/source/OptionsMenu.hx b/source/OptionsMenu.hx index f732001..600a960 100644 --- a/source/OptionsMenu.hx +++ b/source/OptionsMenu.hx @@ -24,7 +24,7 @@ class OptionsMenu extends MusicBeatState new DFJKOption(controls), new Judgement("Customize your Hit Timings (LEFT or RIGHT)"), #if !html - new FPSCapOption("Cap your FPS (Left for -10, Right for -10. SHIFT to go faster)"), + new FPSCapOption("Cap your FPS (Left for -10, Right for +10. SHIFT to go faster)"), #end new ScrollSpeedOption("Change your scroll speed (Left for -0.1, right for +0.1. If its at 1, it will be chart dependent)"), new OffsetMenu("Get a note offset based off of your inputs!"), diff --git a/source/PlayState.hx b/source/PlayState.hx index 8b7f4e6..415de42 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -259,7 +259,7 @@ class PlayState extends MusicBeatState Conductor.mapBPMChanges(SONG); Conductor.changeBPM(SONG.bpm); - trace('INFORMATION ABOUT WHAT U PLAYIN WIT:\nFRAMES: ' + Conductor.safeFrames + '\nZONE: ' + Conductor.safeZoneOffset); + trace('INFORMATION ABOUT WHAT U PLAYIN WIT:\nFRAMES: ' + Conductor.safeFrames + '\nZONE: ' + Conductor.safeZoneOffset + '\nTS: ' + Conductor.timeScale); switch (SONG.song.toLowerCase()) { @@ -1233,7 +1233,9 @@ class PlayState extends MusicBeatState for (songNotes in section.sectionNotes) { - var daStrumTime:Float = songNotes[0]; + var daStrumTime:Float = songNotes[0] + FlxG.save.data.offset; + if (daStrumTime < 0) + daStrumTime = 0; var daNoteData:Int = Std.int(songNotes[1] % 4); var gottaHitNote:Bool = section.mustHitSection; @@ -2158,7 +2160,7 @@ class PlayState extends MusicBeatState private function popUpScore(daNote:Note):Void { var noteDiff:Float = Math.abs(Conductor.songPosition - daNote.strumTime); - var wife:Float = EtternaFunctions.wife3(noteDiff, 1.7); + var wife:Float = EtternaFunctions.wife3(noteDiff, Conductor.timeScale); // boyfriend.playAnim('hey'); vocals.volume = 1; diff --git a/source/Ratings.hx b/source/Ratings.hx index 410d63c..46e9ffb 100644 --- a/source/Ratings.hx +++ b/source/Ratings.hx @@ -3,27 +3,27 @@ class Ratings public static function CalculateRating(noteDiff:Float, ?customSafeZone:Float):String { - if (customSafeZone == null) - { - Conductor.safeZoneOffset = (Conductor.safeFrames / 60) * 1000; - customSafeZone = Conductor.safeZoneOffset; - } + var customTimeScale = Conductor.timeScale; + if (customSafeZone != null) + customTimeScale = customSafeZone / 166; + + // trace(customTimeScale + ' vs ' + Conductor.timeScale); // I HATE THIS IF CONDITION // IF LEMON SEES THIS I'M SORRY :( - if (noteDiff > customSafeZone * 0.50) // way early + if (noteDiff > 135 * customTimeScale) // way early return "shit"; - else if (noteDiff > customSafeZone * 0.26) // early + else if (noteDiff > 90 * customTimeScale) // early return "bad"; - else if (noteDiff > customSafeZone * 0.20) // your kinda there + else if (noteDiff > 45 * customTimeScale) // your kinda there return "good"; - else if (noteDiff < customSafeZone * -0.20) // little late + else if (noteDiff < -45 * customTimeScale) // little late return "good"; - else if (noteDiff < customSafeZone * -0.26) // late + else if (noteDiff < -90 * customTimeScale) // late return "bad"; - else if (noteDiff < customSafeZone * -0.50) // late as fuck + else if (noteDiff < -135 * customTimeScale) // late as fuck return "shit"; return "sick"; }