Dump of #364 (Outside Room)

@create #6792 named outside room:outside room
@prop #364."dawn_msg" "The sun is rising over the bay." rc
@prop #364."night_msg" "In the southern skies, Mercury, Venus Mars and Jupiter form a spectacular display." rc
@prop #364."dusk_msg" "The sun falls rapidly out of sight behind the Los Altos Hills" rc
@prop #364."day_msg" "The sun is shining, the birds are singing." rc
@prop #364."outside_messages_enabled" 1 rc
;;#364.("enabled") = 1
;;#364.("residents") = {#102, #82, #259}
;;#364.("free_entry") = 0
"#364.("entrances") => E_PERM (Permission denied)
"#364.("exits") => E_PERM (Permission denied)
"#364.("key") => E_PERM (Permission denied)
;;#364.("aliases") = {"outside room"}
;;#364.("object_size") = {3898, 1141286558}

@verb #364:"description" this none this
@program #364:description
"This description returns the passed arguments, PLUS a message on the room which is selected according to where the sun is positioned.";
"If this.outside_messages_enabled == 0, it simply returns its parents arguments.";
"Modified Feb 3 1993, darkrider";
if (!this:is_outside())
  return pass(@args);
endif
"Do that funky outside messages thing.";
mess = this:time_of_day_msg();
foo = pass(@args);
if ((typeof(mess) != STR) || (mess == ""))
  return pass(@args);
elseif (typeof(foo) == LIST)
  return {@foo, mess};
else
  return (tostr(foo) + this.look_sep_msg) + mess;
endif
"quinn 17-oct-93 2040: put time-of-day stuff into a separate verb.";
.

@verb #364:"dawn_msg night_msg dusk_msg day_msg" this none this
@program #364:dawn_msg
return this.(verb);
.

@verb #364:"time_of_day_msg" this none this
@program #364:time_of_day_msg
":time_of_day_msg([NUM time])";
"-> Message reflecting the appearance of this room at the current time of day.";
time = args ? args[1] | time();
sun = this:sun(time);
if (sun < -1500)
  mess = this:night_msg();
elseif (sun > 1500)
  mess = this:day_msg();
elseif (tonum(ctime(time)[12..13]) < 12)
  "not a robust test, probably give the wrong answer in northern Norway for instance.";
  mess = this:dawn_msg();
else
  mess = this:dusk_msg();
endif
return mess;
"quinn 17-oct-93 2041: cut code from :description into this.";
.

@verb #364:"sun" this none this
@program #364:sun
":sun([NUM time]) -> Number representing the sun's position.";
"By default passes to $time_utils.  See that verb for formulae.";
return $time_utils:sun(@args);
"quinn 17-oct-93 2044: allow for specialised time-of-day reporting.";
.

@verb #364:"is_outside" this none this
@program #364:is_outside
":is_outside() -> Is the room non-enclosed, outdoors, exterior, etc...";
return this.outside_messages_enabled;
.

"***finished***