From the NannyMUD documentation

LAST CHANGE

2000-12-09

NAME

        time_room - A room with time functionality.

INHERITS

        /std/room

FUNCTIONS

SETUP FUNCTIONS

        set_weather
        set_long
        add_item

OTHER FUNCTIONS

        timed_new_hour_hook
        timed_new_part_of_day_hook

QUERY FUNCTIONS

        query_moonlight
        query_constellations
        query_weather
        query_temperature

PROPERTIES

INTERNAL PROPERTIES


PROPERTY NAME

        atmosphere - Set sky conditions.

DESCRIPTION

        This property is used to set the condition of the sky in a
        room.  Valid values are:
        "clear"    - No clouds.  Rain is not possible. DEFAULT.
        "cloudy"   - Some clouds.  A light sprinkle is possible.
        "overcast" - Many clouds.  A drizzle is possible.
        "stormy"   - Very many clouds.  A downpour is possible.

SEE ALSO

        dark_stormy_nights in std/room/time_room

PROPERTY NAME

        windspeed - 

DESCRIPTION

        This property is used to set the wind speed.  Valid values
        are:
        "still"   - No wind. (DEFAULT)
        "breeze"  - Usually pleasant.
        "gusty"   - Pleasant or miserable, usually depending on season.
        "typhoon" - Very very hard, and very very rare.

PROPERTY NAME

        rainfall - Amount of rain.

DESCRIPTION

        Used to set the amount of rain (or snow, if winter) falling.
        Valid values:
        "none"       DEFAULT.
        "sprinkle" - Must be at least cloudy.
        "drizzle"  - Must be at least overcast.
        "downpour" - Must be stormy.

NOTE

        If a greater rainfall value is set than the current cloud cover
        can handle, the maximum amount of rainfall possible for that
        cloud cover will be used.

PROPERTY NAME

        sun_string - used to replace default description.

PROPERTY NAME

        moon_string - used to replace default description.

PROPERTY NAME

        sky_string - used to replace default description.

PROPERTY NAME

        stars_string - used to replace default description.

PROPERTY NAME

        wind_string - used to replace default description.

PROPERTY NAME

        rain_string - used to replace default description.

PROPERTY NAME

        sunrise_string - used to replace default description.

PROPERTY NAME

        sunset_string - used to replace default description.

PROPERTY NAME

        hide_weather_change - Hide weather changes.

DESCRIPTION

        Set this property to inhibit echo messages in the room when
        the weather changes.

PROPERTY NAME

        dark_stormy_nights - Make stormy give dark nights.

DESCRIPTION

        If a room is "stormy", then it will be dark at night.  Set this
        property if you want this to happen.

NOTE

        The default add_item descriptions are varied enough that, even
        by never replacing them, they should avoid redundancy in a
        range of areas.  This results in very large descriptive functions.
        Future hackers to this object's code are encouraged to add to
        (and change where absolutely necessary) the list.

NOTE

        Certain property settings MAY result in silly and/or ambiguous
        default add_item descriptions.  The emphasis here is for the
        coding wizard to be consistent when they assign properties to
        a room.  Hopefully, many of these have been accounted for, but
        the possibility remains.

NOTE

        All functions within this object reference NannyTime, and not
        the absolute time ("real-life" fabrication).

DESCRIPTION

        The time room is an inheritable room object for easy NannyTime
        functionality and weather control.

        The time daemon is nice, but possibly not the easiest for a
        newbie wizard to use.  Not only does this room allow sensible
        access to commonly-used timed functions, it also adds default
        add_item descriptions for the sky, sun, moon, wind, rain/snow,
        and stars.  These descriptions can be (and are encouraged to be)
        replaced by setting properties in the room.

	FOR THE HARDCORE REALIST
        The idea behind the way I would handle the weather in my area
        is as follows, for a typical temperate zone:
 
        Temperature only typically changes when the sun sets and rises,
        and is also usually dependent on the season.  Changes in
        temperature tend to effect changes in wind direction and speed.

        Wind speed therefore changes MOST when the sun sets and rises,
        but still CAN change every hour or day_part, though not as likely
        nor severely.  Wind speed effects changes in the clouds.

        Cloud cover can only change if there is wind, depending perhaps,
        though not necessarily, on the strength and direction of the
        wind.  Cloud cover affects the potential for rainfall.

        Rainfall just follows naturally, at appropriate randomness or
        whim of the wizard, capable of changing all the time within
        the bounds of cloud cover.

        I would also throw in exceptional cases for individual seasons,
        such as more rain in the spring, or more wind in the fall.

        In the context of an entire area, one could imagine writing a
        daemon to control all the weather for the area, keeping track
        of temperature gradients, wind directions, cloud and rain
        movements, and all that goes with it, to form a cohesive weather
        system that moves over the entire area.

SEE ALSO

        timed in daemon/timed

FUNCTION


NAME

        set_weater - Shortcut for setting weather proeprties.

SYNTAX

        varargs void set_weather(mixed prop1 [,
                                 string prop2,string prop3,string prop4])

