示例#1
0
        void Start()
        {
            autoNav = new AutoStellarNavigation(GetNavConfig());

            self = this;
            new Harmony(__GUID__).PatchAll();
        }
示例#2
0
 public static void TrySpeedUp(AutoStellarNavigation __this, PlayerMove_Sail __instance)
 {
     if (__instance.player.mecha.coreEnergy >= __this.speedUpEnergylimit)
     {
         __this.sailSpeedUp = true;
     }
 }
示例#3
0
        private void Start()
        {
            __this             = this;
            s_NavigateInstance = new AutoStellarNavigation(GetNavigationConfig());

            new Harmony(__GUID__).PatchAll();
        }
示例#4
0
 public static bool TryWrap(AutoStellarNavigation self, PlayerMove_Sail __instance)
 {
     if (HasWarpChance(self, __instance))
     {
         TryEnterWarp(__instance);
         return(true);
     }
     return(false);
 }
示例#5
0
            public static bool HasWrapChance(AutoStellarNavigation self, PlayerMove_Sail __instance)
            {
                bool LocalPlanetWarp()
                {
                    if (GameMain.localPlanet != null && self.target.TargetPlanet.id == GameMain.localPlanet.id)
                    {
                        return(false);
                    }
                    else if ((__instance.player.uPosition - self.target.TargetPlanet.uPosition).magnitude < (self.localWrapMinDistance))
                    {
                        return(false);
                    }
                    else
                    {
                        return(true);
                    }
                }

                if (self.IsCurNavStar() || LocalPlanetWarp())
                {
                    if (__instance.player.mecha.thrusterLevel >= 3)
                    {
                        if (__instance.mecha.coreEnergy > __instance.mecha.warpStartPowerPerSpeed * (double)__instance.mecha.maxWarpSpeed)
                        {
                            if (GetWraperCount(__instance) <= 0)
                            {
                                return(false);
                            }
                            else
                            {
                                return(true);
                            }
                        }
                        else
                        {
                            return(false);
                        }
                    }
                    else
                    {
                        return(false);
                    }
                }
                else
                {
                    return(false);
                }
            }
示例#6
0
            public VectorLF3 GetDir(AutoStellarNavigation __this, Player __instance)
            {
                VectorLF3 dir = VectorLF3.zero;

                if (__this.IsCurNavStar())
                {
                    dir = (TargetStar.uPosition - __instance.uPosition).normalized;
                }
                else if (__this.IsCurNavPlanet())
                {
                    dir = (TargetPlanet.uPosition - __instance.uPosition).normalized;
                }
                else
                {
                    ModDebug.Error("GetDir While No Target!!!");
                }

                return(dir);
            }