diff --git a/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs b/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs index 85bfa7d4..c4c9387e 100644 --- a/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs +++ b/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs @@ -242,6 +242,19 @@ namespace NewHorizons.Builder.Body PairExit(config.linksTo, outerFogWarpVolume); + // If the config says only certain entrances are allowed, enforce that + if (config.allowedEntrances != null) + { + var entrances = outerFogWarpVolume._exits; + var newEntrances = new List(); + foreach (var index in config.allowedEntrances) + { + if(index < 0 || 5 < index) continue; + newEntrances.Add(entrances[index]); + } + outerFogWarpVolume._exits = newEntrances.ToArray(); + } + // Set the scale var scale = config.radius / BASE_DIMENSION_RADIUS; geometry.transform.localScale = Vector3.one * scale; diff --git a/NewHorizons/Builder/Props/BrambleNodeBuilder.cs b/NewHorizons/Builder/Props/BrambleNodeBuilder.cs index 9b6e733a..c67d2278 100644 --- a/NewHorizons/Builder/Props/BrambleNodeBuilder.cs +++ b/NewHorizons/Builder/Props/BrambleNodeBuilder.cs @@ -214,6 +214,19 @@ namespace NewHorizons.Builder.Props fogLight._linkedLightData = new List(); sector.RegisterFogLight(fogLight); + + // If the config says only certain entrances are allowed, enforce that + if (config.possibleExits != null) + { + var exits = innerFogWarpVolume._exits; + var newExits = new List(); + foreach (var index in config.possibleExits) + { + if(index < 0 || 5 < index) continue; + newExits.Add(exits[index]); + } + innerFogWarpVolume._exits = newExits.ToArray(); + } // set up screen fog effect // (in the base game, any sector that contains a bramble node needs an EffectRuleset with type FogWarp) diff --git a/NewHorizons/External/Modules/BrambleModule.cs b/NewHorizons/External/Modules/BrambleModule.cs index 4e499ac0..bfd08d68 100644 --- a/NewHorizons/External/Modules/BrambleModule.cs +++ b/NewHorizons/External/Modules/BrambleModule.cs @@ -41,6 +41,11 @@ namespace NewHorizons.External.Modules /// The internal radius (in meters) of the dimension. The default is 1705. /// [DefaultValue(1705f)] public float radius = 1705f; + + /// + /// 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. + /// + public int[] allowedEntrances; } @@ -86,6 +91,11 @@ namespace NewHorizons.External.Modules /// The color of the shafts of light coming from the entrances to the node. Leave blank for the default yellowish color: (131, 124, 105, 255) /// public MColor lightTint; + + /// + /// An array of integers from 0-5. By default, all entrances are allowed. To force this node to warp players out from only one hole set this value to [3], [5], or similar. Values of 0-5 only. + /// + public int[] possibleExits; } } }