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) if (dataNotes.length != 0)
{ {
var coolNote = dataNotes[0]; var coolNote = null;
if (!coolNote.sustainActive) 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; return;
}
if (dataNotes.length > 1) // stacked notes or really close ones if (dataNotes.length > 1) // stacked notes or really close ones
{ {
@ -2843,7 +2852,7 @@ class PlayState extends MusicBeatState
else else
{ {
if (!daNote.isSustainNote) if (!daNote.isSustainNote)
health -= 0.075; health -= 0.10;
vocals.volume = 0; vocals.volume = 0;
if (theFunne && !daNote.isSustainNote) if (theFunne && !daNote.isSustainNote)
noteMiss(daNote.noteData, daNote); noteMiss(daNote.noteData, daNote);
@ -2852,16 +2861,19 @@ class PlayState extends MusicBeatState
else else
{ {
if (!daNote.isSustainNote) if (!daNote.isSustainNote)
health -= 0.075; health -= 0.10;
vocals.volume = 0; vocals.volume = 0;
if (theFunne && !daNote.isSustainNote) if (theFunne && !daNote.isSustainNote)
noteMiss(daNote.noteData, daNote); noteMiss(daNote.noteData, daNote);
} }
} }
if (!daNote.wasGoodHit && daNote.isSustainNote && daNote.sustainActive && daNote.spotInLine != daNote.parent.children.length) if (!daNote.wasGoodHit
&& daNote.isSustainNote
&& daNote.sustainActive
&& daNote.spotInLine != daNote.parent.children.length)
{ {
health -= 0.2; // give a health punishment for failing a LN health -= 0.20; // give a health punishment for failing a LN
trace("hold fell over at " + daNote.spotInLine); trace("hold fell over at " + daNote.spotInLine);
for (i in daNote.parent.children) for (i in daNote.parent.children)
i.sustainActive = false; i.sustainActive = false;
@ -3096,7 +3108,7 @@ class PlayState extends MusicBeatState
score = -300; score = -300;
combo = 0; combo = 0;
misses++; misses++;
health -= 0.45; health -= 0.06;
ss = false; ss = false;
shits++; shits++;
if (FlxG.save.data.accuracyMod == 0) if (FlxG.save.data.accuracyMod == 0)
@ -3104,7 +3116,7 @@ class PlayState extends MusicBeatState
case 'bad': case 'bad':
daRating = 'bad'; daRating = 'bad';
score = 0; score = 0;
health -= 0.2; health -= 0.02;
ss = false; ss = false;
bads++; bads++;
if (FlxG.save.data.accuracyMod == 0) if (FlxG.save.data.accuracyMod == 0)
@ -3114,8 +3126,6 @@ class PlayState extends MusicBeatState
score = 200; score = 200;
ss = false; ss = false;
goods++; goods++;
if (health < 2)
health += 0.001;
if (FlxG.save.data.accuracyMod == 0) if (FlxG.save.data.accuracyMod == 0)
totalNotesHit += 0.75; totalNotesHit += 0.75;
case 'sick': case 'sick':
@ -3126,6 +3136,7 @@ class PlayState extends MusicBeatState
sicks++; sicks++;
} }
// trace('Wife accuracy loss: ' + wife + ' | Rating: ' + daRating + ' | Score: ' + score + ' | Weight: ' + (1 - wife)); // trace('Wife accuracy loss: ' + wife + ' | Rating: ' + daRating + ' | Score: ' + score + ' | Weight: ' + (1 - wife));
if (daRating != 'shit' || daRating != 'bad') if (daRating != 'shit' || daRating != 'bad')