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); }
public static void setHinter(HintSwimToSurface hinter) { SwimToSurfacePatcher.hinter = hinter; }
public static void PostFix(HintSwimToSurface __instance) { SwimToSurfacePatcher.setHinter(__instance); }
static void Postfix(HintSwimToSurface __instance) => hintMessageHash = __instance.messageHash;