oops forgot about this

This commit is contained in:
Kade M
2021-07-10 17:01:29 -07:00
parent 388c6215c7
commit 2897fdc489
2 changed files with 44 additions and 17 deletions

View File

@ -40,6 +40,13 @@ class Note extends FlxSprite
public var dataColor:Array<String> = ['purple', 'blue', 'green', 'red']; public var dataColor:Array<String> = ['purple', 'blue', 'green', 'red'];
public var isParent:Bool = false;
public var parent:Note = null;
public var spotInLine:Int = 0;
public var sustainActive:Bool = true;
public var children:Array<Note> = [];
public function new(strumTime:Float, noteData:Int, ?prevNote:Note, ?sustainNote:Bool = false, ?inCharter:Bool = false) public function new(strumTime:Float, noteData:Int, ?prevNote:Note, ?sustainNote:Bool = false, ?inCharter:Bool = false)
{ {
super(); super();
@ -167,6 +174,10 @@ class Note extends FlxSprite
{ {
super.update(elapsed); super.update(elapsed);
if (!modifiedByLua)
if (!sustainActive)
alpha = 0.4;
if (mustPress) if (mustPress)
{ {
// ass // ass

View File

@ -1763,6 +1763,11 @@ class PlayState extends MusicBeatState
susLength = susLength / Conductor.stepCrochet; susLength = susLength / Conductor.stepCrochet;
unspawnNotes.push(swagNote); unspawnNotes.push(swagNote);
if (susLength > 0)
swagNote.isParent = true;
var type = 0;
for (susNote in 0...Math.floor(susLength)) for (susNote in 0...Math.floor(susLength))
{ {
oldNote = unspawnNotes[Std.int(unspawnNotes.length - 1)]; oldNote = unspawnNotes[Std.int(unspawnNotes.length - 1)];
@ -1777,6 +1782,11 @@ class PlayState extends MusicBeatState
{ {
sustainNote.x += FlxG.width / 2; // general offset sustainNote.x += FlxG.width / 2; // general offset
} }
sustainNote.parent = swagNote;
swagNote.children.push(sustainNote);
sustainNote.spotInLine = type;
type++;
} }
swagNote.mustPress = gottaHitNote; swagNote.mustPress = gottaHitNote;
@ -2861,6 +2871,11 @@ class PlayState extends MusicBeatState
{ {
daNote.kill(); daNote.kill();
notes.remove(daNote, true); notes.remove(daNote, true);
if (!daNote.isParent)
{
for(i in daNote.parent.children)
i.sustainActive = false;
}
} }
else else
{ {
@ -2871,10 +2886,18 @@ class PlayState extends MusicBeatState
totalNotesHit += 1; totalNotesHit += 1;
else else
{ {
health -= 0.075; if (daNote.isSustainNote)
vocals.volume = 0; {
if (theFunne) daNote.kill();
noteMiss(daNote.noteData, daNote); notes.remove(daNote, true);
}
else
{
health -= 0.075;
vocals.volume = 0;
if (theFunne)
noteMiss(daNote.noteData, daNote);
}
} }
} }
else else
@ -3102,6 +3125,8 @@ class PlayState extends MusicBeatState
var rating:FlxSprite = new FlxSprite(); var rating:FlxSprite = new FlxSprite();
var score:Float = 350; var score:Float = 350;
trace(totalNotesHit);
if (FlxG.save.data.accuracyMod == 1) if (FlxG.save.data.accuracyMod == 1)
totalNotesHit += wife; totalNotesHit += wife;
@ -3432,7 +3457,7 @@ class PlayState extends MusicBeatState
{ {
notes.forEachAlive(function(daNote:Note) notes.forEachAlive(function(daNote:Note)
{ {
if (daNote.isSustainNote && daNote.canBeHit && daNote.mustPress && holdArray[daNote.noteData]) if (daNote.isSustainNote && daNote.canBeHit && daNote.mustPress && holdArray[daNote.noteData] && daNote.sustainActive)
goodNoteHit(daNote); goodNoteHit(daNote);
}); });
} }
@ -3779,6 +3804,7 @@ class PlayState extends MusicBeatState
*/ */
function updateAccuracy() function updateAccuracy()
{ {
trace(totalPlayed + "/" + totalNotesHit);
totalPlayed += 1; totalPlayed += 1;
accuracy = Math.max(0, totalNotesHit / totalPlayed * 100); accuracy = Math.max(0, totalNotesHit / totalPlayed * 100);
accuracyDefault = Math.max(0, totalNotesHitDefault / totalPlayed * 100); accuracyDefault = Math.max(0, totalNotesHitDefault / totalPlayed * 100);
@ -3885,6 +3911,7 @@ class PlayState extends MusicBeatState
{ {
if (!note.isSustainNote) if (!note.isSustainNote)
{ {
trace(totalNotesHit);
popUpScore(note); popUpScore(note);
combo += 1; combo += 1;
} }
@ -3921,21 +3948,10 @@ class PlayState extends MusicBeatState
{ {
if (Math.abs(note.noteData) == spr.ID) if (Math.abs(note.noteData) == spr.ID)
{ {
if (!note.isSustainNote)
{
popUpScore(note);
combo += 1;
}
else
totalNotesHit += 1;
#if windows
if (luaModchart != null)
luaModchart.executeState('playerOneSing', [note.noteData, Conductor.songPosition]);
#end
spr.animation.play('confirm', true); spr.animation.play('confirm', true);
} }
}); });
note.kill(); note.kill();
notes.remove(note, true); notes.remove(note, true);
note.destroy(); note.destroy();