Skip to content

Commit

Permalink
fix hold notes on group characters
Browse files Browse the repository at this point in the history
  • Loading branch information
Vortex2Oblivion committed Feb 25, 2024
1 parent 8247371 commit 2ae00f9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 21 deletions.
2 changes: 1 addition & 1 deletion source/modding/ModchartUtilities.hx
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ class ModchartUtilities {
lua = LuaL.newstate();
LuaL.openlibs(lua);

trace('Loaded script at $path');
trace('Loading script at path \'${path}\'', DEBUG);
//trace("lua version: " + Lua.version());
//trace("LuaJIT version: " + Lua.versionJIT());

Expand Down
31 changes: 11 additions & 20 deletions source/states/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -2634,17 +2634,18 @@ class PlayState extends MusicBeatState {
if (daNote.singAnimPrefix != 'sing'){
singAnim = singAnim.replace('sing', daNote.singAnimPrefix);
}


if (characterPlayingAs == 0) {
if (dad.otherCharacters == null || dad.otherCharacters.length - 1 < daNote.character)
dad.playAnim(singAnim, true);
else {
if (daNote.characters.length <= 1)
dad.otherCharacters[daNote.character].playAnim(singAnim);
dad.otherCharacters[daNote.character].playAnim(singAnim, true);
else {
for (character in daNote.characters) {
if (dad.otherCharacters.length - 1 >= character)
dad.otherCharacters[character].playAnim(singAnim);
dad.otherCharacters[character].playAnim(singAnim, true);
}
}
}
Expand Down Expand Up @@ -2685,13 +2686,11 @@ class PlayState extends MusicBeatState {
if (boyfriend.otherCharacters == null || boyfriend.otherCharacters.length - 1 < daNote.character)
boyfriend.playAnim(singAnim, true);
else if (daNote.characters.length <= 1)
boyfriend.otherCharacters[daNote.character].playAnim(NoteVariables.Character_Animation_Arrays[SONG.keyCount - 1][Std.int(Math.abs(daNote.noteData))],
true);
boyfriend.otherCharacters[daNote.character].playAnim(singAnim,true);
else {
for (character in daNote.characters) {
if (boyfriend.otherCharacters.length - 1 >= character)
boyfriend.otherCharacters[character].playAnim(NoteVariables.Character_Animation_Arrays[SONG.keyCount - 1][Std.int(Math.abs(daNote.noteData))],
true);
boyfriend.otherCharacters[character].playAnim(singAnim,true);
}
}

Expand Down Expand Up @@ -4056,20 +4055,18 @@ class PlayState extends MusicBeatState {
if (note.singAnimPrefix != 'sing'){
singAnim = singAnim.replace('sing', note.singAnimPrefix);
}

if (characterPlayingAs == 0) {
if (boyfriend.otherCharacters != null && !(boyfriend.otherCharacters.length - 1 < note.character))
if (note.characters.length <= 1)
boyfriend.otherCharacters[note.character].playAnim(singAnim);
boyfriend.otherCharacters[note.character].playAnim(singAnim, true);
else {
for (character in note.characters) {
if (boyfriend.otherCharacters.length - 1 >= character)
boyfriend.otherCharacters[character].playAnim(singAnim);
boyfriend.otherCharacters[character].playAnim(singAnim, true);
}
}
else
boyfriend.playAnim(NoteVariables.Character_Animation_Arrays[SONG.playerKeyCount - 1][Std.int(Math.abs(note.noteData % SONG.playerKeyCount))],
true);
boyfriend.playAnim(singAnim);

if (note.isSustainNote){
executeALuaState("playerOneSingHeld", lua_Data);
Expand All @@ -4082,21 +4079,15 @@ class PlayState extends MusicBeatState {
} else {
if (dad.otherCharacters != null && !(dad.otherCharacters.length - 1 < note.character))
if (note.characters.length <= 1)
dad.otherCharacters[note.character].playAnim(NoteVariables.Character_Animation_Arrays[SONG.playerKeyCount - 1][Std.int(Math.abs(note.noteData % SONG.playerKeyCount))]
+ altAnim,
true);
dad.otherCharacters[note.character].playAnim(singAnim,true);
else {
for (character in note.characters) {
if (dad.otherCharacters.length - 1 >= character)
dad.otherCharacters[character].playAnim(NoteVariables.Character_Animation_Arrays[SONG.playerKeyCount - 1][Std.int(Math.abs(note.noteData % SONG.playerKeyCount))]
+ altAnim,
true);
dad.otherCharacters[character].playAnim(singAnim,true);
}
}
else
dad.playAnim(NoteVariables.Character_Animation_Arrays[SONG.playerKeyCount - 1][Std.int(Math.abs(note.noteData % SONG.playerKeyCount))]
+ altAnim,
true);
dad.playAnim(singAnim,true);

if (note.isSustainNote){
executeALuaState("playerTwoSingHeld", lua_Data);
Expand Down

0 comments on commit 2ae00f9

Please sign in to comment.