forked from akanyan/mu3-mods
feat!: rename and reorganize
This commit is contained in:
55
Extras/SkipCutscenes/MU3.Sequence/patch_PlayMusic.cs
Normal file
55
Extras/SkipCutscenes/MU3.Sequence/patch_PlayMusic.cs
Normal file
@ -0,0 +1,55 @@
|
||||
using MonoMod;
|
||||
using MU3.Battle;
|
||||
using MU3.Data;
|
||||
using MU3.Game;
|
||||
using MU3.Util;
|
||||
|
||||
namespace MU3.Sequence;
|
||||
|
||||
class patch_PlayMusic: PlayMusic {
|
||||
private GameEngine _gameEngine;
|
||||
private SessionInfo _sessionInfo;
|
||||
private bool _nuclearSkip = false;
|
||||
public static bool ForceSkipped { get; private set; }
|
||||
|
||||
[MonoModIgnore]
|
||||
private extern bool isPartyPlay();
|
||||
|
||||
private extern void orig_Execute_StartCutscene();
|
||||
private void Execute_StartCutscene() {
|
||||
orig_Execute_StartCutscene();
|
||||
ForceSkipped = false;
|
||||
if(Singleton<Sys.System>.instance.config.isQuickStart || Singleton<UIInput>.instance.getTriggerOn(UIInput.Key.MenuLeft)) {
|
||||
ForceSkipped = true;
|
||||
_gameEngine.skipStartCutscene();
|
||||
if(isPartyPlay()) {
|
||||
setNextState(EState.PartyWaitReady);
|
||||
} else {
|
||||
setNextState(EState.Countdown);
|
||||
}
|
||||
}
|
||||
}
|
||||
public extern bool orig_updateState(float deltaTime);
|
||||
public override bool updateState(float deltaTime = -1f) {
|
||||
var state = getCurrentState();
|
||||
if(state >= EState.PlayEnd && Singleton<UIInput>.instance.getTriggerOn(UIInput.Key.MenuLeft)) {
|
||||
if(!isPartyPlay() || state > EState.CalcResult) {
|
||||
_nuclearSkip = true;
|
||||
}
|
||||
}
|
||||
if(_nuclearSkip) {
|
||||
bool isTutorial = SingletonMonoBehaviour<GameEngine>.instance.sessionInfo.isTutorial;
|
||||
if(!isTutorial) {
|
||||
if(state < EState.CalcResult) {
|
||||
setNextState(EState.CalcResult);
|
||||
}
|
||||
if(state > EState.CalcResult) {
|
||||
int selectorID = SingletonStateMachine<DataManager, DataManager.EState>.instance.getMemoryChapterData(_sessionInfo.chapterSelection.memoryChapterId)?.getMemoryChapterSelectorID() ?? 4;
|
||||
Singleton<GameSound>.instance.gameBGM.playBGM(236, selectorID);
|
||||
setNextState(EState.End);
|
||||
}
|
||||
}
|
||||
}
|
||||
return orig_updateState(deltaTime);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user