Fix Sustain Miss As One Note
This commit is contained in:
@@ -113,8 +113,8 @@ class Note extends FlxSprite
|
||||
|
||||
public var animSuffix:String = null;
|
||||
|
||||
public var tripTimer:Float = 0; // ranges from 0 to 1
|
||||
|
||||
// Deprecated?
|
||||
@:dox(hide) public var tripTimer:Float = 0; // ranges from 0 to 1
|
||||
|
||||
private static function customTypePathExists(path:String) {
|
||||
if (__customNoteTypeExists.exists(path))
|
||||
|
||||
@@ -1833,18 +1833,25 @@ class PlayState extends MusicBeatState
|
||||
*/
|
||||
public function noteMiss(strumLine:StrumLine, note:Note, ?direction:Int, ?player:Int):Void
|
||||
{
|
||||
var playerID:Null<Int> = note == null ? player : strumLines.members.indexOf(strumLine);
|
||||
var directionID:Null<Int> = note == null ? direction : note.strumID;
|
||||
var hasNote:Bool = note != null;
|
||||
var playerID:Null<Int> = hasNote ? strumLines.members.indexOf(strumLine) : player;
|
||||
var directionID:Null<Int> = hasNote ? note.strumID : direction;
|
||||
if (playerID == null || directionID == null || playerID == -1) return;
|
||||
|
||||
if (Flags.SUSTAINS_AS_ONE_NOTE) {
|
||||
if (note != null ? (note.isSustainNote && note.prevNote != null && note.prevNote.isSustainNote && !note.prevNote.wasGoodHit) : false) {
|
||||
if (hasNote) {
|
||||
if (Flags.SUSTAINS_AS_ONE_NOTE && note.isSustainNote) {
|
||||
strumLine.deleteNote(note);
|
||||
return;
|
||||
if (note.sustainParent.wasGoodHit) {
|
||||
note.sustainParent.wasGoodHit = false;
|
||||
note.sustainParent.tooLate = true;
|
||||
note = note.sustainParent;
|
||||
}
|
||||
else
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var event:NoteMissEvent = gameAndCharsEvent("onPlayerMiss", EventManager.get(NoteMissEvent).recycle(note, -10, 1, muteVocalsOnMiss, note != null ? ((note.isSustainNote && Flags.SUSTAINS_AS_ONE_NOTE) ? -0.1425 : -0.0475) : -0.04, Paths.sound(FlxG.random.getObject(Flags.DEFAULT_MISS_SOUNDS)), FlxG.random.float(0.1, 0.2), note == null, combo > 5, "sad", true, true, "miss", strumLines.members[playerID].characters, playerID, note != null ? note.noteType : null, directionID, 0));
|
||||
var event:NoteMissEvent = gameAndCharsEvent("onPlayerMiss", EventManager.get(NoteMissEvent).recycle(note, -10, 1, muteVocalsOnMiss, hasNote ? ((note.isSustainNote && Flags.SUSTAINS_AS_ONE_NOTE) ? -0.1425 : -0.0475) : -0.04, Paths.sound(FlxG.random.getObject(Flags.DEFAULT_MISS_SOUNDS)), FlxG.random.float(0.1, 0.2), !hasNote, combo > 5, "sad", true, true, "miss", strumLines.members[playerID].characters, playerID, hasNote ? note.noteType : null, directionID, 0));
|
||||
strumLine.onMiss.dispatch(event);
|
||||
if (event.cancelled) {
|
||||
gameAndCharsEvent("onPostPlayerMiss", event);
|
||||
@@ -1883,7 +1890,7 @@ class PlayState extends MusicBeatState
|
||||
}
|
||||
}
|
||||
|
||||
if (event.deleteNote && strumLine != null && note != null)
|
||||
if (event.deleteNote && strumLine != null && hasNote)
|
||||
strumLine.deleteNote(note);
|
||||
|
||||
gameAndCharsEvent("onPostPlayerMiss", event);
|
||||
|
||||
@@ -241,20 +241,8 @@ class StrumLine extends FlxTypedGroup<Strum> {
|
||||
if (__updateNote_event.strum == null) return;
|
||||
if (__updateNote_event.__reposNote) __updateNote_event.strum.updateNotePosition(daNote);
|
||||
|
||||
|
||||
if (daNote.isSustainNote)
|
||||
{
|
||||
if (daNote.isSustainNote) {
|
||||
daNote.updateSustain(__updateNote_event.strum);
|
||||
|
||||
if (daNote.tripTimer > 0 && daNote.tailCount > 3)
|
||||
{
|
||||
daNote.tripTimer -= 0.05 / daNote.sustainLength;
|
||||
if (daNote.tripTimer <= 0)
|
||||
{
|
||||
daNote.tripTimer = 0;
|
||||
daNote.canBeHit = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -264,14 +252,7 @@ class StrumLine extends FlxTypedGroup<Strum> {
|
||||
var __notePerStrum:Array<Note> = [];
|
||||
|
||||
function __inputProcessPressed(note:Note) {
|
||||
if (__pressed[note.strumID] && note.isSustainNote && note.strumTime < __updateNote_songPos && !note.wasGoodHit) {
|
||||
note.tripTimer = 1;
|
||||
PlayState.instance.goodNoteHit(this, note);
|
||||
}
|
||||
}
|
||||
function __inputProcessPressedOne(note:Note) {
|
||||
if (__pressed[note.strumID] && note.isSustainNote && note.sustainParent != null && note.prevNote != null && note.prevNote.wasGoodHit && note.strumTime < __updateNote_songPos && !note.wasGoodHit) {
|
||||
note.tripTimer = 1;
|
||||
if (__pressed[note.strumID] && note.isSustainNote && note.sustainParent.wasGoodHit && note.strumTime < __updateNote_songPos && !note.wasGoodHit) {
|
||||
PlayState.instance.goodNoteHit(this, note);
|
||||
}
|
||||
}
|
||||
@@ -338,10 +319,7 @@ class StrumLine extends FlxTypedGroup<Strum> {
|
||||
if (c.lastAnimContext != DANCE)
|
||||
c.__lockAnimThisFrame = true;
|
||||
|
||||
if (Flags.SUSTAINS_AS_ONE_NOTE)
|
||||
notes.forEachAlive(__inputProcessPressedOne);
|
||||
else
|
||||
notes.forEachAlive(__inputProcessPressed);
|
||||
notes.forEachAlive(__inputProcessPressed);
|
||||
}
|
||||
|
||||
forEach(function(str:Strum) {
|
||||
|
||||
Reference in New Issue
Block a user