LN and health drain work

This commit is contained in:
Kade M 2021-07-11 18:30:52 -07:00
parent f8ae7c1234
commit 9323c03fed

View File

@ -1545,10 +1545,19 @@ class PlayState extends MusicBeatState
if (dataNotes.length != 0)
{
var coolNote = dataNotes[0];
if (!coolNote.sustainActive)
var coolNote = null;
for (i in dataNotes)
if (!i.isSustainNote)
{
coolNote = i;
break;
}
if (coolNote == null) // Note is null, which means it's probably a sustain note. Update will handle this (HOPEFULLY???)
{
return;
}
if (dataNotes.length > 1) // stacked notes or really close ones
{
@ -2829,48 +2838,51 @@ class PlayState extends MusicBeatState
&& daNote.mustPress)
{
if (daNote.isSustainNote && daNote.wasGoodHit)
{
daNote.kill();
notes.remove(daNote, true);
}
else
{
if (loadRep && daNote.isSustainNote)
{
// im tired and lazy this sucks I know i'm dumb
if (findByTime(daNote.strumTime) != null)
totalNotesHit += 1;
daNote.kill();
notes.remove(daNote, true);
}
else
{
if (loadRep && daNote.isSustainNote)
{
// im tired and lazy this sucks I know i'm dumb
if (findByTime(daNote.strumTime) != null)
totalNotesHit += 1;
else
{
if (!daNote.isSustainNote)
health -= 0.10;
vocals.volume = 0;
if (theFunne && !daNote.isSustainNote)
noteMiss(daNote.noteData, daNote);
}
}
else
{
if (!daNote.isSustainNote)
health -= 0.075;
health -= 0.10;
vocals.volume = 0;
if (theFunne && !daNote.isSustainNote)
noteMiss(daNote.noteData, daNote);
}
}
else
if (!daNote.wasGoodHit
&& daNote.isSustainNote
&& daNote.sustainActive
&& daNote.spotInLine != daNote.parent.children.length)
{
if (!daNote.isSustainNote)
health -= 0.075;
vocals.volume = 0;
if (theFunne && !daNote.isSustainNote)
noteMiss(daNote.noteData, daNote);
health -= 0.20; // give a health punishment for failing a LN
trace("hold fell over at " + daNote.spotInLine);
for (i in daNote.parent.children)
i.sustainActive = false;
}
}
if (!daNote.wasGoodHit && daNote.isSustainNote && daNote.sustainActive && daNote.spotInLine != daNote.parent.children.length)
{
health -= 0.2; // give a health punishment for failing a LN
trace("hold fell over at " + daNote.spotInLine);
for(i in daNote.parent.children)
i.sustainActive = false;
daNote.visible = false;
daNote.kill();
notes.remove(daNote, true);
}
daNote.visible = false;
daNote.kill();
notes.remove(daNote, true);
}
});
}
@ -3096,7 +3108,7 @@ class PlayState extends MusicBeatState
score = -300;
combo = 0;
misses++;
health -= 0.45;
health -= 0.06;
ss = false;
shits++;
if (FlxG.save.data.accuracyMod == 0)
@ -3104,7 +3116,7 @@ class PlayState extends MusicBeatState
case 'bad':
daRating = 'bad';
score = 0;
health -= 0.2;
health -= 0.02;
ss = false;
bads++;
if (FlxG.save.data.accuracyMod == 0)
@ -3114,8 +3126,6 @@ class PlayState extends MusicBeatState
score = 200;
ss = false;
goods++;
if (health < 2)
health += 0.001;
if (FlxG.save.data.accuracyMod == 0)
totalNotesHit += 0.75;
case 'sick':
@ -3126,6 +3136,7 @@ class PlayState extends MusicBeatState
sicks++;
}
// trace('Wife accuracy loss: ' + wife + ' | Rating: ' + daRating + ' | Score: ' + score + ' | Weight: ' + (1 - wife));
if (daRating != 'shit' || daRating != 'bad')