using System; using System.ComponentModel; using System.Runtime.Serialization; using NewHorizons.Utility; using Newtonsoft.Json; using Newtonsoft.Json.Converters; namespace NewHorizons.External.Modules { [JsonConverter(typeof(StringEnumConverter))] public enum GravityFallOff { [EnumMember(Value = @"linear")] Linear = 0, [EnumMember(Value = @"inverseSquared")] InverseSquared = 1 } [JsonObject] public class BaseModule { /// /// The intensity of light the dark side of the body should have. Timber Hearth has `1.4` for reference /// public float ambientLight; /// /// 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; /// /// If it has a comet tail, it'll be oriented according to these Euler angles. /// public MVector3 cometTailRotation; /// /// How gravity falls off with distance. Most planets use linear but the sun and some moons use inverseSquared. /// [DefaultValue("linear")] public GravityFallOff gravityFallOff = GravityFallOff.Linear; /// /// 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 the body should have a marker on the map screen. /// public bool hasMapMarker; /// /// 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; /// /// An override for the radius of the planet's gravitational sphere of influence. Optional /// public float soiOverride; /// /// The acceleration due to gravity felt as the surfaceSize. Timber Hearth has 12 for reference /// public float surfaceGravity; /// /// A scale height used for a number of things. Should be the approximate radius of the body. /// public float surfaceSize; /// /// Radius of the zero gravity volume. This will make it so no gravity from any planet will affect you. Useful for satellites. /// public float zeroGravityRadius; /// /// Optional. You can force this planet's gravity to be felt over other gravity/zero-gravity sources by increasing this number. /// public int gravityVolumePriority; #region Obsolete [Obsolete("IsSatellite is deprecated, please use ShowMinimap instead")] public bool isSatellite; [Obsolete("BlackHoleSize is deprecated, please use SingularityModule instead")] public float blackHoleSize; [Obsolete("LavaSize is deprecated, please use LavaModule instead")] public float lavaSize; [Obsolete("WaterTint is deprecated, please use WaterModule instead")] public float waterSize; [Obsolete("WaterTint is deprecated, please use WaterModule instead")] public MColor waterTint; [Obsolete("HasAmbientLight is deprecated, please use AmbientLight instead")] public bool hasAmbientLight; [Obsolete("HasReferenceFrame is deprecated, please use ReferenceModule instead")] [DefaultValue(true)] public bool hasReferenceFrame = true; [Obsolete("CloakRadius is deprecated, please use CloakModule instead")] public float cloakRadius; [Obsolete("SphereOfInfluence is deprecated, please use soiOverride instead")] public float sphereOfInfluence; #endregion Obsolete } }