some fixes

This commit is contained in:
KadeDev 2021-03-23 14:29:49 -07:00
parent 9181f41b69
commit fc36958af9
3 changed files with 142 additions and 72 deletions

View File

@ -1011,7 +1011,11 @@ class ChartingState extends MusicBeatState
var i = _song.notes[curSection].sectionNotes[n]; var i = _song.notes[curSection].sectionNotes[n];
if (i == null) if (i == null)
continue; continue;
if (i[0] == note.strumTime + (note.strumTime == 0 ? 0 : 1) && i[1] % 4 == note.noteData) if ((i[0] == note.strumTime + (note.strumTime == 0 ? 0 : 1)
? true : i[0] == note.strumTime)
&& i[1] % 4 == note.noteData)
// Why does it do this?
// I DONT FUCKING KNOW!!!!!!!!!!!!!!
{ {
trace('GAMING'); trace('GAMING');
_song.notes[curSection].sectionNotes.remove(i); _song.notes[curSection].sectionNotes.remove(i);

View File

@ -60,7 +60,7 @@ class EtternaFunctions
return (getNotes() * 350); return (getNotes() * 350);
} }
public static function wife3(maxms:Float, ts) public static function wife3(maxms:Float, ts:Float)
{ {
var max_points = 1.0; var max_points = 1.0;
var miss_weight = -5.5; var miss_weight = -5.5;

View File

@ -167,7 +167,7 @@ class PlayState extends MusicBeatState
{ {
if (FlxG.save.data.etternaMode) if (FlxG.save.data.etternaMode)
Conductor.safeFrames = 7; // 116ms hit window (j3-4) Conductor.safeFrames = 5; // 116ms hit window (j3-4)
else else
Conductor.safeFrames = 10; // 166ms hit window (j1) Conductor.safeFrames = 10; // 166ms hit window (j1)
@ -1131,7 +1131,6 @@ class PlayState extends MusicBeatState
if (!paused) if (!paused)
FlxG.sound.playMusic(Paths.inst(PlayState.SONG.song), 1, false); FlxG.sound.playMusic(Paths.inst(PlayState.SONG.song), 1, false);
FlxG.sound.music.onComplete = endSong;
vocals.play(); vocals.play();
if (FlxG.save.data.songPosition) if (FlxG.save.data.songPosition)
@ -1554,14 +1553,14 @@ class PlayState extends MusicBeatState
return ranking; return ranking;
} }
public static var songRate = 1.5;
override public function update(elapsed:Float) override public function update(elapsed:Float)
{ {
#if !debug #if !debug
perfectMode = false; perfectMode = false;
#end #end
songPositionBar = Conductor.songPosition;
if (FlxG.keys.justPressed.NINE) if (FlxG.keys.justPressed.NINE)
{ {
if (iconP1.animation.curAnim.name == 'bf-old') if (iconP1.animation.curAnim.name == 'bf-old')
@ -1668,6 +1667,11 @@ class PlayState extends MusicBeatState
{ {
// Conductor.songPosition = FlxG.sound.music.time; // Conductor.songPosition = FlxG.sound.music.time;
Conductor.songPosition += FlxG.elapsed * 1000; Conductor.songPosition += FlxG.elapsed * 1000;
/*@:privateAccess
{
FlxG.sound.music._channel.
}*/
songPositionBar = Conductor.songPosition;
if (!paused) if (!paused)
{ {
@ -1911,6 +1915,7 @@ class PlayState extends MusicBeatState
if (!inCutscene) if (!inCutscene)
keyShit(); keyShit();
#if debug #if debug
if (FlxG.keys.justPressed.ONE) if (FlxG.keys.justPressed.ONE)
endSong(); endSong();
@ -2005,7 +2010,7 @@ class PlayState extends MusicBeatState
private function popUpScore(strumtime:Float):Void private function popUpScore(strumtime:Float):Void
{ {
var noteDiff:Float = Math.abs(strumtime - Conductor.songPosition); var noteDiff:Float = Math.abs(strumtime - Conductor.songPosition);
var wife:Float = EtternaFunctions.wife3(noteDiff, 1); var wife:Float = EtternaFunctions.wife3(noteDiff, FlxG.save.data.etternaMode ? 1 : 1.7);
// boyfriend.playAnim('hey'); // boyfriend.playAnim('hey');
vocals.volume = 1; vocals.volume = 1;
@ -2296,15 +2301,15 @@ class PlayState extends MusicBeatState
if (repPresses < rep.replay.keyPresses.length && repReleases < rep.replay.keyReleases.length) if (repPresses < rep.replay.keyPresses.length && repReleases < rep.replay.keyReleases.length)
{ {
upP = NearlyEquals(rep.replay.keyPresses[repPresses].time, Conductor.songPosition) && rep.replay.keyPresses[repPresses].key == "up"; upP = rep.replay.keyPresses[repPresses].time + 1 <= Conductor.songPosition && rep.replay.keyPresses[repPresses].key == "up";
rightP = NearlyEquals(rep.replay.keyPresses[repPresses].time, Conductor.songPosition) && rep.replay.keyPresses[repPresses].key == "right"; rightP = rep.replay.keyPresses[repPresses].time + 1 <= Conductor.songPosition && rep.replay.keyPresses[repPresses].key == "right";
downP = NearlyEquals(rep.replay.keyPresses[repPresses].time, Conductor.songPosition) && rep.replay.keyPresses[repPresses].key == "down"; downP = rep.replay.keyPresses[repPresses].time + 1 <= Conductor.songPosition && rep.replay.keyPresses[repPresses].key == "down";
leftP = NearlyEquals(rep.replay.keyPresses[repPresses].time, Conductor.songPosition) && rep.replay.keyPresses[repPresses].key == "left"; leftP = rep.replay.keyPresses[repPresses].time + 1 <= Conductor.songPosition && rep.replay.keyPresses[repPresses].key == "left";
upR = NearlyEquals(rep.replay.keyReleases[repReleases].time, Conductor.songPosition) && rep.replay.keyReleases[repReleases].key == "up"; upR = rep.replay.keyPresses[repReleases].time - 1 <= Conductor.songPosition && rep.replay.keyReleases[repReleases].key == "up";
rightR = NearlyEquals(rep.replay.keyReleases[repReleases].time, Conductor.songPosition) && rep.replay.keyReleases[repReleases].key == "right"; rightR = rep.replay.keyPresses[repReleases].time - 1 <= Conductor.songPosition && rep.replay.keyReleases[repReleases].key == "right";
downR = NearlyEquals(rep.replay.keyReleases[repReleases].time, Conductor.songPosition) && rep.replay.keyReleases[repReleases].key == "down"; downR = rep.replay.keyPresses[repReleases].time - 1<= Conductor.songPosition && rep.replay.keyReleases[repReleases].key == "down";
leftR = NearlyEquals(rep.replay.keyReleases[repReleases].time, Conductor.songPosition) && rep.replay.keyReleases[repReleases].key == "left"; leftR = rep.replay.keyPresses[repReleases].time - 1<= Conductor.songPosition && rep.replay.keyReleases[repReleases].key == "left";
upHold = upP ? true : upR ? false : true; upHold = upP ? true : upR ? false : true;
rightHold = rightP ? true : rightR ? false : true; rightHold = rightP ? true : rightR ? false : true;
@ -2500,7 +2505,21 @@ class PlayState extends MusicBeatState
switch (spr.ID) switch (spr.ID)
{ {
case 2: case 2:
if (upP && spr.animation.curAnim.name != 'confirm') if (loadRep)
{
/*if (upP)
{
spr.animation.play('pressed');
new FlxTimer().start(Math.abs(rep.replay.keyPresses[repReleases].time - Conductor.songPosition) + 10, function(tmr:FlxTimer)
{
spr.animation.play('static');
repReleases++;
});
}*/
}
else
{
if (upP && spr.animation.curAnim.name != 'confirm' && !loadRep)
{ {
spr.animation.play('pressed'); spr.animation.play('pressed');
trace('play'); trace('play');
@ -2510,24 +2529,69 @@ class PlayState extends MusicBeatState
spr.animation.play('static'); spr.animation.play('static');
repReleases++; repReleases++;
} }
}
case 3: case 3:
if (rightP && spr.animation.curAnim.name != 'confirm') if (loadRep)
{
/*if (upP)
{
spr.animation.play('pressed');
new FlxTimer().start(Math.abs(rep.replay.keyPresses[repReleases].time - Conductor.songPosition) + 10, function(tmr:FlxTimer)
{
spr.animation.play('static');
repReleases++;
});
}*/
}
else
{
if (rightP && spr.animation.curAnim.name != 'confirm' && !loadRep)
spr.animation.play('pressed'); spr.animation.play('pressed');
if (rightR) if (rightR)
{ {
spr.animation.play('static'); spr.animation.play('static');
repReleases++; repReleases++;
} }
}
case 1: case 1:
if (downP && spr.animation.curAnim.name != 'confirm') if (loadRep)
{
/*if (upP)
{
spr.animation.play('pressed');
new FlxTimer().start(Math.abs(rep.replay.keyPresses[repReleases].time - Conductor.songPosition) + 10, function(tmr:FlxTimer)
{
spr.animation.play('static');
repReleases++;
});
}*/
}
else
{
if (downP && spr.animation.curAnim.name != 'confirm' && !loadRep)
spr.animation.play('pressed'); spr.animation.play('pressed');
if (downR) if (downR)
{ {
spr.animation.play('static'); spr.animation.play('static');
repReleases++; repReleases++;
} }
}
case 0: case 0:
if (leftP && spr.animation.curAnim.name != 'confirm') if (loadRep)
{
/*if (upP)
{
spr.animation.play('pressed');
new FlxTimer().start(Math.abs(rep.replay.keyPresses[repReleases].time - Conductor.songPosition) + 10, function(tmr:FlxTimer)
{
spr.animation.play('static');
repReleases++;
});
}*/
}
else
{
if (leftP && spr.animation.curAnim.name != 'confirm' && !loadRep)
spr.animation.play('pressed'); spr.animation.play('pressed');
if (leftR) if (leftR)
{ {
@ -2535,6 +2599,7 @@ class PlayState extends MusicBeatState
repReleases++; repReleases++;
} }
} }
}
if (spr.animation.curAnim.name == 'confirm' && !curStage.startsWith('school')) if (spr.animation.curAnim.name == 'confirm' && !curStage.startsWith('school'))
{ {
@ -2560,7 +2625,7 @@ class PlayState extends MusicBeatState
misses++; misses++;
var noteDiff:Float = Math.abs(daNote.strumTime - Conductor.songPosition); var noteDiff:Float = Math.abs(daNote.strumTime - Conductor.songPosition);
var wife:Float = EtternaFunctions.wife3(noteDiff, 1); var wife:Float = EtternaFunctions.wife3(noteDiff, FlxG.save.data.etternaMode ? 1 : 1.7);
totalNotesHit += wife; totalNotesHit += wife;
@ -2707,6 +2772,7 @@ class PlayState extends MusicBeatState
boyfriend.playAnim('singLEFT', true); boyfriend.playAnim('singLEFT', true);
} }
if (!loadRep)
playerStrums.forEach(function(spr:FlxSprite) playerStrums.forEach(function(spr:FlxSprite)
{ {
if (Math.abs(note.noteData) == spr.ID) if (Math.abs(note.noteData) == spr.ID)