diff --git a/NewHorizons/Builder/Body/StarBuilder.cs b/NewHorizons/Builder/Body/StarBuilder.cs index 940db684..a9b532bd 100644 --- a/NewHorizons/Builder/Body/StarBuilder.cs +++ b/NewHorizons/Builder/Body/StarBuilder.cs @@ -313,8 +313,9 @@ namespace NewHorizons.Builder.Body var stellarDeath = supernovaGO.AddComponent(); stellarDeath.enabled = false; stellarDeath._surface = starGO.GetComponentInChildren(); - stellarDeath._supernovaScale = new AnimationCurve(new Keyframe(0, 200, 0, 0, 1f / 3f, 1f / 3f), new Keyframe(45, starModule.supernovaSize, 1758.508f, 1758.508f, 1f / 3f, 1f / 3f)); - stellarDeath._supernovaAlpha = new AnimationCurve(new Keyframe(5, 1, 0, 0, 1f / 3f, 1f / 3f), new Keyframe(15, 1.0002f, 0, 0, 1f / 3f, 1f / 3f), new Keyframe(50, 0, -0.0578f, 1 / 3f, -0.0578f, 1 / 3f)); + var duration = starModule.supernovaSize / starModule.supernovaSpeed; + stellarDeath._supernovaScale = new AnimationCurve(new Keyframe(0, 200, 0, 0, 1f / 3f, 1f / 3f), new Keyframe(duration, starModule.supernovaSize, 1758.508f, 1758.508f, 1f / 3f, 1f / 3f)); + stellarDeath._supernovaAlpha = new AnimationCurve(new Keyframe(duration / 9f, 1, 0, 0, 1f / 3f, 1f / 3f), new Keyframe(duration / 3f, 1.0002f, 0, 0, 1f / 3f, 1f / 3f), new Keyframe(duration, 0, -0.0578f, 1 / 3f, -0.0578f, 1 / 3f)); stellarDeath._explosionParticles = supernova._explosionParticles; stellarDeath._shockwave = supernova._shockwave; stellarDeath._shockwaveLength = supernova._shockwaveLength; diff --git a/NewHorizons/External/Modules/VariableSize/StarModule.cs b/NewHorizons/External/Modules/VariableSize/StarModule.cs index 558673e5..0f37ca1d 100644 --- a/NewHorizons/External/Modules/VariableSize/StarModule.cs +++ b/NewHorizons/External/Modules/VariableSize/StarModule.cs @@ -63,6 +63,13 @@ namespace NewHorizons.External.Modules.VariableSize [Range(0f, double.MaxValue)] public float supernovaSize = 50000f; + /// + /// Speed of the supernova wall in meters per second. + /// + [DefaultValue(1111f)] + [Range(1f, double.MaxValue)] + public float supernovaSpeed = 1111f; + /// /// The tint of the supernova this star creates when it dies. ///