Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
mcagabe19 committed Oct 15, 2024
2 parents 1d305ff + 5124916 commit b85070a
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 89 deletions.
7 changes: 2 additions & 5 deletions source/Note.hx
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,15 @@ typedef PreloadedChartNote = {
isSustainEnd:Bool,
sustainLength:Float,
sustainScale:Float,
parent:PreloadedChartNote,
parentST:Float,
hitHealth:Float,
missHealth:Float,
hitCausesMiss:Null<Bool>,
wasHit:Bool,
multSpeed:Float,
noteDensity:Float,
wasSpawned:Bool,
ignoreNote:Bool,
lowPriority:Bool,
wasMissed:Bool
}

typedef NoteSplashData = {
Expand Down Expand Up @@ -598,10 +596,9 @@ class Note extends FlxSprite
doOppStuff = chartNoteData.oppNote;
gfNote = chartNoteData.gfNote;
isSustainNote = chartNoteData.isSustainNote;
sustainLength = chartNoteData.sustainLength;
sustainScale = chartNoteData.sustainScale;
lowPriority = chartNoteData.lowPriority;
if (isSustainNote) parentST = chartNoteData.parent.strumTime;
if (isSustainNote) parentST = chartNoteData.parentST;

hitHealth = chartNoteData.hitHealth;
missHealth = chartNoteData.missHealth;
Expand Down
113 changes: 50 additions & 63 deletions source/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -2901,6 +2901,8 @@ class PlayState extends MusicBeatState
}
var currentBPMLol:Float = Conductor.bpm;
var currentMultiplier:Float = 1;
var gottaHitNote:Bool = false;
var swagNote:PreloadedChartNote;
for (section in noteData) {
if (section.changeBPM) currentBPMLol = section.bpm;

Expand All @@ -2913,22 +2915,19 @@ class PlayState extends MusicBeatState
firstNoteData = Std.int(songNotes[1] % 4);
assignedFirstData = true;
}
if (!randomMode && !flip && !stairs && !waves) {
daNoteData = Std.int(songNotes[1] % 4);
}
if (oneK) {
daNoteData = firstNoteData;
}
if (randomMode) {
daNoteData = FlxG.random.int(0, 3);
}
if (flip) {
daNoteData = Std.int(Math.abs((songNotes[1] % 4) - 3));
}
if (!randomMode && !flip && !stairs && !waves) daNoteData = Std.int(songNotes[1] % 4);

if (oneK) daNoteData = firstNoteData;

if (randomMode) daNoteData = FlxG.random.int(0, 3);

if (flip) daNoteData = Std.int(Math.abs((songNotes[1] % 4) - 3));

if (stairs && !waves) {
daNoteData = stair % 4;
stair++;
}

