forked from akanyan/mu3-mods
55 lines
2.0 KiB
C#
55 lines
2.0 KiB
C#
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);
|
|
}
|
|
} |