diff --git a/appveyor-linux.yml b/appveyor-linux.yml index dc06bb0..6dfee0f 100644 --- a/appveyor-linux.yml +++ b/appveyor-linux.yml @@ -9,7 +9,7 @@ install: - cd /home/appveyor - sudo add-apt-repository ppa:haxe/releases -y - sudo apt update - - sudo apt install neko tar gcc-multilib g++-multilib -y + - sudo apt install neko tar gcc-7 g++-7 gcc-7-multilib g++-7-multilib -y - wget https://github.com/HaxeFoundation/haxe/releases/download/4.1.5/haxe-4.1.5-linux64.tar.gz - mkdir $HAXE_INSTALLDIR - tar -xf haxe-4.1.5-linux64.tar.gz -C $HAXE_INSTALLDIR diff --git a/appveyor-windows.yml b/appveyor-windows.yml index eaf9b74..ae69bca 100644 --- a/appveyor-windows.yml +++ b/appveyor-windows.yml @@ -37,8 +37,9 @@ install: - haxelib run lime rebuild extension-webm windows - haxelib install linc_luajit - haxelib install actuate - - haxelib git extension-webm https://github.com/KadeDev/extension-webm - - lime rebuild extension-webm windows + #- haxelib git extension-webm https://github.com/KadeDev/extension-webm + #- haxelib run lime rebuild extension-webm windows + #why here's dublicate lmao - haxelib list # No tests idk lol diff --git a/assets/preload/data/freeplaySonglist.txt b/assets/preload/data/freeplaySonglist.txt index a5939ad..7af8115 100644 --- a/assets/preload/data/freeplaySonglist.txt +++ b/assets/preload/data/freeplaySonglist.txt @@ -1,4 +1,4 @@ -Tutorial:gf:1 +Tutorial:gf:0 Bopeebo:dad:1 Fresh:dad:1 Dad Battle:dad:1 diff --git a/docs/guides/weeks.md b/docs/guides/weeks.md index 90b89ca..f2097cb 100644 --- a/docs/guides/weeks.md +++ b/docs/guides/weeks.md @@ -15,8 +15,10 @@ Scroll down to Line 26, or Search (Windows/Linux: `Ctrl+F`, Mac: `Cmd+F`) for "w --- ```haxe -var weekData:Array = [ - +static function weekData():Array +{ + return [ + ['Tutorial'], ['Bopeebo', 'Fresh', 'Dadbattle'], @@ -30,8 +32,9 @@ var weekData:Array = [ ['Cocoa', 'Eggnog', 'Winter-Horrorland'], ['Senpai', 'Roses', 'Thorns'] - -]; + + ]; +} ``` --- @@ -45,8 +48,10 @@ Example --- ```haxe -var weekData:Array = [ - +static function weekData():Array +{ + return [ + ['Tutorial'], ['Bopeebo', 'Fresh', 'Dadbattle'], @@ -58,12 +63,13 @@ var weekData:Array = [ ['Satin-Panties', "High", "Milf"], ['Cocoa', 'Eggnog', 'Winter-Horrorland'], - + ['Senpai', 'Roses', 'Thorns'], ['Ugh', 'Guns', 'Stress'] - -]; + + ]; +} ``` --- diff --git a/source/DialogueBox.hx b/source/DialogueBox.hx index d52358c..07363c6 100644 --- a/source/DialogueBox.hx +++ b/source/DialogueBox.hx @@ -155,7 +155,7 @@ class DialogueBox extends FlxSpriteGroup portraitLeft.visible = false; if (PlayState.SONG.song.toLowerCase() == 'thorns') { - portraitLeft.color = FlxColor.BLACK; + portraitLeft.visible = false; swagDialogue.color = FlxColor.WHITE; dropText.color = FlxColor.BLACK; } diff --git a/source/FreeplayState.hx b/source/FreeplayState.hx index b939a1f..15813fb 100644 --- a/source/FreeplayState.hx +++ b/source/FreeplayState.hx @@ -64,20 +64,22 @@ class FreeplayState extends MusicBeatState { var data:Array = initSonglist[i].split(':'); var meta = new SongMetadata(data[0], Std.parseInt(data[2]), data[1]); - songs.push(meta); - var format = StringTools.replace(meta.songName, " ", "-"); - switch (format) { - case 'Dad-Battle': format = 'Dadbattle'; - case 'Philly-Nice': format = 'Philly'; - } + if(Std.parseInt(data[2]) <= FlxG.save.data.weekUnlocked - 1) + { + songs.push(meta); + var format = StringTools.replace(meta.songName, " ", "-"); + switch (format) { + case 'Dad-Battle': format = 'Dadbattle'; + case 'Philly-Nice': format = 'Philly'; + } - var diffs = []; - FreeplayState.loadDiff(0,format,meta.songName,diffs); - FreeplayState.loadDiff(1,format,meta.songName,diffs); - FreeplayState.loadDiff(2,format,meta.songName,diffs); - FreeplayState.songData.set(meta.songName,diffs); - trace('loaded diffs for ' + meta.songName); - //diffList += meta.songName + "\nEasy: " + DiffCalc.CalculateDiff(songData.get(meta.songName)[0]) + "\nNormal: " + DiffCalc.CalculateDiff(songData.get(meta.songName)[1]) + "\nHard: " + DiffCalc.CalculateDiff(songData.get(meta.songName)[2]) + "\n\n"; + var diffs = []; + FreeplayState.loadDiff(0,format,meta.songName,diffs); + FreeplayState.loadDiff(1,format,meta.songName,diffs); + FreeplayState.loadDiff(2,format,meta.songName,diffs); + FreeplayState.songData.set(meta.songName,diffs); + trace('loaded diffs for ' + meta.songName); + } } //trace("\n" + diffList); diff --git a/source/KadeEngineData.hx b/source/KadeEngineData.hx index 0a26829..2e5b424 100644 --- a/source/KadeEngineData.hx +++ b/source/KadeEngineData.hx @@ -6,7 +6,10 @@ class KadeEngineData { public static function initSave() { - if (FlxG.save.data.newInput == null) + if (FlxG.save.data.weekUnlocked == null) + FlxG.save.data.weekUnlocked = 7; + + if (FlxG.save.data.newInput == null) FlxG.save.data.newInput = true; if (FlxG.save.data.downscroll == null) diff --git a/source/Main.hx b/source/Main.hx index a065da2..6c06d39 100644 --- a/source/Main.hx +++ b/source/Main.hx @@ -23,7 +23,7 @@ class Main extends Sprite var skipSplash:Bool = true; // Whether to skip the flixel splash screen that appears in release mode. var startFullscreen:Bool = false; // Whether to start the game in fullscreen on desktop targets - public static var watermarks = true; // Whether to put Kade Engine liteartly anywhere + public static var watermarks = true; // Whether to put Kade Engine literally anywhere // You can pretty much ignore everything from here on - your code should go in your states. diff --git a/source/ModchartState.hx b/source/ModchartState.hx index 6e194d1..571edbf 100644 --- a/source/ModchartState.hx +++ b/source/ModchartState.hx @@ -250,7 +250,7 @@ class ModchartState PlayState.instance.removeObject(PlayState.boyfriend); PlayState.boyfriend = new Boyfriend(oldboyfriendx, oldboyfriendy, id); PlayState.instance.addObject(PlayState.boyfriend); - PlayState.instance.iconP2.animation.play(id); + PlayState.instance.iconP1.animation.play(id); } function makeAnimatedLuaSprite(spritePath:String,names:Array,prefixes:Array,startAnim:String, id:String) diff --git a/source/Note.hx b/source/Note.hx index ec67490..72264a4 100644 --- a/source/Note.hx +++ b/source/Note.hx @@ -166,7 +166,7 @@ class Note extends FlxSprite x -= width / 2; - if (PlayState.curStage.startsWith('school')) + if (noteTypeCheck == 'pixel') x += 30; if (prevNote.isSustainNote) diff --git a/source/Options.hx b/source/Options.hx index 7c8f411..8be193e 100644 --- a/source/Options.hx +++ b/source/Options.hx @@ -698,3 +698,127 @@ class CamZoomOption extends Option return "Camera Zoom " + (!FlxG.save.data.camzoom ? "off" : "on"); } } + +class LockWeeksOption extends Option +{ + var confirm:Bool = false; + + public function new(desc:String) + { + super(); + description = desc; + } + public override function press():Bool + { + if(!confirm) + { + confirm = true; + display = updateDisplay(); + return true; + } + FlxG.save.data.weekUnlocked = 1; + StoryMenuState.weekUnlocked = [true, true]; + trace('Weeks Locked'); + display = updateDisplay(); + return true; + } + + private override function updateDisplay():String + { + return confirm ? "Confirm Story Reset" : "Reset Story Progress"; + } +} + +class ResetScoreOption extends Option +{ + var confirm:Bool = false; + + public function new(desc:String) + { + super(); + description = desc; + } + public override function press():Bool + { + if(!confirm) + { + confirm = true; + display = updateDisplay(); + return true; + } + FlxG.save.data.songScores = null; + for(key in Highscore.songScores.keys()) + { + Highscore.songScores[key] = 0; + } + FlxG.save.data.songCombos = null; + for(key in Highscore.songCombos.keys()) + { + Highscore.songCombos[key] = ''; + } + confirm = false; + trace('Highscores Wiped'); + display = updateDisplay(); + return true; + } + + private override function updateDisplay():String + { + return confirm ? "Confirm Score Reset" : "Reset Score"; + } +} + +class ResetSettings extends Option +{ + var confirm:Bool = false; + + public function new(desc:String) + { + super(); + description = desc; + } + public override function press():Bool + { + if(!confirm) + { + confirm = true; + display = updateDisplay(); + return true; + } + FlxG.save.data.weekUnlocked = null; + FlxG.save.data.newInput = null; + FlxG.save.data.downscroll = null; + FlxG.save.data.dfjk = null; + FlxG.save.data.accuracyDisplay = null; + FlxG.save.data.offset = null; + FlxG.save.data.songPosition = null; + FlxG.save.data.fps = null; + FlxG.save.data.changedHit = null; + FlxG.save.data.fpsRain = null; + FlxG.save.data.fpsCap = null; + FlxG.save.data.scrollSpeed = null; + FlxG.save.data.npsDisplay = null; + FlxG.save.data.frames = null; + FlxG.save.data.accuracyMod = null; + FlxG.save.data.watermark = null; + FlxG.save.data.ghost = null; + FlxG.save.data.distractions = null; + FlxG.save.data.flashing = null; + FlxG.save.data.resetButton = null; + FlxG.save.data.botplay = null; + FlxG.save.data.cpuStrums = null; + FlxG.save.data.strumline = null; + FlxG.save.data.customStrumLine = null; + FlxG.save.data.camzoom = null; + KadeEngineData.initSave(); + confirm = false; + trace('All settings have been reset'); + display = updateDisplay(); + return true; + } + + private override function updateDisplay():String + { + return confirm ? "Confirm Settings Reset" : "Reset Settings"; + } +} diff --git a/source/OptionsMenu.hx b/source/OptionsMenu.hx index 6581771..e67cd0f 100644 --- a/source/OptionsMenu.hx +++ b/source/OptionsMenu.hx @@ -61,7 +61,13 @@ class OptionsMenu extends MusicBeatState new ScoreScreen("Show the score screen after the end of a song"), new ShowInput("Display every single input in the score screen."), new Optimization("No backgrounds, no characters, centered notes, no player 2."), - new BotPlay("Showcase your charts and mods with autoplay."), + new BotPlay("Showcase your charts and mods with autoplay.") + ]), + + new OptionCategory("Manage Save Data", [ + new ResetScoreOption("Reset your score on all songs and weeks."), + new LockWeeksOption("Reset your storymode progress. (only Tutorial + Week 1 will be unlocked)"), + new ResetSettings("Reset ALL your settings.") ]) ]; diff --git a/source/PlayState.hx b/source/PlayState.hx index daca7ed..c95cae2 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -2318,18 +2318,12 @@ class PlayState extends MusicBeatState switch (dad.curCharacter) { - case 'mom': + case 'mom' | 'mom-car': camFollow.y = dad.getMidpoint().y; - case 'senpai': - camFollow.y = dad.getMidpoint().y - 430; - camFollow.x = dad.getMidpoint().x - 100; - case 'senpai-angry': + case 'senpai' | 'senpai-angry': camFollow.y = dad.getMidpoint().y - 430; camFollow.x = dad.getMidpoint().x - 100; } - - if (dad.curCharacter == 'mom') - vocals.volume = 1; } if (PlayState.SONG.notes[Std.int(curStep / 16)].mustHitSection && camFollow.x != boyfriend.getMidpoint().x - 100) @@ -2794,17 +2788,13 @@ class PlayState extends MusicBeatState } #end - // if () - StoryMenuState.weekUnlocked[Std.int(Math.min(storyWeek + 1, StoryMenuState.weekUnlocked.length - 1))] = true; - if (SONG.validScore) { NGio.unlockMedal(60961); Highscore.saveWeekScore(storyWeek, campaignScore, storyDifficulty); } - FlxG.save.data.weekUnlocked = StoryMenuState.weekUnlocked; - FlxG.save.flush(); + StoryMenuState.unlockNextWeek(storyWeek); } else { diff --git a/source/StoryMenuState.hx b/source/StoryMenuState.hx index 5957720..120d4fa 100644 --- a/source/StoryMenuState.hx +++ b/source/StoryMenuState.hx @@ -24,18 +24,21 @@ class StoryMenuState extends MusicBeatState { var scoreText:FlxText; - var weekData:Array = [ - ['Tutorial'], - ['Bopeebo', 'Fresh', 'Dad Battle'], - ['Spookeez', 'South', "Monster"], - ['Pico', 'Philly Nice', "Blammed"], - ['Satin Panties', "High", "Milf"], - ['Cocoa', 'Eggnog', 'Winter Horrorland'], - ['Senpai', 'Roses', 'Thorns'] - ]; + static function weekData():Array + { + return [ + ['Tutorial'], + ['Bopeebo', 'Fresh', 'Dad Battle'], + ['Spookeez', 'South', "Monster"], + ['Pico', 'Philly Nice', "Blammed"], + ['Satin Panties', "High", "Milf"], + ['Cocoa', 'Eggnog', 'Winter Horrorland'], + ['Senpai', 'Roses', 'Thorns'] + ]; + } var curDifficulty:Int = 1; - public static var weekUnlocked:Array = [true, true, true, true, true, true, true]; + public static var weekUnlocked:Array = []; var weekCharacters:Array = [ ['', 'bf', 'gf'], @@ -73,8 +76,21 @@ class StoryMenuState extends MusicBeatState var leftArrow:FlxSprite; var rightArrow:FlxSprite; + function unlockWeeks():Array + { + var weeks:Array = [true]; + + for(i in 0...FlxG.save.data.weekUnlocked) + { + weeks.push(true); + } + return weeks; + } + override function create() { + weekUnlocked = unlockWeeks(); + #if windows // Updating Discord Rich Presence DiscordClient.changePresence("In the Story Mode Menu", null); @@ -120,7 +136,7 @@ class StoryMenuState extends MusicBeatState trace("Line 70"); - for (i in 0...weekData.length) + for (i in 0...weekData().length) { var weekThing:MenuItem = new MenuItem(0, yellowBG.y + yellowBG.height + 10, i); weekThing.y += ((weekThing.height + 20) * i); @@ -134,6 +150,7 @@ class StoryMenuState extends MusicBeatState // Needs an offset thingie if (!weekUnlocked[i]) { + trace('locking week ' + i); var lock:FlxSprite = new FlxSprite(weekThing.width + 10 + weekThing.x); lock.frames = ui_tex; lock.animation.addByPrefix('lock', 'lock'); @@ -314,7 +331,7 @@ class StoryMenuState extends MusicBeatState stopspamming = true; } - PlayState.storyPlaylist = weekData[curWeek]; + PlayState.storyPlaylist = weekData()[curWeek]; PlayState.isStoryMode = true; selectedWeek = true; @@ -388,10 +405,10 @@ class StoryMenuState extends MusicBeatState { curWeek += change; - if (curWeek >= weekData.length) + if (curWeek >= weekData().length) curWeek = 0; if (curWeek < 0) - curWeek = weekData.length - 1; + curWeek = weekData().length - 1; var bullShit:Int = 0; @@ -417,7 +434,7 @@ class StoryMenuState extends MusicBeatState grpWeekCharacters.members[2].setCharacter(weekCharacters[curWeek][2]); txtTracklist.text = "Tracks\n"; - var stringThing:Array = weekData[curWeek]; + var stringThing:Array = weekData()[curWeek]; for (i in stringThing) txtTracklist.text += "\n" + i; @@ -433,4 +450,16 @@ class StoryMenuState extends MusicBeatState intendedScore = Highscore.getWeekScore(curWeek, curDifficulty); #end } + + public static function unlockNextWeek(week:Int):Void + { + if(week <= weekData().length - 1 && FlxG.save.data.weekUnlocked == week) + { + weekUnlocked.push(true); + trace('Week ' + week + ' beat (Week ' + (week + 1) + ' unlocked)'); + } + + FlxG.save.data.weekUnlocked = weekUnlocked.length - 1; + FlxG.save.flush(); + } } diff --git a/source/TitleState.hx b/source/TitleState.hx index 4a30c1a..cbf4da5 100644 --- a/source/TitleState.hx +++ b/source/TitleState.hx @@ -102,20 +102,6 @@ class TitleState extends MusicBeatState Highscore.load(); - if (FlxG.save.data.weekUnlocked != null) - { - // FIX LATER!!! - // WEEK UNLOCK PROGRESSION!! - // StoryMenuState.weekUnlocked = FlxG.save.data.weekUnlocked; - - if (StoryMenuState.weekUnlocked.length < 4) - StoryMenuState.weekUnlocked.insert(0, true); - - // QUICK PATCH OOPS! - if (!StoryMenuState.weekUnlocked[0]) - StoryMenuState.weekUnlocked[0] = true; - } - #if FREEPLAY FlxG.switchState(new FreeplayState()); #elseif CHARTING