Esempio n. 1
0
        /// <summary>
        /// This function returns the lunar phase for an arbitary day.
        /// </summary>
        /// <param name="Today">The day you are examining for.</param>
        /// <returns></returns>
        public static MoonPhase GetLunarPhaseForDay(SDate Today)
        {
            //divide it by the cycle.
            int currentCycle = (int)Math.Floor(Today.DaysSinceStart / (double)cycleLength);
            int currentDay   = GetDayOfCycle(Today);

            return(SDVMoon.GetLunarPhase(currentDay));
        }
Esempio n. 2
0
        public MoonPhase GetLunarPhase()
        {
            //divide it by the cycle.
            int currentCycle = (int)Math.Floor(SDate.Now().DaysSinceStart / (double)cycleLength);
            int currentDay   = GetDayOfCycle(SDate.Now());

            MoonPhase ret = SDVMoon.GetLunarPhase(currentDay);

            if (ret == MoonPhase.FullMoon)
            {
                if (Dice.NextDoublePositive() <= ModConfig.BadMoonRising)
                {
                    return(MoonPhase.BloodMoon);
                }
            }

            return(ret);
        }