DESCRIPTION

        This is a shortcut function for setting the weather properties
        in a room.  Up to four properties can be set, but only one is
        required.  The arguments can be temperature (warm, cold, arid,
        clammy, temperate), atmosphere value, windspeed value, and/or
        the rainfall value.  If the weather is changed by this function,
        the room will echo the change unless the "hide_weather_change"
        property is set.  Alternatively, an array of weather values
        can be sent as the first argument.  The other arguments will
        then be discarded.

        If you use this function to set your rainfall, then your
        rainfall value will always fall within the bounds of the
        atmosphere, and you won't need to check both properties when
        determining rainfall.

        Using it to set temperature will automatically remove all other
        conflicting temperature values.

EXAMPLE

        set_weather("@get_clouds()","@get_rain()","warm","breeze");

EXAMPLE

        set_weather("cloudy","downpour");

        The last example will set rainfall to "sprinkle", since that's
        the most it can do when it's "cloudy".

NOTE

        set_weather("@room->query_weather()"); will NOT work, as eval()
        doesn't seem to handle it correctly.

NOTE

        No matter what order the arguments are sent in, they are always
        processed in this order:

        1. Temperature properties
        2. Windspeed
        3. Atmosphere
        4. Rainfall

        While this function always sets the appropriate properties,
        the reverse is NOT true.

SEE ALSO

        query_weather in std/room/time_room

SEE ALSO

        query_temperature in std/room/time_room

SEE ALSO

        hide_weather_change in std/room/time_room

SEE ALSO

        atmosphere in std/room/time_room

SEE ALSO

        windspeed in std/room/time_room

SEE ALSO

        rainfall in std/room/time_room

FUNCTION


NAME

        set_long - Set the long description.

SYNTAX

        varargs void set_long(string long [,string function,mixed value])

DESCRIPTION

        This is a backwards-compatible function analogous to the normal
        set_long(), except it contains extra arguments that can be set to
        specify when to set the description.

        The function "function" is called every hour by the room.  If the
        result of that function matches "value" (value can be anything),
        then the longdesc will be changed.  Note that this has uses beyond
        typical time-dependent changes.

EXAMPLE

        set_long("It's daytime.","@query_daytime()",1);
        set_long("It's nighttime.");

        This changes the desc to "It's daytime." as long as query_daytime()
        is 1, otherwise it defaults to "It's nighttime."

EXAMPLE

 
        set_long("This is a room.","@change_desc()");

        This will simply run the "change_desc" function every hour,
        with no changes to the longdesc.

        set_long("It's not summer.","@query_season()",
                ({ "winter","fall","spring" }));

NOTE

        Remember that query_season() will return "fall" and NOT "autumn".

FUNCTION


NAME

        add_item - Add an item description.

SYNTAX

        varargs void add_item(mixed item,string desc [,string function,
                                                       mixed value])

DESCRIPTION

        This is another backwards-compatible function.  It allows items
        to be automatically added and removed every hour or more.  If
        "function" does not return "value", then that item will be
        removed.  If it does, then it will be added.  Otherwise it works
        the same as set_long().

SEE ALSO

        set_long in lfun/basic/set_long
        set_long in std/basic/basic
        set_long in std/room/time_room

SEE ALSO

        basic in std/basic/basic

FUNCTION


NAME

        timed_new_hour_hook - Internal function.

DESCRIPTION

        This is an internal function, used to handle the change of
        temporal descriptions. It is incorporated here for
        completeness.

FUNCTION


NAME

        timed_new_part_of_day_hook - Internal function.

DESCRIPTION

        This is an internal function, used to handle the change of
        temporal descriptions. It is incorporated here for
        completeness.

FUNCTION


NAME

        query_moonlight - Is there moonlight?

SYNTAX

        status query_moonlight()

DESCRIPTION

        Returns true if: query_night() == 1
                    and: query_moon() == 1
                    and: query_property("atmosphere") != "stormy"
                    and: query_property("atmosphere") != "overcast"

FUNCTION


NAME

        query_constellations - Briefly describe current constellations.

SYNTAX

        varargs string query_constellations(int description)

DESCRIPTION

        In sync with the months, constellations pass over Nanny.
        If description is 1, this function returns a brief
        description of all visible constellations.  If description
        is 2, it returns the actual star formations.  Otherwise it
        returns the names of all visible constellations.

EXAMPLE

        For a given month,
        query_constellations() returns
          "Padrone, Mats, and Qqqq"
        query_constellations(1) returns
          "Padrone, the Wizard of Law and Balance, Mats, the Creator, and " +
          "Qqqq, the God of Banishment"

FUNCTION


NAME

        query_weather - Return specified weathers.

SYNTAX

        string *query_weather()

DESCRIPTION

        Returns an array of the weather as specified with set_weather.
        It may NOT be accurate if the weather was set with
        add_property().

        query_weather()[0] is temperature
        query_weather()[1] is windspeed
        query_weather()[2] is atmosphere
        query_weather()[3] is rainfall

FUNCTION


NAME

        query_temperature - Return specified temperatures.

SYNTAX

        string query_temperature()

DESCRIPTION

        Returns the temperature in the room.  Like query_weather(), it
        may NOT be accurate if the temperature wasn't changed with
        set_weather().