diff --git a/assets/preload/images/freeplaydifficulties/nerfed.png b/assets/preload/images/freeplaydifficulties/nerfed.png new file mode 100644 index 0000000..8ee2428 Binary files /dev/null and b/assets/preload/images/freeplaydifficulties/nerfed.png differ diff --git a/assets/preload/images/freeplaydifficulties/normal.png b/assets/preload/images/freeplaydifficulties/normal.png new file mode 100644 index 0000000..7ff8485 Binary files /dev/null and b/assets/preload/images/freeplaydifficulties/normal.png differ diff --git a/assets/preload/sounds/cancelMenu.ogg b/assets/preload/sounds/cancelMenu.ogg index d56d11d..ca3b9f7 100644 Binary files a/assets/preload/sounds/cancelMenu.ogg and b/assets/preload/sounds/cancelMenu.ogg differ diff --git a/assets/preload/sounds/confirmMenu.ogg b/assets/preload/sounds/confirmMenu.ogg index f60010e..74c8790 100644 Binary files a/assets/preload/sounds/confirmMenu.ogg and b/assets/preload/sounds/confirmMenu.ogg differ diff --git a/assets/preload/sounds/scrollMenu.ogg b/assets/preload/sounds/scrollMenu.ogg index e5697c9..72c18a5 100644 Binary files a/assets/preload/sounds/scrollMenu.ogg and b/assets/preload/sounds/scrollMenu.ogg differ diff --git a/assets/videos/joe_mod_intro_video.mp4 b/assets/videos/joe_mod_intro_video.mp4 new file mode 100644 index 0000000..9fc4ec3 Binary files /dev/null and b/assets/videos/joe_mod_intro_video.mp4 differ diff --git a/assets/videos/joe_mod_intro_video_big.mp4 b/assets/videos/joe_mod_intro_video_big.mp4 new file mode 100644 index 0000000..834ce8b Binary files /dev/null and b/assets/videos/joe_mod_intro_video_big.mp4 differ diff --git a/example_mods/data/joeseph/script1.lua b/example_mods/data/joeseph/script1.lua deleted file mode 100644 index a5d9960..0000000 --- a/example_mods/data/joeseph/script1.lua +++ /dev/null @@ -1,6 +0,0 @@ - --- aura/fyrid - -function onUpdate(elapsed) - setHealth(1) -end \ No newline at end of file diff --git a/source/FreeplayState.hx b/source/FreeplayState.hx index 77bd7cc..8c512ad 100644 --- a/source/FreeplayState.hx +++ b/source/FreeplayState.hx @@ -43,6 +43,7 @@ class FreeplayState extends MusicBeatState var songCover:FlxSprite; var songCoverMask:FlxSprite; var songCoverFinal:FlxSprite; + var diffSprite:FlxSprite; var arrow1:FlxSprite; var arrow2:FlxSprite; var songText:FlxText; @@ -56,6 +57,15 @@ class FreeplayState extends MusicBeatState var tagline:String = ''; + public static var availableDiffs:Array = [ + 'normal', + 'nerfed' + ]; + + public static var curDiff:String = ''; + var diffSelected:Int = 0; + var songSelected:Bool = false; + private var grpSongs:FlxTypedGroup; private var curPlaying:Bool = false; @@ -166,6 +176,14 @@ class FreeplayState extends MusicBeatState FlxSpriteUtil.alphaMaskFlxSprite(songCover, songCoverMask, songCoverFinal); add(songCoverFinal); + diffSprite = new FlxSprite().loadGraphic(Paths.image('freeplaydifficulties/normal')); + diffSprite.antialiasing = ClientPrefs.globalAntialiasing; + diffSprite.setGraphicSize(Std.int(diffSprite.width * 0.5)); + diffSprite.updateHitbox(); + diffSprite.screenCenter(X); + diffSprite.y = -300; + add(diffSprite); + tagline = getFreeplayTag(); songText = new FlxText(0, songCover.y + 360, FlxG.width, "", 76); @@ -334,26 +352,34 @@ class FreeplayState extends MusicBeatState { if (leftP) { - changeSelection(-shiftMult); - updateSongCoverAndText(); - holdTime = 0; + if (!songSelected) { + changeSelection(-shiftMult); + updateSongCoverAndText(); + holdTime = 0; - FlxTween.cancelTweensOf(arrow1); - arrow1.x = 0; - FlxTween.tween(arrow1, {x: 20}, 1, {ease: FlxEase.circOut}); + FlxTween.cancelTweensOf(arrow1); + arrow1.x = 0; + FlxTween.tween(arrow1, {x: 20}, 1, {ease: FlxEase.circOut}); + } else { + changeDiff(-1); + } } if (rightP) { - changeSelection(shiftMult); - updateSongCoverAndText(); - holdTime = 0; + if (!songSelected) { + changeSelection(shiftMult); + updateSongCoverAndText(); + holdTime = 0; - FlxTween.cancelTweensOf(arrow2); - arrow2.x = FlxG.width - 150; - FlxTween.tween(arrow2, {x: FlxG.width - 170}, 1, {ease: FlxEase.circOut}); + FlxTween.cancelTweensOf(arrow2); + arrow2.x = FlxG.width - 150; + FlxTween.tween(arrow2, {x: FlxG.width - 170}, 1, {ease: FlxEase.circOut}); + } else { + changeDiff(1); + } } - if(controls.UI_LEFT || controls.UI_RIGHT) + if((controls.UI_LEFT || controls.UI_RIGHT) && !songSelected) { var checkLastHold:Int = Math.floor((holdTime - 0.5) * 10); holdTime += elapsed; @@ -379,7 +405,7 @@ class FreeplayState extends MusicBeatState } } - if(FlxG.mouse.wheel != 0 && FlxG.keys.pressed.SHIFT) + if(FlxG.mouse.wheel != 0 && FlxG.keys.pressed.SHIFT && !songSelected) { FlxG.sound.play(Paths.sound('scrollMenu'), 0.2); changeSelection(-1 * FlxG.mouse.wheel, false); @@ -389,12 +415,16 @@ class FreeplayState extends MusicBeatState if (controls.BACK) { - persistentUpdate = false; - if(colorTween != null) { - colorTween.cancel(); + if (!songSelected) { + persistentUpdate = false; + if(colorTween != null) { + colorTween.cancel(); + } + FlxG.sound.play(Paths.sound('cancelMenu')); + MusicBeatState.switchState(new MainMenuState()); + } else { + setDiffSelect(false); } - FlxG.sound.play(Paths.sound('cancelMenu')); - MusicBeatState.switchState(new MainMenuState()); } if(ctrl) @@ -445,28 +475,30 @@ class FreeplayState extends MusicBeatState trace(poop); if (sys.FileSystem.exists(Paths.modsJson(songLowercase + '/' + poop)) || sys.FileSystem.exists(Paths.json(songLowercase + '/' + poop))) { - - trace(sys.FileSystem.exists(Paths.modsJson(songLowercase + '/' + poop))); - - PlayState.SONG = Song.loadFromJson(poop, songLowercase); - PlayState.isStoryMode = false; - PlayState.storyDifficulty = curDifficulty; + if (songSelected) { + trace(sys.FileSystem.exists(Paths.modsJson(songLowercase + '/' + poop))); - trace('CURRENT WEEK: ' + WeekData.getWeekFileName()); - if(colorTween != null) { - colorTween.cancel(); - } - - if (FlxG.keys.pressed.SHIFT){ - LoadingState.loadAndSwitchState(new ChartingState()); - }else{ - LoadingState.loadAndSwitchState(new PlayState()); - } + PlayState.SONG = Song.loadFromJson(poop, songLowercase); + PlayState.isStoryMode = false; + PlayState.storyDifficulty = curDifficulty; - FlxG.sound.music.volume = 0; + trace('CURRENT WEEK: ' + WeekData.getWeekFileName()); + if(colorTween != null) { + colorTween.cancel(); + } - destroyFreeplayVocals(); + if (FlxG.keys.pressed.SHIFT){ + LoadingState.loadAndSwitchState(new ChartingState()); + }else{ + LoadingState.loadAndSwitchState(new PlayState()); + } + FlxG.sound.music.volume = 0; + + destroyFreeplayVocals(); + } + + setDiffSelect(true); } else { FlxG.sound.play(Paths.sound('cancelMenu')); FlxTween.cancelTweensOf(errorText); @@ -493,6 +525,18 @@ class FreeplayState extends MusicBeatState vocals = null; } + function setDiffSelect(selected:Bool = true) { + songSelected = selected; + + FlxTween.cancelTweensOf(diffSprite); + + if (selected == true) { + FlxTween.tween(diffSprite, {y: 35}, 0.7, {ease: FlxEase.backOut}); + } else { + FlxTween.tween(diffSprite, {y: -300}, 0.7, {ease: FlxEase.backIn}); + } + } + function getFreeplayTag():String //stolen from title text.. { var taglist:Array = CoolUtil.coolTextFile(Paths.txt('freeplayText')); @@ -522,6 +566,22 @@ class FreeplayState extends MusicBeatState FlxSpriteUtil.alphaMaskFlxSprite(songCover, songCoverMask, songCoverFinal); } + function changeDiff(change:Int = 0, playSound:Bool = true) + { + if(playSound) FlxG.sound.play(Paths.sound('scrollMenu'), 0.4); + + diffSelected += change; + + if (diffSelected < 0) + diffSelected = availableDiffs.length - 1; + if (diffSelected >= availableDiffs.length) + diffSelected = 0; + + curDiff = availableDiffs[diffSelected]; + diffSprite.loadGraphic(Paths.image('freeplaydifficulties/' + curDiff)); + trace(curDiff); + } + function changeSelection(change:Int = 0, playSound:Bool = true) { if(playSound) FlxG.sound.play(Paths.sound('scrollMenu'), 0.4); diff --git a/source/Main.hx b/source/Main.hx index 56be353..8c1684c 100644 --- a/source/Main.hx +++ b/source/Main.hx @@ -29,7 +29,7 @@ class Main extends Sprite { var gameWidth:Int = 1280; // Width of the game in pixels (might be less / more in actual pixels depending on your zoom). var gameHeight:Int = 720; // Height of the game in pixels (might be less / more in actual pixels depending on your zoom). - var initialState:Class = TitleState; // The FlxState the game starts with. + var initialState:Class = SplashState; // The FlxState the game starts with. var zoom:Float = -1; // If -1, zoom is automatically calculated to fit the window dimensions. var framerate:Int = 60; // How many frames per second the game should run at. var skipSplash:Bool = true; // Whether to skip the flixel splash screen that appears in release mode. diff --git a/source/MainMenuState.hx b/source/MainMenuState.hx index 282f266..abfd31e 100644 --- a/source/MainMenuState.hx +++ b/source/MainMenuState.hx @@ -55,6 +55,8 @@ class MainMenuState extends MusicBeatState #end WeekData.loadTheFirstEnabledMod(); + FlxG.mouse.visible = true; + #if desktop // Updating Discord Rich Presence DiscordClient.changePresence("In the Menus", null); @@ -253,6 +255,11 @@ class MainMenuState extends MusicBeatState { CoolUtil.browserLoad('https://ninja-muffin24.itch.io/funkin'); } + else if (optionShit[curSelected] == 'story_mode') + { + FlxG.camera.shake(0.01, 0.1); + FlxG.sound.play(Paths.sound('cancelMenu')); + } else { selectedSomethin = true; @@ -333,6 +340,12 @@ class MainMenuState extends MusicBeatState { //spr.screenCenter(X); //spr.x = 20; + + if (spr.ID == 0) { + spr.color = 0xBBBBBB; + } else { + spr.color = 0xFFFFFF; + } }); } diff --git a/source/PlayState.hx b/source/PlayState.hx index a27fbb2..983af2c 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -1191,7 +1191,9 @@ class PlayState extends MusicBeatState healthBarBG.visible = !ClientPrefs.hideHud; healthBarBG.xAdd = -4; healthBarBG.yAdd = -4; - add(healthBarBG); + if (FreeplayState.curDiff != 'nerfed') { + add(healthBarBG); + } if(ClientPrefs.downScroll) healthBarBG.y = 0.11 * FlxG.height; healthBar = new FlxBar(healthBarBG.x + 4, healthBarBG.y + 4, RIGHT_TO_LEFT, Std.int(healthBarBG.width - 8), Std.int(healthBarBG.height - 8), this, @@ -1200,8 +1202,10 @@ class PlayState extends MusicBeatState // healthBar healthBar.visible = !ClientPrefs.hideHud; healthBar.alpha = ClientPrefs.healthBarAlpha; - add(healthBar); - healthBarBG.sprTracker = healthBar; + if (FreeplayState.curDiff != 'nerfed') { + add(healthBar); + healthBarBG.sprTracker = healthBar; + } iconP1 = new HealthIcon(boyfriend.healthIcon, true); iconP1.y = healthBar.y - 75; @@ -3110,8 +3114,13 @@ class PlayState extends MusicBeatState var iconOffset:Int = 26; - iconP1.x = healthBar.x + (healthBar.width * (FlxMath.remapToRange(healthBar.percent, 0, 100, 100, 0) * 0.01)) + (150 * iconP1.scale.x - 150) / 2 - iconOffset; - iconP2.x = healthBar.x + (healthBar.width * (FlxMath.remapToRange(healthBar.percent, 0, 100, 100, 0) * 0.01)) - (150 * iconP2.scale.x) / 2 - iconOffset * 2; + if (FreeplayState.curDiff != 'nerfed') { + iconP1.x = healthBar.x + (healthBar.width * (FlxMath.remapToRange(healthBar.percent, 0, 100, 100, 0) * 0.01)) + (150 * iconP1.scale.x - 150) / 2 - iconOffset; + iconP2.x = healthBar.x + (healthBar.width * (FlxMath.remapToRange(healthBar.percent, 0, 100, 100, 0) * 0.01)) - (150 * iconP2.scale.x) / 2 - iconOffset * 2; + } else if (FreeplayState.curDiff == 'nerfed') { + iconP1.x = FlxG.width - 500; + iconP2.x = 350; + } if (health > 2) health = 2; @@ -3144,6 +3153,13 @@ class PlayState extends MusicBeatState iconP2.animation.curAnim.curFrame = 0; } + if (FreeplayState.curDiff == 'nerfed') { + health = 1; + + iconP1.animation.curAnim.curFrame = 0; + iconP2.animation.curAnim.curFrame = 0; + } + if (FlxG.keys.anyJustPressed(debugKeysCharacter) && !endingSong && !inCutscene) { persistentUpdate = false; paused = true; diff --git a/source/SplashState.hx b/source/SplashState.hx new file mode 100644 index 0000000..5e4097b --- /dev/null +++ b/source/SplashState.hx @@ -0,0 +1,104 @@ +package; + +import flixel.FlxCamera; +import flixel.FlxG; +import flixel.FlxGame; +import flixel.FlxObject; +import flixel.FlxSprite; +import flixel.FlxState; +import flixel.FlxSubState; +import flixel.util.FlxColor; +import flixel.text.FlxText; +#if sys +import sys.FileSystem; +#end + +#if VIDEOS_ALLOWED +#if (hxCodec >= "3.0.0") +import hxcodec.flixel.FlxVideo as MP4Handler; +#elseif (hxCodec == "2.6.1") +import hxcodec.VideoHandler as MP4Handler; +#elseif (hxCodec == "2.6.0") +import VideoHandler as MP4Handler; +#else +import vlc.MP4Handler; +#end +#end + +class SplashState extends MusicBeatState // plays joeseph splash screen then goes to menu (unless videos arent allowed) +{ + var splashVideoName:String = 'joe_mod_intro_video'; + + var skipText:FlxText; + + override function create() + { + #if VIDEOS_ALLOWED + playSplashVideo(splashVideoName); + #else + MusicBeatState.switchState(new TitleState()); // cuz no videos allowed!! + #end + + /* + skipText = new FlxText(10, FlxG.height - 42, FlxG.width, "Press ENTER to skip", 32); + skipText.setFormat(Paths.font("vcr.ttf"), 32, FlxColor.WHITE, CENTER, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK); + add(skipText); + */ + + super.create(); + } + + function playSplashVideo(videoname) { + var filepath:String = Paths.video(videoname); + #if sys + if(!FileSystem.exists(filepath)) + #else + if(!OpenFlAssets.exists(filepath)) + #end + { + FlxG.log.warn('Couldnt find video file: ' + videoname); + MusicBeatState.switchState(new TitleState()); + return; + } + + var video:MP4Handler = new MP4Handler(); + #if (hxCodec >= "3.0.0") //had to mix 0.7 with this because i have updated hxcodec teehee :3 + // Recent versions + video.play(filepath); + video.onEndReached.add(function() + { + video.dispose(); + MusicBeatState.switchState(new TitleState()); + return; + }, true); + #else + // Older versions + video.playVideo(filepath); + video.finishCallback = function() + { + MusicBeatState.switchState(new TitleState()); + return; + } + #end + } + + function skipSplashVideo(videoname) { + var filepath:String = Paths.video(videoname); + #if sys + if(!FileSystem.exists(filepath)) + #else + if(!OpenFlAssets.exists(filepath)) + #end + { + FlxG.log.warn('Couldnt find video file: ' + videoname); + MusicBeatState.switchState(new TitleState()); + return; + } + + var video:MP4Handler = new MP4Handler(); + video.dispose(); // this should do it + MusicBeatState.switchState(new TitleState()); + FlxG.sound.play(Paths.sound('cancelMenu')); + return; + } +} \ No newline at end of file diff --git a/source/TitleState.hx b/source/TitleState.hx index b952ee3..ebe7023 100644 --- a/source/TitleState.hx +++ b/source/TitleState.hx @@ -707,13 +707,13 @@ class TitleState extends MusicBeatState // credTextShit.text = "Friday"; // credTextShit.screenCenter(); case 14: - addMoreText('Friday'); + addMoreText('FNF'); // credTextShit.visible = true; case 15: - addMoreText('Night'); + addMoreText('Vs'); // credTextShit.text += '\nNight'; case 16: - addMoreText('Funkin'); // credTextShit.text += '\nFunkin'; + addMoreText('Joeseph'); // credTextShit.text += '\nFunkin'; case 17: skipIntro();