private void LongDistanceNavigate(PlayerMove_Sail __instance) { VectorLF3 dir = target.GetDirection(__instance.player); Sail.SetDir(__instance, dir); VectorLF3 advisePoint = VectorLF3.zero; if (AdvisePointIfOcclusion(__instance, ref advisePoint, longNavUncoverRange)) { #if DEBUG ModDebug.Log("LongDistanceNavigate - ToAdvisePoint:" + advisePoint); #endif dir = (advisePoint - __instance.player.uPosition).normalized; Sail.SetDir(__instance, dir); Sail.TrySpeedUp(this, __instance); } else if (Target.IsFocusingNormalized(dir, __instance.player.uVelocity.normalized) && !__instance.player.warping) { if (__instance.player.mecha.coreEnergy >= wrapEnergylimit && Warp.TryWrap(this, __instance)) { #if DEBUG ModDebug.Log("Enter Wrap"); #endif return; } else if (IsCurNavPlanet && target.IsLocalStarPlanet == true) { #if DEBUG ModDebug.Log("Local Planet Navigate No Wrap Chance SpeedUp"); #endif Sail.TrySpeedUp(this, __instance); return; } else if (LongDistanceNavigateNeedSpeedUp()) { #if DEBUG ModDebug.Log("Long Distance Navigate Need SpeedUp"); #endif Sail.TrySpeedUp(this, __instance); } else { #if DEBUG ModDebug.Log("Long Distance Navigate No SpeedUp And Warp"); #endif } } bool LongDistanceNavigateNeedSpeedUp() { if (__instance.player.mecha.coreEnergy >= speedUpEnergylimit) { if (__instance.player.mecha.thrusterLevel < THRUSTER_LEVEL_WARP) { return(true); } //else if (Warp.GetWarperCount(__instance) <= 0) else if (!Warp.HasWarper(__instance)) { return(true); } return(true); } //Prepare warp if (__instance.player.mecha.coreEnergy < wrapEnergylimit) { return(false); } return(false); } }