Generic Post-Apocalypse Room (#110)

(an instance of Generic Ambient Noise Room made by Calkins)

     It is raining this day in Bellona.

[Citation: ]

Go to location of this object, wooden box.


HELP MANUAL:
     The Generic Post-Apocalypse Room Class (PARC) allows room descriptions and details 
to depend on the time of day and the weather.  It has eight settable messages:
     
      day_msg       - substituted for day in the room description
                      during the hours of 9am to 6pm.
      evening_msg   - substituted for day from 6pm to 9pm.
      night_msg     - substituted for day from 9pm to 6am.
      morning_msg   - substituted for day from 6am to 9am.
     
      cool_msg      - substituted for raining in the room description
                      when the weather is cool.
      warm_msg      - substituted for raining when it is warm.
      raining_msg   - substituted for raining when it is warm and raining.
      snowing_msg   - substituted for raining when it is cold and snowing.
     
     raining is substituted first, then day.  So the weather messages can contain day.
     Time of day messages are useful indoors and out.  Weather messages are most often 
used in outdoor rooms, but an indoor room's description could contain a sentence 
like:
     
        Through an open window, day raining.
     
     Which, given the right message definitions, could result in:
     
        Through an open window, the night-time sky is silhouetted by a snow-covered fire 
escape.
     
     PARC also supports basic details that can be looked at:
     
      @det*ail  is    - add or replace a detail description
      @rmd*etail              - remove a detail
      @details                      - show all the detail names
     
     Note that detail strings can contain raining and day.  It is often wise to keep the 
associated time and weather messages simple (like their default values) so they can 
be useful in a variety of detail strings as well as in the room description.
     PARC is a child of the Generic Ambient Noise Room, so see also: help #176



VERB SOURCE CODE:

@details:
if (player != this.owner)
    player:tell(E_PERM);
    return;
endif
player:tell("Details here are: ", $string_utils:print(this.detail_names));
.


@det*ail:
if (player != this.owner)
    player:tell(E_PERM);
    return;
endif
name = dobjstr;
desc = iobjstr;
if (i = name in this.detail_names)
    this.detail_descriptions = listset(this.detail_descriptions, desc, i);
    player:tell("Detail ", name, " replaced.");
else
    this.detail_names = {@this.detail_names, name};
    this.detail_descriptions = {@this.detail_descriptions, desc};
    player:tell("Detail ", name, " added.");
endif
.


@rmd*etail:
if (player != this.owner)
    player:tell(E_PERM);
    return;
endif
if (i = dobjstr in this.detail_names)
    this.detail_names = listdelete(this.detail_names, i);
    this.detail_descriptions = listdelete(this.detail_descriptions, i);
    player:tell("Detail ", dobjstr, " deleted.");
else
    player:tell("Detail ", dobjstr, " not found.");
endif
.


l*ook:
if ((length(args) != 1) || valid($string_utils:match_object(dobjstr, this)))
    pass(@args);
elseif (i = $string_utils:match_stringlist(dobjstr, this.detail_names))
    player:tell(this:weather_daytime(this.detail_descriptions[i]));
else
    player:tell("I see no \"", dobjstr, "\" here.");
endif
.


weather_daytime:
hour = tonum(ctime(clock = time())[12..13]);
if ((hour < 6) || (hour > 20))
    daytime = this.night_msg;
elseif (hour < 9)
    daytime = this.morning_msg;
elseif (hour < 18)
    daytime = this.day_msg;
else
    daytime = this.evening_msg;
endif
noise = abs((((clock / 3600) / 8) * 1103515245) + 12345) % 3;
climate = abs(((clock / 3600) / 24) + noise) % 11;
if (climate == 2)
    weather = this.raining_msg;
elseif (climate < 6)
    weather = this.warm_msg;
elseif (climate == 8)
    weather = this.snowing_msg;
else
    weather = this.cool_msg;
endif
if (typeof(args[1]) == STR)
    s = strsub(args[1], "%weather", weather);
    return strsub(s, "%daytime", daytime);
elseif (typeof(args[1]) == LIST)
    l = {};
    for s in (args[1])
        s = strsub(s, "%weather", weather);
        s = strsub(s, "%daytime", daytime);
        l = {@l, s};
    endfor
    return l;
else
    return args[1];
endif
.


description:
return this:weather_daytime(pass(@args));
.


break smash:
dobj = $string_utils:match_object(dobjstr, player.location);
if (valid(dobj) && $object_utils:has_callable_verb(dobj, "break_self"))
    dobj:break_self();
else
    player:tell("Either ", dobjstr, " is not here, or it is unbreakable.");
endif
.


set_detail_descriptions set_detail_names:
"Allows note editors to set these props. Doesn't check for proper value";
if ((!$perm_utils:controls(caller_perms(), this)) && (caller != this))
    return E_PERM;
elseif (args)
    which = verb[5..length(verb)];
    return this.(which) = args[1];
else
    return E_INVARG;
endif
.



PROPERTY DATA:
      day_msg
      night_msg
      morning_msg
      evening_msg
      warm_msg
      raining_msg
      cool_msg
      snowing_msg
      detail_names
      detail_descriptions
      citation_msg

CHILDREN:
Bridge Nutmeg Orchard The River Bridge Pier Jackson & Broadway Brisbain & Broadway Drive Way Entrance Hall Clearing In The Park Lobby Of Office Building Generic Urban Streen Scene Roof Top Room 222 Garden Stone Building Park Public Restrooms Dining Room Generic Secured Post-Apocalypse Room The Foyer of The Chantry The Library The Parlour Tunnel Concrete Lot Room 333 The Entrance Hall The Living Room Cave Entrance Crypt Damp Tunnel Crystal Cave Underground Pool Underground Maelstrom Stalactite Chamber Chamber of Petroglyphs Tourist Center Landing Grocery Store Outside the Grocery Store The Loft Always Already Room 444 Bellona Zoo Parking Lot truck Broken Bottle Cafe Z Museum Outside the D.E.W Drop Inn The Crossroads Generic Room with Stacking Interzone University Interzone: Port Of Saints Bellona: Bus Depot Ape Island War on Drugs Television Evangelist I. The Magus II. The Door Of The Occult Sanctuary III. Isis-Urania IV. The Cubic Stone V. The Master Of The Aracana VI. The Two Roads VII. The Chariot of Osiris VIII. Themis IX. The Veiled Lamp X. The Sphinx XI. The Tamed Lion XII. The Sacrifice XIII. The Scythe XIV. The Solar Spirit XV. Typhon XVI. The Lightning-Struck Tower XVII. The Star Of The Magi XVIII. Twilight XIX. The Blazing Light XX. The Awakening Of The Dead O. The Crocodile XXI. The Crown Of The Magi Interzone Plaza Gaming Tables The Rave Back Alley Taxi Hallway Hallway Hallway Hallway Kitchen Dining Hall Veranda Generic Auditorium Dying Moon Carnival crannog My First Home! Archean Island Cambrian Shore The Late-Permian Event Late Cretaceous Brown Cardboard Box The Roof Garden Entry Trash Bin Johnathon's basement Johnathon's room flutterby's whimsy Quent's Garret orb Middle of South Channel Beside a Large Building a small barrel A simple room Generic Elevator Dog Solitude Triskelion Post-Industrial Park Desolate Shore here Sunken Islandia Information Storage Battle Zone Rickety Stairs Exeunt Dragonfly's Escuela Ground Floor Hallway TrepaNation Elevator Shaft Amethyst's Basement Desolation Row Backroom a cardboard box A Narrow Patch of Green Chora Drag-Strip Speedway Rebellion's Wellspring Mausoleum Idle Hands