Rewrote hit window, score screen, fixed replays.
This commit is contained in:
@ -76,6 +76,7 @@ class PlayState extends MusicBeatState
|
||||
public static var storyPlaylist:Array<String> = [];
|
||||
public static var storyDifficulty:Int = 1;
|
||||
public static var weekSong:Int = 0;
|
||||
public static var weekScore:Int = 0;
|
||||
public static var shits:Int = 0;
|
||||
public static var bads:Int = 0;
|
||||
public static var goods:Int = 0;
|
||||
@ -104,6 +105,8 @@ class PlayState extends MusicBeatState
|
||||
|
||||
private var vocals:FlxSound;
|
||||
|
||||
public var originalX:Float;
|
||||
|
||||
public static var dad:Character;
|
||||
public static var gf:Character;
|
||||
public static var boyfriend:Boyfriend;
|
||||
@ -129,7 +132,8 @@ class PlayState extends MusicBeatState
|
||||
public var health:Float = 1; //making public because sethealth doesnt work without it
|
||||
private var combo:Int = 0;
|
||||
public static var misses:Int = 0;
|
||||
private var accuracy:Float = 0.00;
|
||||
public static var campaignMisses:Int = 0;
|
||||
public var accuracy:Float = 0.00;
|
||||
private var accuracyDefault:Float = 0.00;
|
||||
private var totalNotesHit:Float = 0;
|
||||
private var totalNotesHitDefault:Float = 0;
|
||||
@ -177,7 +181,7 @@ class PlayState extends MusicBeatState
|
||||
var wiggleShit:WiggleEffect = new WiggleEffect();
|
||||
|
||||
var talking:Bool = true;
|
||||
var songScore:Int = 0;
|
||||
public var songScore:Int = 0;
|
||||
var songScoreDef:Int = 0;
|
||||
var scoreTxt:FlxText;
|
||||
var replayTxt:FlxText;
|
||||
@ -207,7 +211,9 @@ class PlayState extends MusicBeatState
|
||||
// BotPlay text
|
||||
private var botPlayState:FlxText;
|
||||
// Replay shit
|
||||
private var saveNotes:Array<Float> = [];
|
||||
private var saveNotes:Array<Dynamic> = [];
|
||||
|
||||
public static var highestCombo:Int = 0;
|
||||
|
||||
private var executeModchart = false;
|
||||
|
||||
@ -227,16 +233,25 @@ class PlayState extends MusicBeatState
|
||||
if (FlxG.sound.music != null)
|
||||
FlxG.sound.music.stop();
|
||||
|
||||
sicks = 0;
|
||||
bads = 0;
|
||||
shits = 0;
|
||||
goods = 0;
|
||||
|
||||
if (!isStoryMode)
|
||||
{
|
||||
sicks = 0;
|
||||
bads = 0;
|
||||
shits = 0;
|
||||
goods = 0;
|
||||
}
|
||||
misses = 0;
|
||||
|
||||
repPresses = 0;
|
||||
repReleases = 0;
|
||||
|
||||
|
||||
PlayStateChangeables.useDownscroll = FlxG.save.data.downscroll;
|
||||
PlayStateChangeables.safeFrames = FlxG.save.data.frames;
|
||||
PlayStateChangeables.scrollSpeed = FlxG.save.data.scrollSpeed;
|
||||
PlayStateChangeables.botPlay = FlxG.save.data.botplay;
|
||||
|
||||
|
||||
// pre lowercasing the song name (create)
|
||||
var songLowercase = StringTools.replace(PlayState.SONG.song, " ", "-").toLowerCase();
|
||||
switch (songLowercase) {
|
||||
@ -244,6 +259,8 @@ class PlayState extends MusicBeatState
|
||||
case 'philly-nice': songLowercase = 'philly';
|
||||
}
|
||||
|
||||
removedVideo = false;
|
||||
|
||||
#if windows
|
||||
executeModchart = FileSystem.exists(Paths.lua(songLowercase + "/modchart"));
|
||||
#end
|
||||
@ -315,7 +332,7 @@ class PlayState extends MusicBeatState
|
||||
Conductor.mapBPMChanges(SONG);
|
||||
Conductor.changeBPM(SONG.bpm);
|
||||
|
||||
trace('INFORMATION ABOUT WHAT U PLAYIN WIT:\nFRAMES: ' + Conductor.safeFrames + '\nZONE: ' + Conductor.safeZoneOffset + '\nTS: ' + Conductor.timeScale + '\nBotPlay : ' + FlxG.save.data.botplay);
|
||||
trace('INFORMATION ABOUT WHAT U PLAYIN WIT:\nFRAMES: ' + PlayStateChangeables.safeFrames + '\nZONE: ' + Conductor.safeZoneOffset + '\nTS: ' + Conductor.timeScale + '\nBotPlay : ' + PlayStateChangeables.botPlay);
|
||||
|
||||
//dialogue shit
|
||||
switch (songLowercase)
|
||||
@ -865,13 +882,17 @@ class PlayState extends MusicBeatState
|
||||
{
|
||||
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);
|
||||
|
||||
PlayStateChangeables.useDownscroll = rep.replay.isDownscroll;
|
||||
PlayStateChangeables.safeFrames = rep.replay.sf;
|
||||
PlayStateChangeables.botPlay = true;
|
||||
}
|
||||
|
||||
trace('uh ' + PlayStateChangeables.safeFrames);
|
||||
|
||||
trace("SF CALC: " + Math.floor((PlayStateChangeables.safeFrames / 60) * 1000));
|
||||
|
||||
var doof:DialogueBox = new DialogueBox(false, dialogue);
|
||||
// doof.x += 70;
|
||||
// doof.y = FlxG.height * 0.5;
|
||||
@ -883,7 +904,7 @@ class PlayState extends MusicBeatState
|
||||
strumLine = new FlxSprite(0, 50).makeGraphic(FlxG.width, 10);
|
||||
strumLine.scrollFactor.set();
|
||||
|
||||
if (FlxG.save.data.downscroll)
|
||||
if (PlayStateChangeables.useDownscroll)
|
||||
strumLine.y = FlxG.height - 165;
|
||||
|
||||
strumLineNotes = new FlxTypedGroup<FlxSprite>();
|
||||
@ -929,7 +950,7 @@ class PlayState extends MusicBeatState
|
||||
if (FlxG.save.data.songPosition) // I dont wanna talk about this code :(
|
||||
{
|
||||
songPosBG = new FlxSprite(0, 10).loadGraphic(Paths.image('healthBar'));
|
||||
if (FlxG.save.data.downscroll)
|
||||
if (PlayStateChangeables.useDownscroll)
|
||||
songPosBG.y = FlxG.height * 0.9 + 45;
|
||||
songPosBG.screenCenter(X);
|
||||
songPosBG.scrollFactor.set();
|
||||
@ -942,7 +963,7 @@ class PlayState extends MusicBeatState
|
||||
add(songPosBar);
|
||||
|
||||
var songName = new FlxText(songPosBG.x + (songPosBG.width / 2) - 20,songPosBG.y,0,SONG.song, 16);
|
||||
if (FlxG.save.data.downscroll)
|
||||
if (PlayStateChangeables.useDownscroll)
|
||||
songName.y -= 3;
|
||||
songName.setFormat(Paths.font("vcr.ttf"), 16, FlxColor.WHITE, RIGHT, FlxTextBorderStyle.OUTLINE,FlxColor.BLACK);
|
||||
songName.scrollFactor.set();
|
||||
@ -951,7 +972,7 @@ class PlayState extends MusicBeatState
|
||||
}
|
||||
|
||||
healthBarBG = new FlxSprite(0, FlxG.height * 0.9).loadGraphic(Paths.image('healthBar'));
|
||||
if (FlxG.save.data.downscroll)
|
||||
if (PlayStateChangeables.useDownscroll)
|
||||
healthBarBG.y = 50;
|
||||
healthBarBG.screenCenter(X);
|
||||
healthBarBG.scrollFactor.set();
|
||||
@ -970,32 +991,38 @@ class PlayState extends MusicBeatState
|
||||
kadeEngineWatermark.scrollFactor.set();
|
||||
add(kadeEngineWatermark);
|
||||
|
||||
if (FlxG.save.data.downscroll)
|
||||
if (PlayStateChangeables.useDownscroll)
|
||||
kadeEngineWatermark.y = FlxG.height * 0.9 + 45;
|
||||
|
||||
scoreTxt = new FlxText(FlxG.width / 2 - 235, healthBarBG.y + 50, 0, "", 20);
|
||||
if (!FlxG.save.data.accuracyDisplay)
|
||||
scoreTxt.x = healthBarBG.x + healthBarBG.width / 2;
|
||||
scoreTxt.setFormat(Paths.font("vcr.ttf"), 16, FlxColor.WHITE, CENTER, FlxTextBorderStyle.OUTLINE,FlxColor.BLACK);
|
||||
|
||||
scoreTxt.screenCenter(X);
|
||||
|
||||
originalX = scoreTxt.x;
|
||||
|
||||
|
||||
scoreTxt.scrollFactor.set();
|
||||
if (offsetTesting)
|
||||
scoreTxt.x += 300;
|
||||
if(FlxG.save.data.botplay) scoreTxt.x = FlxG.width / 2 - 20;
|
||||
|
||||
scoreTxt.setFormat(Paths.font("vcr.ttf"), 16, FlxColor.WHITE, FlxTextAlign.CENTER, FlxTextBorderStyle.OUTLINE,FlxColor.BLACK);
|
||||
|
||||
add(scoreTxt);
|
||||
|
||||
replayTxt = new FlxText(healthBarBG.x + healthBarBG.width / 2 - 75, healthBarBG.y + (FlxG.save.data.downscroll ? 100 : -100), 0, "REPLAY", 20);
|
||||
replayTxt = new FlxText(healthBarBG.x + healthBarBG.width / 2 - 75, healthBarBG.y + (PlayStateChangeables.useDownscroll ? 100 : -100), 0, "REPLAY", 20);
|
||||
replayTxt.setFormat(Paths.font("vcr.ttf"), 42, FlxColor.WHITE, RIGHT, FlxTextBorderStyle.OUTLINE,FlxColor.BLACK);
|
||||
replayTxt.borderSize = 4;
|
||||
replayTxt.borderQuality = 2;
|
||||
replayTxt.scrollFactor.set();
|
||||
if (loadRep)
|
||||
{
|
||||
add(replayTxt);
|
||||
}
|
||||
// Literally copy-paste of the above, fu
|
||||
botPlayState = new FlxText(healthBarBG.x + healthBarBG.width / 2 - 75, healthBarBG.y + (FlxG.save.data.downscroll ? 100 : -100), 0, "BOTPLAY", 20);
|
||||
botPlayState = new FlxText(healthBarBG.x + healthBarBG.width / 2 - 75, healthBarBG.y + (PlayStateChangeables.useDownscroll ? 100 : -100), 0, "BOTPLAY", 20);
|
||||
botPlayState.setFormat(Paths.font("vcr.ttf"), 42, FlxColor.WHITE, RIGHT, FlxTextBorderStyle.OUTLINE,FlxColor.BLACK);
|
||||
botPlayState.scrollFactor.set();
|
||||
|
||||
if(FlxG.save.data.botplay && !loadRep) add(botPlayState);
|
||||
botPlayState.borderSize = 4;
|
||||
botPlayState.borderQuality = 2;
|
||||
if(PlayStateChangeables.botPlay && !loadRep) add(botPlayState);
|
||||
|
||||
iconP1 = new HealthIcon(SONG.player1, true);
|
||||
iconP1.y = healthBar.y - (iconP1.height / 2);
|
||||
@ -1341,7 +1368,7 @@ class PlayState extends MusicBeatState
|
||||
remove(songName);
|
||||
|
||||
songPosBG = new FlxSprite(0, 10).loadGraphic(Paths.image('healthBar'));
|
||||
if (FlxG.save.data.downscroll)
|
||||
if (PlayStateChangeables.useDownscroll)
|
||||
songPosBG.y = FlxG.height * 0.9 + 45;
|
||||
songPosBG.screenCenter(X);
|
||||
songPosBG.scrollFactor.set();
|
||||
@ -1355,7 +1382,7 @@ class PlayState extends MusicBeatState
|
||||
add(songPosBar);
|
||||
|
||||
var songName = new FlxText(songPosBG.x + (songPosBG.width / 2) - 20,songPosBG.y,0,SONG.song, 16);
|
||||
if (FlxG.save.data.downscroll)
|
||||
if (PlayStateChangeables.useDownscroll)
|
||||
songName.y -= 3;
|
||||
songName.setFormat(Paths.font("vcr.ttf"), 16, FlxColor.WHITE, RIGHT, FlxTextBorderStyle.OUTLINE,FlxColor.BLACK);
|
||||
songName.scrollFactor.set();
|
||||
@ -1754,7 +1781,7 @@ class PlayState extends MusicBeatState
|
||||
perfectMode = false;
|
||||
#end
|
||||
|
||||
if (FlxG.save.data.botplay && FlxG.keys.justPressed.ONE)
|
||||
if (PlayStateChangeables.botPlay && FlxG.keys.justPressed.ONE)
|
||||
camHUD.visible = !camHUD.visible;
|
||||
|
||||
|
||||
@ -1763,6 +1790,8 @@ class PlayState extends MusicBeatState
|
||||
if (GlobalVideo.get().ended && !removedVideo)
|
||||
{
|
||||
remove(videoSprite);
|
||||
FlxG.stage.window.onFocusOut.remove(focusOut);
|
||||
FlxG.stage.window.onFocusIn.remove(focusIn);
|
||||
removedVideo = true;
|
||||
}
|
||||
}
|
||||
@ -1874,6 +1903,10 @@ class PlayState extends MusicBeatState
|
||||
if (!FlxG.save.data.accuracyDisplay)
|
||||
scoreTxt.text = "Score: " + songScore;
|
||||
|
||||
var lengthInPx = scoreTxt.textField.length * scoreTxt.frameHeight; // bad way but does more or less a better job
|
||||
|
||||
scoreTxt.x = (originalX - (lengthInPx / 2)) + 335;
|
||||
|
||||
if (FlxG.keys.justPressed.ENTER && startedCountdown && canPause)
|
||||
{
|
||||
persistentUpdate = false;
|
||||
@ -1896,6 +1929,8 @@ class PlayState extends MusicBeatState
|
||||
{
|
||||
GlobalVideo.get().stop();
|
||||
remove(videoSprite);
|
||||
FlxG.stage.window.onFocusOut.remove(focusOut);
|
||||
FlxG.stage.window.onFocusIn.remove(focusIn);
|
||||
removedVideo = true;
|
||||
}
|
||||
#if windows
|
||||
@ -1947,6 +1982,8 @@ class PlayState extends MusicBeatState
|
||||
{
|
||||
GlobalVideo.get().stop();
|
||||
remove(videoSprite);
|
||||
FlxG.stage.window.onFocusOut.remove(focusOut);
|
||||
FlxG.stage.window.onFocusIn.remove(focusIn);
|
||||
removedVideo = true;
|
||||
}
|
||||
|
||||
@ -2297,12 +2334,12 @@ class PlayState extends MusicBeatState
|
||||
|
||||
if (!daNote.modifiedByLua)
|
||||
{
|
||||
if (FlxG.save.data.downscroll)
|
||||
if (PlayStateChangeables.useDownscroll)
|
||||
{
|
||||
if (daNote.mustPress)
|
||||
daNote.y = (playerStrums.members[Math.floor(Math.abs(daNote.noteData))].y + 0.45 * (Conductor.songPosition - daNote.strumTime) * FlxMath.roundDecimal(FlxG.save.data.scrollSpeed == 1 ? SONG.speed : FlxG.save.data.scrollSpeed, 2));
|
||||
daNote.y = (playerStrums.members[Math.floor(Math.abs(daNote.noteData))].y + 0.45 * (Conductor.songPosition - daNote.strumTime) * FlxMath.roundDecimal(PlayStateChangeables.scrollSpeed == 1 ? SONG.speed : PlayStateChangeables.scrollSpeed, 2));
|
||||
else
|
||||
daNote.y = (strumLineNotes.members[Math.floor(Math.abs(daNote.noteData))].y + 0.45 * (Conductor.songPosition - daNote.strumTime) * FlxMath.roundDecimal(FlxG.save.data.scrollSpeed == 1 ? SONG.speed : FlxG.save.data.scrollSpeed, 2));
|
||||
daNote.y = (strumLineNotes.members[Math.floor(Math.abs(daNote.noteData))].y + 0.45 * (Conductor.songPosition - daNote.strumTime) * FlxMath.roundDecimal(PlayStateChangeables.scrollSpeed == 1 ? SONG.speed : PlayStateChangeables.scrollSpeed, 2));
|
||||
if(daNote.isSustainNote)
|
||||
{
|
||||
// Remember = minus makes notes go up, plus makes them go down
|
||||
@ -2312,7 +2349,7 @@ class PlayState extends MusicBeatState
|
||||
daNote.y += daNote.height / 2;
|
||||
|
||||
// If not in botplay, only clip sustain notes when properly hit, botplay gets to clip it everytime
|
||||
if(!FlxG.save.data.botplay)
|
||||
if(!PlayStateChangeables.botPlay)
|
||||
{
|
||||
if((!daNote.mustPress || daNote.wasGoodHit || daNote.prevNote.wasGoodHit && !daNote.canBeHit) && daNote.y - daNote.offset.y * daNote.scale.y + daNote.height >= (strumLine.y + Note.swagWidth / 2))
|
||||
{
|
||||
@ -2334,14 +2371,14 @@ class PlayState extends MusicBeatState
|
||||
}else
|
||||
{
|
||||
if (daNote.mustPress)
|
||||
daNote.y = (playerStrums.members[Math.floor(Math.abs(daNote.noteData))].y - 0.45 * (Conductor.songPosition - daNote.strumTime) * FlxMath.roundDecimal(FlxG.save.data.scrollSpeed == 1 ? SONG.speed : FlxG.save.data.scrollSpeed, 2));
|
||||
daNote.y = (playerStrums.members[Math.floor(Math.abs(daNote.noteData))].y - 0.45 * (Conductor.songPosition - daNote.strumTime) * FlxMath.roundDecimal(PlayStateChangeables.scrollSpeed == 1 ? SONG.speed : PlayStateChangeables.scrollSpeed, 2));
|
||||
else
|
||||
daNote.y = (strumLineNotes.members[Math.floor(Math.abs(daNote.noteData))].y - 0.45 * (Conductor.songPosition - daNote.strumTime) * FlxMath.roundDecimal(FlxG.save.data.scrollSpeed == 1 ? SONG.speed : FlxG.save.data.scrollSpeed, 2));
|
||||
daNote.y = (strumLineNotes.members[Math.floor(Math.abs(daNote.noteData))].y - 0.45 * (Conductor.songPosition - daNote.strumTime) * FlxMath.roundDecimal(PlayStateChangeables.scrollSpeed == 1 ? SONG.speed : PlayStateChangeables.scrollSpeed, 2));
|
||||
if(daNote.isSustainNote)
|
||||
{
|
||||
daNote.y -= daNote.height / 2;
|
||||
|
||||
if(!FlxG.save.data.botplay)
|
||||
if(!PlayStateChangeables.botPlay)
|
||||
{
|
||||
if((!daNote.mustPress || daNote.wasGoodHit || daNote.prevNote.wasGoodHit && !daNote.canBeHit) && daNote.y + daNote.offset.y * daNote.scale.y <= (strumLine.y + Note.swagWidth / 2))
|
||||
{
|
||||
@ -2453,7 +2490,7 @@ class PlayState extends MusicBeatState
|
||||
// WIP interpolation shit? Need to fix the pause issue
|
||||
// daNote.y = (strumLine.y - (songTime - daNote.strumTime) * (0.45 * PlayState.SONG.speed));
|
||||
|
||||
if ((daNote.mustPress && daNote.tooLate && !FlxG.save.data.downscroll || daNote.mustPress && daNote.tooLate && FlxG.save.data.downscroll) && daNote.mustPress)
|
||||
if ((daNote.mustPress && daNote.tooLate && !PlayStateChangeables.useDownscroll || daNote.mustPress && daNote.tooLate && PlayStateChangeables.useDownscroll) && daNote.mustPress)
|
||||
{
|
||||
if (daNote.isSustainNote && daNote.wasGoodHit)
|
||||
{
|
||||
@ -2462,10 +2499,26 @@ class PlayState extends MusicBeatState
|
||||
}
|
||||
else
|
||||
{
|
||||
health -= 0.075;
|
||||
vocals.volume = 0;
|
||||
if (theFunne)
|
||||
noteMiss(daNote.noteData, daNote);
|
||||
if (loadRep && daNote.isSustainNote)
|
||||
{
|
||||
// im tired and lazy this sucks I know i'm dumb
|
||||
if (findByTime(daNote.strumTime) != null)
|
||||
totalNotesHit += 1;
|
||||
else
|
||||
{
|
||||
health -= 0.075;
|
||||
vocals.volume = 0;
|
||||
if (theFunne)
|
||||
noteMiss(daNote.noteData, daNote);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
health -= 0.075;
|
||||
vocals.volume = 0;
|
||||
if (theFunne)
|
||||
noteMiss(daNote.noteData, daNote);
|
||||
}
|
||||
}
|
||||
|
||||
daNote.visible = false;
|
||||
@ -2503,16 +2556,21 @@ class PlayState extends MusicBeatState
|
||||
if (useVideo)
|
||||
{
|
||||
GlobalVideo.get().stop();
|
||||
FlxG.stage.window.onFocusOut.remove(focusOut);
|
||||
FlxG.stage.window.onFocusIn.remove(focusIn);
|
||||
PlayState.instance.remove(PlayState.instance.videoSprite);
|
||||
}
|
||||
|
||||
if (isStoryMode)
|
||||
campaignMisses = misses;
|
||||
|
||||
if (!loadRep)
|
||||
rep.SaveReplay(saveNotes);
|
||||
else
|
||||
{
|
||||
FlxG.save.data.botplay = false;
|
||||
FlxG.save.data.scrollSpeed = 1;
|
||||
FlxG.save.data.downscroll = false;
|
||||
PlayStateChangeables.botPlay = false;
|
||||
PlayStateChangeables.scrollSpeed = 1;
|
||||
PlayStateChangeables.useDownscroll = false;
|
||||
}
|
||||
|
||||
if (FlxG.save.data.fpsCap > 290)
|
||||
@ -2529,6 +2587,8 @@ class PlayState extends MusicBeatState
|
||||
canPause = false;
|
||||
FlxG.sound.music.volume = 0;
|
||||
vocals.volume = 0;
|
||||
FlxG.sound.music.pause();
|
||||
vocals.pause();
|
||||
if (SONG.validScore)
|
||||
{
|
||||
// adjusting the highscore song name to be compatible
|
||||
@ -2561,12 +2621,14 @@ class PlayState extends MusicBeatState
|
||||
|
||||
if (storyPlaylist.length <= 0)
|
||||
{
|
||||
FlxG.sound.playMusic(Paths.music('freakyMenu'));
|
||||
|
||||
transIn = FlxTransitionableState.defaultTransIn;
|
||||
transOut = FlxTransitionableState.defaultTransOut;
|
||||
|
||||
FlxG.switchState(new StoryMenuState());
|
||||
paused = true;
|
||||
|
||||
FlxG.sound.music.stop();
|
||||
vocals.stop();
|
||||
openSubState(new ResultsScreen());
|
||||
|
||||
#if windows
|
||||
if (luaModchart != null)
|
||||
@ -2628,7 +2690,14 @@ class PlayState extends MusicBeatState
|
||||
else
|
||||
{
|
||||
trace('WENT BACK TO FREEPLAY??');
|
||||
FlxG.switchState(new FreeplayState());
|
||||
|
||||
paused = true;
|
||||
|
||||
|
||||
FlxG.sound.music.stop();
|
||||
vocals.stop();
|
||||
|
||||
openSubState(new ResultsScreen());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2644,11 +2713,10 @@ class PlayState extends MusicBeatState
|
||||
|
||||
private function popUpScore(daNote:Note):Void
|
||||
{
|
||||
var noteDiff:Float = Math.abs(Conductor.songPosition - daNote.strumTime);
|
||||
var noteDiff:Float = -(daNote.strumTime - Conductor.songPosition);
|
||||
var wife:Float = EtternaFunctions.wife3(noteDiff, Conductor.timeScale);
|
||||
// boyfriend.playAnim('hey');
|
||||
vocals.volume = 1;
|
||||
|
||||
var placement:String = Std.string(combo);
|
||||
|
||||
var coolText:FlxText = new FlxText(0, 0, 0, placement, 32);
|
||||
@ -2743,7 +2811,10 @@ class PlayState extends MusicBeatState
|
||||
rating.velocity.x -= FlxG.random.int(0, 10);
|
||||
|
||||
var msTiming = HelperFunctions.truncateFloat(noteDiff, 3);
|
||||
if(FlxG.save.data.botplay) msTiming = 0;
|
||||
if(PlayStateChangeables.botPlay && !loadRep) msTiming = 0;
|
||||
|
||||
if (loadRep)
|
||||
msTiming = HelperFunctions.truncateFloat(findByTime(daNote.strumTime)[3], 3);
|
||||
|
||||
if (currentTimingShown != null)
|
||||
remove(currentTimingShown);
|
||||
@ -2789,7 +2860,7 @@ class PlayState extends MusicBeatState
|
||||
if (currentTimingShown.alpha != 1)
|
||||
currentTimingShown.alpha = 1;
|
||||
|
||||
if(!FlxG.save.data.botplay) add(currentTimingShown);
|
||||
if(!PlayStateChangeables.botPlay || loadRep) add(currentTimingShown);
|
||||
|
||||
var comboSpr:FlxSprite = new FlxSprite().loadGraphic(Paths.image(pixelShitPart1 + 'combo' + pixelShitPart2));
|
||||
comboSpr.screenCenter();
|
||||
@ -2806,7 +2877,7 @@ class PlayState extends MusicBeatState
|
||||
|
||||
comboSpr.velocity.x += FlxG.random.int(1, 10);
|
||||
currentTimingShown.velocity.x += comboSpr.velocity.x;
|
||||
if(!FlxG.save.data.botplay) add(rating);
|
||||
if(!PlayStateChangeables.botPlay || loadRep) add(rating);
|
||||
|
||||
if (!curStage.startsWith('school'))
|
||||
{
|
||||
@ -2833,6 +2904,9 @@ class PlayState extends MusicBeatState
|
||||
|
||||
var comboSplit:Array<String> = (combo + "").split('');
|
||||
|
||||
if (combo > highestCombo)
|
||||
highestCombo = combo;
|
||||
|
||||
// make sure we have 3 digits to display (looks weird otherwise lol)
|
||||
if (comboSplit.length == 1)
|
||||
{
|
||||
@ -2957,7 +3031,7 @@ class PlayState extends MusicBeatState
|
||||
#end
|
||||
|
||||
// Prevent player input if botplay is on
|
||||
if(FlxG.save.data.botplay)
|
||||
if(PlayStateChangeables.botPlay)
|
||||
{
|
||||
holdArray = [false, false, false, false];
|
||||
pressArray = [false, false, false, false];
|
||||
@ -3017,8 +3091,6 @@ class PlayState extends MusicBeatState
|
||||
}
|
||||
});
|
||||
|
||||
trace('\nCURRENT LINE:\n' + directionsAccounted);
|
||||
|
||||
for (note in dumbNotes)
|
||||
{
|
||||
FlxG.log.add("killing dumb ass note at " + note.strumTime);
|
||||
@ -3067,7 +3139,7 @@ class PlayState extends MusicBeatState
|
||||
noteMiss(shit, null);
|
||||
}
|
||||
|
||||
if(dontCheck && possibleNotes.length > 0 && FlxG.save.data.ghost && !FlxG.save.data.botplay)
|
||||
if(dontCheck && possibleNotes.length > 0 && FlxG.save.data.ghost && !PlayStateChangeables.botPlay)
|
||||
{
|
||||
if (mashViolations > 8)
|
||||
{
|
||||
@ -3083,17 +3155,19 @@ class PlayState extends MusicBeatState
|
||||
|
||||
notes.forEachAlive(function(daNote:Note)
|
||||
{
|
||||
if(FlxG.save.data.downscroll && daNote.y > strumLine.y ||
|
||||
!FlxG.save.data.downscroll && daNote.y < strumLine.y)
|
||||
if(PlayStateChangeables.useDownscroll && daNote.y > strumLine.y ||
|
||||
!PlayStateChangeables.useDownscroll && daNote.y < strumLine.y)
|
||||
{
|
||||
// Force good note hit regardless if it's too late to hit it or not as a fail safe
|
||||
if(FlxG.save.data.botplay && daNote.canBeHit && daNote.mustPress ||
|
||||
FlxG.save.data.botplay && daNote.tooLate && daNote.mustPress)
|
||||
if(PlayStateChangeables.botPlay && daNote.canBeHit && daNote.mustPress ||
|
||||
PlayStateChangeables.botPlay && daNote.tooLate && daNote.mustPress)
|
||||
{
|
||||
if(loadRep)
|
||||
{
|
||||
//trace('ReplayNote ' + tmpRepNote.strumtime + ' | ' + tmpRepNote.direction);
|
||||
if(rep.replay.songNotes.contains(HelperFunctions.truncateFloat(daNote.strumTime, 2)))
|
||||
var n = findByTime(daNote.strumTime);
|
||||
trace(n);
|
||||
if(n != null)
|
||||
{
|
||||
goodNoteHit(daNote);
|
||||
boyfriend.holdTimer = daNote.sustainLength;
|
||||
@ -3106,7 +3180,7 @@ class PlayState extends MusicBeatState
|
||||
}
|
||||
});
|
||||
|
||||
if (boyfriend.holdTimer > Conductor.stepCrochet * 4 * 0.001 && (!holdArray.contains(true) || FlxG.save.data.botplay))
|
||||
if (boyfriend.holdTimer > Conductor.stepCrochet * 4 * 0.001 && (!holdArray.contains(true) || PlayStateChangeables.botPlay))
|
||||
{
|
||||
if (boyfriend.animation.curAnim.name.startsWith('sing') && !boyfriend.animation.curAnim.name.endsWith('miss'))
|
||||
boyfriend.playAnim('idle');
|
||||
@ -3130,6 +3204,17 @@ class PlayState extends MusicBeatState
|
||||
});
|
||||
}
|
||||
|
||||
public function findByTime(time:Float):Array<Dynamic>
|
||||
{
|
||||
for (i in rep.replay.songNotes)
|
||||
{
|
||||
//trace('checking ' + Math.round(i[0]) + ' against ' + Math.round(time));
|
||||
if (i[0] == time)
|
||||
return i;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public var fuckingVolume:Float = 1;
|
||||
public var useVideo = false;
|
||||
|
||||
@ -3139,10 +3224,34 @@ class PlayState extends MusicBeatState
|
||||
|
||||
public var videoSprite:FlxSprite;
|
||||
|
||||
public function focusOut() {
|
||||
if (paused)
|
||||
return;
|
||||
persistentUpdate = false;
|
||||
persistentDraw = true;
|
||||
paused = true;
|
||||
|
||||
if (FlxG.sound.music != null)
|
||||
{
|
||||
FlxG.sound.music.pause();
|
||||
vocals.pause();
|
||||
}
|
||||
|
||||
openSubState(new PauseSubState(boyfriend.getScreenPosition().x, boyfriend.getScreenPosition().y));
|
||||
}
|
||||
public function focusIn()
|
||||
{
|
||||
// nada
|
||||
}
|
||||
|
||||
|
||||
public function backgroundVideo(source:String) // for background videos
|
||||
{
|
||||
useVideo = true;
|
||||
|
||||
FlxG.stage.window.onFocusOut.add(focusOut);
|
||||
FlxG.stage.window.onFocusIn.add(focusIn);
|
||||
|
||||
var ourSource:String = "assets/videos/daWeirdVid/dontDelete.webm";
|
||||
WebmPlayer.SKIP_STEP_LIMIT = 90;
|
||||
var str1:String = "WEBM SHIT";
|
||||
@ -3202,6 +3311,10 @@ class PlayState extends MusicBeatState
|
||||
combo = 0;
|
||||
misses++;
|
||||
|
||||
if (daNote != null)
|
||||
if (!loadRep)
|
||||
saveNotes.push([daNote.strumTime,daNote.sustainLength,daNote.noteData,166 * Math.floor((PlayState.rep.replay.sf / 60) * 1000) / 166]);
|
||||
|
||||
//var noteDiff:Float = Math.abs(daNote.strumTime - Conductor.songPosition);
|
||||
//var wife:Float = EtternaFunctions.wife3(noteDiff, FlxG.save.data.etternaMode ? 1 : 1.7);
|
||||
|
||||
@ -3288,9 +3401,9 @@ class PlayState extends MusicBeatState
|
||||
|
||||
function noteCheck(controlArray:Array<Bool>, note:Note):Void // sorry lol
|
||||
{
|
||||
var noteDiff:Float = Math.abs(note.strumTime - Conductor.songPosition);
|
||||
var noteDiff:Float = -(note.strumTime - Conductor.songPosition);
|
||||
|
||||
note.rating = Ratings.CalculateRating(noteDiff);
|
||||
note.rating = Ratings.CalculateRating(noteDiff, Math.floor((PlayStateChangeables.safeFrames / 60) * 1000));
|
||||
|
||||
/* if (loadRep)
|
||||
{
|
||||
@ -3339,10 +3452,16 @@ class PlayState extends MusicBeatState
|
||||
if (mashing != 0)
|
||||
mashing = 0;
|
||||
|
||||
var noteDiff:Float = Math.abs(note.strumTime - Conductor.songPosition);
|
||||
var noteDiff:Float = -(note.strumTime - Conductor.songPosition);
|
||||
|
||||
if(loadRep)
|
||||
noteDiff = findByTime(note.strumTime)[3];
|
||||
|
||||
note.rating = Ratings.CalculateRating(noteDiff);
|
||||
|
||||
if (note.rating == "miss")
|
||||
return;
|
||||
|
||||
// add newest note to front of notesHitArray
|
||||
// the oldest notes are at the end and are removed first
|
||||
if (!note.isSustainNote)
|
||||
@ -3384,7 +3503,13 @@ class PlayState extends MusicBeatState
|
||||
|
||||
|
||||
if(!loadRep && note.mustPress)
|
||||
saveNotes.push(HelperFunctions.truncateFloat(note.strumTime, 2));
|
||||
{
|
||||
var array = [note.strumTime,note.sustainLength,note.noteData,noteDiff];
|
||||
if (note.isSustainNote)
|
||||
array[1] = -1;
|
||||
trace('pushing ' + array[0]);
|
||||
saveNotes.push(array);
|
||||
}
|
||||
|
||||
playerStrums.forEach(function(spr:FlxSprite)
|
||||
{
|
||||
@ -3523,8 +3648,6 @@ class PlayState extends MusicBeatState
|
||||
}
|
||||
#end
|
||||
|
||||
|
||||
|
||||
// yes this updates every step.
|
||||
// yes this is bad
|
||||
// but i'm doing it to update misses and accuracy
|
||||
@ -3547,7 +3670,7 @@ class PlayState extends MusicBeatState
|
||||
|
||||
if (generatedMusic)
|
||||
{
|
||||
notes.sort(FlxSort.byY, (FlxG.save.data.downscroll ? FlxSort.ASCENDING : FlxSort.DESCENDING));
|
||||
notes.sort(FlxSort.byY, (PlayStateChangeables.useDownscroll ? FlxSort.ASCENDING : FlxSort.DESCENDING));
|
||||
}
|
||||
|
||||
#if windows
|
||||
@ -3597,13 +3720,14 @@ class PlayState extends MusicBeatState
|
||||
camHUD.zoom += 0.03;
|
||||
}
|
||||
|
||||
iconP1.setGraphicSize(Std.int(iconP1.width + 30));
|
||||
iconP2.setGraphicSize(Std.int(iconP2.width + 30));
|
||||
|
||||
iconP1.updateHitbox();
|
||||
iconP2.updateHitbox();
|
||||
}
|
||||
|
||||
iconP1.setGraphicSize(Std.int(iconP1.width + 30));
|
||||
iconP2.setGraphicSize(Std.int(iconP2.width + 30));
|
||||
|
||||
iconP1.updateHitbox();
|
||||
iconP2.updateHitbox();
|
||||
|
||||
if (curBeat % gfSpeed == 0)
|
||||
{
|
||||
gf.dance();
|
||||
|
Reference in New Issue
Block a user