diff --git a/NewHorizons/Assets/textures/FogColorRamp.png b/NewHorizons/Assets/textures/FogColorRamp.png index 5bc8a0b9..4fbb2da6 100644 Binary files a/NewHorizons/Assets/textures/FogColorRamp.png and b/NewHorizons/Assets/textures/FogColorRamp.png differ diff --git a/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs b/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs index 4dce6bc3..a96988dd 100644 --- a/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs +++ b/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs @@ -85,7 +85,7 @@ namespace NewHorizons.Builder.Body // remove default vines var geoBatchedGroup = geometry.FindChild("BatchedGroup"); - var collider = geoBatchedGroup.FindChild("BatchedMeshColliders_1"); + var collider = geoBatchedGroup.FindChild("BatchedMeshColliders_0"); collider.transform.parent = geometry.transform; GameObject.Destroy(geoBatchedGroup); diff --git a/NewHorizons/Builder/Body/StarBuilder.cs b/NewHorizons/Builder/Body/StarBuilder.cs index 8266b9d4..d3c2812c 100644 --- a/NewHorizons/Builder/Body/StarBuilder.cs +++ b/NewHorizons/Builder/Body/StarBuilder.cs @@ -24,6 +24,7 @@ namespace NewHorizons.Builder.Body public static StarController Make(GameObject planetGO, Sector sector, StarModule starModule, IModBehaviour mod) { var starGO = MakeStarGraphics(planetGO, sector, starModule, mod); + var ramp = starGO.GetComponentInChildren().sharedMaterial.GetTexture(ColorRamp); var sunAudio = Object.Instantiate(SearchUtilities.Find("Sun_Body/Sector_SUN/Audio_SUN"), starGO.transform); sunAudio.transform.localPosition = Vector3.zero; @@ -140,15 +141,10 @@ namespace NewHorizons.Builder.Body controller.StartColour = starModule.tint; controller.EndColour = starModule.endTint; controller.WillExplode = starModule.goSupernova; - if (!string.IsNullOrEmpty(starModule.starRampTexture)) - { - var ramp = ImageUtilities.GetTexture(mod, starModule.starRampTexture); - controller.normalRamp = ramp; - } + controller.normalRamp = !string.IsNullOrEmpty(starModule.starRampTexture) ? ImageUtilities.GetTexture(mod, starModule.starRampTexture) : ramp; if (!string.IsNullOrEmpty(starModule.starCollapseRampTexture)) { - var ramp = ImageUtilities.GetTexture(mod, starModule.starCollapseRampTexture); - controller.collapseRamp = ramp; + controller.collapseRamp = ImageUtilities.GetTexture(mod, starModule.starCollapseRampTexture); } surfaceAudio.SetStarEvolutionController(controller); starGO.SetActive(true); diff --git a/NewHorizons/Builder/General/AstroObjectBuilder.cs b/NewHorizons/Builder/General/AstroObjectBuilder.cs index 667ff4bd..43c92a28 100644 --- a/NewHorizons/Builder/General/AstroObjectBuilder.cs +++ b/NewHorizons/Builder/General/AstroObjectBuilder.cs @@ -37,7 +37,7 @@ namespace NewHorizons.Builder.General { var alignment = body.AddComponent(); alignment.SetTargetBody(primaryBody?.GetAttachedOWRigidbody()); - alignment._usePhysicsToRotate = true; + alignment._usePhysicsToRotate = !config.Orbit.isStatic; if (config.Orbit.alignmentAxis == null) { alignment._localAlignmentAxis = new Vector3(0, -1, 0); diff --git a/NewHorizons/Builder/General/RFVolumeBuilder.cs b/NewHorizons/Builder/General/RFVolumeBuilder.cs index c5826e44..814563ac 100644 --- a/NewHorizons/Builder/General/RFVolumeBuilder.cs +++ b/NewHorizons/Builder/General/RFVolumeBuilder.cs @@ -41,6 +41,13 @@ namespace NewHorizons.Builder.General RFV._isPrimaryVolume = true; RFV._isCloseRangeVolume = false; + if (module.localPosition != null) + { + rfGO.transform.localPosition = module.localPosition; + RV._localPosition = module.localPosition; + RV._useCenterOfMass = false; + } + owrb.SetAttachedReferenceFrameVolume(RFV); if (!module.enabled) GameObject.Destroy(rfGO); diff --git a/NewHorizons/Builder/Props/AudioVolumeBuilder.cs b/NewHorizons/Builder/Props/AudioVolumeBuilder.cs index 91d1d3f6..8e45efc8 100644 --- a/NewHorizons/Builder/Props/AudioVolumeBuilder.cs +++ b/NewHorizons/Builder/Props/AudioVolumeBuilder.cs @@ -27,6 +27,7 @@ namespace NewHorizons.Builder.Props var owAudioSource = go.AddComponent(); owAudioSource._audioSource = audioSource; owAudioSource.loop = true; + owAudioSource.SetTrack((OWAudioMixer.TrackName)Enum.Parse(typeof(OWAudioMixer.TrackName), Enum.GetName(typeof(AudioMixerTrackName), info.track))); AudioUtilities.SetAudioClip(owAudioSource, info.audio, mod); var audioVolume = go.AddComponent(); @@ -36,6 +37,7 @@ namespace NewHorizons.Builder.Props var owTriggerVolume = go.AddComponent(); owTriggerVolume._shape = shape; + audioVolume._triggerVolumeOverride = owTriggerVolume; go.SetActive(true); diff --git a/NewHorizons/Builder/Props/BrambleNodeBuilder.cs b/NewHorizons/Builder/Props/BrambleNodeBuilder.cs index 811ccd05..15e4f668 100644 --- a/NewHorizons/Builder/Props/BrambleNodeBuilder.cs +++ b/NewHorizons/Builder/Props/BrambleNodeBuilder.cs @@ -23,7 +23,7 @@ namespace NewHorizons.Builder.Props // values are all nodes' warp controllers that link to a given dimension // unpairedNodes[name of dimension that doesn't exist yet] => List{warp controller for node that links to that dimension, ...} private static Dictionary> _unpairedNodes = new(); - private static Dictionary> _propogatedSignals = null; + private static Dictionary> _propagatedSignals = null; public static Dictionary NamedNodes { get; private set; } public static Dictionary BuiltBrambleNodes { get; private set; } @@ -34,7 +34,7 @@ namespace NewHorizons.Builder.Props public static void Init() { _unpairedNodes = new(); - _propogatedSignals = null; + _propagatedSignals = null; NamedNodes = new(); BuiltBrambleNodes = new(); } @@ -80,7 +80,7 @@ namespace NewHorizons.Builder.Props return outerFogWarpVolume; } - private static void PropogateSignals() + private static void PropagateSignals() { // The purpose of this function is to determine which signals any given node should play, based on which dimension it links to // you know how the main dark bramble node, the one that forms the core of the planet, plays Feldspar's harmonica signal, even though Feldspar isn't in the dimension that the node links directly to? @@ -88,7 +88,7 @@ namespace NewHorizons.Builder.Props // New Strategy (thanks Damian): // 1) Run Floyd-Warshall on the dimensions (where each dimension is a vertex and each node is an edge) - // 2) For each dimension A, if it's possible to reach dimension B, add dimension B's signals to the list propogatedSignals[A] + // 2) For each dimension A, if it's possible to reach dimension B, add dimension B's signals to the list propagatedSignals[A] var allDimensions = PlanetCreationHandler.allBodies.Where(body => body?.Config?.Bramble?.dimension != null).Select(body => body.Config).ToList(); @@ -129,11 +129,11 @@ namespace NewHorizons.Builder.Props // // this dictionary lists all the signals a given node should have, depending on the dimension it links to - // ie, if a node links to "dimension1", then that node should spawn all of the signals in the list propogatedSignals["dimension1"] - _propogatedSignals = new Dictionary>(); + // ie, if a node links to "dimension1", then that node should spawn all of the signals in the list propagatedSignals["dimension1"] + _propagatedSignals = new Dictionary>(); foreach (var dimension in allDimensions) { - _propogatedSignals[dimension.name] = new(); + _propagatedSignals[dimension.name] = new(); var dimensionIndex = dimensionNameToIndex[dimension.name]; foreach (var destinationDimension in allDimensions) @@ -143,7 +143,7 @@ namespace NewHorizons.Builder.Props var destinationIndex = dimensionNameToIndex[destinationDimension.name]; if (access[dimensionIndex, destinationIndex]) { - _propogatedSignals[dimension.name].AddRange(destinationDimension.Props.signals); + _propagatedSignals[dimension.name].AddRange(destinationDimension.Props.signals); } } } @@ -289,8 +289,8 @@ namespace NewHorizons.Builder.Props } // Make signals - if (_propogatedSignals == null) PropogateSignals(); - foreach (var signalConfig in _propogatedSignals[config.linksTo]) + if (_propagatedSignals == null) PropagateSignals(); + foreach (var signalConfig in _propagatedSignals[config.linksTo]) { var signalGO = SignalBuilder.Make(go, sector, signalConfig, mod); signalGO.GetComponent()._identificationDistance = 0; diff --git a/NewHorizons/Builder/Props/DetailBuilder.cs b/NewHorizons/Builder/Props/DetailBuilder.cs index 49a7d0b2..de0a86c4 100644 --- a/NewHorizons/Builder/Props/DetailBuilder.cs +++ b/NewHorizons/Builder/Props/DetailBuilder.cs @@ -106,6 +106,7 @@ namespace NewHorizons.Builder.Props if (prefab == null) return null; GameObject prop = prefab.InstantiateInactive(); + prop.name = prefab.name; prop.transform.parent = sector?.transform ?? planetGO.transform; StreamingHandler.SetUpStreaming(prop, sector); diff --git a/NewHorizons/Builder/Props/GeyserBuilder.cs b/NewHorizons/Builder/Props/GeyserBuilder.cs index 54e478a4..7d45635c 100644 --- a/NewHorizons/Builder/Props/GeyserBuilder.cs +++ b/NewHorizons/Builder/Props/GeyserBuilder.cs @@ -7,12 +7,11 @@ namespace NewHorizons.Builder.Props { public static void Make(GameObject planetGO, Sector sector, PropModule.GeyserInfo info) { - var original = SearchUtilities.Find("TimberHearth_Body/Sector_TH/Interactables_TH/Geysers/Geyser_Village"); - GameObject geyserGO = original.InstantiateInactive(); + var geyserGO = SearchUtilities.Find("TimberHearth_Body/Sector_TH/Interactables_TH/Geysers/Geyser_Village").InstantiateInactive(); geyserGO.transform.parent = sector?.transform ?? planetGO.transform; geyserGO.name = "Geyser"; - var pos = ((Vector3)info.position); + var pos = (Vector3)info.position; // Want half of it to be underground var length = pos.magnitude - 65; @@ -25,7 +24,9 @@ namespace NewHorizons.Builder.Props var up = planetGO.transform.TransformPoint(pos) - planetGO.transform.position; geyserGO.transform.rotation = Quaternion.FromToRotation(geyserGO.transform.up, up) * geyserGO.transform.rotation; - var controller = geyserGO.GetComponent(); + if (info.disableBubbles) geyserGO.FindChild("GeyserParticles/GeyserBubbles").SetActive(false); + if (info.disableShaft) geyserGO.FindChild("GeyserParticles/GeyserShaft").SetActive(false); + if (info.disableSpout) geyserGO.FindChild("GeyserParticles/GeyserSpout").SetActive(false); geyserGO.SetActive(true); @@ -34,8 +35,8 @@ namespace NewHorizons.Builder.Props // Do this after awake Delay.FireOnNextUpdate(() => geyserFluidVolume._maxHeight = 1); - geyserFluidVolume.enabled = true; - geyserGO.transform.Find("FluidVolume_Geyser").GetComponent().enabled = true; + geyserFluidVolume.enabled = true; // why do we enable this? idk + geyserFluidVolume.GetComponent().enabled = true; // i think this is already enabled but wtv } } } diff --git a/NewHorizons/Builder/Props/NomaiTextBuilder.cs b/NewHorizons/Builder/Props/NomaiTextBuilder.cs index 02cc532e..81ec285f 100644 --- a/NewHorizons/Builder/Props/NomaiTextBuilder.cs +++ b/NewHorizons/Builder/Props/NomaiTextBuilder.cs @@ -97,7 +97,7 @@ namespace NewHorizons.Builder.Props { if (_scrollPrefab == null) InitPrefabs(); - var xmlPath = System.IO.File.ReadAllText(mod.ModHelper.Manifest.ModFolderPath + info.xmlFile); + var xmlPath = File.ReadAllText(mod.ModHelper.Manifest.ModFolderPath + info.xmlFile); switch (info.type) { @@ -365,7 +365,7 @@ namespace NewHorizons.Builder.Props { GameObject arc; var type = arcInfo != null ? arcInfo.type : PropModule.NomaiTextArcInfo.NomaiTextArcType.Adult; - var variation = arcInfo == null ? arcInfo.variation : -1; + var variation = arcInfo != null ? arcInfo.variation : -1; switch (type) { case PropModule.NomaiTextArcInfo.NomaiTextArcType.Child: diff --git a/NewHorizons/Builder/Props/SignalBuilder.cs b/NewHorizons/Builder/Props/SignalBuilder.cs index 4ccb7311..5d7e9485 100644 --- a/NewHorizons/Builder/Props/SignalBuilder.cs +++ b/NewHorizons/Builder/Props/SignalBuilder.cs @@ -164,9 +164,17 @@ namespace NewHorizons.Builder.Props source.velocityUpdateMode = AudioVelocityUpdateMode.Fixed; source.rolloffMode = AudioRolloffMode.Custom; - if (_customCurve == null) - _customCurve = SearchUtilities.Find("Moon_Body/Sector_THM/Characters_THM/Villager_HEA_Esker/Signal_Whistling").GetComponent().GetCustomCurve(AudioSourceCurveType.CustomRolloff); - + if (_customCurve == null) + { + _customCurve = new AnimationCurve( + new Keyframe(0.0333f, 1f, -30.012f, -30.012f, 0.3333f, 0.3333f), + new Keyframe(0.0667f, 0.5f, -7.503f, -7.503f, 0.3333f, 0.3333f), + new Keyframe(0.1333f, 0.25f, -1.8758f, -1.8758f, 0.3333f, 0.3333f), + new Keyframe(0.2667f, 0.125f, -0.4689f, -0.4689f, 0.3333f, 0.3333f), + new Keyframe(0.5333f, 0.0625f, -0.1172f, -0.1172f, 0.3333f, 0.3333f), + new Keyframe(1f, 0f, -0.0333f, -0.0333f, 0.3333f, 0.3333f)); + } + source.SetCustomCurve(AudioSourceCurveType.CustomRolloff, _customCurve); // If it can be heard regularly then we play it immediately source.playOnAwake = !info.onlyAudibleToScope; diff --git a/NewHorizons/Components/ShipWarpController.cs b/NewHorizons/Components/ShipWarpController.cs index 9a9f1aad..ed08e79e 100644 --- a/NewHorizons/Components/ShipWarpController.cs +++ b/NewHorizons/Components/ShipWarpController.cs @@ -37,9 +37,13 @@ namespace NewHorizons.Components MakeWhiteHole(); _isWarpingIn = false; - - _oneShotSource = gameObject.AddComponent(); + + var audioObject = new GameObject("WarpOneShot"); + audioObject.transform.parent = transform; + audioObject.SetActive(false); + _oneShotSource = audioObject.AddComponent(); _oneShotSource._track = OWAudioMixer.TrackName.Ship; + audioObject.SetActive(true); GlobalMessenger.AddListener("FinishOpenEyes", new Callback(OnFinishOpenEyes)); } diff --git a/NewHorizons/Components/SizeControllers/StarEvolutionController.cs b/NewHorizons/Components/SizeControllers/StarEvolutionController.cs index 42398c2b..1ae2d0d9 100644 --- a/NewHorizons/Components/SizeControllers/StarEvolutionController.cs +++ b/NewHorizons/Components/SizeControllers/StarEvolutionController.cs @@ -34,7 +34,7 @@ namespace NewHorizons.Components.SizeControllers private float _collapseStartSize; private float _collapseTimer; - public float collapseTime = 5f; // seconds + public float collapseTime = 10f; // seconds public float lifespan = 22f; // minutes private float _age; @@ -45,6 +45,7 @@ namespace NewHorizons.Components.SizeControllers private Material _collapseEndSurfaceMaterial; private Material _startSurfaceMaterial; private Material _endSurfaceMaterial; + private Material _surfaceMaterial; private Texture _normalRamp; private Texture _collapseRamp; @@ -55,10 +56,14 @@ namespace NewHorizons.Components.SizeControllers private float maxScale; private float minScale; private static readonly int ColorRamp = Shader.PropertyToID("_ColorRamp"); + private static readonly int ColorTime = Shader.PropertyToID("_ColorTime"); + private static readonly int InnerRadius = Shader.PropertyToID("_InnerRadius"); + private static readonly int OuterRadius = Shader.PropertyToID("_OuterRadius"); + private static readonly int SkyColor = Shader.PropertyToID("_SkyColor"); private Color _currentColour; - void Start() + private void Start() { var sun = GameObject.FindObjectOfType(); _collapseStartSurfaceMaterial = new Material(sun._collapseStartSurfaceMaterial); @@ -133,6 +138,7 @@ namespace NewHorizons.Components.SizeControllers } _flareEmitter = GetComponentInChildren(); + _surfaceMaterial = supernova._surface._materials[0]; } public void OnDestroy() @@ -159,15 +165,20 @@ namespace NewHorizons.Components.SizeControllers { _currentColour = Color.Lerp(_startColour, _endColour, t); supernova._surface._materials[0].Lerp(_startSurfaceMaterial, _endSurfaceMaterial, t); + supernova._surface._materials[0].SetFloat(ColorTime, t); } else { _currentColour = _endColour; + supernova._surface._materials[0].Lerp(_startSurfaceMaterial, _endSurfaceMaterial, 1); + supernova._surface._materials[0].SetFloat(ColorTime, 1); } } else { _currentColour = _startColour; + supernova._surface._materials[0].Lerp(_startSurfaceMaterial, _endSurfaceMaterial, 0); + supernova._surface._materials[0].SetFloat(ColorTime, 0); } if (_flareEmitter != null) _flareEmitter._tint = _currentColour; @@ -217,7 +228,17 @@ namespace NewHorizons.Components.SizeControllers if (_proxy != null) _proxy.StartCollapse(); } - private void StartSupernova() + public void StopCollapse() + { + Logger.LogVerbose($"{gameObject.transform.root.name} stopped collapse"); + + _isCollapsing = false; + supernova._surface._materials[0].CopyPropertiesFromMaterial(_endSurfaceMaterial); + + if (_proxy != null) _proxy.StopCollapse(); + } + + public void StartSupernova() { Logger.LogVerbose($"{gameObject.transform.root.name} started supernova"); @@ -229,6 +250,25 @@ namespace NewHorizons.Components.SizeControllers if (_destructionVolume != null) _destructionVolume._deathType = DeathType.Supernova; } + public void StopSupernova() + { + Logger.LogVerbose($"{gameObject.transform.root.name} stopped supernova"); + + supernova.enabled = false; + _isSupernova = false; + if (atmosphere != null) atmosphere.SetActive(true); + if (_destructionVolume != null) + { + _destructionVolume._deathType = DeathType.Energy; + _destructionVolume.transform.localScale = Vector3.one; + } + if (_heatVolume != null) _heatVolume.transform.localScale = Vector3.one; + gameObject.SetActive(true); + transform.localScale = Vector3.one; + supernova._surface._materials[0] = _surfaceMaterial; + supernova._surface.transform.localScale = Vector3.one; + } + protected new void FixedUpdate() { _age += Time.deltaTime; @@ -266,13 +306,13 @@ namespace NewHorizons.Components.SizeControllers _fog._fogTint = fogColour; } - if (_atmosphereRenderers != null && _atmosphereRenderers.Count() > 0) + if (_atmosphereRenderers != null) { foreach (var lod in _atmosphereRenderers) { - lod.material.SetFloat("_InnerRadius", CurrentScale); - lod.material.SetFloat("_OuterRadius", CurrentScale * StarBuilder.OuterRadiusRatio); - lod.material.SetColor("_SkyColor", _currentColour); + lod.material.SetFloat(InnerRadius, CurrentScale); + lod.material.SetFloat(OuterRadius, CurrentScale * StarBuilder.OuterRadiusRatio); + lod.material.SetColor(SkyColor, _currentColour); } } } diff --git a/NewHorizons/External/Modules/AtmosphereModule.cs b/NewHorizons/External/Modules/AtmosphereModule.cs index b0f31bc9..5c3167bd 100644 --- a/NewHorizons/External/Modules/AtmosphereModule.cs +++ b/NewHorizons/External/Modules/AtmosphereModule.cs @@ -112,7 +112,7 @@ namespace NewHorizons.External.Modules /// /// Fluid type for sounds/effects when colliding with this cloud. /// - public CloudFluidType fluidType = CloudFluidType.Cloud; + [DefaultValue("cloud")] public CloudFluidType fluidType = CloudFluidType.Cloud; /// /// Add lightning to this planet like on Giant's Deep. diff --git a/NewHorizons/External/Modules/BaseModule.cs b/NewHorizons/External/Modules/BaseModule.cs index 8c8e0ede..2d434f66 100644 --- a/NewHorizons/External/Modules/BaseModule.cs +++ b/NewHorizons/External/Modules/BaseModule.cs @@ -38,7 +38,7 @@ namespace NewHorizons.External.Modules /// /// How gravity falls off with distance. Most planets use linear but the sun and some moons use inverseSquared. /// - public GravityFallOff gravityFallOff = GravityFallOff.Linear; + [DefaultValue("linear")] public GravityFallOff gravityFallOff = GravityFallOff.Linear; /// /// Radius of a simple sphere used as the ground for the planet. If you want to use more complex terrain, leave this as diff --git a/NewHorizons/External/Modules/PropModule.cs b/NewHorizons/External/Modules/PropModule.cs index afc24cb2..1724b3e0 100644 --- a/NewHorizons/External/Modules/PropModule.cs +++ b/NewHorizons/External/Modules/PropModule.cs @@ -208,6 +208,11 @@ namespace NewHorizons.External.Modules /// Position of the geyser /// public MVector3 position; + + /// + /// Disable the individual particle systems of the geyser + /// + public bool disableBubbles, disableShaft, disableSpout; } [JsonObject] @@ -248,7 +253,7 @@ namespace NewHorizons.External.Modules /// /// What type of cyclone should this be? Upwards and downwards are both tornados and will push in that direction. /// - public TornadoType type = TornadoType.Downwards; + [DefaultValue("downwards")] public TornadoType type = TornadoType.Downwards; /// /// Angular distance from the starting position that it will wander, in terms of the angle around the x-axis. @@ -409,7 +414,7 @@ namespace NewHorizons.External.Modules /// /// What needs to be done to the volume to unlock the facts /// - public RevealVolumeType revealOn = RevealVolumeType.Enter; + [DefaultValue("enter")] public RevealVolumeType revealOn = RevealVolumeType.Enter; /// /// A list of facts to reveal @@ -489,7 +494,7 @@ namespace NewHorizons.External.Modules /// /// The type of object this is. /// - public NomaiTextType type = NomaiTextType.Wall; + [DefaultValue("wall")] public NomaiTextType type = NomaiTextType.Wall; /// /// The relative path to the xml file for this object. @@ -523,7 +528,7 @@ namespace NewHorizons.External.Modules /// /// The type of text to display. /// - public NomaiTextArcType type = NomaiTextArcType.Adult; + [DefaultValue("adult")] public NomaiTextArcType type = NomaiTextArcType.Adult; /// /// Which variation of the chosen type to place. If not specified, a random variation will be selected based on the seed provided in the parent module. @@ -575,7 +580,7 @@ namespace NewHorizons.External.Modules /// /// The type of object this is. /// - public SlideShowType type = SlideShowType.SlideReel; + [DefaultValue("slideReel")] public SlideShowType type = SlideShowType.SlideReel; } [JsonObject] @@ -738,9 +743,35 @@ namespace NewHorizons.External.Modules public float radius; /// - /// The radius of this audio volume + /// The audio to use. Can be a path to a .wav/.ogg/.mp3 file, or taken from the AudioClip list. /// public string audio; + + /// + /// The audio track of this audio volume + /// + [DefaultValue("environment")] public AudioMixerTrackName track = AudioMixerTrackName.Environment; } } + + [JsonConverter(typeof(StringEnumConverter))] + public enum AudioMixerTrackName + { + [EnumMember(Value = @"undefined")] Undefined = 0, + [EnumMember(Value = @"menu")] Menu = 1, + [EnumMember(Value = @"music")] Music = 2, + [EnumMember(Value = @"environment")] Environment = 4, + [EnumMember(Value = @"environmentUnfiltered")] Environment_Unfiltered = 5, + [EnumMember(Value = @"endTimesSfx")] EndTimes_SFX = 8, + [EnumMember(Value = @"signal")] Signal = 16, + [EnumMember(Value = @"death")] Death = 32, + [EnumMember(Value = @"player")] Player = 64, + [EnumMember(Value = @"playerExternal")] Player_External = 65, + [EnumMember(Value = @"ship")] Ship = 128, + [EnumMember(Value = @"map")] Map = 256, + [EnumMember(Value = @"endTimesMusic")] EndTimes_Music = 512, + [EnumMember(Value = @"muffleWhileRafting")] MuffleWhileRafting = 1024, + [EnumMember(Value = @"muffleIndoors")] MuffleIndoors = 2048, + [EnumMember(Value = @"slideReelMusic")] SlideReelMusic = 4096, + } } \ No newline at end of file diff --git a/NewHorizons/External/Modules/ReferenceFrameModule.cs b/NewHorizons/External/Modules/ReferenceFrameModule.cs index 0704366a..12254866 100644 --- a/NewHorizons/External/Modules/ReferenceFrameModule.cs +++ b/NewHorizons/External/Modules/ReferenceFrameModule.cs @@ -39,5 +39,10 @@ namespace NewHorizons.External.Modules /// The radius of the sphere around the planet which you can click on to target it. Defaults to twice the sphere of influence. /// public float targetColliderRadius; + + /// + /// Position of the reference frame relative to the object. + /// + public MVector3 localPosition; } } \ No newline at end of file diff --git a/NewHorizons/External/Modules/VariableSize/FunnelModule.cs b/NewHorizons/External/Modules/VariableSize/FunnelModule.cs index 81a21dee..5c49da12 100644 --- a/NewHorizons/External/Modules/VariableSize/FunnelModule.cs +++ b/NewHorizons/External/Modules/VariableSize/FunnelModule.cs @@ -1,4 +1,5 @@ -using System.Runtime.Serialization; +using System.ComponentModel; +using System.Runtime.Serialization; using NewHorizons.Utility; using Newtonsoft.Json; using Newtonsoft.Json.Converters; @@ -33,6 +34,6 @@ namespace NewHorizons.External.Modules.VariableSize /// /// Type of fluid the funnel transfers /// - public FunnelType type = FunnelType.Sand; + [DefaultValue("sand")] public FunnelType type = FunnelType.Sand; } } \ No newline at end of file diff --git a/NewHorizons/Handlers/PlanetDestructionHandler.cs b/NewHorizons/Handlers/PlanetDestructionHandler.cs index ee3b9535..7e04ef30 100644 --- a/NewHorizons/Handlers/PlanetDestructionHandler.cs +++ b/NewHorizons/Handlers/PlanetDestructionHandler.cs @@ -90,10 +90,7 @@ namespace NewHorizons.Handlers case AstroObject.Name.CaveTwin: case AstroObject.Name.TowerTwin: DisableBody(SearchUtilities.Find("FocalBody"), delete); - DisableBody(SearchUtilities.Find("SandFunnel_Body"), delete); - break; - case AstroObject.Name.MapSatellite: - DisableBody(SearchUtilities.Find("MapSatellite_Body"), delete); + DisableBody(SearchUtilities.Find("SandFunnel_Body", false), delete); break; case AstroObject.Name.GiantsDeep: // Might prevent leftover jellyfish from existing diff --git a/NewHorizons/Patches/VisionTorchPatches.cs b/NewHorizons/Patches/VisionTorchPatches.cs index 88fc1956..6140c26a 100644 --- a/NewHorizons/Patches/VisionTorchPatches.cs +++ b/NewHorizons/Patches/VisionTorchPatches.cs @@ -35,6 +35,18 @@ namespace NewHorizons.Patches return true; } + + [HarmonyPrefix] + [HarmonyPatch(typeof(MindProjectorTrigger), nameof(MindProjectorTrigger.OnTriggerVolumeExit))] + private static bool MindProjectorTrigger_OnTriggerVolumeExit(MindProjectorTrigger __instance, GameObject hitObj) + { + var t = hitObj.GetComponent(); + if (t != null) //(hitObj.CompareTag("PrisonerDetector")) + { + __instance._mindProjector.OnProjectionComplete -= t.onSlidesComplete; + } + return true; + } } [HarmonyPatch] diff --git a/NewHorizons/Schemas/body_schema.json b/NewHorizons/Schemas/body_schema.json index 5c920b62..b7e33836 100644 --- a/NewHorizons/Schemas/body_schema.json +++ b/NewHorizons/Schemas/body_schema.json @@ -315,6 +315,7 @@ }, "fluidType": { "description": "Fluid type for sounds/effects when colliding with this cloud.", + "default": "cloud", "$ref": "#/definitions/CloudFluidType" }, "hasLightning": { @@ -420,6 +421,7 @@ }, "gravityFallOff": { "description": "How gravity falls off with distance. Most planets use linear but the sun and some moons use inverseSquared.", + "default": "linear", "$ref": "#/definitions/GravityFallOff" }, "groundSize": { @@ -644,6 +646,7 @@ }, "type": { "description": "Type of fluid the funnel transfers", + "default": "sand", "$ref": "#/definitions/FunnelType" } } @@ -1076,6 +1079,18 @@ "position": { "description": "Position of the geyser", "$ref": "#/definitions/MVector3" + }, + "disableBubbles": { + "type": "boolean", + "description": "Disable the individual particle systems of the geyser" + }, + "disableShaft": { + "type": "boolean", + "description": "Disable the individual particle systems of the geyser" + }, + "disableSpout": { + "type": "boolean", + "description": "Disable the individual particle systems of the geyser" } } }, @@ -1109,6 +1124,7 @@ }, "type": { "description": "The type of object this is.", + "default": "wall", "$ref": "#/definitions/NomaiTextType" }, "xmlFile": { @@ -1131,6 +1147,7 @@ }, "type": { "description": "The type of text to display.", + "default": "adult", "$ref": "#/definitions/NomaiTextArcType" }, "variation": { @@ -1231,6 +1248,7 @@ }, "revealOn": { "description": "What needs to be done to the volume to unlock the facts", + "default": "enter", "$ref": "#/definitions/RevealVolumeType" }, "reveals": { @@ -1325,6 +1343,7 @@ }, "type": { "description": "The type of object this is.", + "default": "slideReel", "$ref": "#/definitions/SlideShowType" } } @@ -1499,6 +1518,7 @@ }, "type": { "description": "What type of cyclone should this be? Upwards and downwards are both tornados and will push in that direction.", + "default": "downwards", "$ref": "#/definitions/TornadoType" }, "wanderDegreesX": { @@ -1657,10 +1677,55 @@ }, "audio": { "type": "string", - "description": "The radius of this audio volume" + "description": "The audio to use. Can be a path to a .wav/.ogg/.mp3 file, or taken from the AudioClip list." + }, + "track": { + "description": "The audio track of this audio volume", + "default": "environment", + "$ref": "#/definitions/AudioMixerTrackName" } } }, + "AudioMixerTrackName": { + "type": "string", + "description": "", + "x-enumNames": [ + "Undefined", + "Menu", + "Music", + "Environment", + "Environment_Unfiltered", + "EndTimes_SFX", + "Signal", + "Death", + "Player", + "Player_External", + "Ship", + "Map", + "EndTimes_Music", + "MuffleWhileRafting", + "MuffleIndoors", + "SlideReelMusic" + ], + "enum": [ + "undefined", + "menu", + "music", + "environment", + "environmentUnfiltered", + "endTimesSfx", + "signal", + "death", + "player", + "playerExternal", + "ship", + "map", + "endTimesMusic", + "muffleWhileRafting", + "muffleIndoors", + "slideReelMusic" + ] + }, "SignalInfo": { "type": "object", "additionalProperties": false, @@ -1748,6 +1813,10 @@ "type": "number", "description": "The radius of the sphere around the planet which you can click on to target it. Defaults to twice the sphere of influence.", "format": "float" + }, + "localPosition": { + "description": "Position of the reference frame relative to the object.", + "$ref": "#/definitions/MVector3" } } },