Exemplo n.º 1
0
        public override void Randomize()
        {
            if (Hyperdrive.seedString == AstroUtils.KERBIN_SYSTEM_COORDS)
            {
                return;
            }
            float value = WarpRNG.GetValue();

            // Atmosphere has a 75% chance of being generated if we are a planet
            // Atmosphere has a 10% chance of being generated if we are a moon
            if (value >= 0.25f && AstroUtils.IsSun(planetData.referenceBody) || value <= 0.1f)
            {
                hasAtmosphere = true;
            }
            if (hasAtmosphere)
            {
                value = WarpRNG.GetValue();
                // 10% chance if atmosphere the atmosphere has oxygen
                if (value >= 0.9f)
                {
                    hasOxygen = true;
                }
                atmosphereHeight       = WarpRNG.GenerateFloat(0.5f, 15.0f);
                atmospherePressureMult = WarpRNG.GenerateFloat(0.1f, 15.0f);
                ambientColor           = new Color(WarpRNG.GetValue() * 0.25f, WarpRNG.GetValue() * 0.25f, WarpRNG.GetValue() * 0.25f);
            }
            // Temperature measured by distance from sun
            if (!IsSun())
            {
                double orbitHeight = planetData.semiMajorAxis / AstroUtils.MAX_SEMI_MAJOR_AXIS;
                double inverseMult = 1.0 - orbitHeight;
                tempMultiplier = 5.0f * (float)inverseMult;
            }
        }
 public bool IsSun()
 {
     return(AstroUtils.IsSun(planet));
 }