mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
If smaller than 1000 don't explode by default
This commit is contained in:
parent
6da2425809
commit
a447b80307
@ -11,8 +11,15 @@ namespace NewHorizons.Builder.Body
|
||||
{
|
||||
public static class StellarRemnantBuilder
|
||||
{
|
||||
public const float whiteDwarfSize = 1000;
|
||||
public const float neutronStarSize = 2000;
|
||||
public const float blackholeSize = 4000;
|
||||
|
||||
public static GameObject Make(GameObject go, OWRigidbody rb, float soi, IModBehaviour mod, NewHorizonsBody star)
|
||||
{
|
||||
var remnantType = star.Config.Star.stellarRemnantType;
|
||||
if (remnantType == StellarRemnantType.Default && star.Config.Star.size < whiteDwarfSize) return null;
|
||||
|
||||
try
|
||||
{
|
||||
Logger.Log($"Creating stellar remnant for [{star.Config.name}]");
|
||||
@ -22,8 +29,6 @@ namespace NewHorizons.Builder.Body
|
||||
|
||||
sector.gameObject.SetActive(false);
|
||||
|
||||
var remnantType = star.Config.Star.stellarRemnantType;
|
||||
|
||||
if (remnantType == StellarRemnantType.Default) remnantType = GetDefault(star.Config.Star.size);
|
||||
|
||||
switch (remnantType)
|
||||
@ -60,8 +65,8 @@ namespace NewHorizons.Builder.Body
|
||||
|
||||
private static StellarRemnantType GetDefault(float progenitorSize)
|
||||
{
|
||||
if (progenitorSize >= 4000) return StellarRemnantType.BlackHole;
|
||||
else if (2000 < progenitorSize && progenitorSize < 4000) return StellarRemnantType.NeutronStar;
|
||||
if (progenitorSize >= blackholeSize) return StellarRemnantType.BlackHole;
|
||||
else if (neutronStarSize < progenitorSize && progenitorSize < blackholeSize) return StellarRemnantType.NeutronStar;
|
||||
else return StellarRemnantType.WhiteDwarf;
|
||||
}
|
||||
|
||||
|
||||
@ -511,9 +511,16 @@ namespace NewHorizons.Handlers
|
||||
remnantGO = StellarRemnantBuilder.Make(go, rb, sphereOfInfluence, body.Mod, body);
|
||||
}
|
||||
|
||||
if (remnantGO != null)
|
||||
{
|
||||
remnantGO.SetActive(false);
|
||||
starEvolutionController.SetStellarRemnant(remnantGO);
|
||||
}
|
||||
else
|
||||
{
|
||||
starEvolutionController.willExplode = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (body.Config?.Bramble != null)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user