Skip to content

Commit

Permalink
Merge pull request #68 from CharlesCatYT/botplay
Browse files Browse the repository at this point in the history
botplay
  • Loading branch information
moxie-coder committed Aug 24, 2023
2 parents 6dbe18f + c3904d9 commit ce47a51
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 36 deletions.
3 changes: 0 additions & 3 deletions art/BuildGameBotplay.bat

This file was deleted.

3 changes: 0 additions & 3 deletions art/TestGameBotplay.bat

This file was deleted.

2 changes: 2 additions & 0 deletions source/OptionsMenu.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
61 changes: 31 additions & 30 deletions source/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -2321,49 +2321,50 @@ class PlayState extends MusicBeatState
var controlArray:Array<Bool> = [leftP, downP, upP, rightP];
var releaseArray:Array<Bool> = [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)
{
Expand Down
3 changes: 3 additions & 0 deletions source/SaveDataHandler.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit ce47a51

Please sign in to comment.