diff --git a/assets/charts/milf/bump.hx b/assets/charts/milf/bump.hx new file mode 100644 index 00000000..750d8770 --- /dev/null +++ b/assets/charts/milf/bump.hx @@ -0,0 +1,8 @@ +function beatHit(curBeat:Int) { + switch(curBeat) { + case 168: + camZoomingInterval = 1; + case 200: + camZoomingInterval = 4; + } +} \ No newline at end of file diff --git a/buildnumber.txt b/buildnumber.txt index a36df4ef..61f9147f 100644 --- a/buildnumber.txt +++ b/buildnumber.txt @@ -1 +1 @@ -269 \ No newline at end of file +275 \ No newline at end of file diff --git a/source/funkin/game/Note.hx b/source/funkin/game/Note.hx index 7d65132b..1ac87713 100644 --- a/source/funkin/game/Note.hx +++ b/source/funkin/game/Note.hx @@ -34,6 +34,12 @@ class Note extends FlxSprite public var isSustainNote:Bool = false; public var noteScore:Float = 1; + public var noteTypeID:Int = 0; + + public var noteType(get, null):String; + private function get_noteType() { + return PlayState.instance.getNoteType(noteTypeID); + } public static var swagWidth:Float = 160 * 0.7; diff --git a/source/funkin/game/PlayState.hx b/source/funkin/game/PlayState.hx index fb245381..2571c64b 100644 --- a/source/funkin/game/PlayState.hx +++ b/source/funkin/game/PlayState.hx @@ -1,5 +1,6 @@ package funkin.game; +import funkin.scripting.Script; import flixel.util.FlxDestroyUtil; #if desktop import Discord.DiscordClient; @@ -39,6 +40,7 @@ import flixel.util.FlxSort; import flixel.util.FlxStringUtil; import flixel.util.FlxTimer; import haxe.Json; +import haxe.io.Path; import lime.utils.Assets; import openfl.display.BlendMode; import openfl.display.StageQuality; @@ -47,6 +49,7 @@ import funkin.system.Conductor; import funkin.system.Song; import funkin.menus.*; +import funkin.scripting.events.*; using StringTools; @@ -201,6 +204,21 @@ class PlayState extends MusicBeatState // TODO: Custom Stage Loading add(new Stage(SONG.stage)); + + switch(SONG.song) { + // case "": + // ADD YOUR HARDCODED SCRIPTS HERE! + default: + var content = Paths.getFolderContent('charts/${SONG.song.toLowerCase()}/', false, true, !fromMods); + trace(content); + for(file in content) { + var ext = Path.extension(file).toLowerCase(); + if (Script.scriptExtensions.contains(ext)) { + scripts.add(Script.create(file)); + } + } + } + scripts.load(); scripts.call("create"); @@ -1091,7 +1109,6 @@ class PlayState extends MusicBeatState private function popUpScore(strumtime:Float):Void { var noteDiff:Float = Math.abs(strumtime - Conductor.songPosition); - // boyfriend.playAnim('hey'); vocals.volume = 1; var placement:String = Std.string(combo); @@ -1320,6 +1337,11 @@ class PlayState extends MusicBeatState } } + public function getNoteType(id:Int) { + // TODO: Note Types + return null; + } + function goodNoteHit(note:Note):Void { if (!note.wasGoodHit) @@ -1327,11 +1349,11 @@ class PlayState extends MusicBeatState camZooming = true; if (note.mustPress) { // TODO: See TODO above - scripts.call("onPlayerHit", [note]); + scripts.event("onPlayerHit", new NoteHitEvent(note, note.mustPress ? boyfriend : dad, note.mustPress, note.noteType)); if (!note.isSustainNote) { - popUpScore(note.strumTime); combo++; + popUpScore(note.strumTime); } if (note.noteData >= 0) diff --git a/source/funkin/menus/FreeplayState.hx b/source/funkin/menus/FreeplayState.hx index ba478448..6f25b673 100644 --- a/source/funkin/menus/FreeplayState.hx +++ b/source/funkin/menus/FreeplayState.hx @@ -149,7 +149,7 @@ class FreeplayState extends MusicBeatState #if PRELOAD_ALL var autoplayElapsed:Float = 0; - var songInstPlaying:Bool = false; + var songInstPlaying:Bool = true; var curPlayingInst:String = null; #end diff --git a/source/funkin/mods/ModsAssetLibrary.hx b/source/funkin/mods/ModsAssetLibrary.hx index 2b40cb18..5ef35807 100644 --- a/source/funkin/mods/ModsAssetLibrary.hx +++ b/source/funkin/mods/ModsAssetLibrary.hx @@ -121,6 +121,8 @@ class ModsAssetLibrary extends AssetLibrary { if (!FileSystem.isDirectory('$path$e')) result.push(e); return result; + } catch(e) { + // woops!! } return []; } diff --git a/source/funkin/scripting/ScriptPack.hx b/source/funkin/scripting/ScriptPack.hx index 22c4bdfe..5bfcb205 100644 --- a/source/funkin/scripting/ScriptPack.hx +++ b/source/funkin/scripting/ScriptPack.hx @@ -2,6 +2,7 @@ package funkin.scripting; import funkin.scripting.events.CancellableEvent; +@:access(CancellableEvent) class ScriptPack extends Script { public var scripts:Array