Dimension scale fixes

This commit is contained in:
TerrificTrifid 2022-08-01 16:19:28 -05:00
parent ac7e65d4bf
commit 342599cb96
2 changed files with 19 additions and 10 deletions

View File

@ -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<SphereShape>().radius *= scale;
outerFogWarpVolume._warpRadius *= scale;
outerFogWarpVolume._exitRadius *= scale;
var fogGO = atmo.FindChild("FogSphere_Hub");
var fog = fogGO.GetComponent<PlanetaryFogController>();
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<SphereShape>();
@ -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<DarkBrambleCloakSphere>();
cloak.transform.localScale = Vector3.one * 4000f;
repelVolume.GetComponent<SphereShape>().radius = 2400f * scale;
repelVolume.GetComponent<DarkBrambleRepelVolume>()._innerRadius = 2010f * scale;
var cloak = repelVolume.GetComponentInChildren<DarkBrambleCloakSphere>();
cloak.transform.localScale = Vector3.one * 4020f * scale;
cloak._sectors = new Sector[] { sector };
cloak.GetComponent<Renderer>().enabled = true;

View File

@ -32,15 +32,20 @@ namespace NewHorizons.External.Modules
/// </summary>
public MColor fogTint;
/// <summary>
/// The density of the fog inside this dimension. The default is 6.
/// </summary>
[DefaultValue(6f)] public float fogDensity = 6f;
/// <summary>
/// The name of the *node* that the player is taken to when exiting this dimension.
/// </summary>
public string linksTo;
/// <summary>
/// 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.
/// </summary>
[DefaultValue(1705f)] public float radius = 1705f;
[DefaultValue(750f)] public float radius = 750f;
/// <summary>
/// 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.