reminder that you suck lol

This commit is contained in:
Detoria 2021-05-13 00:52:00 -03:00 committed by GitHub
parent 8fe4766f69
commit 712fc1a984
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3745 additions and 3741 deletions

View File

@ -182,6 +182,12 @@ class PauseSubState extends MusicBeatSubstate
case "Restart Song":
FlxG.resetState();
case "Exit to menu":
if(PlayState.loadRep)
{
FlxG.save.data.botplay = false;
FlxG.save.data.scrollSpeed = 1;
FlxG.save.data.downscroll = false;
}
PlayState.loadRep = false;
#if windows
if (PlayState.luaModchart != null)
@ -192,6 +198,7 @@ class PauseSubState extends MusicBeatSubstate
#end
if (FlxG.save.data.fpsCap > 290)
(cast (Lib.current.getChildAt(0), Main)).setFPSCap(290);
FlxG.switchState(new MainMenuState());
}
}

View File

@ -203,6 +203,8 @@ class PlayState extends MusicBeatState
public static var songOffset:Float = 0;
// BotPlay text
private var botPlayState:FlxText;
// Replay shit
private var saveNotes:Array<Float> = [];
private var executeModchart = false;
@ -823,6 +825,16 @@ class PlayState extends MusicBeatState
add(dad);
add(boyfriend);
if (loadRep)
{
FlxG.watch.addQuick('rep rpesses',repPresses);
FlxG.watch.addQuick('rep releases',repReleases);
FlxG.save.data.botplay = true;
FlxG.save.data.scrollSpeed = rep.replay.noteSpeed;
FlxG.save.data.downscroll = rep.replay.isDownscroll;
// FlxG.watch.addQuick('Queued',inputsQueued);
}
var doof:DialogueBox = new DialogueBox(false, dialogue);
// doof.x += 70;
@ -832,7 +844,6 @@ class PlayState extends MusicBeatState
Conductor.songPosition = -5000;
strumLine = new FlxSprite(0, 50).makeGraphic(FlxG.width, 10);
strumLine.scrollFactor.set();
@ -940,7 +951,7 @@ class PlayState extends MusicBeatState
botPlayState.setFormat(Paths.font("vcr.ttf"), 42, FlxColor.WHITE, RIGHT, FlxTextBorderStyle.OUTLINE,FlxColor.BLACK);
botPlayState.scrollFactor.set();
if(FlxG.save.data.botplay) add(botPlayState);
if(FlxG.save.data.botplay && !loadRep) add(botPlayState);
iconP1 = new HealthIcon(SONG.player1, true);
iconP1.y = healthBar.y - (iconP1.height / 2);
@ -2057,12 +2068,6 @@ class PlayState extends MusicBeatState
FlxG.watch.addQuick("beatShit", curBeat);
FlxG.watch.addQuick("stepShit", curStep);
if (loadRep) // rep debug
{
FlxG.watch.addQuick('rep rpesses',repPresses);
FlxG.watch.addQuick('rep releases',repReleases);
// FlxG.watch.addQuick('Queued',inputsQueued);
}
if (curSong == 'Fresh')
{
@ -2322,7 +2327,13 @@ class PlayState extends MusicBeatState
function endSong():Void
{
if (!loadRep)
rep.SaveReplay();
rep.SaveReplay(saveNotes);
else
{
FlxG.save.data.botplay = false;
FlxG.save.data.scrollSpeed = 1;
FlxG.save.data.downscroll = false;
}
if (FlxG.save.data.fpsCap > 290)
(cast (Lib.current.getChildAt(0), Main)).setFPSCap(290);
@ -2868,12 +2879,23 @@ class PlayState extends MusicBeatState
if(FlxG.save.data.botplay && daNote.canBeHit && daNote.mustPress ||
FlxG.save.data.botplay && daNote.tooLate && daNote.mustPress)
{
if(loadRep)
{
//trace('ReplayNote ' + tmpRepNote.strumtime + ' | ' + tmpRepNote.direction);
if(rep.replay.songNotes.contains(HelperFunctions.truncateFloat(daNote.strumTime, 2)))
{
goodNoteHit(daNote);
boyfriend.holdTimer = daNote.sustainLength;
}
}else {
goodNoteHit(daNote);
boyfriend.holdTimer = daNote.sustainLength;
}
}
}
});
if (boyfriend.holdTimer > Conductor.stepCrochet * 4 * 0.001 && !holdArray.contains(true))
if (boyfriend.holdTimer > Conductor.stepCrochet * 4 * 0.001 && (!holdArray.contains(true) || FlxG.save.data.botplay))
{
if (boyfriend.animation.curAnim.name.startsWith('sing') && !boyfriend.animation.curAnim.name.endsWith('miss'))
boyfriend.playAnim('idle');
@ -2999,7 +3021,7 @@ class PlayState extends MusicBeatState
note.rating = Ratings.CalculateRating(noteDiff);
if (loadRep)
/* if (loadRep)
{
if (controlArray[note.noteData])
goodNoteHit(note, false);
@ -3010,10 +3032,10 @@ class PlayState extends MusicBeatState
goodNoteHit(note, false);
}
}
}
else if (controlArray[note.noteData])
{
} */
if (controlArray[note.noteData])
{
goodNoteHit(note, (mashing > getKeyPresses(note)));
/*if (mashing > getKeyPresses(note) && mashViolations <= 2)
@ -3090,14 +3112,8 @@ class PlayState extends MusicBeatState
#end
if (!loadRep)
playerStrums.forEach(function(spr:FlxSprite)
{
if (Math.abs(note.noteData) == spr.ID)
{
spr.animation.play('confirm', true);
}
});
if(!loadRep && note.mustPress)
saveNotes.push(HelperFunctions.truncateFloat(note.strumTime, 2));
note.wasGoodHit = true;
vocals.volume = 1;
@ -3276,17 +3292,8 @@ class PlayState extends MusicBeatState
// Conductor.changeBPM(SONG.bpm);
// Dad doesnt interupt his own notes
// Commented out until a reason to bring this back arises in the future
/* if (SONG.notes[Math.floor(curStep / 16)].mustHitSection)
dad.dance(); */
/* no because this is kinda dumb
if(dad.animation.curAnim.name.startsWith('sing'))
if(dad.animation.finished)
if (SONG.notes[Math.floor(curStep / 16)].mustHitSection)
dad.dance();
else
dad.dance();
*/
}
// FlxG.log.add('change bpm' + SONG.notes[Std.int(curStep / 16)].changeBPM);
wiggleShit.update(Conductor.crochet);

View File

@ -11,26 +11,15 @@ import haxe.Json;
import flixel.input.keyboard.FlxKey;
import openfl.utils.Dictionary;
typedef KeyPress =
{
public var time:Float;
public var key:String;
}
typedef KeyRelease =
{
public var time:Float;
public var key:String;
}
typedef ReplayJSON =
{
public var replayGameVer:String;
public var timestamp:Date;
public var songName:String;
public var songDiff:Int;
public var keyPresses:Array<KeyPress>;
public var keyReleases:Array<KeyRelease>;
public var songNotes:Array<Float>;
public var noteSpeed:Float;
public var isDownscroll:Bool;
}
class Replay
@ -45,8 +34,9 @@ class Replay
replay = {
songName: "Tutorial",
songDiff: 1,
keyPresses: [],
keyReleases: [],
noteSpeed: 1.5,
isDownscroll: false,
songNotes: [],
replayGameVer: version,
timestamp: Date.now()
};
@ -58,18 +48,19 @@ class Replay
rep.LoadFromJSON();
trace('basic replay data:\nSong Name: ' + rep.replay.songName + '\nSong Diff: ' + rep.replay.songDiff + '\nKeys Length: ' + rep.replay.keyPresses.length);
trace('basic replay data:\nSong Name: ' + rep.replay.songName + '\nSong Diff: ' + rep.replay.songDiff + '\nNotes Length: ' + rep.replay.songNotes.length);
return rep;
}
public function SaveReplay()
public function SaveReplay(notearray:Array<Float>)
{
var json = {
"songName": PlayState.SONG.song.toLowerCase(),
"songDiff": PlayState.storyDifficulty,
"keyPresses": replay.keyPresses,
"keyReleases": replay.keyReleases,
"noteSpeed": (FlxG.save.data.scrollSpeed > 1 ? FlxG.save.data.scrollSpeed : PlayState.SONG.speed),
"isDownscroll": FlxG.save.data.downscroll,
"songNotes": notearray,
"timestamp": Date.now(),
"replayGameVer": version
};
@ -81,7 +72,6 @@ class Replay
#end
}
public function LoadFromJSON()
{
#if sys