Lunar Disturbances API - Sakorona/SDVMods GitHub Wiki

API Documentation

This is the API signature for Lunar Disturbances

    public interface ILunarDisturbancesAPI
    {
        string GetCurrentMoonPhase();
        string GetPlainCurrMoonPhase();
        bool IsSolarEclipse();
        int GetMoonRise();
        int GetMoonSet();
        bool IsMoonUp(int time);
        int GetCycleLength();
        float GetBrightnessQuotient();
        int GetMoonZenith();
        float GetTrackPosition();
        float AlterEclipseOdds();
        void ForceEclipse();
        void ForceEclipseTomorrow();
        bool IsEclipseTomorrow();
    }

Functions

GetCurrentMoonPhase

No Parameters

Returns a string of the current phase. This is the description (so localization friendly) one.

GetPlainCurrMoonPhase

No Parameters (added 1.1.2)

Returns a string of the current phase. This returns phases dependent on the phase: Valid Returns: "NewMoon","FullMoon","FirstQuarter","ThirdQuarter","WaningCrescent","WaningGibbous","WaxingGibbous","WaxingCrescent","ErrorMoon" and "ErrorPhase"

(From 1.2.2+) "BlueMoon","HarvestMoon","SpiritsMoon","BloodMoon"

IsSolarEclipse

No Parameters

Returns a bool describing the solar eclipse status (So if you need to do compatiblity or want to run other events, etc.)

GetMoonRise

No Parameters

Will return the time the moon rises for the current in-game day.

GetMoonSet

No Parameters

Will return the time the moon sets for the current in-game day.

IsMoonUp

int time - This should be the same format as the game uses internally (e.g 930, 1610 or 2620)

This will determine if the moon is up in the time zone

GetCycleLength

Added 1.3

This returns the length of the current cycle.

GetBrightnessQuotient

This returns a brightness amount relative to a full moon.

  • Blood Moon, Blue Moon: 200%
  • Harvest Moon: 155%
  • Spirit's Moon: 115%
  • Full Moon: 100%
  • Waning/Waxing Gibbous: 65%
  • Third Quarter, First Quarter: 50%
  • Waning/Waxing Gibbous: 15%
  • New Moon: 2%

GetMoonZenith

This returns the time the moon is at it's zenith

GetTrackPosition

This gets the position on the moon track per the day

AlterEclipseOdds

This alters the eclipse odds. Note: this is not reset while the mod is running.

ForceEclipse

This forces the eclipse on the current day

ForceEclipseTomorrow

This forces the eclipse on the next day

IsEclipseTomorrow

This will return true if there is an eclipse tomorrow.