Example #1
0
        /// <summary>
        ///     This function fills in the details of the star.
        /// </summary>
        /// <param name="s">The star to be filled in</param>
        /// <param name="ourDice">The Ddice object used</param>
        /// <param name="maxMass">Max mass of the system</param>
        /// <param name="sysName">The name of the system</param>
        public static void GenerateAStar( Star s, Dice ourDice, double maxMass, string sysName )
        {
            //check mass first - if unset, set it.
            if (Math.Abs(s.CurrMass) < 0)
            {
                s.UpdateMass(s.OrderId == Star.IsPrimary ? RollStellarMass(ourDice, s.OrderId) : RollStellarMass(ourDice, s.OrderId, maxMass));
            }

            //if we are in the white dwarf branch, reroll mass.
            if (s.EvoLine.FindCurrentAgeGroup(s.StarAge) == StarAgeLine.RetCollaspedstar)
            {
                s.UpdateMass(ourDice.RollInRange(0.9, 1.4), true);
            }

            //set the generic name
            s.Name = Star.GenGenericName(sysName, s.OrderId);

            //initalize the luminosity first, then update it given the current age, status and mass.
            s.SetLumin();
            s.CurrLumin = Star.GetCurrLumin(s.EvoLine, s.StarAge, s.CurrMass);

            //determine the temperature
            s.EffTemp = Star.GetInitTemp(s.CurrMass);
            s.EffTemp = Star.GetCurrentTemp(s.EvoLine, s.CurrLumin, s.StarAge, s.CurrMass, ourDice);

            //DERIVED STATS: RADIUS, Spectral Type
            s.Radius = Star.GetRadius(s.CurrMass, s.EffTemp, s.CurrLumin, s.EvoLine.FindCurrentAgeGroup(s.StarAge));
            s.SetSpectralType();
            s.StarColor = Star.SetColor(ourDice, s.EffTemp);

            //set flare status.
            SetFlareStatus(s, ourDice);

            //end this here. We will hand orbital mechanics elsewhere.
        }
