Пример #1
0
 private static void Prefix()
 {
     if (Core.God.Setting.stopOnReading.Value)
     {
         GameSpeeder.ApplyTimeScale(false);
     }
 }
Пример #2
0
        private static bool GetQuquWindow_LateUpdate_Prefix(GetQuquWindow __instance, MethodBase __originalMethod)
        {
            if (GetQuquWindow_LateUpdate_stopPatching)
            {
                return(true);
            }

            // 没有激活变速时不patch避免功能未激活时对原游戏功能可能产生的影响
            if (!GameSpeeder.IsTimePatchEnable())
            {
                return(true);
            }

            float realDeltaTime = Time.unscaledDeltaTime;

            GetQuquWindow_LateUpdate_fixDeltaTime += Time.deltaTime;
            float fFramePass = GetQuquWindow_LateUpdate_fixDeltaTime / realDeltaTime;
            int   nFramePass = (int)Math.Floor(fFramePass);

            GetQuquWindow_LateUpdate_fixDeltaTime -= nFramePass * realDeltaTime;

            while (nFramePass-- > 0)
            {
                if (!__instance.getQuquWindow.activeSelf)
                {
                    return(false);
                }

                GetQuquWindow_LateUpdate_stopPatching = true;
                __originalMethod.Invoke(__instance, null);
                GetQuquWindow_LateUpdate_stopPatching = false;
            }

            return(false);
        }
Пример #3
0
            private static void Postfix()
            {
                if (God.Core.God.Setting.stopOnCatching.Value)
                {
                    GameSpeeder.ApplyTimeScale(false);
                }

                GetQuquWindow_LateUpdate_fixDeltaTime = 0;
            }
Пример #4
0
        private static void BattleSystem_GetEnemy_Postfix(BattleSystem __instance, bool newBattle)
        {
            if (newBattle)
            {
                BattleSystem_GetEnemy__thisBattleAlreadySet = false;
            }
            else if (BattleSystem_GetEnemy__thisBattleAlreadySet)
            {
                return;
            }

            int nEnemyId           = __instance.ActorId(false, false);
            int nPlayerId          = __instance.ActorId(true, false);
            int enemyJingCunPoint  = int.Parse(DateFile.instance.GetActorDate(nEnemyId, 901, false));
            int playerJingCunPoint = int.Parse(DateFile.instance.GetActorDate(nPlayerId, 901, false));

            // Main.Logger.Log("New Enemy Entered " + nEnemyId + " " + enemyJingCunPoint);
            if (God.Core.God.Setting.stopOnHiJingcunEnemy.Value &&
                enemyJingCunPoint - playerJingCunPoint >= God.Core.God.Setting.minJingcunExc.Value)
            {
                BattleSystem_GetEnemy__thisBattleAlreadySet = true;
                GameSpeeder.ApplyTimeScale(false);
            }
        }
Пример #5
0
 private void LateUpdate() => GameSpeeder.CheckPerFrame();
Пример #6
0
 private static void Postfix() => GameSpeeder.ApplyTimeScale(God.Core.God.Setting.enabled.Value);