Пример #1
0
            private static void Postfix(PlayerMove_Walk __instance, ref bool __result)
            {
                if (autoNav.enable && autoNav.target.IsVaild())
                {
                    if (autoNav.DetermineArrive())
                    {
                        ModDebug.Log("WalkModeArrive");
                        autoNav.Arrive();
                    }
                    else if (
                        __instance.mecha.thrusterLevel < 1)
                    {
                        autoNav.Arrive("驱动引擎等级过低".ModText());
                    }
                    else if (__instance.player.mecha.coreEnergy < minAutoNavEnergy.Value)
                    {
                        autoNav.Arrive("机甲能量过低".ModText());
                    }
                    else
                    {
                        AutoStellarNavigation.Walk.TrySwitchToFly(__instance);
                        __result = true;
                        return;
                    }

                    __result = false;
                }
            }
Пример #2
0
            /// <summary>
            /// Walk --> Fly or Arrive
            /// </summary>
            private static void Postfix(PlayerMove_Walk __instance, ref bool __result)
            {
                if (!s_NavigateInstance.enable)
                {
                    return;
                }

                if (!s_NavigateInstance.target.IsVaild())
                {
                    return;
                }

                if (s_NavigateInstance.DetermineArrive())
                {
                    ModDebug.Log("WalkModeArrive");
                    s_NavigateInstance.Arrive();
                }
                else if (__instance.mecha.thrusterLevel < 1)
                {
                    s_NavigateInstance.Arrive("驱动引擎等级过低".ModText());
                }
                else if (__instance.player.mecha.coreEnergy < s_NavigateMinEnergy.Value)
                {
                    s_NavigateInstance.Arrive("机甲能量过低".ModText());
                }
                else
                {
                    AutoStellarNavigation.Walk.TrySwitchToFly(__instance);
                    //切换至Fly Mode 中对 UpdateJump 方法进行拦截
                    __result = true;
                }
            }
Пример #3
0
            public static bool TrySwitchToFly(PlayerMove_Walk __instance)
            {
#if DEBUG
                ModDebug.Log("Try Switch To Fly");
#endif

                //if (__instance.mecha.thrusterLevel < 1)
                if (__instance.mecha.thrusterLevel < THRUSTER_LEVEL_FLY)
                {
                    return(false);
                }

                __instance.jumpCoolTime = 0.3f;
                __instance.jumpedTime   = 0.0f;

                __instance.flyUpChance = 0.0f;
                __instance.SwitchToFly();

                return(true);
            }
Пример #4
0
            public static bool TrySwitchToFly(PlayerMove_Walk __instance)
            {
#if DEBUG
                ModDebug.Log("TrySwitchToFly");
#endif

                if (__instance.mecha.thrusterLevel >= 1)
                {
                    __instance.jumpCoolTime = 0.3f;
                    __instance.jumpedTime   = 0.0f;

                    __instance.flyUpChance = 0.0f;
                    __instance.SwitchToFly();

                    return(true);
                }
                else
                {
                    return(false);
                }
            }