mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2025-01-01 01:36:47 +00:00
in-engine shit for new chart format
This commit is contained in:
parent
e49a3c9b03
commit
4b5173f9b7
|
@ -6,7 +6,6 @@ import Song.SwagSong;
|
||||||
* ...
|
* ...
|
||||||
* @author
|
* @author
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef BPMChangeEvent =
|
typedef BPMChangeEvent =
|
||||||
{
|
{
|
||||||
var stepTime:Int;
|
var stepTime:Int;
|
||||||
|
@ -28,9 +27,7 @@ class Conductor
|
||||||
|
|
||||||
public static var bpmChangeMap:Array<BPMChangeEvent> = [];
|
public static var bpmChangeMap:Array<BPMChangeEvent> = [];
|
||||||
|
|
||||||
public function new()
|
public function new() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function mapBPMChanges(song:SwagSong)
|
public static function mapBPMChanges(song:SwagSong)
|
||||||
{
|
{
|
||||||
|
@ -39,11 +36,11 @@ class Conductor
|
||||||
var curBPM:Float = song.bpm;
|
var curBPM:Float = song.bpm;
|
||||||
var totalSteps:Int = 0;
|
var totalSteps:Int = 0;
|
||||||
var totalPos:Float = 0;
|
var totalPos:Float = 0;
|
||||||
for (i in 0...song.notes.length)
|
for (i in 0...song.notes[PlayState.storyDifficulty].length)
|
||||||
{
|
{
|
||||||
if(song.notes[i].changeBPM && song.notes[i].bpm != curBPM)
|
if (song.notes[PlayState.storyDifficulty][i].changeBPM && song.notes[PlayState.storyDifficulty][i].bpm != curBPM)
|
||||||
{
|
{
|
||||||
curBPM = song.notes[i].bpm;
|
curBPM = song.notes[PlayState.storyDifficulty][i].bpm;
|
||||||
var event:BPMChangeEvent = {
|
var event:BPMChangeEvent = {
|
||||||
stepTime: totalSteps,
|
stepTime: totalSteps,
|
||||||
songTime: totalPos,
|
songTime: totalPos,
|
||||||
|
@ -52,7 +49,7 @@ class Conductor
|
||||||
bpmChangeMap.push(event);
|
bpmChangeMap.push(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
var deltaSteps:Int = song.notes[i].lengthInSteps;
|
var deltaSteps:Int = song.notes[PlayState.storyDifficulty][i].lengthInSteps;
|
||||||
totalSteps += deltaSteps;
|
totalSteps += deltaSteps;
|
||||||
totalPos += ((60 / curBPM) * 1000 / 4) * deltaSteps;
|
totalPos += ((60 / curBPM) * 1000 / 4) * deltaSteps;
|
||||||
}
|
}
|
||||||
|
|
|
@ -187,7 +187,7 @@ class Note extends FlxSprite
|
||||||
prevNote.animation.play('redhold');
|
prevNote.animation.play('redhold');
|
||||||
}
|
}
|
||||||
|
|
||||||
prevNote.scale.y *= Conductor.stepCrochet / 100 * 1.5 * PlayState.SONG.speed;
|
prevNote.scale.y *= Conductor.stepCrochet / 100 * 1.5 * PlayState.SONG.speed[PlayState.storyDifficulty];
|
||||||
prevNote.updateHitbox();
|
prevNote.updateHitbox();
|
||||||
// prevNote.setGraphicSize();
|
// prevNote.setGraphicSize();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1594,7 +1594,7 @@ class PlayState extends MusicBeatState
|
||||||
var noteData:Array<SwagSection>;
|
var noteData:Array<SwagSection>;
|
||||||
|
|
||||||
// NEW SHIT
|
// NEW SHIT
|
||||||
noteData = songData.notes;
|
noteData = songData.notes[storyDifficulty];
|
||||||
|
|
||||||
for (section in noteData)
|
for (section in noteData)
|
||||||
{
|
{
|
||||||
|
@ -2003,9 +2003,9 @@ class PlayState extends MusicBeatState
|
||||||
changeSection(-1);
|
changeSection(-1);
|
||||||
#end
|
#end
|
||||||
|
|
||||||
if (generatedMusic && SONG.notes[Std.int(curStep / 16)] != null)
|
if (generatedMusic && SONG.notes[storyDifficulty][Std.int(curStep / 16)] != null)
|
||||||
{
|
{
|
||||||
cameraRightSide = SONG.notes[Std.int(curStep / 16)].mustHitSection;
|
cameraRightSide = SONG.notes[storyDifficulty][Std.int(curStep / 16)].mustHitSection;
|
||||||
|
|
||||||
cameraMovement();
|
cameraMovement();
|
||||||
}
|
}
|
||||||
|
@ -2093,7 +2093,8 @@ class PlayState extends MusicBeatState
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
while (unspawnNotes[0] != null && unspawnNotes[0].strumTime - Conductor.songPosition < 1800 / SONG.speed)
|
while (unspawnNotes[0] != null
|
||||||
|
&& unspawnNotes[0].strumTime - Conductor.songPosition < 1800 / SONG.speed[PlayState.storyDifficulty])
|
||||||
{
|
{
|
||||||
var dunceNote:Note = unspawnNotes[0];
|
var dunceNote:Note = unspawnNotes[0];
|
||||||
notes.add(dunceNote);
|
notes.add(dunceNote);
|
||||||
|
@ -2122,7 +2123,7 @@ class PlayState extends MusicBeatState
|
||||||
|
|
||||||
if (PreferencesMenu.getPref('downscroll'))
|
if (PreferencesMenu.getPref('downscroll'))
|
||||||
{
|
{
|
||||||
daNote.y = (strumLine.y + (Conductor.songPosition - daNote.strumTime) * (0.45 * FlxMath.roundDecimal(SONG.speed, 2)));
|
daNote.y = (strumLine.y + (Conductor.songPosition - daNote.strumTime) * (0.45 * FlxMath.roundDecimal(SONG.speed[storyDifficulty], 2)));
|
||||||
|
|
||||||
if (daNote.isSustainNote)
|
if (daNote.isSustainNote)
|
||||||
{
|
{
|
||||||
|
@ -2145,7 +2146,7 @@ class PlayState extends MusicBeatState
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
daNote.y = (strumLine.y - (Conductor.songPosition - daNote.strumTime) * (0.45 * FlxMath.roundDecimal(SONG.speed, 2)));
|
daNote.y = (strumLine.y - (Conductor.songPosition - daNote.strumTime) * (0.45 * FlxMath.roundDecimal(SONG.speed[storyDifficulty], 2)));
|
||||||
|
|
||||||
if (daNote.isSustainNote
|
if (daNote.isSustainNote
|
||||||
&& (!daNote.mustPress || (daNote.wasGoodHit || (daNote.prevNote.wasGoodHit && !daNote.canBeHit)))
|
&& (!daNote.mustPress || (daNote.wasGoodHit || (daNote.prevNote.wasGoodHit && !daNote.canBeHit)))
|
||||||
|
@ -2166,9 +2167,9 @@ class PlayState extends MusicBeatState
|
||||||
|
|
||||||
var altAnim:String = "";
|
var altAnim:String = "";
|
||||||
|
|
||||||
if (SONG.notes[Math.floor(curStep / 16)] != null)
|
if (SONG.notes[storyDifficulty][Math.floor(curStep / 16)] != null)
|
||||||
{
|
{
|
||||||
if (SONG.notes[Math.floor(curStep / 16)].altAnim)
|
if (SONG.notes[storyDifficulty][Math.floor(curStep / 16)].altAnim)
|
||||||
altAnim = '-alt';
|
altAnim = '-alt';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2262,9 +2263,9 @@ class PlayState extends MusicBeatState
|
||||||
var daPos:Float = 0;
|
var daPos:Float = 0;
|
||||||
for (i in 0...(Std.int(curStep / 16 + sec)))
|
for (i in 0...(Std.int(curStep / 16 + sec)))
|
||||||
{
|
{
|
||||||
if (SONG.notes[i].changeBPM)
|
if (SONG.notes[storyDifficulty][i].changeBPM)
|
||||||
{
|
{
|
||||||
daBPM = SONG.notes[i].bpm;
|
daBPM = SONG.notes[storyDifficulty][i].bpm;
|
||||||
}
|
}
|
||||||
daPos += 4 * (1000 * 60 / daBPM);
|
daPos += 4 * (1000 * 60 / daBPM);
|
||||||
}
|
}
|
||||||
|
@ -2973,17 +2974,17 @@ class PlayState extends MusicBeatState
|
||||||
notes.sort(sortNotes, FlxSort.DESCENDING);
|
notes.sort(sortNotes, FlxSort.DESCENDING);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SONG.notes[Math.floor(curStep / 16)] != null)
|
if (SONG.notes[storyDifficulty][Math.floor(curStep / 16)] != null)
|
||||||
{
|
{
|
||||||
if (SONG.notes[Math.floor(curStep / 16)].changeBPM)
|
if (SONG.notes[storyDifficulty][Math.floor(curStep / 16)].changeBPM)
|
||||||
{
|
{
|
||||||
Conductor.changeBPM(SONG.notes[Math.floor(curStep / 16)].bpm);
|
Conductor.changeBPM(SONG.notes[storyDifficulty][Math.floor(curStep / 16)].bpm);
|
||||||
FlxG.log.add('CHANGED BPM!');
|
FlxG.log.add('CHANGED BPM!');
|
||||||
}
|
}
|
||||||
// else
|
// else
|
||||||
// Conductor.changeBPM(SONG.bpm);
|
// Conductor.changeBPM(SONG.bpm);
|
||||||
}
|
}
|
||||||
// FlxG.log.add('change bpm' + SONG.notes[Std.int(curStep / 16)].changeBPM);
|
// FlxG.log.add('change bpm' + SONG.notes[storyDifficulty][Std.int(curStep / 16)].changeBPM);
|
||||||
wiggleShit.update(Conductor.crochet);
|
wiggleShit.update(Conductor.crochet);
|
||||||
|
|
||||||
// HARDCODING FOR MILF ZOOMS!
|
// HARDCODING FOR MILF ZOOMS!
|
||||||
|
|
|
@ -10,10 +10,10 @@ using StringTools;
|
||||||
typedef SwagSong =
|
typedef SwagSong =
|
||||||
{
|
{
|
||||||
var song:String;
|
var song:String;
|
||||||
var notes:Array<SwagSection>;
|
var notes:Array<Array<SwagSection>>;
|
||||||
var bpm:Float;
|
var bpm:Float;
|
||||||
var needsVoices:Bool;
|
var needsVoices:Bool;
|
||||||
var speed:Float;
|
var speed:Array<Float>;
|
||||||
|
|
||||||
var player1:String;
|
var player1:String;
|
||||||
var player2:String;
|
var player2:String;
|
||||||
|
@ -26,7 +26,7 @@ class Song
|
||||||
public var notes:Array<SwagSection>;
|
public var notes:Array<SwagSection>;
|
||||||
public var bpm:Float;
|
public var bpm:Float;
|
||||||
public var needsVoices:Bool = true;
|
public var needsVoices:Bool = true;
|
||||||
public var speed:Float = 1;
|
public var speed:Array<Float> = [1, 1, 1];
|
||||||
|
|
||||||
public var player1:String = 'bf';
|
public var player1:String = 'bf';
|
||||||
public var player2:String = 'dad';
|
public var player2:String = 'dad';
|
||||||
|
|
Loading…
Reference in a new issue