This commit is contained in:
Kade M
2021-06-21 00:34:44 -07:00
parent fcc6ae72a5
commit ca20b5ce4d
10 changed files with 120 additions and 37 deletions

View File

@ -1,5 +1,7 @@
package;
import Replay.Ana;
import Replay.Analysis;
import webm.WebmPlayer;
import flixel.input.keyboard.FlxKey;
import haxe.Exception;
@ -213,6 +215,7 @@ class PlayState extends MusicBeatState
// Replay shit
private var saveNotes:Array<Dynamic> = [];
private var saveJudge:Array<String> = [];
private var replayAna:Analysis = new Analysis(); // replay analysis
public static var highestCombo:Int = 0;
@ -1475,7 +1478,7 @@ class PlayState extends MusicBeatState
for (songNotes in section.sectionNotes)
{
var daStrumTime:Float = Math.round(songNotes[0]) + FlxG.save.data.offset + songOffset;
var daStrumTime:Float = songNotes[0] + FlxG.save.data.offset + songOffset;
if (daStrumTime < 0)
daStrumTime = 0;
var daNoteData:Int = Std.int(songNotes[1] % 4);
@ -1975,7 +1978,7 @@ class PlayState extends MusicBeatState
FlxG.switchState(new Charting()); */
#if debug
if (FlxG.keys.justPressed.EIGHT)
if (FlxG.keys.justPressed.SIX)
{
if (useVideo)
{
@ -2564,7 +2567,7 @@ class PlayState extends MusicBeatState
campaignMisses = misses;
if (!loadRep)
rep.SaveReplay(saveNotes, saveJudge);
rep.SaveReplay(saveNotes, saveJudge, replayAna);
else
{
PlayStateChangeables.botPlay = false;
@ -3039,6 +3042,7 @@ class PlayState extends MusicBeatState
};
#end
// Prevent player input if botplay is on
if(PlayStateChangeables.botPlay)
{
@ -3046,6 +3050,13 @@ class PlayState extends MusicBeatState
pressArray = [false, false, false, false];
releaseArray = [false, false, false, false];
}
var anas:Array<Ana> = [null,null,null,null];
for (i in 0...pressArray.length)
if (pressArray[i])
anas[i] = new Ana(Conductor.songPosition, null, false, "miss", i);
// HOLDS, check for sustain notes
if (holdArray.contains(true) && /*!boyfriend.stunned && */ generatedMusic)
{
@ -3137,6 +3148,10 @@ class PlayState extends MusicBeatState
if (mashViolations != 0)
mashViolations--;
scoreTxt.color = FlxColor.WHITE;
var noteDiff:Float = -(coolNote.strumTime - Conductor.songPosition);
anas[coolNote.noteData].hit = true;
anas[coolNote.noteData].hitJudge = Ratings.CalculateRating(noteDiff, Math.floor((PlayStateChangeables.safeFrames / 60) * 1000));
anas[coolNote.noteData].nearestNote = [coolNote.strumTime,coolNote.noteData,coolNote.sustainLength];
goodNoteHit(coolNote);
}
}
@ -3148,19 +3163,12 @@ class PlayState extends MusicBeatState
noteMiss(shit, null);
}
if(dontCheck && possibleNotes.length > 0 && FlxG.save.data.ghost && !PlayStateChangeables.botPlay)
{
if (mashViolations > 8)
{
trace('mash violations ' + mashViolations);
scoreTxt.color = FlxColor.RED;
noteMiss(0,null);
}
else
mashViolations++;
}
}
if (!loadRep)
for (i in anas)
if (i != null)
replayAna.anaArray.push(i); // put em all there
notes.forEachAlive(function(daNote:Note)
{