Ejemplo n.º 1
0
        public Weather(System.Random random)
        {
            Sol = 0;
            WeatherVariables vars = new WeatherVariables(random);

            DustIntensity = vars.Chaos / 100f;
            Coverage      = DustIntensity.FromFloat();
            Narrative     = WeatherNarrative.None;
        }
Ejemplo n.º 2
0
        public Weather(System.Random random, Weather previousDay)
        {
            Sol = previousDay.Sol + 1;
            WeatherVariables vars = new WeatherVariables(random);

            //0 means completely new number, 100 means same weather as yesterday
            int sameness = vars.PreviousSystemInertia + vars.Chaos;

            sameness = Math.Max(sameness, 0);
            sameness = Math.Min(sameness, 100);

            DustIntensity = Mathf.Lerp(vars.DustPercentageNumerator / 100f, previousDay.DustIntensity, sameness / 100f);
            Coverage      = DustIntensity.FromFloat();

            if (previousDay.DustIntensity <= .25f && DustIntensity > .75f)
            {
                Narrative = WeatherNarrative.SuddenStorm;
            }
            else if (previousDay.DustIntensity > .75f && DustIntensity < .25f)
            {
                Narrative = WeatherNarrative.SuddenClear;
            }
            else if (previousDay.Coverage == Coverage)
            {
                Narrative = WeatherNarrative.MoreOfSame;
            }
            else if (previousDay.DustIntensity < DustIntensity)
            {
                Narrative = WeatherNarrative.DarkerSkies;
            }
            else if (previousDay.DustIntensity > DustIntensity)
            {
                Narrative = WeatherNarrative.LighterSkies;
            }
            else
            {
                Narrative = WeatherNarrative.None;
            }
        }