using System; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Runtime.Serialization; using NewHorizons.Utility; using Newtonsoft.Json; using Newtonsoft.Json.Converters; namespace NewHorizons.External.Modules.VariableSize { [JsonObject] public class StarModule : VariableSizeModule { /// /// Colour of the star at the end of its lifespan. /// public MColor endTint; /// /// Should this star explode at the end of its lifespan? /// [Obsolete("goSupernova is deprecated, please use stellarDeathType instead")] [DefaultValue(true)] public bool goSupernova = true; /// /// How long in minutes this star will last until it supernovas. /// [DefaultValue(22f)] public float lifespan = 22f; /// /// Should we add a star controller to this body? If you want clouds to work on a binary brown dwarf system, set this to false. /// [DefaultValue(true)] public bool hasStarController = true; /// /// The default sun has its own atmosphere that is different from regular planets. If you want that, set this to /// `true`. /// [DefaultValue(true)] public bool hasAtmosphere = true; /// /// Colour of the light given off. Defaults to yellowish. /// public MColor lightTint; /// /// Radius of the star. /// [DefaultValue(2000f)] [Range(0f, double.MaxValue)] public float size = 2000f; /// /// Relative strength of the light compared to the sun. /// [DefaultValue(1f)] [Range(0f, double.MaxValue)] public float solarLuminosity = 1f; /// /// Radius of the supernova. Any planets within this will be destroyed. /// [DefaultValue(50000f)] [Range(0f, double.MaxValue)] public float supernovaSize = 50000f; /// /// Speed of the supernova wall in meters per second. /// [DefaultValue(1000f)] [Range(1f, double.MaxValue)] public float supernovaSpeed = 1000f; /// /// The tint of the supernova this star creates when it dies. /// public MColor supernovaTint; /// /// Colour of the star. /// public MColor tint; /// /// Path to the texture to put as the star ramp. Optional. /// public string starRampTexture; /// /// Path to the texture to put as the star ramp while it is collapsing. Optional. /// public string starCollapseRampTexture; /// /// How far the light from the star can reach. /// [DefaultValue(50000f)] [Range(0f, double.MaxValue)] public float lightRadius = 50000f; /// /// The type of death your star will have. /// [DefaultValue("default")] public StellarDeathType stellarDeathType = StellarDeathType.Default; /// /// The type of stellar remnant your star will leave behind. /// [DefaultValue("default")] public StellarRemnantType stellarRemnantType = StellarRemnantType.Default; } [JsonConverter(typeof(StringEnumConverter))] public enum StellarDeathType { [EnumMember(Value = @"default")] Default, [EnumMember(Value = @"none")] None, [EnumMember(Value = @"planetaryNebula")] PlanetaryNebula, [EnumMember(Value = @"supernova")] Supernova } [JsonConverter(typeof(StringEnumConverter))] public enum StellarRemnantType { [EnumMember(Value = @"default")] Default, [EnumMember(Value = @"whiteDwarf")] WhiteDwarf, [EnumMember(Value = @"neutronStar")] NeutronStar, [EnumMember(Value = @"pulsar")] Pulsar, [EnumMember(Value = @"blackHole")] BlackHole, [EnumMember(Value = @"custom")] Custom } }