void Start() { autoNav = new AutoStellarNavigation(GetNavConfig()); self = this; new Harmony(__GUID__).PatchAll(); }
public static void TrySpeedUp(AutoStellarNavigation __this, PlayerMove_Sail __instance) { if (__instance.player.mecha.coreEnergy >= __this.speedUpEnergylimit) { __this.sailSpeedUp = true; } }
private void Start() { __this = this; s_NavigateInstance = new AutoStellarNavigation(GetNavigationConfig()); new Harmony(__GUID__).PatchAll(); }
public static bool TryWrap(AutoStellarNavigation self, PlayerMove_Sail __instance) { if (HasWarpChance(self, __instance)) { TryEnterWarp(__instance); return(true); } return(false); }
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); } }
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); }