diff --git a/source/GameOverSubstate.hx b/source/GameOverSubstate.hx index 16ba0d4..4526e5d 100644 --- a/source/GameOverSubstate.hx +++ b/source/GameOverSubstate.hx @@ -98,10 +98,14 @@ class GameOverSubstate extends MusicBeatSubstate { FlxG.sound.music.stop(); - if (PlayState.isStoryMode) - FlxG.switchState(new StoryMenuState()); - else - FlxG.switchState(new FreeplayState()); + var state:MusicBeatState = new FreeplayState(); + if(UnlockingItemState.unlocking.length>0){ + state = new UnlockingItemState(); + }else if(PlayState.isStoryMode){ + state = new StoryMenuState(); + } + + FlxG.switchState(state); } if (bf.animation.curAnim.name == 'firstDeath' && bf.animation.curAnim.curFrame == 12) diff --git a/source/PauseSubState.hx b/source/PauseSubState.hx index 542c1f1..95cc7c4 100644 --- a/source/PauseSubState.hx +++ b/source/PauseSubState.hx @@ -17,7 +17,7 @@ class PauseSubState extends MusicBeatSubstate { var grpMenuShit:FlxTypedGroup; - var menuItems:Array = ['Resume', 'Restart Song', 'Exit to menu']; + var menuItems:Array = ['Resume', 'Restart Song', 'Restart Song with Cutscene', 'Exit to menu']; var curSelected:Int = 0; var pauseMusic:FlxSound; @@ -107,18 +107,22 @@ class PauseSubState extends MusicBeatSubstate close(); case "Restart Song": FlxG.resetState(); + case "Restart Song with Cutscene": + PlayState.didIntro=false; + PlayState.doIntro=true; + FlxG.resetState(); case "Exit to menu": PlayState.didIntro=false; - FlxG.switchState(new MainMenuState()); + var state:MusicBeatState = new MainMenuState(); + if(UnlockingItemState.unlocking.length>0){ + state = new UnlockingItemState(); + } + + FlxG.switchState(state); } } - if (FlxG.keys.justPressed.J) - { - // for reference later! - // PlayerSettings.player1.controls.replaceBinding(Control.LEFT, Keys, FlxKey.J, null); - } } override function destroy() diff --git a/source/PlayState.hx b/source/PlayState.hx index 605f0f2..e51a1ee 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -61,6 +61,8 @@ class PlayState extends MusicBeatState public static var curStage:String = ''; public static var SONG:SwagSong; public static var didIntro:Bool = false; + public static var doIntro:Bool=false; + public static var isStoryMode:Bool = false; public static var storyWeek:Int = 0; public static var storyPlaylist:Array = []; @@ -1876,7 +1878,7 @@ class PlayState extends MusicBeatState startingSong = true; - if (isStoryMode && !didIntro) + if ((isStoryMode || doIntro) && !didIntro) { didIntro=true; switch (curSong.toLowerCase()) @@ -1937,7 +1939,7 @@ class PlayState extends MusicBeatState default: startCountdown(); } - }else if(isStoryMode && didIntro && SONG.song.toLowerCase()=='last-stand' && blueballs>0){ + }else if((isStoryMode || doIntro) && didIntro && SONG.song.toLowerCase()=='last-stand' && blueballs>0){ var shit = CoolUtil.coolTextFile(Paths.txt('last-stand/deathsdialogue')); var dialogue = []; for(idx in 0...shit.length){ diff --git a/source/StoryMenuState.hx b/source/StoryMenuState.hx index 6377260..c20eab6 100644 --- a/source/StoryMenuState.hx +++ b/source/StoryMenuState.hx @@ -118,9 +118,12 @@ class StoryMenuState extends MusicBeatState if(encounterableCameos.length==0 || FlxG.save.data.cameos.contains("Oxidation")){ encounterableCameos.push("Oxidation"); } - trace(encounterableCameos); } + if(FlxG.save.data.cameos.contains("Oxidation") && encounterableCameos.length>1){ + baseCameoChance=0; + } + if (FlxG.sound.music != null) { if (!FlxG.sound.music.playing)