diff --git a/BetterGiveUp/MU3.Sequence/patch_PlayMusic.cs b/BetterGiveUp/MU3.Sequence/patch_PlayMusic.cs index 0a807e1..5e2d091 100644 --- a/BetterGiveUp/MU3.Sequence/patch_PlayMusic.cs +++ b/BetterGiveUp/MU3.Sequence/patch_PlayMusic.cs @@ -15,6 +15,7 @@ namespace MU3.Sequence; public class patch_PlayMusic : PlayMusic { private static readonly TimeSpan HOLD_DURATION = TimeSpan.FromSeconds(1.0f); private static readonly TimeSpan ROLL_DURATION = TimeSpan.FromSeconds(0.5f); + public static bool QuickSkip = false; private GameEngine _gameEngine; private SessionInfo _sessionInfo; private bool _isRolling; @@ -23,9 +24,7 @@ public class patch_PlayMusic : PlayMusic { private bool _isHoldingAck; private DateTime _holdingStartTime; private float enemyPosX; - private patch_NotesManager ntMgr => (patch_NotesManager) _gameEngine?.notesManager; - private extern void orig_Execute_Play(); public static double FadeOut(double progress, double min, double max) { @@ -88,7 +87,13 @@ public class patch_PlayMusic : PlayMusic { if(Singleton.instance.getStateOn(UIInput.Key.MenuRight)) { StartRolling(); } else { - ntMgr.forceDamage(damage: 100); + QuickSkip = true; + setNextState(EState.End); + destroy(); + ntMgr.stopPlay(); + _gameEngine.destroyAllies(); + _gameEngine.finishGame(); + _gameEngine.playFinish(); } } } else { diff --git a/BetterGiveUp/MU3/patch_Scene_37_Result.cs b/BetterGiveUp/MU3/patch_Scene_37_Result.cs new file mode 100644 index 0000000..3386a94 --- /dev/null +++ b/BetterGiveUp/MU3/patch_Scene_37_Result.cs @@ -0,0 +1,35 @@ +#pragma warning disable CS0626 +#pragma warning disable CS0649 +#pragma warning disable IDE0051 +#pragma warning disable IDE1006 + +using MU3.Sequence; +using MU3.Util; + +namespace MU3; + +public class patch_Scene_37_Result : Scene_37_Result { + private Mode mode_; + private extern void orig_Init_Init(); + private enum State { + Init, + Score, + Assignment, + ReleaseMaster, + GetMusic, + UnlockScenario, + Event, + MemoryChapterEvent, + CardCharaUp, + CardCharaWaitSkip, + CardCharaEnd, + End + } + + private void Init_Init() { + orig_Init_Init(); + if(patch_PlayMusic.QuickSkip) { + mode_.set(State.End); + } + } +} \ No newline at end of file diff --git a/BetterGiveUp/MU3/patch_Scene_38_End.cs b/BetterGiveUp/MU3/patch_Scene_38_End.cs new file mode 100644 index 0000000..a240137 --- /dev/null +++ b/BetterGiveUp/MU3/patch_Scene_38_End.cs @@ -0,0 +1,36 @@ +#pragma warning disable CS0626 +#pragma warning disable CS0649 +#pragma warning disable CS0414 +#pragma warning disable IDE0051 +#pragma warning disable IDE1006 + +using MU3.Sequence; +using MU3.Util; + +namespace MU3; + +public class patch_Scene_38_End : Scene_38_End { + private Mode mode_; + private extern void orig_Init_Init(); + private int result_; + private enum State { + Init, + Continue, + SendResultContinue, + EndContinue, + ForceLogout, + ConsumeGP, + End, + WaitDestroy + } + + private void Init_Init() { + orig_Init_Init(); + + if(patch_PlayMusic.QuickSkip) { + result_ = 0; + mode_.set(State.End); + patch_PlayMusic.QuickSkip = false; + } + } +} \ No newline at end of file diff --git a/README.md b/README.md index 457c030..5166418 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,21 @@ ## µ3 mods -Miscellaneous mods for µ3/SDDT for my personal use. +Miscellaneous mods for µ3/SDDT; mainly for my personal use, though suggestions/PRs are welcome. ### BetterGiveUp -Hold down the evil red menu button for 1 second to give up, or the friendlier yellow button to restart. Based on GiveUp, but Better (impossible to misclick). +Enables these buttons in music play: + +* Red menu: instant return to song select +* Yellow menu: instant restart + +To avoid misclicks, you have to hold the button down for 1 second. Based on GiveUp, but Better. ### ExportChartData -Export some useful chart data into a dollar-separated file (charts.csv) when the game launches. +Exports some useful chart data into a dollar-separated file (charts.csv) when the game launches. ### NaiveRating -Replace the in-game rating algorithm (OldBest30+NewBest15+Recent10) with Best45. -This change is client-side and immediate, but **the server will acknowledge it**. I host my own server and don't care, but you have been warned. \ No newline at end of file +Replaces the in-game rating algorithm (OldBest30+NewBest15+Recent10) with Best45. +This change is client-side and immediate, but the server **will** acknowledge it. I host my own server and don't care, but you have been warned. \ No newline at end of file