From df89df1c47ca35b00e0b1dccbefb0c059a9c5fcc Mon Sep 17 00:00:00 2001 From: Super Date: Wed, 18 Aug 2021 17:04:59 -0400 Subject: [PATCH] 0.4.1; - Hurt arrows from VSOmega and Tricky now make you lose 1000 points from score and will lose 30 health offline - Fixed the game crashing after playing a song - Boot to where the song was chosen from when exiting to the menu from the pause screen --- source/FinishSubState.hx | 30 ++++++++++++++++------------ source/FreeplayState.hx | 1 + source/MainMenuState.hx | 2 +- source/Note.hx | 4 ++-- source/PauseSubState.hx | 3 ++- source/PlayState.hx | 24 ++++++++++++---------- source/QuickOptionsSubState.hx | 2 +- source/Ratings.hx | 1 - source/Song.hx | 19 +++++++++++++++++- source/onlinemod/OfflinePlayState.hx | 4 ++-- source/onlinemod/OnlinePlayState.hx | 4 ++-- version.downloadMe | 13 ++++-------- 12 files changed, 64 insertions(+), 43 deletions(-) diff --git a/source/FinishSubState.hx b/source/FinishSubState.hx index 26668790..e812b034 100644 --- a/source/FinishSubState.hx +++ b/source/FinishSubState.hx @@ -47,7 +47,7 @@ class FinishSubState extends MusicBeatSubstate PlayState.gf.playAnim('sad',true); } super(); - if (win) boyfriend.animation.finishCallback = this.finishNew; else dad.animation.finishCallback = this.finishNew; + if (win) boyfriend.animation.finishCallback = this.finishNew; else finishNew(); if (FlxG.save.data.camMovement && camFollow != null){ PlayState.instance.followChar(if(win) 0 else 1); } @@ -113,6 +113,21 @@ class FinishSubState extends MusicBeatSubstate cameras = [FlxG.cameras.list[FlxG.cameras.list.length - 1]]; } + public static function retMenu(){ + if (PlayState.isStoryMode){FlxG.switchState(new StoryMenuState());return;} + PlayState.actualSongName = ""; // Reset to prevent issues + switch (PlayState.stateType) + { + case 2:FlxG.switchState(new onlinemod.OfflineMenuState()); + case 4:FlxG.switchState(new multi.MultiMenuState()); + case 5:FlxG.switchState(new osu.OsuMenuState()); + + + default:FlxG.switchState(new FreeplayState()); + } + return; + } + override function update(elapsed:Float) { super.update(elapsed); @@ -127,18 +142,7 @@ class FinishSubState extends MusicBeatSubstate if (accepted) { - if (PlayState.isStoryMode){FlxG.switchState(new StoryMenuState());return;} - PlayState.actualSongName = ""; // Reset to prevent issues - switch (PlayState.stateType) - { - case 2:FlxG.switchState(new onlinemod.OfflineMenuState()); - case 4:FlxG.switchState(new multi.MultiMenuState()); - case 5:FlxG.switchState(new osu.OsuMenuState()); - - - default:FlxG.switchState(new FreeplayState()); - } - return; + retMenu(); } if (FlxG.keys.justPressed.R) diff --git a/source/FreeplayState.hx b/source/FreeplayState.hx index a9534df2..63303576 100644 --- a/source/FreeplayState.hx +++ b/source/FreeplayState.hx @@ -206,6 +206,7 @@ class FreeplayState extends MusicBeatState PlayState.isStoryMode = false; PlayState.storyDifficulty = curDifficulty; PlayState.storyWeek = songs[curSelected].week; + PlayState.stateType = 0; trace('CUR WEEK' + PlayState.storyWeek); LoadingState.loadAndSwitchState(new PlayState()); } diff --git a/source/MainMenuState.hx b/source/MainMenuState.hx index 9a5ba2e9..32262e92 100644 --- a/source/MainMenuState.hx +++ b/source/MainMenuState.hx @@ -28,7 +28,7 @@ using StringTools; class MainMenuState extends SickMenuState { - public static var ver:String = "0.4.0"; + public static var ver:String = "0.4.1"; public static var firstStart:Bool = true; diff --git a/source/Note.hx b/source/Note.hx index c67744c7..204ee048 100644 --- a/source/Note.hx +++ b/source/Note.hx @@ -41,7 +41,7 @@ class Note extends FlxSprite public var rating:String = "shit"; - public function new(strumTime:Float, _noteData:Int, ?prevNote:Note, ?sustainNote:Bool = false, ?inCharter:Bool = false) + public function new(strumTime:Float, _noteData:Int, ?prevNote:Note, ?sustainNote:Bool = false, ?inCharter:Bool = false,?_shouldntBeHit:Bool = false) { super(); if (FlxG.save.data.downscroll) offscreenY = 50; @@ -50,7 +50,7 @@ class Note extends FlxSprite this.prevNote = prevNote; isSustainNote = sustainNote; - shouldntBeHit = (_noteData > 7 || (isSustainNote && prevNote.shouldntBeHit)) && onlinemod.OnlinePlayMenuState.socket == null; + shouldntBeHit = (isSustainNote && prevNote.shouldntBeHit || _shouldntBeHit); x += 50; // MAKE SURE ITS DEFINITELY OFF SCREEN? diff --git a/source/PauseSubState.hx b/source/PauseSubState.hx index 2c7ed1d0..c2f0e14c 100644 --- a/source/PauseSubState.hx +++ b/source/PauseSubState.hx @@ -179,7 +179,8 @@ class PauseSubState extends MusicBeatSubstate if (FlxG.save.data.fpsCap > 290) (cast (Lib.current.getChildAt(0), Main)).setFPSCap(290); - FlxG.switchState(new MainMenuState()); + FinishSubState.retMenu(); + return; } function countdown(){try{ ready = false; diff --git a/source/PlayState.hx b/source/PlayState.hx index b0b32634..98c3ae54 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -227,6 +227,7 @@ class PlayState extends MusicBeatState public static var stepAnimEvents:Map>; public static var canUseAlts:Bool = false; public static var hitSoundEff:Sound; + public static var hurtSoundEff:Sound; public var inputMode:Int = 0; var inputEngineName:String = "Unspecified"; @@ -989,6 +990,8 @@ class PlayState extends MusicBeatState // cameras = [FlxG.cameras.list[1]]; if(hitSound && hitSoundEff == null) hitSoundEff = Sound.fromFile(( if (FileSystem.exists('mods/hitSound.ogg')) 'mods/hitSound.ogg' else Paths.sound('Normal_Hit'))); + if(hurtSoundEff == null) hitSoundEff = Sound.fromFile(( if (FileSystem.exists('mods/hurtSound.ogg')) 'mods/hurtSound.ogg' else Paths.sound('ANGRY'))); + startingSong = true; if (isStoryMode) @@ -1394,7 +1397,7 @@ class PlayState extends MusicBeatState else oldNote = null; - var swagNote:Note = new Note(daStrumTime, daNoteData, oldNote); + var swagNote:Note = new Note(daStrumTime, daNoteData, oldNote,null,null,songNotes[3] == 1); swagNote.sustainLength = songNotes[2]; swagNote.scrollFactor.set(0, 0); @@ -1407,7 +1410,7 @@ class PlayState extends MusicBeatState { oldNote = unspawnNotes[Std.int(unspawnNotes.length - 1)]; - var sustainNote:Note = new Note(daStrumTime + (Conductor.stepCrochet * susNote) + Conductor.stepCrochet, daNoteData, oldNote, true); + var sustainNote:Note = new Note(daStrumTime + (Conductor.stepCrochet * susNote) + Conductor.stepCrochet, daNoteData, oldNote, true,null,songNotes[3] == 1); sustainNote.scrollFactor.set(); unspawnNotes.push(sustainNote); @@ -2566,7 +2569,7 @@ class PlayState extends MusicBeatState daNote.kill(); notes.remove(daNote, true); } - else + else if (!daNote.shouldntBeHit) { health -= 0.075; vocals.volume = 0; @@ -3012,7 +3015,7 @@ class PlayState extends MusicBeatState daNote.kill(); notes.remove(daNote, true); } - else + else if (!daNote.shouldntBeHit) { health -= 0.075; vocals.volume = 0; @@ -3266,14 +3269,16 @@ class PlayState extends MusicBeatState if(daNote != null && daNote.shouldntBeHit && !forced) return; if(daNote != null && forced && daNote.shouldntBeHit){ // Only true on hurt arrows - daNote.kill(); - notes.remove(daNote, true); - daNote.destroy(); + daNote.kill(); + notes.remove(daNote, true); + daNote.destroy(); + FlxG.sound.play(hitSoundEff, 1); + } if (!boyfriend.stunned) { + if (boyfriend.useMisses){FlxG.sound.play(boyfriend.missSounds[direction], 1);}else{FlxG.sound.play(Paths.soundRandom('missnote', 1, 3), FlxG.random.float(0.1, 0.2));} health -= 0.04; - if (boyfriend.useMisses){FlxG.sound.play(boyfriend.missSounds[direction], 0.7);}else{FlxG.sound.play(Paths.soundRandom('missnote', 1, 3), FlxG.random.float(0.1, 0.2));} switch (direction) { case 0: @@ -3297,8 +3302,7 @@ class PlayState extends MusicBeatState totalNotesHit -= 1; songScore -= 10; - if (daNote != null && daNote.shouldntBeHit) {songScore -= 290; health -= 0.16;} // Having it insta kill, not a good idea - + if (daNote != null && daNote.shouldntBeHit) {songScore -= 990; health -= 0.26;} // Having it insta kill, not a good idea diff --git a/source/QuickOptionsSubState.hx b/source/QuickOptionsSubState.hx index 59e6beff..7f21b558 100644 --- a/source/QuickOptionsSubState.hx +++ b/source/QuickOptionsSubState.hx @@ -21,7 +21,7 @@ class QuickOptionsSubState extends MusicBeatSubstate { var grpMenuShit:FlxTypedGroup; - public static var settings:Map = ["Inverted chart" => false,"Opponent Arrows" => true]; + public static var settings:Map = ["Inverted chart" => false,"Opponent Arrows" => true,"Hurt notes" => true]; var menuItems:Array = []; var curSelected:Int = 0; public static function getSetting(str:String){ diff --git a/source/Ratings.hx b/source/Ratings.hx index fbd9e03a..23f6f3c4 100644 --- a/source/Ratings.hx +++ b/source/Ratings.hx @@ -99,7 +99,6 @@ class Ratings if (customSafeZone != null) customTimeScale = customSafeZone / 166; - if (noteDiff > 166 * customTimeScale) // so god damn early its a miss return "miss"; diff --git a/source/Song.hx b/source/Song.hx index 6df3b89f..33df4958 100644 --- a/source/Song.hx +++ b/source/Song.hx @@ -80,6 +80,22 @@ class Song } return swagShit; } + static function removeHurtArrows(swagShit:SwagSong):SwagSong{ + for (sid => section in swagShit.notes) { + for (nid => note in section.sectionNotes){ + swagShit.notes[sid].sectionNotes[nid][3] = 0; + } + } + return swagShit; + } + static function convHurtArrows(swagShit:SwagSong):SwagSong{ // Support for Andromeda and tricky notes + for (sid => section in swagShit.notes) { + for (nid => note in section.sectionNotes){ + if(note[4] == 1 || note[1] > 7) {swagShit.notes[sid].sectionNotes[nid][3] = 1;} + } + } + return swagShit; + } public static function parseJSONshit(rawJson:String):SwagSong { @@ -88,10 +104,11 @@ class Song swagShit.defplayer1 = swagShit.player1; swagShit.defplayer2 = swagShit.player2; if (PlayState.invertedChart || QuickOptionsSubState.getSetting("Inverted chart")) swagShit = invertChart(swagShit); + if (QuickOptionsSubState.getSetting("Hurt notes") || onlinemod.OnlinePlayMenuState.socket != null)swagShit = convHurtArrows(swagShit); if (onlinemod.OnlinePlayMenuState.socket == null){ if (!QuickOptionsSubState.getSetting("Opponent Arrows")) swagShit = removeOpponentArrows(swagShit); + if (!QuickOptionsSubState.getSetting("Hurt notes")) swagShit = removeHurtArrows(swagShit); } - swagShit.defgf = swagShit.gfVersion; return swagShit; } diff --git a/source/onlinemod/OfflinePlayState.hx b/source/onlinemod/OfflinePlayState.hx index a214221b..9cae2cde 100644 --- a/source/onlinemod/OfflinePlayState.hx +++ b/source/onlinemod/OfflinePlayState.hx @@ -139,7 +139,7 @@ class OfflinePlayState extends PlayState else oldNote = null; - var swagNote:Note = new Note(daStrumTime, daNoteData, oldNote); + var swagNote:Note = new Note(daStrumTime, daNoteData, oldNote,null,null,songNotes[3] == 1); swagNote.sustainLength = songNotes[2]; swagNote.scrollFactor.set(0, 0); @@ -152,7 +152,7 @@ class OfflinePlayState extends PlayState { oldNote = unspawnNotes[Std.int(unspawnNotes.length - 1)]; - var sustainNote:Note = new Note(daStrumTime + (Conductor.stepCrochet * susNote) + Conductor.stepCrochet, daNoteData, oldNote, true); + var sustainNote:Note = new Note(daStrumTime + (Conductor.stepCrochet * susNote) + Conductor.stepCrochet, daNoteData, oldNote, true,null,songNotes[3] == 1); sustainNote.scrollFactor.set(); unspawnNotes.push(sustainNote); diff --git a/source/onlinemod/OnlinePlayState.hx b/source/onlinemod/OnlinePlayState.hx index 774ee270..e3f9e26c 100644 --- a/source/onlinemod/OnlinePlayState.hx +++ b/source/onlinemod/OnlinePlayState.hx @@ -224,7 +224,7 @@ class OnlinePlayState extends PlayState oldNote = null; - var swagNote:Note = new Note(daStrumTime, daNoteData, oldNote); + var swagNote:Note = new Note(daStrumTime, daNoteData, oldNote,null,null,songNotes[3] == 1); swagNote.sustainLength = songNotes[2]; swagNote.scrollFactor.set(0, 0); @@ -237,7 +237,7 @@ class OnlinePlayState extends PlayState { oldNote = unspawnNotes[Std.int(unspawnNotes.length - 1)]; - var sustainNote:Note = new Note(daStrumTime + (Conductor.stepCrochet * susNote) + Conductor.stepCrochet, daNoteData, oldNote, true); + var sustainNote:Note = new Note(daStrumTime + (Conductor.stepCrochet * susNote) + Conductor.stepCrochet, daNoteData, oldNote, true,null,songNotes[3] == 1); sustainNote.scrollFactor.set(); unspawnNotes.push(sustainNote); diff --git a/version.downloadMe b/version.downloadMe index 0a190353..1d81bd9c 100644 --- a/version.downloadMe +++ b/version.downloadMe @@ -1,9 +1,4 @@ -0.4.0; -- An overhaul to how characters are loaded -- Characters can now use custom voices -- Hitsounds were optimised and use Osu!Mania sounds(A custom hitsound.ogg can be placed in your mods folder) -- Hurt arrows(Only works with Tricky arrows at the moment) -- Player 3 can be used on animation offsets for GF -- Improvements to the animation debug -- Voices nolonger play during finished state -- Some quality of life improvements +0.4.1; +- Hurt arrows from VSOmega and Tricky now make you lose 1000 points from score and will lose 30 health offline +- Fixed the game crashing after playing a song +- Boot to where the song was chosen from when exiting to the menu from the pause screen