mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Move shock effect setting to a separate module
This commit is contained in:
parent
3ab60abb1e
commit
8c937f67ef
@ -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);
|
||||
}
|
||||
|
||||
5
NewHorizons/External/Configs/PlanetConfig.cs
vendored
5
NewHorizons/External/Configs/PlanetConfig.cs
vendored
@ -150,6 +150,11 @@ namespace NewHorizons.External.Configs
|
||||
/// </summary>
|
||||
public ShipLogModule ShipLog;
|
||||
|
||||
/// <summary>
|
||||
/// Settings for shock effect on planet when the nearest star goes supernova
|
||||
/// </summary>
|
||||
public ShockEffectModule ShockEffect;
|
||||
|
||||
/// <summary>
|
||||
/// Spawn the player at this planet
|
||||
/// </summary>
|
||||
|
||||
5
NewHorizons/External/Modules/BaseModule.cs
vendored
5
NewHorizons/External/Modules/BaseModule.cs
vendored
@ -56,11 +56,6 @@ namespace NewHorizons.External.Modules
|
||||
/// </summary>
|
||||
public bool hasMapMarker;
|
||||
|
||||
/// <summary>
|
||||
/// Does this planet have a shock effect when the nearest star goes supernova?
|
||||
/// </summary>
|
||||
[DefaultValue(true)] public bool hasSupernovaShockEffect = true;
|
||||
|
||||
/// <summary>
|
||||
/// Can this planet survive entering a star?
|
||||
/// </summary>
|
||||
|
||||
28
NewHorizons/External/Modules/ShockEffectModule.cs
vendored
Normal file
28
NewHorizons/External/Modules/ShockEffectModule.cs
vendored
Normal file
@ -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
|
||||
{
|
||||
/// <summary>
|
||||
/// Does this planet have a shock effect when the nearest star goes supernova? Automatically disabled for stars, focal points, and stellar remnants.
|
||||
/// </summary>
|
||||
public bool hasSupernovaShockEffect = true;
|
||||
|
||||
/// <summary>
|
||||
/// Asset Bundle that contains the shock effect mesh
|
||||
/// </summary>
|
||||
public string assetBundle;
|
||||
|
||||
/// <summary>
|
||||
/// Path in the asset bundle that leads a replacement mesh for the planet's supernova shock effect
|
||||
/// </summary>
|
||||
public string meshPath;
|
||||
}
|
||||
}
|
||||
@ -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);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user