Replaced invulernableToSun to hasFluidDetector, document anglerfish behaviour (#830)

This commit is contained in:
xen-42 2024-10-03 00:10:51 -04:00
parent e793ce92cb
commit c9fa785ac6
4 changed files with 15 additions and 5 deletions

View File

@ -19,7 +19,7 @@ namespace NewHorizons.Builder.General
astroObject.isVanilla = isVanilla; astroObject.isVanilla = isVanilla;
astroObject.HideDisplayName = !config.MapMarker.enabled; astroObject.HideDisplayName = !config.MapMarker.enabled;
astroObject.invulnerableToSun = config.Base.invulnerableToSun; astroObject.invulnerableToSun = !config.Base.hasFluidDetector;
if (config.Orbit != null) astroObject.SetOrbitalParametersFromConfig(config.Orbit); if (config.Orbit != null) astroObject.SetOrbitalParametersFromConfig(config.Orbit);

View File

@ -90,7 +90,7 @@ namespace NewHorizons.Builder.General
OWRB.RegisterAttachedForceDetector(forceDetector); OWRB.RegisterAttachedForceDetector(forceDetector);
// For falling into sun // For falling into sun
if (!config.Base.invulnerableToSun && config.Star == null && config.FocalPoint == null) if (config.Base.hasFluidDetector && config.Star == null && config.FocalPoint == null)
{ {
detectorGO.layer = Layer.AdvancedDetector; detectorGO.layer = Layer.AdvancedDetector;

View File

@ -281,7 +281,7 @@ namespace NewHorizons.External.Configs
} }
// Stars and focal points shouldnt be destroyed by stars // Stars and focal points shouldnt be destroyed by stars
if (Star != null || FocalPoint != null) Base.invulnerableToSun = true; if (Star != null || FocalPoint != null) Base.hasFluidDetector = false;
} }
public void Migrate() public void Migrate()
@ -664,6 +664,11 @@ namespace NewHorizons.External.Configs
if (destructionVolume.onlyAffectsPlayerAndShip) destructionVolume.onlyAffectsPlayerRelatedBodies = true; if (destructionVolume.onlyAffectsPlayerAndShip) destructionVolume.onlyAffectsPlayerRelatedBodies = true;
} }
} }
if (Base.invulnerableToSun)
{
Base.hasFluidDetector = false;
}
} }
#endregion #endregion
} }

View File

@ -37,9 +37,11 @@ namespace NewHorizons.External.Modules
public float groundSize; public float groundSize;
/// <summary> /// <summary>
/// Can this planet survive entering a star? /// Is this planet able to detect fluid volumes? Disabling this means that entering a star or lava volume will not destroy this planet
/// May have adverse effects if anglerfish are added to this planet, disable this if you want those to work (they have fluid volumes in their mouths)
/// </summary> /// </summary>
public bool invulnerableToSun; [DefaultValue(true)]
public bool hasFluidDetector = true;
/// <summary> /// <summary>
/// Do we show the minimap when walking around this planet? /// Do we show the minimap when walking around this planet?
@ -84,6 +86,9 @@ namespace NewHorizons.External.Modules
#region Obsolete #region Obsolete
[Obsolete("invulnerableToSun is deprecated, please use hasFluidDetector instead")]
public bool invulnerableToSun;
[Obsolete("IsSatellite is deprecated, please use ShowMinimap instead")] [Obsolete("IsSatellite is deprecated, please use ShowMinimap instead")]
public bool isSatellite; public bool isSatellite;