Example #2
0
        /// <summary>
        ///     Populates orbits around a star, according to GURPS 4e rules. (Does not create them)
        /// </summary>
        /// <param name="s">The star we're populating around</param>
        /// <param name="myDice">Our Ddice object.</param>
        public static void PopulateOrbits( Star s, Dice myDice )
        {
            const double maxRatio = 2.0;
            const double minRatio = 1.4;
            const double minDistance = .15;
            var firstGasGiant = !s.ContainsGasGiants();

            foreach (var sat in s.SysPlanets)
            {
                var roll = myDice.GurpsRoll();

                //set gas giants first.
                if (s.GasGiantFlag != Star.GasgiantNone)
                {
                    //BEFORE SNOW LINE: Only Eccentric, Epistellar
                    if (sat.OrbitalRadius < Star.SnowLine(s.InitLumin))
                    {
                        if (roll <= 8 && s.GasGiantFlag == Star.GasgiantEccentric)
                        {
                            sat.UpdateType(Satellite.BasetypeGasgiant);
                            UpdateGasGiantSize(sat, myDice.GurpsRoll() + 4);
                        }

                        if (roll <= 6 && s.GasGiantFlag == Star.GasgiantEpistellar)
                        {
                            sat.UpdateType(Satellite.BasetypeGasgiant);
                            UpdateGasGiantSize(sat, myDice.GurpsRoll() + 4);
                        }
                    }

                    //AFTER SNOW LINE: All three
                    if (sat.OrbitalRadius >= Star.SnowLine(s.InitLumin))
                    {
                        if (roll <= 15 && s.GasGiantFlag == Star.GasgiantConventional)
                        {
                            sat.UpdateType(Satellite.BasetypeGasgiant);
                            if (firstGasGiant)
                            {
                                UpdateGasGiantSize(sat, myDice.GurpsRoll() + 4);
                                firstGasGiant = false;
                            }
                            else
                            {
                                UpdateGasGiantSize(sat, myDice.GurpsRoll());
                            }
                        }

                        if (roll <= 14 && ( s.GasGiantFlag == Star.GasgiantEccentric || s.GasGiantFlag == Star.GasgiantEpistellar ))
                        {
                            sat.UpdateType(Satellite.BasetypeGasgiant);
                            if (firstGasGiant)
                            {
                                UpdateGasGiantSize(sat, myDice.GurpsRoll() + 4);
                                firstGasGiant = false;
                            }
                            else
                            {
                                UpdateGasGiantSize(sat, myDice.GurpsRoll());
                            }
                        }
                    }
                }

                //Done with the gas giant. Let's go start seeign what else it could be.

                //We can get mods now.
                if (sat.BaseType != Satellite.BasetypeGasgiant)
                {
                    //INNER AND OUTER RADIUS
                    var mod = 0;

                    if (sat.OrbitalRadius - minDistance <= Star.InnerRadius(s.InitLumin, s.InitMass) || sat.OrbitalRadius / Star.InnerRadius(s.InitLumin, s.InitMass) <= maxRatio)
                    {
                        mod = mod - 3;
                    }

                    if (sat.OrbitalRadius + minDistance >= Star.OuterRadius(s.InitMass) || Star.OuterRadius(s.InitMass) / sat.OrbitalRadius <= maxRatio)
                    {
                        mod = mod - 3;
                    }

                    //FORBIDDDEN ZONE
                    if (s.GetClosestDistToForbiddenZone(sat.OrbitalRadius) <= minDistance || ( s.GetClosestForbiddenZoneRatio(sat.OrbitalRadius) < maxRatio && s.GetClosestForbiddenZoneRatio(sat.OrbitalRadius) > minRatio ))
                    {
                        //MessageBox.Show("THE FORBIDDEN ZONE!!!!");
                        mod = mod - 6;
                    }

                    //GAS GIANT LOCATION
                    if (s.IsPrevSatelliteGasGiant(sat.OrbitalRadius))
                    {
                        mod = mod - 6;
                    }
                    if (s.IsNextSatelliteGasGiant(sat.OrbitalRadius))
                    {
                        mod = mod - 3;
                    }

                    //now let's get the orbit type.
                    // MessageBox.Show("Mod is " + mod);
                    mod = mod + myDice.GurpsRoll();
                    //MessageBox.Show("Mod + Roll is " + mod);
                    if (mod <= 3)
                    {
                        sat.UpdateType(Satellite.BasetypeEmpty);
                    }

                    if (mod >= 4 && mod <= 6)
                    {
                        sat.UpdateType(Satellite.BasetypeAsteroidbelt);

                        //Expanded Asteroid Belt options
                        if (OptionCont.ExpandAsteroidBelt != null && (bool) OptionCont.ExpandAsteroidBelt)
                        {
                            roll = myDice.GurpsRoll();
                            if (roll <= 6)
                            {
                                sat.UpdateSize(Satellite.SizeTiny);
                            }
                            if (roll >= 7 && roll <= 13)
                            {
                                sat.UpdateSize(Satellite.SizeSmall);
                            }
                            if (roll >= 14 && roll <= 15)
                            {
                                sat.UpdateSize(Satellite.SizeMedium);
                            }
                            if (roll >= 16)
                            {
                                sat.UpdateSize(Satellite.SizeLarge);
                            }
                        }

                        else
                        {
                            sat.UpdateSize(Satellite.SizeSmall);
                        }
                    }

                    if (mod >= 7 && mod <= 8)
                    {
                        sat.UpdateTypeSize(Satellite.BasetypeTerrestial, Satellite.SizeTiny);
                    }

                    if (mod >= 9 && mod <= 11)
                    {
                        sat.UpdateTypeSize(Satellite.BasetypeTerrestial, Satellite.SizeSmall);
                    }

                    if (mod >= 12 && mod <= 15)
                    {
                        sat.UpdateTypeSize(Satellite.BasetypeTerrestial, Satellite.SizeMedium);
                    }

                    if (mod >= 16)
                    {
                        sat.UpdateTypeSize(Satellite.BasetypeTerrestial, Satellite.SizeLarge);
                    }
                }
            }
        }
