mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Make planets die in stars
This commit is contained in:
parent
9e05f5a49e
commit
ff04a5d7b6
@ -13,7 +13,7 @@ namespace NewHorizons.Builder.General
|
|||||||
{
|
{
|
||||||
static class DetectorBuilder
|
static class DetectorBuilder
|
||||||
{
|
{
|
||||||
public static GameObject Make(GameObject body, OWRigidbody OWRB, AstroObject primaryBody, AstroObject astroObject, bool inherit = true)
|
public static GameObject Make(GameObject body, OWRigidbody OWRB, AstroObject primaryBody, AstroObject astroObject, bool inherit, bool destroyedBySun)
|
||||||
{
|
{
|
||||||
GameObject detectorGO = new GameObject("FieldDetector");
|
GameObject detectorGO = new GameObject("FieldDetector");
|
||||||
detectorGO.SetActive(false);
|
detectorGO.SetActive(false);
|
||||||
@ -25,6 +25,13 @@ namespace NewHorizons.Builder.General
|
|||||||
forceDetector.SetValue("_inheritElement0", inherit);
|
forceDetector.SetValue("_inheritElement0", inherit);
|
||||||
OWRB.RegisterAttachedForceDetector(forceDetector);
|
OWRB.RegisterAttachedForceDetector(forceDetector);
|
||||||
|
|
||||||
|
// For falling into sun
|
||||||
|
if(destroyedBySun)
|
||||||
|
{
|
||||||
|
var fluidDetector = detectorGO.AddComponent<DynamicFluidDetector>();
|
||||||
|
// Could copy the splash from the interloper
|
||||||
|
}
|
||||||
|
|
||||||
GravityVolume parentGravityVolume = primaryBody?.GetAttachedOWRigidbody()?.GetAttachedGravityVolume();
|
GravityVolume parentGravityVolume = primaryBody?.GetAttachedOWRigidbody()?.GetAttachedGravityVolume();
|
||||||
if (parentGravityVolume != null)
|
if (parentGravityVolume != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -80,7 +80,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
StreamingManager.LoadStreamingAssets(child.assetBundle);
|
StreamingManager.LoadStreamingAssets(child.assetBundle);
|
||||||
}
|
}
|
||||||
|
|
||||||
var detectorGO = DetectorBuilder.Make(raftObject, owRigidBody, ao, null, false);
|
var detectorGO = DetectorBuilder.Make(raftObject, owRigidBody, ao, null, false, false);
|
||||||
var fluidDetector = detectorGO.AddComponent<DynamicFluidDetector>();
|
var fluidDetector = detectorGO.AddComponent<DynamicFluidDetector>();
|
||||||
Main.Instance.ModHelper.Events.Unity.FireOnNextUpdate(() => fluidDetector._activeVolumes = new EffectVolume[] { body.GetComponentInChildren<RadialFluidVolume>() }.ToList());
|
Main.Instance.ModHelper.Events.Unity.FireOnNextUpdate(() => fluidDetector._activeVolumes = new EffectVolume[] { body.GetComponentInChildren<RadialFluidVolume>() }.ToList());
|
||||||
|
|
||||||
|
|||||||
@ -14,7 +14,7 @@ namespace NewHorizons.Components
|
|||||||
{
|
{
|
||||||
var detector = base.transform.GetComponentInChildren<DynamicForceDetector>();
|
var detector = base.transform.GetComponentInChildren<DynamicForceDetector>();
|
||||||
var ao = base.GetComponent<AstroObject>();
|
var ao = base.GetComponent<AstroObject>();
|
||||||
var newDetector = DetectorBuilder.Make(base.gameObject, ao.GetAttachedOWRigidbody(), ao.GetPrimaryBody(), ao);
|
var newDetector = DetectorBuilder.Make(base.gameObject, ao.GetAttachedOWRigidbody(), ao.GetPrimaryBody(), ao, true, false);
|
||||||
newDetector.transform.parent = detector.transform.parent;
|
newDetector.transform.parent = detector.transform.parent;
|
||||||
GameObject.Destroy(detector);
|
GameObject.Destroy(detector);
|
||||||
}
|
}
|
||||||
|
|||||||
1
NewHorizons/External/BaseModule.cs
vendored
1
NewHorizons/External/BaseModule.cs
vendored
@ -22,6 +22,7 @@ namespace NewHorizons.External
|
|||||||
public bool CenterOfSolarSystem { get; set; } = false;
|
public bool CenterOfSolarSystem { get; set; } = false;
|
||||||
public bool IsSatellite { get; set; }
|
public bool IsSatellite { get; set; }
|
||||||
public float CloakRadius { get; set; } = 0f;
|
public float CloakRadius { get; set; } = 0f;
|
||||||
|
public bool InvulnerableToSun { get; set; }
|
||||||
|
|
||||||
// Old, see SingularityModule instead
|
// Old, see SingularityModule instead
|
||||||
public float BlackHoleSize { get; set; }
|
public float BlackHoleSize { get; set; }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user