using System.Runtime.Serialization; using NewHorizons.Utility; using Newtonsoft.Json; using System.ComponentModel; using UnityEngine.Internal; namespace NewHorizons.External.Modules { public enum GravityFallOff { [EnumMember(Value = @"linear")] Linear = 0, [EnumMember(Value = @"inverseSquared")] InverseSquared = 1 } [JsonObject] public class BaseModule { /// /// If the body should have a marker on the map screen. /// public bool HasMapMarker; /// /// The intensity of light the dark side of the body should have. Timber Hearth has `1.4` for reference /// public float AmbientLight; /// /// The acceleration due to gravity felt as the surfaceSize. Timber Hearth has 12 for reference /// public float SurfaceGravity; /// /// How gravity falls off with distance. Most planets use linear but the sun and some moons use inverseSquared. /// [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public GravityFallOff GravityFallOff = GravityFallOff.Linear; /// /// A scale height used for a number of things. Should be the approximate radius of the body. /// public float SurfaceSize; /// /// An override for the radius of the planet's gravitational sphere of influence. Optional /// public float SphereOfInfluence; /// /// Radius of a simple sphere used as the ground for the planet. If you want to use more complex terrain, leave this as 0. /// public float GroundSize; /// /// If you want the body to have a tail like the Interloper. /// public bool HasCometTail; /// /// If it has a comet tail, it'll be oriented according to these Euler angles. /// public MVector3 CometTailRotation; /// /// Allows the object to be targeted on the map. /// [DefaultValue(true)] public bool HasReferenceFrame = true; /// /// Set this to true if you are replacing the sun with a different body. Only one object in a star system should ever have this set to true. /// public bool CenterOfSolarSystem = false; /// /// Radius of the cloaking field around the planet. It's a bit finicky so experiment with different values. If you don't want a cloak, leave this as 0. /// public float CloakRadius = 0f; /// /// Can this planet survive entering a star? /// public bool InvulnerableToSun; /// /// Do we show the minimap when walking around this planet? /// [DefaultValue(true)] public bool ShowMinimap = true; #region Obsolete [System.Obsolete("IsSatellite is deprecated, please use ShowMinimap instead")] public bool IsSatellite; [System.Obsolete("BlackHoleSize is deprecated, please use SingularityModule instead")] public float BlackHoleSize; [System.Obsolete("LavaSize is deprecated, please use LavaModule instead")] public float LavaSize; [System.Obsolete("WaterTint is deprecated, please use WaterModule instead")] public float WaterSize; [System.Obsolete("WaterTint is deprecated, please use WaterModule instead")] public MColor WaterTint; [System.Obsolete("HasAmbientLight is deprecated, please use AmbientLight instead")] public bool HasAmbientLight; #endregion Obsolete } }