From 9323c03feddda5d65ed81f36bc7c650b32ff2c2c Mon Sep 17 00:00:00 2001 From: Kade M Date: Sun, 11 Jul 2021 18:30:52 -0700 Subject: [PATCH] LN and health drain work --- source/PlayState.hx | 83 +++++++++++++++++++++++++-------------------- 1 file changed, 47 insertions(+), 36 deletions(-) diff --git a/source/PlayState.hx b/source/PlayState.hx index cc575e4..49f6928 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -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')