Example #3
0
        /// <summary>
        ///     This picks the gas giant flag for a star.
        /// </summary>
        /// <param name="myStar">The star we're setting for</param>
        /// <param name="roll">The Ddice roll</param>
        public static void GasGiantFlag( Star myStar, int roll )
        {
            //base set.
            int noGasGiant;
            int conGaGiant;
            int eccGaGiant;
            int epiGaGiant;

            if ((bool) !OptionCont.MoreConGasGiantChances)
            {
                noGasGiant = 10;
                conGaGiant = 12;
                eccGaGiant = 14;
                epiGaGiant = 18;
            }
            else
            {
                noGasGiant = 6;
                conGaGiant = 13;
                eccGaGiant = 15;
                epiGaGiant = 18;
            }

            if (roll <= noGasGiant)
            {
                myStar.GasGiantFlag = Star.GasgiantNone;
            }
            if (roll > noGasGiant && roll <= conGaGiant)
            {
                myStar.GasGiantFlag = Star.GasgiantConventional;
            }
            if (roll > conGaGiant && roll <= eccGaGiant)
            {
                myStar.GasGiantFlag = Star.GasgiantEccentric;
            }
            if (roll > eccGaGiant && roll <= epiGaGiant)
            {
                myStar.GasGiantFlag = Star.GasgiantEpistellar;
            }
        }
Example #4
0
        private static void CalcEccentricity( Dice ourDice, Star s )
        {
            var modifiers = 0; //reset the thing.

            if (OptionCont.LessStellarEccent)
            {
                //now we generate eccentricities
                if (s.OrbitalSep == Star.OrbsepVeryclose)
                {
                    modifiers = modifiers - 10; //Very Close
                }
                if (s.OrbitalSep == Star.OrbsepClose)
                {
                    modifiers = modifiers - 6; //Close
                }
                if (s.OrbitalSep == Star.OrbsepModerate)
                {
                    modifiers = modifiers - 2; //Moderate
                }
            }
            else
            {
                if (s.OrbitalSep == Star.OrbsepVeryclose)
                {
                    modifiers = modifiers - 6; //Very Close
                }
                if (s.OrbitalSep == Star.OrbsepClose)
                {
                    modifiers = modifiers - 4; //Close
                }
                if (s.OrbitalSep == Star.OrbsepModerate)
                {
                    modifiers = modifiers - 2; //Moderate
                }
            }

            var roll = ourDice.GurpsRoll(modifiers);
            Star.GenerateEccentricity(roll, s);

            if (OptionCont.ForceVeryLowStellarEccent)
            {
                if (s.OrbitalEccent > .2)
                {
                    s.OrbitalEccent = .1;
                }
                if (s.OrbitalEccent > .1 && s.OrbitalEccent < .2)
                {
                    s.OrbitalEccent = .05;
                }
            }
        }
Example #5
0
        /// <summary>
        ///     This sets the flare status of a star
        /// </summary>
        /// <param name="s">The star we're setting for</param>
        /// <param name="ourDice">The Ddice object we use.</param>
        public static void SetFlareStatus( Star s, Dice ourDice )
        {
            var roll = ourDice.GurpsRoll();
            var limit = 12;
            var massLimit = .45;

            if (OptionCont.AnyStarFlareStar)
            {
                massLimit = 11;
            }
            if (OptionCont.MoreFlareStarChance != null && (bool) OptionCont.MoreFlareStarChance)
            {
                limit = 9;
            }

            if (roll >= limit && s.CurrMass <= massLimit)
            {
                s.IsFlareStar = true;
            }
        }
Example #6
0
 public static void GenerateEccentricity( int roll, Star s )
 {
     //set the eccentricity
     if (roll <= 3)
     {
         s.OrbitalEccent = 0;
     }
     if (roll == 4)
     {
         s.OrbitalEccent = .1;
     }
     if (roll == 5)
     {
         s.OrbitalEccent = .2;
     }
     if (roll == 6)
     {
         s.OrbitalEccent = .3;
     }
     if (roll == 7 || roll == 8)
     {
         s.OrbitalEccent = .4;
     }
     if (roll >= 9 && roll <= 11)
     {
         s.OrbitalEccent = .5;
     }
     if (roll == 12 || roll == 13)
     {
         s.OrbitalEccent = .6;
     }
     if (roll == 14 || roll == 15)
     {
         s.OrbitalEccent = .7;
     }
     if (roll == 16)
     {
         s.OrbitalEccent = .8;
     }
     if (roll == 17)
     {
         s.OrbitalEccent = .9;
     }
     if (roll >= 18)
     {
         s.OrbitalEccent = .95;
     }
 }
Example #7
0
 public void AddStar( Star newStar )
 {
     SysStars.Add(newStar);
 }