public static bool Prefix(HintSwimToSurface __instance, ref bool __result, int ___numShown)
        {
            Player main = Player.main;

            if (main == null)
            {
                __result = false;
                return(false);
            }
            if (___numShown >= __instance.maxNumToShow)
            {
                __result = false;
                return(false);
            }
            if (Ocean.main == null)
            {
                __result = false;
                return(false);
            }
            float   oxygenAvailable = main.GetOxygenAvailable();
            float   depthOf         = Ocean.GetDepthOf(main.gameObject);
            Vehicle vehicle         = main.GetVehicle();

            __result = (oxygenAvailable <__instance.oxygenThreshold && depthOf> 0f && main.IsSwimming()) || (vehicle != null && !vehicle.IsPowered());
            return(false);
        }
Exemplo n.º 2
0
 public static void setHinter(HintSwimToSurface hinter)
 {
     SwimToSurfacePatcher.hinter = hinter;
 }
Exemplo n.º 3
0
 public static void PostFix(HintSwimToSurface __instance)
 {
     SwimToSurfacePatcher.setHinter(__instance);
 }
Exemplo n.º 4
0
 static void Postfix(HintSwimToSurface __instance) => hintMessageHash = __instance.messageHash;