diff --git a/NewHorizons/Builder/Body/ProxyBuilder.cs b/NewHorizons/Builder/Body/ProxyBuilder.cs index 6e127336..9943a900 100644 --- a/NewHorizons/Builder/Body/ProxyBuilder.cs +++ b/NewHorizons/Builder/Body/ProxyBuilder.cs @@ -171,7 +171,7 @@ namespace NewHorizons.Builder.Body } NHSupernovaPlanetEffectController supernovaPlanetEffect = null; - if (body.Config.Base.hasSupernovaShockEffect && body.Config.Star == null && body.Config.name != "Sun" && body.Config.FocalPoint == null && !body.Config.isStellarRemnant) + if ((body.Config.ShockEffect == null || body.Config.ShockEffect.hasSupernovaShockEffect) && body.Config.Star == null && body.Config.name != "Sun" && body.Config.FocalPoint == null && !body.Config.isStellarRemnant) { supernovaPlanetEffect = SupernovaEffectBuilder.Make(proxy, null, body.Config, procGen, null, null, null, atmosphere, fog); } diff --git a/NewHorizons/External/Configs/PlanetConfig.cs b/NewHorizons/External/Configs/PlanetConfig.cs index 78024bab..557b65b8 100644 --- a/NewHorizons/External/Configs/PlanetConfig.cs +++ b/NewHorizons/External/Configs/PlanetConfig.cs @@ -150,6 +150,11 @@ namespace NewHorizons.External.Configs /// public ShipLogModule ShipLog; + /// + /// Settings for shock effect on planet when the nearest star goes supernova + /// + public ShockEffectModule ShockEffect; + /// /// Spawn the player at this planet /// diff --git a/NewHorizons/External/Modules/BaseModule.cs b/NewHorizons/External/Modules/BaseModule.cs index aad6549c..2d434f66 100644 --- a/NewHorizons/External/Modules/BaseModule.cs +++ b/NewHorizons/External/Modules/BaseModule.cs @@ -56,11 +56,6 @@ namespace NewHorizons.External.Modules /// public bool hasMapMarker; - /// - /// Does this planet have a shock effect when the nearest star goes supernova? - /// - [DefaultValue(true)] public bool hasSupernovaShockEffect = true; - /// /// Can this planet survive entering a star? /// diff --git a/NewHorizons/External/Modules/ShockEffectModule.cs b/NewHorizons/External/Modules/ShockEffectModule.cs new file mode 100644 index 00000000..5b2405ec --- /dev/null +++ b/NewHorizons/External/Modules/ShockEffectModule.cs @@ -0,0 +1,28 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace NewHorizons.External.Modules +{ + [JsonObject] + public class ShockEffectModule + { + /// + /// Does this planet have a shock effect when the nearest star goes supernova? Automatically disabled for stars, focal points, and stellar remnants. + /// + public bool hasSupernovaShockEffect = true; + + /// + /// Asset Bundle that contains the shock effect mesh + /// + public string assetBundle; + + /// + /// Path in the asset bundle that leads a replacement mesh for the planet's supernova shock effect + /// + public string meshPath; + } +} diff --git a/NewHorizons/Handlers/PlanetCreationHandler.cs b/NewHorizons/Handlers/PlanetCreationHandler.cs index 7eff5420..f0e880c5 100644 --- a/NewHorizons/Handlers/PlanetCreationHandler.cs +++ b/NewHorizons/Handlers/PlanetCreationHandler.cs @@ -597,7 +597,7 @@ namespace NewHorizons.Handlers CloakBuilder.Make(go, sector, rb, body.Config.Cloak, !body.Config.ReferenceFrame.hideInMap, body.Mod); } - if (body.Config.Base.hasSupernovaShockEffect && body.Config.Star == null && body.Config.name != "Sun" && body.Config.FocalPoint == null) + if ((body.Config.ShockEffect == null || body.Config.ShockEffect.hasSupernovaShockEffect) && body.Config.Star == null && body.Config.name != "Sun" && body.Config.FocalPoint == null) { SupernovaEffectBuilder.Make(go, sector, body.Config, procGen, ambientLight, fog, atmosphere, null, fog?._fogImpostor); }