From 342599cb968df51e86aa31de398eb065a9db27f6 Mon Sep 17 00:00:00 2001 From: TerrificTrifid <99054745+TerrificTrifid@users.noreply.github.com> Date: Mon, 1 Aug 2022 16:19:28 -0500 Subject: [PATCH] Dimension scale fixes --- .../Builder/Body/BrambleDimensionBuilder.cs | 20 +++++++++++-------- NewHorizons/External/Modules/BrambleModule.cs | 9 +++++++-- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs b/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs index b3a15493..26bd70fa 100644 --- a/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs +++ b/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs @@ -22,7 +22,7 @@ namespace NewHorizons.Builder.Body public static class BrambleDimensionBuilder { - public static readonly float BASE_DIMENSION_RADIUS = 1705f; + public static readonly float BASE_DIMENSION_RADIUS = 750f; // location of all vanilla bramble dimensions //-9116.795 -19873.44 2480.327 @@ -57,7 +57,7 @@ namespace NewHorizons.Builder.Body var volumes = SearchUtilities.Find("DB_HubDimension_Body/Sector_HubDimension/Volumes_HubDimension").InstantiateInactive(); var effects = SearchUtilities.Find("DB_HubDimension_Body/Sector_HubDimension/Effects_HubDimension").InstantiateInactive(); var geometry = DetailBuilder.MakeDetail(go, sector, "DB_HubDimension_Body/Sector_HubDimension/Geometry_HubDimension", Vector3.zero, Vector3.zero, 1, false); - var exitWarps = SearchUtilities.Find("DB_HubDimension_Body/Sector_HubDimension/OuterWarp_Hub").InstantiateInactive(); + var exitWarps = SearchUtilities.Find("DB_HubDimension_Body/Sector_HubDimension/Interactables_HubDimension/OuterWarp_Hub").InstantiateInactive(); var repelVolume = SearchUtilities.Find("DB_HubDimension_Body/BrambleRepelVolume").InstantiateInactive(); atmo.name = "Atmosphere"; @@ -150,13 +150,15 @@ namespace NewHorizons.Builder.Body // Set the scale var scale = config.radius / BASE_DIMENSION_RADIUS; geometry.transform.localScale = Vector3.one * scale; + sector.gameObject.GetComponent().radius *= scale; outerFogWarpVolume._warpRadius *= scale; outerFogWarpVolume._exitRadius *= scale; var fogGO = atmo.FindChild("FogSphere_Hub"); var fog = fogGO.GetComponent(); fog._fogRadius *= scale; - fog._fogDensity *= scale; + fog._fogDensity = config.fogDensity * scale; + atmo.FindChild("FogBackdrop_Hub").transform.localScale *= scale; var volumesShape = volumes.FindChild("ZeroG_Fluid_Audio_Volume"); var sphereShape = volumesShape.GetComponent(); @@ -164,17 +166,19 @@ namespace NewHorizons.Builder.Body sphereShape.radius *= scale; // Change fog color - if (body.Config.Bramble.dimension.fogTint != null) + if (config.fogTint != null) { - var color = body.Config.Bramble.dimension.fogTint.ToColor(); + var color = config.fogTint.ToColor(); fog.fogTint = color; outerFogWarpVolume._fogColor = color; } - // Set up repel volume to only contain this dimension + // Set up repel volume and cloak to scale and only contain this dimension // The base game one is on the HUB dimension and encompasses all bramble dimensions and their sectors - var cloak = repelVolume.gameObject.GetComponentInChildren(); - cloak.transform.localScale = Vector3.one * 4000f; + repelVolume.GetComponent().radius = 2400f * scale; + repelVolume.GetComponent()._innerRadius = 2010f * scale; + var cloak = repelVolume.GetComponentInChildren(); + cloak.transform.localScale = Vector3.one * 4020f * scale; cloak._sectors = new Sector[] { sector }; cloak.GetComponent().enabled = true; diff --git a/NewHorizons/External/Modules/BrambleModule.cs b/NewHorizons/External/Modules/BrambleModule.cs index e848afa7..43e0cb38 100644 --- a/NewHorizons/External/Modules/BrambleModule.cs +++ b/NewHorizons/External/Modules/BrambleModule.cs @@ -32,15 +32,20 @@ namespace NewHorizons.External.Modules /// public MColor fogTint; + /// + /// The density of the fog inside this dimension. The default is 6. + /// + [DefaultValue(6f)] public float fogDensity = 6f; + /// /// The name of the *node* that the player is taken to when exiting this dimension. /// public string linksTo; /// - /// The internal radius (in meters) of the dimension. The default is 1705. + /// The internal radius (in meters) of the dimension. The default is 750 for the Hub, Escape Pod, and Angler Nest dimensions, and 500 for the others. /// - [DefaultValue(1705f)] public float radius = 1705f; + [DefaultValue(750f)] public float radius = 750f; /// /// An array of integers from 0-5. By default, all entrances are allowed. To force this dimension to warp players in from only one point (like the anglerfish nest dimension in the base game) set this value to [3], [5], or similar. Values of 0-5 only.