From 87094a574a9adf69eb626bb668f533f435c08582 Mon Sep 17 00:00:00 2001 From: CharlesCatYT Date: Tue, 8 Aug 2023 11:19:00 -0400 Subject: [PATCH 1/3] BOTPLAY --- source/OptionsMenu.hx | 2 ++ source/PlayState.hx | 61 ++++++++++++++++++++------------------- source/SaveDataHandler.hx | 3 ++ 3 files changed, 36 insertions(+), 30 deletions(-) diff --git a/source/OptionsMenu.hx b/source/OptionsMenu.hx index 9db8f87..9464476 100644 --- a/source/OptionsMenu.hx +++ b/source/OptionsMenu.hx @@ -63,6 +63,8 @@ class OptionsMenu extends MusicBeatState + "\n" + (FlxG.save.data.donoteclick ? LanguageManager.getTextString('option_hitsound_on') : LanguageManager.getTextString('option_hitsound_off')) + "\n" + + (FlxG.save.data.botplay ? "Botplay On" : "Botplay Off") + + "\n" + (FlxG.save.data.noteCamera ? LanguageManager.getTextString('option_noteCamera_on') : LanguageManager.getTextString('option_noteCamera_off')) + "\n" + LanguageManager.getTextString('option_change_langauge') diff --git a/source/PlayState.hx b/source/PlayState.hx index 3a02ddf..2604365 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -2321,49 +2321,50 @@ class PlayState extends MusicBeatState var controlArray:Array = [leftP, downP, upP, rightP]; var releaseArray:Array = [leftR, downR, upR, rightR]; - #if botplay - var BOTPLAY_pressed_anything = false; - - notes.forEachAlive(function(daNote:Note) + if (FlxG.save.data.botplay) { - if (daNote.canBeHit && daNote.mustPress && !daNote.tooLate && !daNote.wasGoodHit && daNote.finishedGenerating) + var BOTPLAY_pressed_anything = false; + + notes.forEachAlive(function(daNote:Note) { - if (daNote.strumTime <= Conductor.songPosition) + if (daNote.canBeHit && daNote.mustPress && !daNote.tooLate && !daNote.wasGoodHit && daNote.finishedGenerating) { - BOTPLAY_pressed_anything = true; - if (!daNote.isSustainNote) + if (daNote.strumTime <= Conductor.songPosition) { - controlArray[daNote.noteData % 4] = true; + BOTPLAY_pressed_anything = true; + if (!daNote.isSustainNote) + { + controlArray[daNote.noteData % 4] = true; + switch (daNote.noteData % 4) + { + case 0: + leftP = true; + case 1: + downP = true; + case 2: + upP = true; + case 3: + rightP = true; + } + } switch (daNote.noteData % 4) { case 0: - leftP = true; + left = true; case 1: - downP = true; + down = true; case 2: - upP = true; + up = true; case 3: - rightP = true; + right = true; } } - switch (daNote.noteData % 4) - { - case 0: - left = true; - case 1: - down = true; - case 2: - up = true; - case 3: - right = true; - } } - } - }); - if (!BOTPLAY_pressed_anything) - for (e in releaseArray) - e = [true]; - #end + }); + if (!BOTPLAY_pressed_anything) + for (e in releaseArray) + e = [true]; + } if ((upP || rightP || downP || leftP) && !boyfriend.stunned && generatedMusic) { diff --git a/source/SaveDataHandler.hx b/source/SaveDataHandler.hx index e4cfdef..a5947da 100644 --- a/source/SaveDataHandler.hx +++ b/source/SaveDataHandler.hx @@ -17,6 +17,9 @@ class SaveDataHandler if (FlxG.save.data.downscroll == null) FlxG.save.data.downscroll = false; + if (FlxG.save.data.botplay == null) + FlxG.save.data.botplay = false; + if (FlxG.save.data.freeplayCuts == null) FlxG.save.data.freeplayCuts = false; From c52efc83452517694d4162a9025ccd163eb3cf10 Mon Sep 17 00:00:00 2001 From: CharlesCatYT Date: Tue, 8 Aug 2023 15:02:15 -0400 Subject: [PATCH 2/3] who needs these bat files we have botplay options so no need for those stuff --- art/BuildGameBotplay.bat | 3 --- art/TestGameBotplay.bat | 3 --- 2 files changed, 6 deletions(-) delete mode 100644 art/BuildGameBotplay.bat delete mode 100644 art/TestGameBotplay.bat diff --git a/art/BuildGameBotplay.bat b/art/BuildGameBotplay.bat deleted file mode 100644 index f15d335..0000000 --- a/art/BuildGameBotplay.bat +++ /dev/null @@ -1,3 +0,0 @@ -cd .. -lime build windows -release -botplay -pause \ No newline at end of file diff --git a/art/TestGameBotplay.bat b/art/TestGameBotplay.bat deleted file mode 100644 index 32b84d8..0000000 --- a/art/TestGameBotplay.bat +++ /dev/null @@ -1,3 +0,0 @@ -cd .. -lime test windows -debug -botplay -pause \ No newline at end of file From c3904d948ee8f34172eafb676727fa6cd2d23bb6 Mon Sep 17 00:00:00 2001 From: CharlesCatYT Date: Tue, 8 Aug 2023 15:38:46 -0400 Subject: [PATCH 3/3] whoops! --- source/PlayState.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/PlayState.hx b/source/PlayState.hx index 2604365..7d94d6e 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -2363,7 +2363,7 @@ class PlayState extends MusicBeatState }); if (!BOTPLAY_pressed_anything) for (e in releaseArray) - e = [true]; + e = true; } if ((upP || rightP || downP || leftP) && !boyfriend.stunned && generatedMusic)