if (waves) {
switch (stair % 6) {
case 0 | 1 | 2 | 3:
Expand All @@ -2940,7 +2939,8 @@ class PlayState extends MusicBeatState
}
stair++;
}
final gottaHitNote:Bool = ((songNotes[1] < 4 && !opponentChart)

gottaHitNote = ((songNotes[1] < 4 && !opponentChart)
|| (songNotes[1] > 3 && opponentChart) ? section.mustHitSection : !section.mustHitSection);

if ((bothSides || gottaHitNote) && songNotes[3] != 'Hurt Note') {
Expand Down Expand Up @@ -2973,7 +2973,7 @@ class PlayState extends MusicBeatState
multiChangeEvents[1].shift();
}

final swagNote:PreloadedChartNote = cast {
swagNote = cast {
strumTime: daStrumTime,
noteData: daNoteData,
mustPress: bothSides || gottaHitNote,
Expand All @@ -2983,19 +2983,14 @@ class PlayState extends MusicBeatState
noteskin: (gottaHitNote ? bfNoteskin : dadNoteskin),
gfNote: songNotes[3] == 'GF Sing' || (section.gfSection && songNotes[1] < 4),
noAnimation: songNotes[3] == 'No Animation',
isSustainNote: false,
isSustainEnd: false,
noMissAnimation: songNotes[3] == 'No Animation',
sustainLength: songNotes[2],
sustainScale: 0,
parent: null,
hitHealth: 0.023,
missHealth: songNotes[3] != 'Hurt Note' ? 0.0475 : 0.3,
wasHit: false,
hitCausesMiss: songNotes[3] == 'Hurt Note',
multSpeed: 1,
noteDensity: currentMultiplier,
wasSpawned: false,
wasMissed: false,
ignoreNote: songNotes[3] == 'Hurt Note' && gottaHitNote
};
if (swagNote.noteskin.length > 0 && !Paths.noteSkinFramesMap.exists(swagNote.noteskin)) inline Paths.initNote(4, swagNote.noteskin);
Expand All @@ -3009,6 +3004,35 @@ class PlayState extends MusicBeatState
}

inline unspawnNotes.push(swagNote);

if (jackingtime > 0) {
for (i in 0...Std.int(jackingtime)) {
final jackNote:PreloadedChartNote = cast {
strumTime: swagNote.strumTime + (15000 / SONG.bpm) * (i + 1),
noteData: swagNote.noteData,
mustPress: swagNote.mustPress,
oppNote: swagNote.oppNote,
noteType: swagNote.noteType,
animSuffix: (songNotes[3] == 'Alt Animation' || section.altAnim ? '-alt' : ''),
noteskin: (gottaHitNote ? bfNoteskin : dadNoteskin),
gfNote: swagNote.gfNote,
isSustainNote: false,
isSustainEnd: false,
sustainScale: 0,
parentST: 0,
hitHealth: swagNote.hitHealth,
missHealth: swagNote.missHealth,
wasHit: false,
multSpeed: 1,
noteDensity: currentMultiplier,
hitCausesMiss: swagNote.hitCausesMiss,
ignoreNote: swagNote.ignoreNote
};
inline unspawnNotes.push(jackNote);
}
}

if (swagNote.sustainLength < 1) continue;

var ratio:Float = Conductor.bpm / currentBPMLol;

Expand All @@ -3027,54 +3051,18 @@ class PlayState extends MusicBeatState
gfNote: songNotes[3] == 'GF Sing' || (section.gfSection && songNotes[1] < 4),
noAnimation: songNotes[3] == 'No Animation',
isSustainNote: true,
isSustainEnd: susNote == floorSus,
sustainLength: 0,
isSustainEnd: susNote == floorSus,
sustainScale: 1 / ratio,
parent: swagNote,
parentST: swagNote.strumTime,
hitHealth: 0.023,
missHealth: songNotes[3] != 'Hurt Note' ? 0.0475 : 0.1,
wasHit: false,
multSpeed: 1,
noteDensity: currentMultiplier,
hitCausesMiss: songNotes[3] == 'Hurt Note',
wasSpawned: false,
canBeHit:false,
wasMissed: false,
ignoreNote: songNotes[3] == 'Hurt Note' && swagNote.mustPress
};
inline unspawnNotes.push(sustainNote);
//Sys.sleep(0.0001);
}
}

