mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
28 lines
1.0 KiB
C#
28 lines
1.0 KiB
C#
using HarmonyLib;
|
|
using UnityEngine;
|
|
|
|
namespace NewHorizons.Patches.VolumePatches
|
|
{
|
|
[HarmonyPatch]
|
|
public static class FogWarpVolumePatches
|
|
{
|
|
[HarmonyPrefix]
|
|
[HarmonyPatch(typeof(SphericalFogWarpVolume), nameof(SphericalFogWarpVolume.IsProbeOnly))]
|
|
public static bool SphericalFogWarpVolume_IsProbeOnly(SphericalFogWarpVolume __instance, ref bool __result)
|
|
{
|
|
__result = Mathf.Approximately(__instance._exitRadius / __instance._warpRadius, 2f); // Check the ratio between these to determine if seed, instead of just < 10
|
|
return false;
|
|
}
|
|
|
|
[HarmonyPrefix]
|
|
[HarmonyPatch(typeof(FogWarpVolume), nameof(FogWarpVolume.GetFogThickness))]
|
|
public static bool FogWarpVolume_GetFogThickness(FogWarpVolume __instance, ref float __result)
|
|
{
|
|
if (__instance is InnerFogWarpVolume sph) __result = sph._exitRadius;
|
|
else __result = 50; // 50f is hardcoded as the return value in the base game
|
|
|
|
return false;
|
|
}
|
|
}
|
|
}
|