diff --git a/.github/workflows/release_build.yml b/.github/workflows/release_build.yml index 513d04da..f90bb8ee 100644 --- a/.github/workflows/release_build.yml +++ b/.github/workflows/release_build.yml @@ -22,7 +22,7 @@ on: jobs: Build: - if: ${{ github.ref == 'refs/heads/main' || (github.event.pull_request.draft == 'false' && contains(github.event.pull_request.labels.*.name, 'update-pr')) }} + if: ${{ github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'update-pr') }} uses: ./.github/workflows/build.yaml with: build_type: Release @@ -43,7 +43,7 @@ jobs: Update_Release: name: 'Create/Update Release Asset' needs: Build - if: ${{ github.ref != 'refs/heads/main' && github.event.pull_request.draft == 'false' && contains(github.event.pull_request.labels.*.name, 'update-pr') }} + if: ${{ github.ref != 'refs/heads/main' && contains(github.event.pull_request.labels.*.name, 'update-pr') }} runs-on: ubuntu-latest steps: - name: Download Asset diff --git a/.github/workflows/update_release.yml b/.github/workflows/update_release.yml index 7428c467..1bad2aae 100644 --- a/.github/workflows/update_release.yml +++ b/.github/workflows/update_release.yml @@ -11,7 +11,7 @@ on: jobs: Update_Release: name: Create/Update Release - if: ${{ github.event.pull_request.draft == 'false' && contains(github.event.pull_request.labels.*.name, 'update-pr') }} + if: contains(github.event.pull_request.labels.*.name, 'update-pr') runs-on: ubuntu-latest steps: - name: Create/Update Release @@ -26,4 +26,4 @@ jobs: **Generated From PR: ${{ github.event.pull_request.html_url }}** draft: true - prerelease: false \ No newline at end of file + prerelease: false diff --git a/NewHorizons/Builder/Atmosphere/AirBuilder.cs b/NewHorizons/Builder/Atmosphere/AirBuilder.cs index f9c3c617..b3cda09b 100644 --- a/NewHorizons/Builder/Atmosphere/AirBuilder.cs +++ b/NewHorizons/Builder/Atmosphere/AirBuilder.cs @@ -27,12 +27,22 @@ namespace NewHorizons.Builder.Atmosphere ShockLayerRuleset shockLayerRuleset = planetGO.GetComponentInChildren().gameObject.AddComponent(); shockLayerRuleset._type = ShockLayerRuleset.ShockType.Atmospheric; shockLayerRuleset._radialCenter = airGO.transform; + shockLayerRuleset._minShockSpeed = config.Atmosphere.minShockSpeed; + shockLayerRuleset._maxShockSpeed = config.Atmosphere.maxShockSpeed; - var bottom = config.Base.surfaceSize; - var top = config.Atmosphere.size; + if (config.Atmosphere.clouds != null) + { + shockLayerRuleset._innerRadius = config.Atmosphere.clouds.innerCloudRadius; + shockLayerRuleset._outerRadius = config.Atmosphere.clouds.outerCloudRadius; + } + else + { + var bottom = config.Base.surfaceSize; + var top = config.Atmosphere.size; - shockLayerRuleset._innerRadius = (bottom + top) / 2f; - shockLayerRuleset._outerRadius = top; + shockLayerRuleset._innerRadius = (bottom + top) / 2f; + shockLayerRuleset._outerRadius = top; + } if (config.Atmosphere.hasOxygen) { diff --git a/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs b/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs index 0af643bd..dd472e73 100644 --- a/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs +++ b/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs @@ -235,6 +235,9 @@ namespace NewHorizons.Builder.Body fog._fogRadius *= scale; fog._fogDensity *= scale; + var volumesShape = volumes.FindChild("ZeroG_Fluid_Audio_Volume"); + volumesShape.GetComponent().radius *= scale; + // Change fog color if (body.Config.Bramble.dimension.fogTint != null) { diff --git a/NewHorizons/External/Modules/AtmosphereModule.cs b/NewHorizons/External/Modules/AtmosphereModule.cs index 786475f5..b0f31bc9 100644 --- a/NewHorizons/External/Modules/AtmosphereModule.cs +++ b/NewHorizons/External/Modules/AtmosphereModule.cs @@ -86,6 +86,16 @@ namespace NewHorizons.External.Modules /// public bool useAtmosphereShader; + /// + /// Minimum speed that your ship can go in the atmosphere where flames will appear. + /// + [DefaultValue(100f)] public float minShockSpeed = 100f; + + /// + /// Maximum speed that your ship can go in the atmosphere where flames will appear at their brightest. + /// + [DefaultValue(300f)] public float maxShockSpeed = 300f; + [JsonObject] public class CloudInfo { diff --git a/NewHorizons/Patches/BramblePatches.cs b/NewHorizons/Patches/BramblePatches.cs new file mode 100644 index 00000000..bbd5e33b --- /dev/null +++ b/NewHorizons/Patches/BramblePatches.cs @@ -0,0 +1,31 @@ +using HarmonyLib; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace NewHorizons.Patches +{ + [HarmonyPatch] + public class BramblePatches + { + [HarmonyPrefix] + [HarmonyPatch(typeof(SphericalFogWarpVolume), nameof(SphericalFogWarpVolume.IsProbeOnly))] + public static bool SphericalFogWarpVolume_IsProbeOnly(SphericalFogWarpVolume __instance, ref bool __result) + { + __result = false; + 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; + } + } +} diff --git a/NewHorizons/Schemas/body_schema.json b/NewHorizons/Schemas/body_schema.json index 7e079ea6..c5f9c369 100644 --- a/NewHorizons/Schemas/body_schema.json +++ b/NewHorizons/Schemas/body_schema.json @@ -286,6 +286,18 @@ "useAtmosphereShader": { "type": "boolean", "description": "Whether we use an atmospheric shader on the planet. Doesn't affect clouds, fog, rain, snow, oxygen, etc. Purely\nvisual." + }, + "minShockSpeed": { + "type": "number", + "description": "Minimum speed that your ship can go in the atmosphere where flames will appear.", + "format": "float", + "default": 100.0 + }, + "maxShockSpeed": { + "type": "number", + "description": "Maximum speed that your ship can go in the atmosphere where flames will appear at their brightest.", + "format": "float", + "default": 300.0 } } },