if (jackingtime > 0) {
for (i in 0...Std.int(jackingtime)) {
final jackNote:PreloadedChartNote = cast {
strumTime: swagNote.strumTime + (15000 / SONG.bpm) * (i + 1),
noteData: swagNote.noteData,
mustPress: swagNote.mustPress,
oppNote: swagNote.oppNote,
noteType: swagNote.noteType,
animSuffix: (songNotes[3] == 'Alt Animation' || section.altAnim ? '-alt' : ''),
noteskin: (gottaHitNote ? bfNoteskin : dadNoteskin),
gfNote: swagNote.gfNote,
isSustainNote: false,
isSustainEnd: false,
sustainLength: swagNote.sustainLength,
sustainScale: 0,
parent: null,
hitHealth: swagNote.hitHealth,
missHealth: swagNote.missHealth,
wasHit: false,
multSpeed: 1,
noteDensity: currentMultiplier,
hitCausesMiss: swagNote.hitCausesMiss,
wasSpawned: false,
canBeHit:false,
wasMissed: false,
ignoreNote: swagNote.ignoreNote
};
inline unspawnNotes.push(jackNote);
}
}
} else {
Expand Down Expand Up @@ -4110,8 +4098,7 @@ class PlayState extends MusicBeatState
var noteIndex:Int = 0;
while (unspawnNotes.length > 0 && unspawnNotes[noteIndex] != null)
{
if (ClientPrefs.showNotes) unspawnNotes[noteIndex].wasSpawned = false;
else unspawnNotes[noteIndex].wasHit = false;
unspawnNotes[noteIndex].wasHit = false;
noteIndex++;
}
}
Expand Down Expand Up @@ -4386,10 +4373,10 @@ class PlayState extends MusicBeatState
case 'Credits Popup':
{
var string1:String = value1;
if (value1 == '') string1 = SONG.song;
if (value1.length < 1) string1 = SONG.song;
var string2:String = value2;
if (value2 == '') string2 = SONG.songCredit;
var creditsPopup:CreditsPopUp = new CreditsPopUp(FlxG.width, 200, value1, value2);
if (value2.length < 1) string2 = SONG.songCredit;
var creditsPopup:CreditsPopUp = new CreditsPopUp(FlxG.width, 200, string1, string2);
creditsPopup.camera = camHUD;
creditsPopup.scrollFactor.set();
creditsPopup.x = creditsPopup.width * -1;
Expand Down
4 changes: 4 additions & 0 deletions source/StartupState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ class StartupState extends MusicBeatState
vidSprite.playVideo(Paths.video('bambiStartup'), false, false);
vidSprite.finishCallback = function()
{
try { vidSprite.finishVideo(); }
catch (e) {}
FlxG.switchState(TitleState.new);
};
#else
Expand All @@ -92,6 +94,8 @@ class StartupState extends MusicBeatState
vidSprite.playVideo(Paths.video('broCopiedDenpa'), false, false);
vidSprite.finishCallback = function()
{
try { vidSprite.finishVideo(); }
catch (e) {}
FlxG.switchState(TitleState.new);
};
#else
Expand Down
25 changes: 14 additions & 11 deletions source/editors/ChartingState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1144,7 +1144,6 @@ class ChartingState extends MusicBeatState
{
var strum = note[0] + Conductor.stepCrochet * (getSectionBeats(daSec) * 4 * value);


var copiedNote:Array<Dynamic> = [strum, note[1], note[2], note[3]];
_song.notes[daSec].sectionNotes.push(copiedNote);
}
Expand Down Expand Up @@ -1288,6 +1287,7 @@ class ChartingState extends MusicBeatState

copyMultiSectButton = new FlxButton(CopyFutureSectionCount.x, CopyLastSectionCount.y + 40, "Copy from the last " + Std.int(CopyFutureSectionCount.value) + " to the next " + Std.int(CopyFutureSectionCount.value) + " sections, " + Std.int(CopyLoopCount.value) + " times", function()
{
var swapNotes:Bool = FlxG.keys.pressed.CONTROL;
var daSec = FlxMath.maxInt(curSec, Std.int(CopyLastSectionCount.value));
var value1:Int = Std.int(CopyLastSectionCount.value);
var value2:Int = Std.int(CopyFutureSectionCount.value) * Std.int(CopyLoopCount.value);
Expand All @@ -1307,8 +1307,9 @@ class ChartingState extends MusicBeatState
{
var strum = note[0] + Conductor.stepCrochet * (getSectionBeats(daSec - value1) * 4 * value1);


var copiedNote:Array<Dynamic> = [strum, note[1], note[2], note[3]];
var data = note[1];
if (swapNotes) data = Std.int(note[1] + 4) % 8;
var copiedNote:Array<Dynamic> = [strum, data, note[2], note[3]];
inline _song.notes[daSec].sectionNotes.push(copiedNote);
}
if (curSection - value1 < 0)
Expand All @@ -1334,6 +1335,7 @@ class ChartingState extends MusicBeatState

var copyNextButton:FlxButton = new FlxButton(CopyNextSectionCount.x, CopyNextSectionCount.y + 20, "Copy to the next..", function()
{
var swapNotes:Bool = FlxG.keys.pressed.CONTROL;
var value:Int = Std.int(CopyNextSectionCount.value);
if(value == 0) {
return;
Expand All @@ -1345,15 +1347,16 @@ class ChartingState extends MusicBeatState
saveUndo(_song); //I don't even know why.

for(i in 0...value) {
changeSection(curSec+1);
for (note in _song.notes[curSec-1].sectionNotes)
{
var strum = note[0] + Conductor.stepCrochet * (getSectionBeats(curSec-1) * 4);

changeSection(curSec+1);
for (note in _song.notes[curSec-1].sectionNotes)
{
var strum = note[0] + Conductor.stepCrochet * (getSectionBeats(curSec-1) * 4);

var copiedNote:Array<Dynamic> = [strum, note[1], note[2], note[3]];
_song.notes[curSec].sectionNotes.push(copiedNote);
}
var data = note[1];
if (swapNotes) data = Std.int(note[1] + 4) % 8;
var copiedNote:Array<Dynamic> = [strum, data, note[2], note[3]];
_song.notes[curSec].sectionNotes.push(copiedNote);
}
}
updateGrid(false);
});
Expand Down
9 changes: 1 addition & 8 deletions source/editors/EditorPlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,6 @@ class EditorPlayState extends MusicBeatState

final gottaHitNote:Bool = (songNotes[1] < 4 ? section.mustHitSection : !section.mustHitSection);

var oldNote:PreloadedChartNote = unspawnNotes[unspawnNotes.length - 1];

final swagNote:PreloadedChartNote = cast {
strumTime: daStrumTime,
noteData: daNoteData,
Expand All @@ -254,8 +252,6 @@ class EditorPlayState extends MusicBeatState
isSustainEnd: false,
sustainLength: songNotes[2],
sustainScale: 0,
parent: null,
prevNote: oldNote,
hitHealth: 0.023,
missHealth: 0.0475,
wasHit: false,
Expand All @@ -274,8 +270,6 @@ class EditorPlayState extends MusicBeatState
final floorSus:Int = Math.floor(swagNote.sustainLength / Conductor.stepCrochet);
if (floorSus > 0) {
for (susNote in 0...floorSus + 1) {
oldNote = unspawnNotes[Std.int(unspawnNotes.length - 1)];

final sustainNote:PreloadedChartNote = cast {
strumTime: daStrumTime + (Conductor.stepCrochet * susNote),
noteData: daNoteData,
Expand All @@ -289,8 +283,7 @@ class EditorPlayState extends MusicBeatState
isSustainEnd: susNote == floorSus,
sustainLength: 0,
sustainScale: 1 / ratio,
parent: swagNote,
prevNote: oldNote,
parentST: swagNote.strumTime,
hitHealth: 0.023,
missHealth: 0.0475,
wasHit: false,
Expand Down
2 changes: 1 addition & 1 deletion source/editors/WeekEditorState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ class WeekEditorFreeplayState extends MusicBeatState
FlxG.sound.volumeUpKeys = TitleState.volumeUpKeys;
if(virtualPad.buttonB.justPressed || FlxG.keys.justPressed.ESCAPE) {
FlxG.switchState(editors.MasterEditorMenu.new);
FlxG.sound.playMusic(Paths.music('freakyMenu'));
FlxG.sound.playMusic(Paths.music('freakyMenu-' + ClientPrefs.daMenuMusic));
if (music != null && music.music != null) music.destroy();
}

Expand Down
2 changes: 1 addition & 1 deletion source/options/VisualsUISubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class VisualsUISubState extends BaseOptionsMenu
"Which note splash would you like?",
'splashType',
'string',
'Psych Engine',
'Default',
noteSplashList);
addOption(option);
}
Expand Down

0 comments on commit b85070a

Please sign in to comment.