Skip to content

Commit

Permalink
a ton of stuff i cant put here
Browse files Browse the repository at this point in the history
if a song is over 10 minutes long, the skip time option now skims through time 3x faster
added an option to reduce botplay lag EVEN FURTHER
increased fps limit to 1000
  • Loading branch information
JordanSantiagoYT authored May 24, 2023
1 parent 7805b22 commit 393fd9b
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 8 deletions.
5 changes: 5 additions & 0 deletions source/ClientPrefs.hx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class ClientPrefs {
public static var arrowHSV:Array<Array<Int>> = [[0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0]];
public static var ghostTapping:Bool = true;
public static var communityGameMode:Bool = false;
public static var lessBotLag:Bool = false;
public static var coolGameplay:Bool = false;
public static var fuckDeath:Bool = false;
public static var hudType:String = 'Kade Engine';
Expand Down Expand Up @@ -138,6 +139,7 @@ class ClientPrefs {
FlxG.save.data.arrowHSV = arrowHSV;
FlxG.save.data.ghostTapping = ghostTapping;
FlxG.save.data.communityGameMode = communityGameMode;
FlxG.save.data.lessBotLag = lessBotLag;
FlxG.save.data.coolGameplay = coolGameplay;
FlxG.save.data.timeBarType = timeBarType;
FlxG.save.data.marvRateColor = marvRateColor;
Expand Down Expand Up @@ -247,6 +249,9 @@ class ClientPrefs {
if(FlxG.save.data.arrowHSV != null) {
arrowHSV = FlxG.save.data.arrowHSV;
}
if(FlxG.save.data.lessBotLag != null) {
lessBotLag = FlxG.save.data.lessBotLag;
}
if(FlxG.save.data.ghostTapping != null) {
ghostTapping = FlxG.save.data.ghostTapping;
}
Expand Down
4 changes: 4 additions & 0 deletions source/PauseSubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ class PauseSubState extends MusicBeatSubstate
{
curTime += 45000 * elapsed * (controls.UI_LEFT ? -1 : 1);
}
if(holdTime > 0.5 && FlxG.sound.music.length >= 600000)
{
curTime += 150000 * elapsed * (controls.UI_LEFT ? -1 : 1);
}

if(curTime >= FlxG.sound.music.length) curTime -= FlxG.sound.music.length;
else if(curTime < 0) curTime += FlxG.sound.music.length;
Expand Down
52 changes: 45 additions & 7 deletions source/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ class PlayState extends MusicBeatState

public var gfSpeed:Int = 1;
public var health:Float = 1.5;
private var displayedHealth:Float = 1.5;
public var combo:Int = 0;
public var missCombo:Int = 1;

Expand Down Expand Up @@ -1404,7 +1405,7 @@ class PlayState extends MusicBeatState
add(healthBarBG);

healthBar = new FlxBar(healthBarBG.x + 4, healthBarBG.y + 4, (opponentChart ? LEFT_TO_RIGHT : RIGHT_TO_LEFT), Std.int(healthBarBG.width - 8), Std.int(healthBarBG.height - 8), this,
'health', 0, 3);
'displayedHealth', 0, 3);
healthBar.scrollFactor.set();
// healthBar
healthBar.visible = !ClientPrefs.hideHud;
Expand All @@ -1424,7 +1425,7 @@ class PlayState extends MusicBeatState
add(healthBarBG);

healthBar = new FlxBar(healthBarBG.x + 4, healthBarBG.y + 4, (opponentChart ? LEFT_TO_RIGHT : RIGHT_TO_LEFT), Std.int(healthBarBG.width - 8), Std.int(healthBarBG.height - 8), this,
'health', 0, 3);
'displayedHealth', 0, 3);
healthBar.scrollFactor.set();
// healthBar
healthBar.visible = !ClientPrefs.hideHud;
Expand All @@ -1443,7 +1444,7 @@ class PlayState extends MusicBeatState
if(ClientPrefs.downScroll) healthBarBG.y = 0.11 * FlxG.height;

healthBar = new FlxBar(healthBarBG.x + 4, healthBarBG.y + 4, (opponentChart ? LEFT_TO_RIGHT : RIGHT_TO_LEFT), Std.int(healthBarBG.width - 8), Std.int(healthBarBG.height - 8), this,
'health', 0, 3);
'displayedHealth', 0, 3);
healthBar.scrollFactor.set();
// healthBar
healthBar.visible = !ClientPrefs.hideHud;
Expand Down Expand Up @@ -3360,6 +3361,13 @@ class PlayState extends MusicBeatState
var limoSpeed:Float = 0;
override public function update(elapsed:Float)
{
if (ClientPrefs.framerate > 60)
{
displayedHealth = FlxMath.lerp(displayedHealth, health, .1);
} else if (ClientPrefs.framerate == 60)
{
displayedHealth = FlxMath.lerp(displayedHealth, health, .4);
}
/*if (FlxG.keys.justPressed.NINE)
{
iconP1.swapOldIcon();
Expand Down Expand Up @@ -4841,8 +4849,6 @@ class PlayState extends MusicBeatState
}
}

var msJudges = [];

private function popUpScore(note:Note = null):Void
{
var noteDiff:Float = Math.abs(note.strumTime - Conductor.songPosition + ClientPrefs.ratingOffset);
Expand Down Expand Up @@ -5004,7 +5010,7 @@ class PlayState extends MusicBeatState

if(!practiceMode) {
songScore += score;
if(!note.ratingDisabled)
if(!note.ratingDisabled || cpuControlled && !ClientPrefs.lessBotLag)
{
songHits++;
totalPlayed++;
Expand Down Expand Up @@ -5125,6 +5131,15 @@ if (!allSicks && ClientPrefs.colorRatingFC && songMisses > 0)
if(combo >= 1000) {
seperatedScore.push(Math.floor(combo / 1000) % 10);
}
if(combo >= 10000) {
seperatedScore.push(Math.floor(combo / 10000) % 10);
}
if(combo >= 100000) {
seperatedScore.push(Math.floor(combo / 100000) % 10);
}
if(combo >= 1000000) {
seperatedScore.push(Math.floor(combo / 1000000) % 10);
}
seperatedScore.push(Math.floor(combo / 100) % 10);
seperatedScore.push(Math.floor(combo / 10) % 10);
seperatedScore.push(combo % 10);
Expand Down Expand Up @@ -5772,7 +5787,30 @@ if (!allSicks && ClientPrefs.colorRatingFC && songMisses > 0 && ClientPrefs.hudT
return;
}

if (!note.isSustainNote)
if (!note.isSustainNote && !cpuControlled)
{
combo += 1;
missCombo = 0;
notesHitArray.unshift(Date.now());
popUpScore(note);
}
if (!note.isSustainNote && cpuControlled && ClientPrefs.lessBotLag)
{
if (!ClientPrefs.noMarvJudge)
{
songScore += 500;
}
else if (ClientPrefs.noMarvJudge)
{
songScore += 350;
}
combo += 1;
notesHitArray.unshift(Date.now());
if(!note.noteSplashDisabled && !note.isSustainNote) {
spawnNoteSplashOnNote(note);
}
}
if (!note.isSustainNote && cpuControlled && !ClientPrefs.lessBotLag)
{
combo += 1;
missCombo = 0;
Expand Down
1 change: 1 addition & 0 deletions source/Song.hx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class Song
public var player1:String = 'bf';
public var player2:String = 'dad';
public var gfVersion:String = 'gf';
public var gfVersion2:String = 'gf-bent';

private static function onLoadJson(songJson:Dynamic) // Convert old charts to newest format
{
Expand Down
2 changes: 1 addition & 1 deletion source/options/GraphicsSettingsSubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class GraphicsSettingsSubState extends BaseOptionsMenu
addOption(option);

option.minValue = 60;
option.maxValue = 240;
option.maxValue = 1000;
option.displayFormat = '%v FPS';
option.onChange = onChangeFramerate;
#end
Expand Down

0 comments on commit 393fd9b

Please sign in to comment.