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
{ {
@ -2829,48 +2838,51 @@ class PlayState extends MusicBeatState
&& daNote.mustPress) && daNote.mustPress)
{ {
if (daNote.isSustainNote && daNote.wasGoodHit) 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 daNote.kill();
if (findByTime(daNote.strumTime) != null) notes.remove(daNote, true);
totalNotesHit += 1; }
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 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);
} }
} }
else
if (!daNote.wasGoodHit
&& daNote.isSustainNote
&& daNote.sustainActive
&& daNote.spotInLine != daNote.parent.children.length)
{ {
if (!daNote.isSustainNote) health -= 0.20; // give a health punishment for failing a LN
health -= 0.075; trace("hold fell over at " + daNote.spotInLine);
vocals.volume = 0; for (i in daNote.parent.children)
if (theFunne && !daNote.isSustainNote) i.sustainActive = false;
noteMiss(daNote.noteData, daNote);
} }
}
if (!daNote.wasGoodHit && daNote.isSustainNote && daNote.sustainActive && daNote.spotInLine != daNote.parent.children.length) daNote.visible = false;
{ daNote.kill();
health -= 0.2; // give a health punishment for failing a LN notes.remove(daNote, true);
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);
}
}); });
} }
@ -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')