!\------------------------------------------------------------------------------------------------------------------
    SCAVENGER HUNT - Version 0.5
    Copyright (c) 2000-2002 by Gilles Duchesne

    Written using Hugo v3.0

    This document is part of my "Scavenger Hunt" tutorial. It should be distributed as a package,
    along the following:
    SCAVHUNT1.HTM - Core & rooms
    SCAVHUNT2.HTM - Scenery objects
    SCAVHUNT3.HTM - Inventory objects
    SCAVHUNT4.HTM - NPCs
    SCAVHUNT5.HTM - Time & score (THIS FILE)
    SCAVHUNT6.HTM - Misc info, credits & hints
    SCAVHUNT7.HTM - Sounds & pictures

    The package, as a whole, can be redistributed freely. However, I'd appreciate it if the issues &
    mistakes would be reported to me rather than directly edited. Please contact me at lonecleric@bigfoot.com.

    If you think parts of this code could be reused for your own purposes, feel free to do so.
------------------------------------------------------------------------------------------------------------------\!


!In all the previous incarnations of this game, I always devised some sort of "time limit" to give the player a
!sense of urgency. On the C-64, each turn was worth 5 minutes. On the Amiga, there was a real-time 30 minutes timer.
!
!So, once again, I decided to make the game time-restricted. Since Hugo doesn't have any real-time clock (boooooh!),
!I instated a "static clock". As you'll see, I went to great lengths to try to make that clock more believable, by
!matching the time elapsed to the action the PC accomplishes.

#set DEBUG                              ! include HugoFix library and grammar
#set VERBSTUBS                          ! include verb stub routines
#set NO_AUX_MATH                        ! don't need advanced math routines

#switches -ls                           ! print statistics to SAMPLE.LST
#ifset DEBUG
#switches -d
#endif

!----------------------------------------------------------------------------
! NEW GRAMMAR:
verb "read", "peruse"
    *                                                       DoVague
    * readable                                              DoRead

verb "blow"
    *                                                       DoVague
    * object                                                DoBlow

verb "play"
    *                                                       DoVague
    * "with" living                                         DoPlayWith
    * object                                                DoPlay

! I pasted this one from verblib.g, then modified it to differenciate "on" and "in"
verb "put", "place"
    *                                                       DoVague
    * multiheld "on"/"onto" "ground"/"floor"                DoPutonGround
    * multiheld "outside" xobject                           DoPutonGround
    * "down" multiheld                                      DoDrop
    * multiheld "down"                                      DoDrop
    * multiheld "in"/"into"/"inside" container              DoPutIn
    * multiheld "on"/"onto" platform                        DoPutOn
    * multiheld                                             DoDrop

! Allowing 'give up' as an action
verb "give"
    * "up"                                                  DoGiveUp

! Adding 'ask for' as a valid action
verb "ask", "question", "consult"
    *                                                       DoAsk
    * living                                                DoAsk
    * living "about"/"for" anything                         DoAsk
    * "about"/"for" anything                                DoAskQuestion

! Support the 'buy' command
verb "buy", "purchase"
    *                                                       DoVague
    * anything                                              DoBuy

! Support the 'borrow' command
verb "borrow"
    *                                                       DoVague
    * object                                                DoBorrow

verb "check"
    *                                                       DoVague
    * "out" object                                          DoBorrow
    * object                                                DoLook

verb "bowl"
    *                                                       DoBowl

verb "count"
    *                                                       DoVague
    * anything                                              DoCount

!The Hugolib supports "score" already, so I'm just adding this more-appropriate synonym
verb "status"
    *                                                       DoScore

#include "verblib.g"                    ! normal verb grammar

!----------------------------------------------------------------------------

#include "hugolib.h"                    ! standard library routines

!I'm defining a new attribute for objects. From then on, any object can set its "beenthere" flag.
attribute beenthere

!This new variable can now be used anywhere in the game code. It will also be saved among the other game data.
global g_lessercounter

routine init
{
    !The Hugolib supports a clock-like display in the status bar. This is what we'll use now, instead of the
    !number of turns. However, the "counter" variable now holds the amount of minutes past midnight, so we set
    !its initial value accordingly.
    counter = 540                       ! 9:00 AM
    g_lessercounter = 0

    STATUSTYPE = 2                      ! time
    !This global variable is defined in the Hugolib to determine the number of turns which passes when you type
    !WAIT. The default is 3, and I didn't have a problem with that before, but now that I'm using a timer it
    !could get tricky.
    WAIT_TURN_COUNT = 1
    TEXTCOLOR = DEF_FOREGROUND
    BGCOLOR = DEF_BACKGROUND
    SL_TEXTCOLOR = DEF_SL_FOREGROUND
    SL_BGCOLOR = DEF_SL_BACKGROUND
    color TEXTCOLOR, BGCOLOR

    INDENT_SIZE = 0                     ! no indents whatsoever (doesn't fit my writing style)
    prompt = ">"

    DEFAULT_FONT = PROP_ON
    Font(DEFAULT_FONT)

    display.title_caption = "Scavenger Hunt"
    cls
    "Here you are, visiting your best friend in his new house in Cheapsville. His nice, new, empty, tediously
    boring house in a charmingly boring suburban town.\nYour friend, who always liked games of all kind and
    doesn't say no to the occasional bet, has decided to set up a challenge for you...\n"
    "A scavenger hunt.\n"
    "Here's the idea: he gives you three hours to go around the neighborhood, trying to find all the
    miscellaneous things he's listed. You're supposed to bring all these items back to his house.\n"
    
    "\n\n"
    "\BScavenger Hunt\b"
    "A Small Visit in Cheapsville"
    "Version 0.5"
    print BANNER

    player = you
    location = friendshome
    old_location = location

    move player to location         ! initialize player location
    FindLight(location)             ! whether the player can see
    DescribePlace(location)         ! the appropriate description
    location is visited
    Activate( gamewon )            ! activates the endgame daemon
}

routine main
{
    !If I kept that line in, the timer would increase by 1 minute each turn. It's a simple and elegant solution,
    !used for instance in Kent's "Spur".
    !counter = counter + 1

    !Instead, I'm moving the clock forward based on the current action. The main drawback to this method is that,
    !since this is before all the other checks are done, a failed attempt at an action will take as long
    !as a succeeded one. But hey, maybe it does make some sense anyway, doesn't it? ;-)
    !
    !If you're wondering why I spread the first bunch of actions into 3 separate cases, it's because the
    !Hugo compiler cannot currently handle more than a few cases at once.
    select verbroutine
        case &DoAsk, &DoAskQuestion, &DoGive, &DoHit, &DoInventory, &DoListen, &DoLookAround, &DoMove
            counter += 1    ! one minute
        case &DoPutIn, &DoShow, &DoTalk, &DoTell, &DoJump, &DoPush, &DoPull, &DoTouch
            counter += 1    ! one minute
        case &DoWave, &DoWaveHands, &DoRead
            counter += 1    ! one minute
        case &DoWait, &DoSearch
            counter += 2    ! two minutes
        case else
        {
            !Here's where I make use of my new global - to count smaller time increments
            g_lessercounter++ ! 1/5th of a minute (12 seconds for those counting)
            if g_lessercounter = 5
            {
                g_lessercounter = 0
                counter++
            }
        }

    PrintStatusLine
    run location.each_turn
    runevents
    RunScripts
    if speaking not in location     ! in case the character being spoken
        speaking = 0                ! to leaves
}

player_character you "you"
{
    after
    {
        !The "after actor" code is called for every action where the "you" object is the current PC (which means, in
        !this game, every turn).
        actor DoGo
        {
            !The idea here is to move the clock forward by several minutes every time the PC moves. The time elapsed
            !is based on the location the he just moved in. Outdoor locations take longer to reach than indoor ones,
            !because, well, I think it's nifty.
            select location
                case friendshome, backyard, citybank, publiclibrary, bowlingalley, storageroom, oakstreet
                {
                    !And look, here's my new attribute! I thought it'd make sense if the first visit into a location
                    !took longer, since you're still unfamiliar with the surroundings. I raise the "beenthere" flag
                    !the first time the PC arrives in a location, so the bigger value is only used once.
                    !
                    !The most attentive of you might wonder why I needed this flag since the Hugolib already has a
                    !"visited" flag. Simple: By the time this code is called, the flag has already been set.
                    if location is beenthere
                        counter += 1
                    else
                    {
                        counter += 4    ! +1 from DoLookAround, in all likelihood
                        location is beenthere
                    }
                }
                case park, intersection, schoolyard, outsidelibrary, outsidebowling
                {
                    if location is beenthere
                        counter += 3
                    else
                    {
                        counter += 6    ! +1 from DoLookAround, in all likelihood
                        location is beenthere
                    }
                }

            return false    ! keep going
        }
    }
}

!----------------------------------------------------------------------------
! ENDGAME DAEMON
! Checks if you've won the game, and if your time is up
!----------------------------------------------------------------------------
daemon gamewon 
{}

event in gamewon
{
    if location = friendshome
        if squash is special
            if FindObject( smalldictionary, location )
                if FindObject( sharpener, location )
                    if FindObject( pen, location )
                        if FindObject( floppydisk, location )
    {
        "\n\nWell, that's everything! Every item on the list, including the elusive racket, has been
        brought. Your friend reluctantly admits that you won the bet, and as it was agreed, promises to
        stop playing those crappy '3D action-adventure' games and to stick to IF for the whole summer."
        if Contains( you, paper )
            "Right now, however, most of your thoughts go to the little paper you're carrying on you... You
            know, the one bearing the phone number of a certain gorgeous librarian... All in all, the coming
            summer's looking great!"
        endflag = 1
    }

    if counter > 720    ! Past noon
    {
        print "\n\nRATS! It's already past noon. Time's up. All those efforts are now going to waste... You can't
        help but cringe thinking you'll have to be mowing your friend's lawn for the whole darn summer. Oh well,
        at least the neighborhood seems nice enough.";
        if npc_librarian is known
            " Especially that sweet librarian..."
        else
            ""
        "\nNevertheless, you must sadly admit that...
        \n\n***  You have lost your bet  ***"
        endflag = 3
    }
}


!----------------------------------------------------------------------------
! CL_ROOM CLASS
! Used to add generic answers to "up" and "down"
!----------------------------------------------------------------------------
room cl_room
{
    u_to
    {
        "Well, there aren't any stairs, elevators, or ladders, around, nor any wings on your back. You won't
        be able to go up."
    }
    d_to
    {
        "You can't go much lower than this."
    }
}

!----------------------------------------------------------------------------
! GENERAL SCENERY
! Objects that are used as scenery in several rooms
!----------------------------------------------------------------------------

scenery streetlight "streetlight"
{
    found_in oakstreet, intersection, schoolyard, outsidelibrary, outsidebowling
    nouns "light", "lamp", "post", "streetlight"
    adjectives "street", "lamp"
    article "a"
    long_desc
    {
        "It's a typical urban street light. You might guess that it's in working order, but it's off now
        against the morning sky. A bunch of other lights, just like this one, run along the street."
    }
}

scenery friendshouse "your friend's house"
{
    found_in oakstreet, backyard
    nouns "house", "building", "home"
    adjectives "friend's", "friend"
    long_desc
    {
        "It's a nice house. Not impressive. Just nice. It's as nice as all the other houses around. Thankfully,
        you think to yourself, they don't all look identical, like in some of those newer suburbs."
    }
    door_to
    {
        select location
            case oakstreet
                return frontdoor.door_to
            case backyard
                return backyarddoor.door_to
    }
    parse_rank 1
}

scenery cl_car
{
    found_in oakstreet, intersection, schoolyard, outsidelibrary, outsidebowling
    article "the"
    before
    {
        object
        {
            "The cars are passing by too fast - just forget it."
        }
        xobject
        {
            "The cars are passing by too fast - just forget it."
        }
    }
}
    
cl_car car "car"
{
    nouns "car"
}

cl_car cars "cars"
{
    nouns "cars"
    is plural
}

scenery grass "grass"
{
    found_in backyard, park
    nouns "grass"
    article "the"
    long_desc
    {
        "The grass seems greener here than back home. But then again, doesn't it always?"
    }
}

scenery sky "sky"
{
    found_in backyard, park, oakstreet, intersection, schoolyard, outsidelibrary, outsidebowling
    nouns "sky"
    article "the"
    long_desc
    {
        "The sky is a plain, uniform grey."
    }
}

scenery houses "houses"
{
    found_in oakstreet, intersection, schoolyard, outsidelibrary, outsidebowling
    nouns "houses", "house"
    article "the"
    long_desc
    {
        "There are several houses in the area. They are all sort of bland and nice. They're each
        significantly different, which relieves the suburban boredom a great deal."
    }
    is plural
}

scenery street "street"
{
    found_in oakstreet, intersection, schoolyard, outsidelibrary, outsidebowling
    nouns "street", "road"
    adjectives "main", "oak"
    article "the"
    long_desc
    {
        "It's a long ribbon of asphalt - nothing out of the ordinary."
    }
}

!----------------------------------------------------------------------------
! FRIEND'S HOME
!----------------------------------------------------------------------------
cl_room friendshome "At your friend's house"
{
    long_desc
    {
        "Your good friend had just begun moving into this fine, empty house. The main center of attention is
        still the desk, which tells a lot about how much still has to be moved. That won't be until the
        afternoon, however. Because of that, a puerile game of scavenger hunt seems like a good idea.
        \nThe main door leads to the east, but there's also a back door to the north, leading to the neighbor's
        backyard.
        \nA work desk has been placed in one corner. The immediate area also has a closet."
    }
    n_to {return backyarddoor.door_to}
    e_to {return frontdoor.door_to}
    out_to {return frontdoor.door_to}
    cant_go
    {
        "Unless you smashed a hole in the wall (which wouldn't be very considerate) you can't go that way."
    }
}

scenery workdesk "work desk"
{
    in friendshome
    nouns "desk"
    adjectives "work"
    article "the"
    long_desc
    {
        "The desk is quite familiar - your friend has had it for ages. It looks great, sitting there with its
        single drawer, but you wouldn't want to watch it all day."
        Perform( &DoLookIn, self )
    }
    is openable, open, container, platform
    capacity 30        ! That's for the top of the table, not the inside
    holding 0
    before
    {
        object DoMove, DoPush
        {
            "The desk might be small, but it's heavy. Since you almost threw out your back putting it there in
            the first place, you're no inclined to shove it around any more. Besides, it looks great where it
            is, and your friend agrees."
        }
        object DoOpen, DoClose
        {
            return Perform( verbroutine, drawer )
        }
        object DoLookIn
        {
            if word[2] = "in", "inside"
                return Perform( &DoLookIn, drawer )
            else
                return false    ! Means "look on" - continue normally
        }
        xobject DoPutIn        !Overrides "put in", not "put on"
        {
            return Perform( &DoPutIn, object, drawer )
        }
    }
}

scenery drawer "desk drawer"
{
    in friendshome
    nouns "drawer"
    adjectives "desk"
    article "the"
    long_desc
    {
        "The drawer, like the desk which contains it, is rather small."
        Perform( &DoLookIn, self )
    }
    is openable, not open, container
    capacity 10
    holding 0
}

scenery closet "small closet"
{
    in friendshome
    nouns "closet"
    adjectives "small", "tiny"
    article "the"
    long_desc
    {
        "This tiny closet will look much better once it's repainted, you bet. For
        the moment, it's ";
        if self is open
        {
            "open."
            Perform( &DoLookIn, self )
        }
        else
            "closed."
    }
    is openable, not open, container
    capacity 100
    holding 0
}

scenery closetdoor "closet door"
{
    in friendshome
    nouns "door"
    adjectives "closet"
    article "the"
    long_desc
    {
        "The door to this tiny closet will look much better once it's repainted, you bet. For
        the moment, it's ";
        if closet is open
            "open."
        else
            "closed."
    }
    is openable
    before
    {
        object DoOpen, DoClose
        {
            return Perform( verbroutine, closet )
        }
    }
}

!----------------------------------------------------------------------------
! NEIGHBOR'S YARD
!----------------------------------------------------------------------------
cl_room backyard "Some neighbor's back yard"
{
    long_desc
    {
        "This back yard doesn't actually belong to your friend, even if there's a door leading to it. It's
        owned by some neighbor he hasn't even met yet. Both houses stand side by side, one to the north, the
        other to the south.
        \nYou notice a doghouse standing alongside one of the fences which surround most of the area."
    }
    s_to {return backyarddoor.door_to}
    in_to {return backyarddoor.door_to}
    se_to oakstreet
    n_to
    {
        "And just how do you plan to introduce yourself?
        \n\I\"Oh, hi there, I'm a friend of that new neighbor you haven't met, please don't mind me while I
        rummage through your belongings!\"\i
        \nUnlikely."
    }
    cant_go
    {
        "Several fences, which you hear make good neighbors, surround this area. The only passage through
        them is to the southeast."
    }
}

door backyarddoor "back yard door"
{
    between friendshome, backyard
    nouns "door"
    adjectives "back", "yard"
    article "the"
    is hidden
}

scenery cl_fence
{
    article "the"
    long_desc
    {
        "Several fences, which you hear make good neighbors, surround this area. The only passage through
        them is to the southeast."
    }
}

cl_fence fence "fence"
{
    in backyard
    nouns "fence"
}

cl_fence fences "fences"
{
    in backyard
    nouns "fences"
    is plural
}

scenery neighboryard "yard"
{
    in backyard
    nouns "yard"
    article "the"
    long_desc
    {
        "It's nice-looking, with neatly-trimmed grass everywhere."
    }
}

scenery doghouse "dog house"
{
    in backyard
    nouns "house", "doghouse"
    adjectives "dog", "red"
    article "the"
    long_desc
    {
        "The cute lil' dog house is painted bright red."
    }
    is container
    before
    {
        object DoEnter, DoLookIn
        {
            return DogDeath
        }
        xobject DoPutIn
        {
            return DogDeath
        }
    }
}

scenery neighborhouse "neighbor's house"
{
    in backyard
    nouns "house", "home", "building"
    adjectives "neighbor", "neighbor's"
    article "the"
    long_desc
    {
        "It's hard to judge the house from its back side, but it seems to be a well-maintained
        home, of roughly the same size and value as your friend's."
    }
    door_to { return backyard.n_to }
}

!----------------------------------------------------------------------------
! STREET, NEAR HOUSE
!----------------------------------------------------------------------------
cl_room oakstreet "Oak Street, near the house"
{
    long_desc
    {
        "You're now standing on the sidewalk of Oak Street. It's a quiet little street, much like every quiet
        little street you've seen in Cheapsville. Cars pass every few minutes, thrusting dust into the
        air. There's no one around; only a streetlight and a garbage bin are here to keep you company.
        \nThe street leads north toward a city park, and south to an intersection. You friend's new house
        stands to the west."
    }
    w_to {return frontdoor.door_to}
    in_to {return frontdoor.door_to}
    nw_to backyard
    n_to park
    s_to intersection
    cant_go
    {
        "You don't see anything worthwhile in that direction, and your time is precious."
    }
    before
    {
        location DoSmell
        {
            "The only thing which gets your nose's attention is the slight stench coming from the
            garbage bin."
        }
    }
}

door frontdoor "front door"
{
    between friendshome, oakstreet
    nouns "door"
    adjectives "front", "house", "main"
    article "the"
    is hidden
}

scenery dust "dust"
{
    in oakstreet
    nouns "dust"
    article "the"
    long_desc
    {
        "You're not likely to win that bet it you lose your precious time analyzing every individual spec
        of dust."
    }
}

scenery garbagebin "garbage bin"
{
    in oakstreet
    nouns "bin", "can"
    adjectives "garbage", "trash"
    article "the"
    long_desc
    {
        "This typical garbage bin has used for its intended purpose, judging by the smell. Although you expect
        to find a cheerful message along the lines of \"PLEASE KEEP OUR TOWN CLEAN\" or \"W.A.S.T.E.\", there's
        nothing like that written on it.
        \nYou notice some miscellaneous trash inside the bin."
    }
    is container
    type nothing
    capacity 30
    holding 0
    before
    {
        object DoSearch
        {
            Perform( &DoSearch, trash )
        }
    }
}

object trash "trash"
{
    in garbagebin
    nouns "trash", "garbage"
    article "some"
    long_desc
    {
        "A more-or-less homogenous heap of miscellaneous garbage. It \Icould\i hide something
        worthwhile, but you're not sure you if really want to go see for yourself."
    }
    before
    {
        object DoSearch
        {
            if parent( squash ) = nothing
            {
                "Setting aside your usually high standards of personal hygiene, you reach inside the
                trash. After a grotesque moment of rummaging, you pull out an old, dessicated squash. Your
                first reaction is to put it back in the bin. Once you do, however, the gears in your head start
                turning. A squash. Well, well..."
                move squash to garbagebin
            }
            else
                "You're pretty sure there isn't anything else of any worth in there."
        }
        object DoGet
        {
            "You are \Unot\u going to carry that trash around."
        }
    }
}

!----------------------------------------------------------------------------
! CITY PARK
!----------------------------------------------------------------------------
cl_room park "Cheapsville City Park"
{
    long_desc
    {
        "The soft grass of what seems to be the only city park in Cheapsville welcome you. It seems nice
        enough, with trees, benches, and the usual elements of a park. However, since the weather today
        isn't that great (the sky is completely grey), the only human being around seems to be that poor
        sap operating the hot dog stand.
        \nTo the south, Oak Street reminds you that suburban civilization is only a few steps away."
    }
    s_to oakstreet
    cant_go
    {
        "A stroll in the park could be nice, but you still intend to win that little bet."
    }
    before
    {
        location DoSmell
        {
            "Hmmm... Hot dogs..."
        }
    }
    after
    {
        location MovePlayer
        {
            hotdog is known
            return false
        }
    }
}

scenery cl_tree
{
    article "the"
    long_desc
    {
        "Trees of various kinds abound in this city park."
    }
}

cl_tree tree "tree"
{
    in park
    nouns "tree"
}

cl_tree trees "trees"
{
    in park
    nouns "trees"
    is plural
}

scenery cl_bench
{
    article "the"
    long_desc
    {
        "You can see benches distributed evenly among the park."
    }
    is enterable
}

cl_bench bench "bench"
{
    in park
    nouns "bench"
}

cl_bench benches "benches"
{
    in park
    nouns "benches"
    is plural
    before
    {
        object DoEnter
        {
            return Perform( &DoEnter, bench )
        }
    }
}

scenery stand "hot dog stand"
{
    in park
    nouns "stand"
    adjectives "hot", "dog", "hotdog"
    article "the"
    long_desc
    {
        "Neat! A hot dog stand! It's a little early to have lunch, but the strong
        smell of the freshly cooked dogs tickles your nose."
    }
}

!----------------------------------------------------------------------------
! INTERSECTION
!----------------------------------------------------------------------------
cl_room intersection "Intersection of Oak & Main"
{
    long_desc
    {
        "Oak Street ends here, reaching Cheapsville's Main Street. Even though it's Monday,
        the whole place remains pretty calm. You can see why your friend picked this town -
        you can't get any quieter without living on a farm.
        \nThe most interesting building in the area is the Cheapsville City Bank, which stands
        proudly on the opposite side of Oak.
        \nMain Street runs east-west. You can also go north, back on Oak Street."
    }
    n_to oakstreet
    s_to { return bankdoor.door_to }
    in_to { return bankdoor.door_to }
    w_to schoolyard
    e_to outsidelibrary
    cant_go
    {
        "There doesn't seem to be anything interesting in that direction."
    }
}

door bankdoor "bank door"
{
    between intersection, citybank
    nouns "door"
    adjectives "bank"
    article "the"
    is hidden
}

scenery bankbuilding "bank"
{
    in intersection
    nouns "bank", "building"
    adjective "city", "bank"
    article "the"
    long_desc
    {
        "A brick building, roughly cubic in shape, with the words \"CHEAPSVILLE CITY BANK\" proudly
        painted on it."
    }
    door_to { return bankdoor.door_to }
}

!----------------------------------------------------------------------------
! BANK
!----------------------------------------------------------------------------
cl_room citybank "Cheapsville City Bank"
{
    long_desc
    {
        "Whoa! It's been ages since you saw an actual city bank. And apparently, today isn't
        your lucky day to see one: at this hour, they're closed. The windows are, anyway. And by the time
        they open, your little wager will be long over.
        \nOn one side of the open area is an ATM. On the other is the receptionist's desk, complete with
        receptionist."
    }
    n_to { return bankdoor.door_to }
    out_to { return bankdoor.door_to }
    cant_go
    {
        "Most of the bank is closed at this hour, and therefore you can't go there."
    }
}

scenery cl_bankwindow
{
    adjectives "teller", "bank", "clerk"
    article "the"
    long_desc
    {
        "There are a few - it looks like three - windows down there, meant to accomodate curmudgeonly
        customers who won't use the ATM. Of course, they're all closed right now."
    }
}

cl_bankwindow bankwindow "window"
{
    in citybank
    nouns "window"
}

cl_bankwindow bankwindows "windows"
{
    in citybank
    nouns "windows"
    is plural
}

scenery atm "ATM"
{
    in citybank
    nouns "atm", "machine"
    adjectives "atm", "cash"
    article "the"
    long_desc
    {
        "It seems the city bank managed to buy an ATM from some bigger bank, and then reprogram it
        for their own use. It seems operational, but is of no use to you, since you're not a client."
    }
}

scenery bankdesk "receptionist's desk"
{
    in citybank
    nouns "desk"
    adjectives "receptionist", "receptionist's"
    article "the"
    long_desc
    {
        "The desk is quite large, and on the side you're facing, featureless. The receptionist
        sits behind it."
    }
}

!----------------------------------------------------------------------------
! SCHOOLYARD
!----------------------------------------------------------------------------
cl_room schoolyard "School yard"
{
    long_desc
    {
        "Oh look, an elementary school! Isn't that nice? It means your friend has picked quite a good
        location to raise a family.
        \nBunches of kids are playing and laughing all around the school yard. Either it's
        recess, or they're having some special \"go play outside\" morning.
        \nThe school stands to the south, while Main Street extends both eastward & westward."
    }
    e_to intersection
    w_to
    {
        "You take a quick peek in that direction. There doesn't seem to be a lot of buildings,
        for a while at least. It might be better to stick to this part of town instead."
    }
    s_to
    {
        "Going inside the school? Well, you're a little too old to pass as a kid, even if you are playing a
        childish game, and you don't really want to scare anyone."
    }
    in_to { return s_to }
    cant_go
    {
        "There doesn't seem to be anything interesting in that direction."
    }
}

scenery yardschool "yard"
{
    in schoolyard
    nouns "yard", "asphalt"
    article "the"
    long_desc
    {
        "A vast open space, covered with asphalt."
    }
}

scenery school "school"
{
    in schoolyard
    nouns "school", "building"
    article "the"
    long_desc
    {
        "This school is bigger than the houses in the immediate area, but fits nicely into the neighborhood. It
        may very well be the only elementary school in the whole town. Apparently, it's called the \"My Dear
        Watson Elementary\"."
    }
    door_to { return schoolyard.s_to }
}

!----------------------------------------------------------------------------
! STREET, OUTSIDE LIBRARY
!----------------------------------------------------------------------------
cl_room outsidelibrary "Main Street, Outside Public Library"
{
    long_desc
    {
        "Main Street extends east and west from here. Aside from a few houses, the only building
        in the area is the public library, which lies on the north side of the street."
    }
    w_to intersection
    e_to outsidebowling
    n_to { return librarydoor.door_to }
    in_to { return librarydoor.door_to }
    cant_go
    {
        "There doesn't seem to be anything interesting in that direction."
    }
}

door librarydoor "library door"
{
    between outsidelibrary, publiclibrary
    nouns "door"
    adjectives "library"
    article "the"
    is hidden
    door_to
    {
        if Contains( you, smalldictionary ) and not smalldictionary is special
            "The librarian turns toward you.
            \n\"I'm sorry, but you'll need to borrow that dictionary if you plan to leave with it.\"
            \nYou nonchalantly slip the dictionary behind your back.
            \n\"And don't even \Bthink\b about trying to smuggle it out,\" she adds in a helpful tone. \"Our
            alarm system works very well.\""
        else
            return door..door_to
    }
}

scenery library "public library"
{
    in outsidelibrary
    nouns "library", "building"
    adjectives "public", "library"
    article "the"
    long_desc
    {
        "It's a smallish, unassuming building. You almost missed it, since it didn't look all that different
        from the other houses."
    }
    door_to { return librarydoor.door_to }
}

!----------------------------------------------------------------------------
! PUBLIC LIBRARY
!----------------------------------------------------------------------------
cl_room publiclibrary "Public Library"
{
    long_desc
    {
        "This isn't the largest library you've seen, of course. But it seems well furnished enough:
        novels, kids' books, biographies, dictionaries, encyclopedias, and other sorts of library materials.
        \nThe door leading outside is to the south. Near it is the librarian, sitting at her desk."
    }
    s_to { return librarydoor.door_to }
    out_to { return librarydoor.door_to }
    cant_go
    {
        "There isn't a way out in that direction."
    }
    before
    {
        location DoSmell
        {
            "The sweet aroma of old paper fills the building."
        }
    }
    after
    {
        location MovePlayer
        {
            librarycard is known
            return false
        }
    }
}

scenery cl_book
{
    adjectives "kids", "kids'"
    article "the"
    long_desc
    {
        "Lots of books of all types, on many different subjects. You'd love to look around in search of some rare
        gem you haven't read, but this obviously isn't the right moment."
    }
    is readable, openable
    before
    {
        object DoGet
        {
            "You don't have a need for any of these right now."
        }
        object DoRead, DoOpen
        {
            "Why yes, of \Ucourse\u! Read a few books. Heck, why not read \Uall\u of them! After all,
            it's not like there was this bet we intended to win. We're not in a big hurry or anything,
            \Uright\u?"
        }
    }
}

cl_book book "book"
{
    in publiclibrary
    nouns "book", "novel", "biography"
}

cl_book books "books"
{
    in publiclibrary
    nouns "books", "novels", "biographies"
    is plural
}

scenery cl_dictionary 
{
    article "the"
    long_desc
    {
        "Several dictionaries of all kind."
    }
    is readable, openable
    before
    {
        object DoGet
        {
            if parent(smalldictionary) = nothing
            {
                "You begin to search for a small dictionary. Fortunately, and to your surprise, there are a
                few that can be borrowed from the library. That's great. Well, it is if you have a card... You
                pick up a smaller English dictionary that circulates.";
                if not Acquire(you, smalldictionary)
                {
                    " However, since you're carrying so much stuff already, you have no choice but to put it
                    back on the ground, at least for the time being."
                    move smalldictionary to publiclibrary
                }
                else
                    ""
            }
            else
                "You already picked one from the shelves. It should suffice."
        }
        object DoRead, DoOpen
        {
            "Why yes, of \Ucourse\u! Read a few books. Heck, why not read \Uall\u of them! After all,
            it's not like there was this bet we intended to win. We're not in a big hurry or anything,
            \Uright\u?"
        }
    }
}

cl_dictionary dictionary "dictionary"
{
    in publiclibrary
    nouns "dictionary"
    adjectives "other", "one"
}

cl_dictionary dictionaries "dictionaries"
{
    in publiclibrary
    nouns "dictionaries"
    adjectives "numerous"
    is plural
    before
    {
        object DoSearch
        {
            Perform( &DoGet, self )
        }
    }
}

scenery cl_encyclopedia
{
    article "the"
    long_desc
    {
        "Lots of reference books, on every subject you can think of."
    }
    is readable, openable
    before
    {
        object DoGet
        {
            "You don't have a need for any of these right now."
        }
        object DoRead, DoOpen
        {
            "Why yes, of \Ucourse\u! Read a few books. Heck, why not read \Uall\u of them! After all,
            it's not like there was this bet we intended to win. We're not in a big hurry or anything,
            \Uright\u?"
        }
    }
}

cl_encyclopedia encyclopedia "encyclopedia"
{
    in publiclibrary
    nouns "encyclopedia"
}

cl_encyclopedia encyclopedias "encyclopedias"
{
    in publiclibrary
    nouns "encyclopedias"
    is plural
}

scenery librariandesk "librarian's desk"
{
    in publiclibrary
    nouns "desk"
    adjectives "librarian", "librarian's", "library"
    article "the"
    long_desc
    {
        "An old wooden desk, worn by the years. It's currently occupied by the librarian herself."
    }
}

scenery librarianeyes "librarian's eyes"
{
    in publiclibrary
    nouns "eyes"
    adjectives "blue", "librarian", "librarian's"
    article "the"
    long_desc
    {
        "Deep blue eyes you'd gladly plunge into."
    }
}

!----------------------------------------------------------------------------
! STREET, OUTSIDE BOWLING ALLEY
!----------------------------------------------------------------------------
cl_room outsidebowling "Main Street, Outside Bowling Alley"
{
    long_desc
    {
        "Ah, finally! After all the niceness and cozyness of this little town, you've found a clear sign
        of modern corruption: the bowling alley. And it's already open, lucky you! The entrance
        stands to your south. You can also escape this place by following Main Street."
    }
    s_to { return bowlingdoor.door_to }
    in_to { return bowlingdoor.door_to }
    w_to outsidelibrary
    e_to
    {
        "You take a quick peek in that direction. There doesn't seem to be a lot of buildings,
        for a while at least. It might be better to stick to this part of town instead."
    }
    cant_go
    {
        "There doesn't seem to be anything interesting in that direction."
    }
}

door bowlingdoor "bowling alley door"
{
    between outsidebowling, bowlingalley
    nouns "door"
    adjectives "bowling", "alley"
    article "the"
    is hidden
}

scenery bowlingbuilding "bowling alley"
{
    in outsidebowling
    nouns "bowling", "alley", "building"
    adjectives "bowling"
    article "the"
    long_desc
    {
        "Although you're no fan of bowling alleys, at least you must commend this one for not using one
        of those tacky animated neon signs you hate so much. Then again, maybe they just lacked the
        budget."
    }
    door_to { return bowlingdoor.door_to }
}

!----------------------------------------------------------------------------
! BOWLING ALLEY
!----------------------------------------------------------------------------
cl_room bowlingalley "Bowling Alley"
{
    long_desc
    {
        "This place might be open, but it's fairly empty at this time of the day. A few enthusiastic
        bowlers are practicing for their next tournament, and that's about it.\n
        Your sharp eyes do notice something interesting, though: a door marked \"STORAGE - EMPLOYEES
        ONLY\"";
        if storagedoor is open
            ", slightly ajar."
        else
            "."
    }
    n_to { return bowlingdoor.door_to }
    out_to { return bowlingdoor.door_to }
    in_to { return storagedoor.door_to }
    cant_go
    {
        "There isn't a way out in that direction."
    }
}

door storagedoor "storage room door"
{
    between storageroom, bowlingalley
    nouns "door"
    adjectives "storage", "room", "employees"
    article "the"
    is hidden
    door_to
    {
        if not npc_stan is special
            "\"NOW JUST WAIT A FRIGGIN' MINUTE!!\" bellows Stan. \"Where do you think you're going, punk!? This
            is a private area. Keep out!\""
        else
            return door..door_to
    }
}

scenery bowlingstuff "bowling equipment"
{
    in bowlingalley
    nouns "equipment", "lanes", "lane", "pins", "pin"
    adjective "bowling"
    article "the"
    long_desc
    {
        "Typical bowling equipment. Nothing worth spending your time on."
    }
    before
    {
        xobject DoThrowAt
        {
            if object = bowlingball
                return Bowling
        }
    }
}

!----------------------------------------------------------------------------
! STORAGE ROOM
!----------------------------------------------------------------------------
cl_room storageroom "Storage Room"
{
    long_desc
    {
        "This storage room would be spacy, if it wasn't completely filled with boxes and boxes
        of now-useless stuff. Only a few narrows paths allow you to walk across the room.\n
        Something in the corner of the room catches your eye almost immediately: an old IBM XT,
        sitting in all its glory on a dusty table."
    }
    out_to { return storagedoor.door_to }
    cant_go
    {
        "The room isn't \Uthat\u big. If you want to exit, just say so."
    }
}

scenery cl_box
{
    article "the"
    long_desc
    {
        "Those boxes might be filled with interesting stuff, but 1) they're tightly packed, and
        2) they're not yours."
    }
    is openable, not open
    before
    {
        object DoOpen
        {
            "Those boxes might be filled with interesting stuff, but 1) they're tightly packed, and
            2) they're not yours."
        }
    }
}

cl_box box "box"
{
    in storageroom
    nouns "box", "stuff"
}

cl_box boxes "boxes"
{
    in storageroom
    nouns "boxes"
    is plural
}

scenery computertable "table"
{
    in storageroom
    nouns "table"
    adjectives "computer", "old", "dusty"
    article "the"
    long_desc
    {
        "It's an old dusty table whose sole purpose is now to support a (possibly older) computer."
    }
}

scenery computer "IBM XT"
{
    in storageroom
    nouns "computer", "ibm", "xt", "beast"
    adjectives "ibm", "xt", "old"
    article "the"
    long_desc
    {
        "It's been quite a while since you saw once. Well, since the last flea market you've been
        to. A true antique.\n
        Your keen eye is drawn to the 5 1/4\" floppy drive right in the middle of the beast."
    }
    is container, switchable, openable, open
    before
    {
        object DoGet, DoMove
        {
            "No way! Those old computers were \Umassive\u!"
        }
        object DoSwitchOn
        {
            "Sorry pal, it looks toast."
        }
        object DoOpen, DoClose, DoLookIn
        {
            return Perform( verbroutine, floppydrive )
        }
        object DoPutIn
        {
            return Perform( &DoPutIn, object, floppydrive )
        }
    }
}

scenery floppydrive "floppy drive"
{
    in computer
    nouns "drive", "lid"
    adjectives "disk", "floppy", "drive"
    article "the"
    long_desc
    {
        "This storage unit - the only one this computer has, actually - is in front of the computer, the lid ";
        if self is open
            "open."
        else
            "closed."
    }
    is openable, not open, container
    before
    {
        object DoPutIn
        {
            "There's no need to put anything in that drive."
        }
    }
}

!----------------------------------------------------------------------------
! INVENTORY OBJECTS
!----------------------------------------------------------------------------

object money "money"
{
    in you
    nouns "money", "cash", "coins", "bills"
    article "some"
    long_desc
    {
        "You're carrying a few coins and some bills. Not much, but probably enough to
        buy a few trinkets."
    }
    is known
    before
    {
        object DoDrop, DoGive, DoPutIn
        {
            "You'd rather keep your money on yourself."
        }
        object DoCount
        {
            "You've got more than enough for the day."
        }
    }
}

object huntlist "object list"
{
    in you
    nouns "list", "note", "paper"
    adjectives "object", "item"
    article "an"
    long_desc
    {
        "It's a small paper listing all the objects you have to find to win the bet. Your
        friend and yourself made it by picking random pages in one book he had.
        \nHere's what's written on it:"
        Perform( &DoRead, huntlist )
    }
    short_desc
    {
        "You see a small paper with a list of objects on them."
    }
    is readable, known
    size 1
    before
    {
        object DoRead
        {
            Font( ITALIC_ON )
            "\n\UItems to find:\u\n\n* A calculator\n* A pencil sharpener\n* A dictionary
            \n* A 5 1/4\" floppy disk\n* A squash racket\n\nEvery item must be brought back to the house."
            Font( ITALIC_OFF )
        }
    }
}

object bowlingball "bowling ball"
{
    in closet
    nouns "ball"
    adjectives "bowling", "black"
    article "a"
    long_desc
    {
        "A big, black, heavy bowling ball. Your friend lent it to your a couple times
        in the past. The holes don't exactly line up with your fingers, but you can still
        get a decent grip."
    }
    short_desc
    {
        "A bowling ball sits over here."
    }
    size 30
    before
    {
        object DoPush, DoMove
        {
            "You know, this is \Unot\u how you bowl. (Just making sure.)"
        }
        object DoBorrow
        {
            !I decided it'd be nicier for the player if I made the taking automatic.
            if location = friendshome
            {
                "You ask your friend if you can take the ball. \"Yeah, sure, no problem.\""
                Perform( &DoGet, self )
                counter++    ! one minute
            }
            else
                return false
        }
    }
}

object airhorn "air horn"
{
    in drawer
    nouns "horn", "can"
    adjectives "air"
    article "an"
    long_desc
    {
        "Aah, the infamous air horn. You just love when your friend brings it to the game. It
        really annoys some of your fellow fans, but what the heck.\n
        This can is about half-full. You could still a few good blows out of it."
    }
    short_desc
    {
        "There is a air horn lying on the ground."
    }
    size 10
    before
    {
        object DoBlow, DoPlay
        {
            if ( location = friendshome ) and ( parent( self ) = squash )
            {
                if squash is special
                    "No need to go through that again."
                else
                {
                    squash is special
                    "Without warning, you press the horn trigger. A resounding blast goes
                    through the house and beyond it. After a few painful seconds, you stop.\n
                    \"And just what the heck do you think...\", starts your friend.\n
                    At the same moment, you both hear a faint voice, probably coming from
                    a neighbor, screaming \"STOP THAT RACKET!\".\n
                    You smile.\n
                    \"No, wait\", your friend starts. \"You're not serious...\"\n
                    \"Well, technically, it was indeed a racket, coming from a squash, and I
                    \"brought\" it inside the house...\"\n
                    \"Dude, this isn't \"Nord & Bert\" or something. This is ridiculous!\"\n
                    You two argue for a little while, but in the end, you win. You brought a
                    squash racket in the house, and so be it."
                    counter += 5 ! five minutes arguing
                }
            }
            else
            {
                select location
                    case park
                        "Yes, blowing the horn around here wouldn't probably disturb anyone... Which is
                        precisely why you don't see the purpose in doing so."
                    case bowlingalley, storageroom, publiclibrary
                        "Given your current location, you'd rather keep quiet."
                    case else
                        "You don't think it'd be reasonable to disturb all the neighborhood right now."
            }
        }
        object DoBorrow
        {
            if location = friendshome
            {
                "You ask your friend if you can take the horn. \"Yeah, sure, no problem.\""
                Perform( &DoGet, self )
                counter++    ! one minute
            }
            else
                return false
        }
    }
}

object squash "dessicated squash"
{
    nouns "squash"
    adjectives "old", "dessicated"
    article "a"
    long_desc
    {
        "Bleh. This squash has spent a good deal of time in the garbage. It's part rotten,
        part dessicated. A piece of it was bitten off, exposing the inside.\n
        Under normal circumstances, you'd \Unever\u carry something like around. But right now..."
    }
    short_desc
    {
        "A dessicated old squash sits lumply on the ground."
    }
    is container
    capacity 10
    holding 0
    size 15
    before
    {
        object DoSmell
        {
            "You catch the beginning of a whiff, and quickly change your mind."
        }
        object DoEat
        {
            "You're not hungry not to eat it at this moment. In fact, come to think of it, you
            doubt you'll ever be hungry enough to eat \Uthis\u!"
        }
    }
}

object hotdog "hot dog"
{
    nouns "hotdog", "hot-dog", "dog", "dressing", "dressings"
    adjectives "hot"
    article "a"
    long_desc
    {
        "A reasonably large hot dog, the kind you find in ball parks. Warm, well-cooked, with
        your favorite dressings. Yummy!"
    }
    short_desc
    {
        "One hot dog was carefully placed on the ground here."
    }
    size 10
    before
    {
        object DoBuy
        {
            if location = park
            {
                if hotdog in nothing
                {
                    npc_hotdogvendor is special
                    "You hand the vendor some of your money, and he hands you a delicious smelling
                    hot dog.";
                    if not Acquire( you, self )
                        " Since your hands are full, however, you almost drop it. You end up putting it
                        carefully on the ground."
                    else
                        ""
                    counter += 2    ! two minutes
                }
                else
                    "Now come on! There's \Uno\u way you're gonna need 2 hot dogs this morning."
            }
            else
                "And just where do you plan to buy that?"
        }
        object DoSmell
        {
            "Smell delicious!"
        }
        object DoEat
        {
            "This is a very tempting idea. However, the scavenger hunt should be your only
            concern for the moment. You guess that it'll still taste good went the hunt is
            over. Besides, it might always come in handy..."
        }
    }
}

object pen "pen"
{
    nouns "pen", "calculator"
    adjectives "calculator"
    article "a"
    long_desc
    {
        "This shiny pen bears, on one tip, a teenie-weenie built-in calculator. It doesn't work,
        of course. Most of these pen were piece of crap, as you well remember. But it's a
        calculator nevertheless, clearly valid as one of the items you seek."
    }
    short_desc
    {
        "There's a pen on the ground."
    }
    is known
    size 5
}

object sharpener "pencil sharpener"
{
    nouns "sharpener"
    adjectives "pencil"
    article "a"
    long_desc
    {
        "A small pencil shapener. Insert pencil, turn pencil, repeat if necessary. Made of light
        plastic, it probably came as a freebie with a pencil case."
    }
    short_desc
    {
        "Your keen eyes notice a small pencil sharpener."
    }
    is known
    size 3
}

object librarycard "library card"
{
    nouns "card"
    adjectives "library"
    article "a"
    long_desc
    {
        "A small plastic card, bearing only the Cheapsville city logo and a bar code. \IA bar code?\i
        How modern!"
    }
    short_desc
    {
        "You notice a library card over here."
    }
    is readable
    size 5
    before
    {
        object DoRead
        {
            "Cheapsville's Public Library - Membership Card"
        }
    }        
}

object paper "librarian note"
{
    nouns "paper", "note"
    adjectives "small", "librarian"
    article "the"
    long_desc
    {
        "The small paper bears the librarian's name and phone number. Hubba Hubba!"
    }
    is readable
    before
    {
        object DoRead
        {
            Perform( &DoLook, self )
        }
    }
}

object smalldictionary "small English dictionary"
{
    nouns "dictionary"
    adjectives "small", "english"
    article "a"
    long_desc
    {
        "A small but slightly heavy English dictionary. Based on the what you read inside the
        back cover, this one can be borrowed from the library."
    }
    short_desc
    {
        "You can see a small English dictionary here."
    }
    is known, readable, openable
    size 30
    parse_rank 1 ! To outrank the dictionary scenery
    before
    {
        object DoRead, DoOpen
        {
            "By the time you go through the whole dictionary, the bet will obviously be lost. Of course, by
            then you'll have tons of lovely new words to express your disappointment..."
        }
        object DoBorrow
        {
            if self is special
                "You already borrowed that dictionary. Once is enough."
            elseif not Contains( you, self )
                "You should probably pick it up first."
            elseif Contains( you, librarycard )
            {
                "\"You'd like to borrow that dictionary, right?\"
                \nShe takes it from you, scan, demagnetize it with some device you're not really
                familiar with, and then hands it back to you.
                \n\"There you go, sir!\""
                self is special
                counter += 2    ! two minutes
            }
            else
                "I don't see how you plan to do that, since you lack a library card."
        }
    }
}

object floppydisk "floppy disk"
{
    in floppydrive
    nouns "disk", "floppy", "diskette"
    adjectives "floppy", "5.25"
    article "a"
    long_desc
    {
        "This thing brings back countless memories. Ah, those nice old 5 1/4\" floppies. So elegant, so
        slim... so fragile, so large, so darn prone to loss of data. Good riddance."
    }
    short_desc
    {
        "There is a 5 1/4\" floppy disk over here."
    }
    is known
    size 15
}


!----------------------------------------------------------------------------
! NPCS (AND THEIR SPECIFIC CONVERSATION TOPICS)
!----------------------------------------------------------------------------

!----------------------------------------------------------------------------
! YOUR FRIEND
!----------------------------------------------------------------------------
character npc_friend "your friend"
{
    in friendshome
    nouns "friend", "man", "guy", "person"
    long_desc
    {
        "You've known him for ages. Through thick and thin, good and bad, you two always managed to keep
        in touch, and to support one another in time of need. You also share a strong interest in games
        and challenges of all kind.
        \nNoticing you staring at him, he turns toward you. \"Is there a problem?\" he asks. \"Or maybe
        you're giving up on our bet already?\""
    }
    is hidden
    before
    {
        object DoAsk
        {
            select xobject
                case bet
                    "\"What? You want to chicken out? No way, pal! What did we agree on, again? Oh yeah,
                    that's right, \Byou\b will be the one mowing my lawn for the whole summer. That'll
                    be pretty sweet.\""
                case lawn
                    "\"It looks good now. But it'll look even better soon, all thanks to you...\""
                case you
                    "\"Don't worry, I won't make you suffer too much once you lose the bet.\""
                case npc_friend
                    "\"Well, the actual moving is far from over, but still I feel great. This town seems
                    fantastic. Plus, I'm about to win this crazy bet, so...\""
                case town
                    "\"Quiet, peaceful, friendly, what more could I need? Now I just have to convince
                    \Byou\b to move here, too.\""
                case wife
                    "\"She loves it here. She's with the kids at the old place right now, though.\""
                case kid, kids
                    "\"The kids are a little anxious, but I'm 100% sure they'll love it here.\""
                case friendshouse
                    "\"See, that's the beauty of it. In those smaller towns, nice houses are much more
                    cheaper. You really should think about that.\""
                case school
                    "\"Yeah, there's even a school not too far away, can you believe it?\""
                case huntlist
                    "\"Don't even \Bthink\b of amending that list. You already accepted it, now you live
                    with it.\""
                case bowlingball
                    "\"Why do you care about it? You want to borrow it or something? Well, I don't mind.\""
                case airhorn
                    "\"Oh yeah, I remember that. I don't think you should blow it, though. You know how
                    annoying the sound is. Quite a racket.\""
                case squashracket
                {
                    if squash is special
                        "\"I still can't believe that trick you pulled. Well, fair is fair...\""
                    else
                        "\"You know I don't own one, and there aren't any sports centers in this part of town.
                        Good luck, man.\""
                }
                case pen
                {
                    if FindObject( pen, friendshome )
                        "\"Why are you asking me? You already found yourself a calculator.\""
                    else
                        "\"Yeah, of course I do have a calculator... back at my old home. Heh Heh.\""
                }
                case sharpener
                {
                    if FindObject( sharpener, friendshome )
                        "\"Why are you asking me? You already found yourself a pencil sharpener.\""
                    else
                        "\"Now come on, this one shouldn't be too tough to get.\""
                }
                case smalldictionary, library, librarycard
                {
                    if FindObject( smalldictionary, friendshome )
                        "\"Why ask me? You already got a dictionary.\""
                    else
                    {
                        library is known
                        librarycard is known
                        "\"I heard the public library isn't too far. But I don't have a card yet.\""
                    }
                }
                case floppydisk
                {
                    if FindObject( floppydisk, friendshome )
                        "\"It's been a long while since I've seen one of those. Congrats, pal.\""
                    else
                        "\"\BThat\b one is a toughy. I'm still surprised I managed to talk you into it.\""
                }
                case else
                    "Your friend looks at you suspiciously. \"Don't you have a bet to win? Or maybe you
                    plan to give up?\""
        }
        object DoTell
        {
            select xobject
                case bet
                    "\"What? You want to chicken out? No way, pal! What did we agree on, again? Oh yeah,
                    that's right, \Byou\b will be the one mowing my lawn for the whole summer. That'll
                    be pretty sweet.\""
                case huntlist
                    "\"Don't even \Bthink\b of amending that list. You already accepted it, now you live
                    with it.\""
                case bowlingball
                    "\"You want to borrow it? Well, I don't mind.\""
                case squashracket
                {
                    if squash is special
                        "\"I still can't believe that trick you pulled. Well, fair is fair...\""
                    else
                        "\"You know I don't own one, and there aren't any sports centers in this part of town.
                        Good luck, man.\""
                }
                case pen
                {
                    if FindObject( pen, friendshome )
                        "\"Yeah, you found one. Congrats...\""
                    else
                        "\"Yeah, of course I do have a calculator... back at my old home. Heh Heh.\""
                }
                case sharpener
                {
                    if FindObject( sharpener, friendshome )
                        "\"Yeah, you found one. Congrats...\""
                    else
                        "\"Now come on, this one shouldn't be too tough to get.\""
                }
                case smalldictionary, library, librarycard
                {
                    if FindObject( smalldictionary, friendshome )
                        "\"Yeah, you found one. Congrats...\""
                    else
                        "\"I heard the public library isn't too far. But I don't have a card yet.\""
                }
                case floppydisk
                {
                    if FindObject( floppydisk, friendshome )
                        "\"Yeah, you found one. Congrats...\""
                    else
                        "\"\BThat\b one is a toughy. I'm still surprised I managed to talk you into it.\""
                }
                case else
                    "\"Why are you wasting time talking about that? Don't you have a bet to win? Or maybe
                    you plan to give up?\""
        }
        xobject DoShow
        {
            select object
                case huntlist
                    "\"Don't even \Bthink\b of amending that list. You already accepted it, now you live
                    with it.\""
                case bowlingball
                    "\"You want to borrow it? Well, I don't mind.\""
                case airhorn
                    "\"Oh yeah, I remember that. I don't think you should blow it, though. You know how
                    annoying the sound is. Quite a racket.\""
                case pen, sharpener, smalldictionary, floppydisk
                    "\"Yeah, you found one. Congrats...\""
                case else
                    return false
        }
        xobject DoGive
        {
            select object
                case huntlist
                    "\"Don't even \Bthink\b of amending that list. You already accepted it, now you live
                    with it.\""
                case bowlingball, airhorn
                    "\"Just leave that somewhere.\""
                case pen, sharpener, smalldictionary, floppydisk
                    "\"Just put it somewhere around here.\""
                case else
                    return false
        }
    }
}

event in npc_friend
{
    select verbroutine
        case &DoAsk, &DoTell, &DoGive, &DoShow, &DoBlow, &DoPlay, &DoLook
            return true        ! NPC cannot idle if we just interacted with him/her
        case else
        {
            select random( 10 )
                case 1
                    "Your friend contemplates his house proudly. \"This is gonna be great!\" he comments."
                case 2
                    "Your friend slowly paces back and forth across the room."
                case 3
                    "In one far corner of the house, your friend rummages through some miscellaneous stuff."
                case 4
                    "Your friend turns toward you. \"Still here? Have you given up already?\""
                case else
                    return true
        }
}

object bet "bet"
{
    nouns "bet", "quest", "game", "hunt"
    article "the"
    is known
}

object lawn "your friend's lawn"
{
    nouns "lawn", "grass"
    article "the"
    is known
}

object wife "your friend's wife"
{
    nouns "wife", "spouse"
    is known
}

object kid "your friend's child"
{
    nouns "child", "kid", "boy", "girl"
    is known
}

object kids "your friend's children"
{
    nouns "children", "kids", "boys", "girls"
    is known, plural
}

object town "Cheapsville"
{
    nouns "town", "city", "cheapsville"
    is known
}

object squashracket "squash racket"
{
    nouns "racket"
    adjectives "squash"
    article "the"
    is known
}

!----------------------------------------------------------------------------
! HOT DOG VENDOR
!----------------------------------------------------------------------------
character npc_hotdogvendor "hot dog vendor"
{
    in park
    nouns "man", "guy", "person", "vendor", "clerk", "salesman", "sap"
    adjectives "hot", "dog", "hot-dog", "hotdog", "poor"
    article "the"
    long_desc
    {
        "Despite his greasy apron, this middle-aged man seems like a nice fellow. He
        keeps working behind his stand, apparently to make sure everything's ready
        for the potential customers."
    }
    is hidden
    before
    {
        object DoAsk
        {
            select xobject
                case npc_hotdogvendor
                    "\"Well, I've been selling hot-dogs in here for years, now. What I enjoy the most about
                    this job is getting to see the children play and the young lovers frolic... I'm a big
                    romantic, y'know.\""
                case you
                    "\"Why, you look... hungry perhaps? I know it's a little early, but how 'bout a nice hot
                    dog?\""
                case town
                    "\"I've been here for quite a while. Before they made that park, actually. I couldn't
                    think of a better place to be.\""
                case thepark
                    "\"Lovely place, isn't it? Too bad there's no one else around...\""
                case hotdog
                    "\"Just try one of those babies, and you'll be convinced.\""
                case school
                    "\"Ya lookin' for it? Follow Oak Street all the way, then turn right on Main.\""
                case bankbuilding
                    "\"Ya lookin' for it? Follow Oak Street all the way, it's right there.\""
                case library
                    "\"Ya wanna go there? Follow Oak Street all the way, then turn left on Main.\""
                case bowlingbuilding
                    "\"Ya wanna go there? Follow Oak Street all the way, then turn left on Main. It's a
                    little farther.\""
                case librarycard
                    "\"Nah, I don't have one...\""
                case squashracket
                    "\"Yikes! I'm not the sporty type m'self, as you might've guess. Can't help ya there.\""
                case pen
                    "\"Nope... I don't need one to count the money I make here, alas.\""
                case sharpener
                    "\"Sorry, I only use pens here.\""
                case smalldictionary, library
                    "\"You trying to insult me or somethin'? Oh, oh I see. Did ya try the library?\""
                case floppydisk
                    "\"A \Bwhat\b? Oh, those black plastic thingies. Haven't seen those in a while.\""
                case else
                    "\"Er... No, don't think I can help ya. How 'bout a delicious hot dog?\""
        }
        object DoTell
        {
            select xobject
                case bet, huntlist
                    "\"Yikes! Well, the best of luck t'ya, pal!\""
                case else
                    return false
        }
        xobject DoShow
        {
            select object
                case huntlist
                    "\"Yikes! Well, the best of luck t'ya, pal!\""
                case money
                    "\"Aah! So you've got enough for a hot dog, then?\""
                case else
                    return false
        }
        xobject DoGive
        {
            if object = money
                Perform( &DoBuy, hotdog )
            else
                return false
        }
    }
}

event in npc_hotdogvendor
{
    select verbroutine
        case &DoAsk, &DoTell, &DoGive, &DoShow, &DoBuy
            return true        ! NPC cannot idle if we just interacted with him/her
        case else
        {
            select random( 8 )
                case 1
                    "The hot dog vendor hums a lively tune."
                case 2
                {
                    if self is special
                        "The vendor turns toward you. \"Hey pal! How 'bout another hot dog?\""
                    else
                        "The vendor turns toward you. \"Hey pal! How 'bout a nice hot dog?\""
                }
                case 3
                    "The vendor rummages through some stuff behind his hot dog stand."
                case else
                    return true
        }
}

object thepark "park"
{
    nouns "park"
    adjectives "city"
    is known
}

!----------------------------------------------------------------------------
! BANK RECEPTIONIST
!----------------------------------------------------------------------------
female_character npc_receptionist "bank receptionist"
{
    in citybank
    nouns "woman", "girl", "person", "receptionist", "secretary", "lady"
    adjectives "bank"
    article "the"
    long_desc
    {
        "A comely woman, probably in her late twenties. She'd look like a high profile
        businesswoman if her suit didn't look so rumpled, as if worn for a long, frantic period.
        \nShe looks deeply involved in her paperwork, although she looks up to you from time to
        time, to see if you actually want something from her."
    }
    is hidden
    before
    {
        object DoAsk
        {
            select xobject
                case bet
                    "\"Oh, I see. Well it sounds like fun! I which I'd have time for things like
                    that.\""
                case town
                    "\"It's a wonderful place, I can tell you that for sure. And do you realize that
                    only a few cities can claim that they still have their very own, non-afiliated
                    bank?\""
                case job, self
                {
                    files is known
                    promotion is known
                    lunch is known
                    "\"Well, I love working here - don't get me wrong - but things have been quite
                    hectic lately. Even forgot my lunch, for Pete's sake. See, there's this bunch of
                    files that need to be computerized, and for some reason I'm the one doing that job.
                    Then again, I don't mind - it's a definite change from my usual job, and I strongly
                    suspect they're giving me this to see how good I am under pressure, new challenges
                    and all that. I smell a promotion...\" She smiles."
                }
                case files
                    "\"Oh, sorry, but that's confidential stuff. Not that it's all that interesting anyway,
                    however.\""
                case promotion
                    "\"Now don't around saying that to everyone! I'm just hoping, thinking... that's all.\""
                case atm
                    "\"Nice isn't it? We acquired it a mere six months ago, and I must say it's been working
                    great. Personally I was somewhat worried at first - because of the diminution of human
                    contact and so on. But I changed my mind, it's just fine.\""
                case bankbuilding
                    "\"The Cheapsville City Bank has quite an interesting history. Its first instalment
                    dates back from 1875, and it was... Oh, sorry. I really don't have time for this now. Tons
                    of work to do, you know.\""
                case thepark
                {
                    hotdog is known
                    "\"Yes, there's a nifty little park not too far from here. Just exit this building, then
                    go right ahead on Oak. Oh, and I recommend buying a hot dog. They're just delicious!\""
                }
                case school
                    "\"The elementary school is a just a few blocks from here. Exit the building and turn left,
                    if you want to go there. I don't know much else about it. I didn't go there, and I don't
                    have any kids - not that I wouldn't like to have some. Then again, don't get me wrong - I
                    still have several years in front of me, so there's no rush. Anyway, back to work...\""
                case library
                {
                    librarycard is known
                    "\"Ah, I just \Blove\b that sweet little library. Of course, I must admit it's a little
                    tiny - nothing to compare big some of the ones in the big city - but it's well furnished
                    nevertheless. I go there at least once a week to borrow some novels - I'm a big fantasy fan,
                    although I don't necessary frown on sci-fi stories, or even romance novels - and quite
                    frankly sometimes I find sci-fi more believable than some of those romances, but anyway - my
                    point is that library is just fine with me? Oh, and if you wanna go there, go out and turn
                    right.\""
                }
                case bowlingbuilding
                    "\"The bowling alley? Frankly, I could never understand why would anyone would be interested
                    in throwing a large ball at a bunch of pins, but hey - that's just little me, I
                    guess... Anyway, the alley's just past the public library.\""
                case hotdog
                    "\"Oh, that nice old man in the park cooks the juicest hot dogs I ever tasted. Now
                    I know these aren't particularly good for your health - even those so-called 'healthy'
                    weiners, I don't trust them - but for \Bthose\b hot dogs I often make an exception, since
                    the sheer taste reminds me of my childhood - you know, the afternoons at the ball park, that
                    kind of stuff.\""
                case lunch
                    "\"Yes, can you believe that? With all the work I have to do and the countless things I had
                    to keep in mind - the stress, you know - I even managed to leave my own lunch at home. I
                    just don't know what I'm gonna do, it's not even lunchtime and I'm already starving - see, I
                    got here at the wee hours of the morning - as you can probably guess, I'm quite
                    dedicated. Well well, poor little me...\""
                case squashracket
                    "\"No, I regret but I'm not the sporting type - I do try to stay in shape, of course - I
                    walk to and from work, and my home isn't really close from here - it's in the newest Western
                    sector, have you been there? Anyway, I don't even think we have any squash facilities in the
                    whole town - a few tennis courts, and maybe, er, badminton, that's it. No squash.\""
                case pen
                {
                    if self is special
                    {
                        if parent( pen ) = nothing
                        {
                            "\"Well, now that I think of it... Give me a sec.\" She starts searching through one
                            of her drawers. \"Ah, there! You see, this is one of those cheap pens that came with
                            a calculator on them. It broke down - not surprising if you ask me, besides who can
                            work with those ridiculously small buttons, I ask you - so anyway, I don't need it
                            anymore. It does count as a calculator, right?\"
                            \nYou totally agree, and gratefully accept.";
                            if not Acquire( you, pen )
                                " Unfortunately, you're carrying so much stuff that it falls on the ground. Oh
                                well..."
                            else
                                ""
                        }
                        else
                            "\"Well, I gave you that pen, didn't I?\""
                    }
                    else
                    {
                        pen is special
                        "\"Er... Well, I \Bdo\b have a calculator, but I do need it. You know, I need it all the
                        time - especially with that current assignment I'm working on - I use it again and
                        again. I mean, I'm sorry - I'd love to help you with that little game of yours - but I
                        just don't think I can, really...\""
                    }
                }
                case sharpener
                    "\"Hmmm... let me think. I \Bshould\b have one of those lying somewhere - I'm pretty sure I
                    used to, at least, with all those pencils I used to have - I always preferred pencils, but
                    now they insist that I use pens all the time.\" She starts searching inside her desk for a
                    while, then gives up. \"Well, it seems I don't have it anymore. Must have given it to
                    someone else and forgot about it. Or maybe I just lost it - I'm not a very orderly person,
                    you know. Oh well, I'm sorry.\""
                case smalldictionary
                {
                    library is known
                    librarycard is known
                    "\"Well, did you try the library? That'd be an obvious option...\""
                }
                case floppydisk
                    "\"Oh my. We do have several computers around here - and I dare say I'm pretty good working
                    with those, well, for the easy tasks at least - I thought about learning to program, but I
                    changed my mind. But those old disks, no, I've never seen one around here. Sorry...\""
                case librarycard
                {
                    if self is special
                    {
                        if parent( librarycard ) = nothing
                        {
                            "\"You'd like to borrow my library card? Well...\"
                            \nYou explain that you plan to borrow a dictionary for a short while only, then return it to the library
                            and bring the card back to her.
                            \n\"Oh, alright! That sounds okay. There...\"
                            \nShe hands you the card.";
                            if not Acquire( you, librarycard )
                                "..which falls of your already quite full hands, and end up on the floor."
                            else
                                ""
                        }
                        else
                            "\"But I already lent it to you!\""
                    }
                    else
                        "\"Why yes, I do have one... But, I, well, you know, I wouldn't lend it to anyone. I
                        mean it's not that don't look trustworthy or anything, but I just don't... Well, you
                        understand, right? I'm so sorry...\""
                }
                case else
                    "\"Sorry, I can't help you there. And I'm pretty busy anyway right now.\""
        }
        object DoTell
        {
            select xobject
                case bet
                    "\"Oh, I see. Well it sounds like fun! I which I'd have time for things like
                    that.\""
                case hotdog
                    "\"Hmmm... I could just die for one of those right now... Hey, you got me wondering. Would
                    you be kind enough - I mean I doubt want to bother you or anything - to go and get me
                    one of those awesome hot dogs? That would be soooooo nice of you.\""
                case else
                    "\"Well, that sounds very nice, but I've got a lot of work to do. Sorry...\""
        }
        xobject DoGive
        {
            select object
                case hotdog
                {
                    if self is special
                        "\"Oh, that's very nice of you - I mean I appreciate the attention, I really do - but
                        one hot dog will be quite sufficient for me. Thanks anyway.\""
                    else
                    {
                        self is special
                        move hotdog to nothing
                        "You hand the hot dog to her. A wide smile enlightens her face. \"Oh, that's great! I was
                        just \Bstarving\b!\" She takes a big bite. \"How khan I rephay yhou for chis?\""
                        if pen is special
                        {
                            "\n\"Oh, I know! Give me a sec.\" She starts searching through one of her drawers.
                            \"Ah, there! You see, this is one of those cheap pens that came with a calculator
                            on them. It broke down - not surprising if you ask me, besides who can work with
                            those ridiculously small buttons, I ask you - so anyway, I don't need it anymore. It
                            does count as a calculator, right?\"
                            \nYou totally agree, and gratefully accept."
                            if not Acquire( you, pen )
                                " Unfortunately, you're carrying so much stuff that it falls on the ground. Oh
                                well..."
                            else
                                ""
                        }
                    }
                }
                case else
                    "\"That's very kind of you, but no thanks.\""
        }
        xobject DoShow
        {
            select object
                case huntlist
                    "\"Oh, I see. Well it sounds like fun! I which I'd have time for things like
                    that.\""
                case hotdog
                {
                    if self is special
                        "\"Oh, that's very nice of you - I mean I appreciate the attention, I really do - but
                        one hot dog will be quite sufficient for me. Thanks anyway.\""
                    else
                        "\"Hmmm... I could just die for one of those right now...\""
                }
                case else
                    return false
        }
        object DoKiss
        {
            return ReceptionistDeath
        }
    }
}

event in npc_receptionist
{
    select verbroutine
        case &DoAsk, &DoTell, &DoGive, &DoShow
            return true        ! NPC cannot idle if we just interacted with him/her
        case else
        {
            select random( 8 )
                case 1
                    "The receptionist shuffles through her stacks of paper, then lets out a sigh."
                case 2
                    "The receptionist raises her gaze toward you. \"Do you require assistance?\" she asks."
                case 3
                {
                    if self is special
                        "The receptionist smiles at you. \"Thanks again for that nice hot dog, it really hit the spot.\""
                    else
                    {
                        lunch is known
                        "The receptionist groans. \"I just can't believe I forgot my lunch!\""
                    }
                }
                case else
                    return true
        }
}

object job "work"
{
    nouns "job", "work"
    is known
}

object files "files"
{
    nouns "files"
    article "the"
    is plural
}

object promotion "promotion"
{
    nouns "promotion"
}

object lunch "lunch"
{
    nouns "lunch", "snack", "food"
    article "a"
}

!----------------------------------------------------------------------------
! SCHOOL KIDS
!----------------------------------------------------------------------------
character npc_schoolkids "school kids"
{
    in schoolyard
    nouns "kids", "children", "boys", "girls"
    adjective "school", "young"
    article "the"
    long_desc
    {
        "Countless young children are running everywhere, playing, laughing, screaming, and doing
        the kind of things normal kids do on recess."
    }
    is hidden, plural
    before
    {
        object DoAsk, DoTell
        {
            if parent( npc_mary ) = nothing
            {
                move npc_mary to schoolyard
                "Startled, some of the kids turn toward you. They seem either shy or scared to talk
                to you. After a few seconds, a little girl steps forward.
                \n\"Hello, sir! What's your name?\"
                \n\"Don't talk to him, Mary!\" another girl says. \"He's a stranger! You know we don't
                talk to strangers!\"
                \n\"Well\", she replies, \"you're all around, right? I'll stay far enough. If he tries
                to kidnap me, you'll scream, ok?\"
                \nGrateful, you introduce yourself to her."
            }
            else
            {
                "Except for Mary, none of the kids will directly speak to you, it seems."
            }
        }
        xobject DoShow, DoGive
        {
            "Having been carefully taught not to accept anything from strangers, the kids refuse to come
            close enough."
        }
        object DoKiss
        {
            return KidsDeath
        }
        object DoPlayWith
        {
            "The kids are clearly scared of you, so playing with them isn't a sensible option."
        }
    }
}

event in npc_schoolkids
{
    select verbroutine
        case &DoAsk, &DoTell, &DoGive, &DoShow
            return true        ! NPC cannot idle if we just interacted with him/her
        case else
        {
            select random( 8 )
                case 1
                    "You're almost overwhelmed by the sounds of all the kids playing around."
                case 2
                    "Some kids come nearby, running and screaming. When they finally notice you, they quickly
                    turn around."
                case 3
                    "You start feeling a little jealous of all these kids having fun. Then again, you're already
                    playing quite a challenging game, aren't you?"
                case else
                    return true
        }
}    

!----------------------------------------------------------------------------
! MARY
!----------------------------------------------------------------------------
female_character npc_mary "little Mary"
{
    nouns "mary", "girl", "child", "kid"
    adjective "school", "young", "little", "brave"
    short_desc
    {
        "That brave little girl, Mary, stands nearby, looking at you with inquisitive eyes."
    }
    long_desc
    {
        "Cute, that's the first word that comes to you. She looks like those little girls they
        use as models in photography studios. Bright eyes, sweet smile... Hey, who knows, maybe you'll
        have a little girl like her someday! Right now, she's scrutinizing you just as you're doing with her."
    }
    before
    {
        object DoAsk
        {
            select xobject
                case bet
                    "\"That sure sounds like a nice game. I wish you good luck, sir!\""
                case town
                    "\"Oh, it's a very big city. I couldn't walk through it all in one day. But I heard
                    that there are much bigger cities. Those must be \Bhuge\b...\""
                case npc_mary
                    "\"Well, my name is Mary. Glad to meet you. My parents say I should always be nice with
                    everybody. But they also say I shouldn't talk with strangers. If I wouldn't talk to you
                    at all, it wouldn't be nice, would it? Sometimes I don't understand my parents at all...\""
                case npc_schoolkids
                    "\"Don't worry, they're just shy.\""
                case bankbuilding
                    "\"My parents like to go there, but I don't. It's too boring...\""
                case thepark
                {
                    hotdog is known
                    "\"Oh, I love the park! My parents always bring me there in the weekend. And sometimes,
                    if I'm real nice, they buy me a super-duper-delicious hot dog!\""
                }
                case school
                {
                    surprise is known
                    "\"I like going to school. I learn tons of fun things. But today's even better! We'll play
                    all kinds of games and we'll even have a picnic! It's a special... hmm... a special
                    commemoration Day! I don't remember the rest. Well, it's gonna be a big surprise.\""
                }
                case surprise
                    "\"Well, I don't know. Otherwise, it wouldn't be a surprise, right?\""
                case library, librarycard
                    "\"Oh, it's that big building down the road with all the books in it. I don't go often,
                    cause I'm not big enough to read all the books. But one day I will.\""
                case bowlingbuilding
                    "\"My daddy bowls sometimes, but I don't go with him.\""
                case hotdog
                    "\"My daddy cooks good hot dogs. But the ones in the park are the bestest!\""
                case squashracket
                    "\"Squash? I thought squash was a sound it does when you jump in a mud puddle?
                    Oh, and Bobby Falstein says they eat squash at his home, but I didn't believe him.\""
                case pen
                    "\"The older kids have calculators, but not us. We have to count, and to count, and sometimes
                    we use our fingers, you know, just to be sure.\""
                case sharpener
                {
                    if parent( sharpener ) = nothing
                    {
                        "\"You mean something like this?\"
                        \nShe digs in her pockets for a while, then proudly exhibits a small pencil sharpener.
                        \n\"I found it on the playground this morning. It doesn't work as good as the big one in
                        our classroom, so I guess you can have it. There...\"
                        \nShe throws the sharpener at you. It falls near your left foot."
                        move sharpener to schoolyard
                    }
                    else
                        "\"But I threw it to you! Did you lost it? Your momma wouldn't be proud...\""
                }
                case smalldictionary
                    "\"Oh, I know: it's a book with all the words explained in it, right? My teacher has one, but
                    you can't have it, cause she needs it.\""
                case floppydisk
                    "\"Huh? What's that?\""
                case else
                    "\"I don't know what you're talking about. Maybe I'm too small... Well, sorry.\""
        }
        object DoTell
        {
            select xobject
                case bet
                    "\"That sure sounds like a nice game. I wish you good luck, sir!\""
                case floppydisk
                    "\"Those things used to exist? Really? Wow...\""
                case else
                    "\"You know lots of things, right sir?\""
        }
        xobject DoShow
        {
            "\"You love to show things? I love show-and-tells too. But I'm not supposed to get too
            close to you, mister. Sorry.\""
        }
        xobject DoGive
        {
            if object = librarycard
                "You decide to hold on to the card until the hunt's over, just to remain on the safe side."
            else
                "\"No thank you, sir\" she replies with an overly polite tone."
        }
        object DoKiss
        {
            return KidsDeath
        }
        object DoPlayWith
        {
            "\"Oh, I'd like to, but I can't. My mommy doesn't want me to play with strangers...\""
        }
    }
}

object surprise "surprise"
{
    nouns "surprise", "day"
    adjectives "special", "commemorative"
    article "the"
}

!----------------------------------------------------------------------------
! LIBRARIAN
!----------------------------------------------------------------------------
female_character npc_librarian "librarian"
{
    in publiclibrary
    nouns "woman", "lady", "librarian", "clerk"
    adjective "library", "librarian"
    article "the"
    long_desc
    {
        "Although she's probably in her mid-thirties, this librarian looks slightly older at first glance,
        due to her \I(very)\i sharp dress, her \I(nice)\i horned-rimmed glasses, and her \I(long)\i brown hair up
        tightly in a bun. When you look at her more closely, however, you can see a flash of youth in her
        \I(gorgeous)\i blue eyes. Apparently, she just likes to dress based on the Ultimate Librarian
        Archetype. Well, you're not the one who'll complain. No sir-ree... In fact, right now you're trying to
        sneak a peek of her \I(long)\i legs lying \I(elegantly)\i along the desk. You can't help but wonder if
        she circulates."
    }
    is hidden
    before
    {
        object DoAsk
        {
            select xobject
                case bet
                    "\"Well, it sure sounds interesting. Too bad I'm working all day, I might have even
                    decided to join and help you...\""
                case you
                    "\"Are you from around here? I don't remember seeing you before today?\"\nYou explain
                    to her that you're just visiting a friend. She frowns. \"Oh well...\""
                case self, job
                    "\"Well, I moved in this town after my studies. I always wanted to be a librarian, and
                    this quiet place was just perfect.\""
                case town
                {
                    mrright is known
                    "\"Cheapsville is a great place to raise a family. At least that's what I think. I do
                    some babysitting once in a while, and I'd love to have kids of my own. I just haven't met
                    Mr. Right, I guess...\""
                }
                case mrright
                    "\"Well, I had my deal of boyfriends, but nothing serious these days, unfortunately.\""
                case thepark
                {
                    hotdog is known
                    "\"Yes, there's a small city park right at the end of Oak street. I love to go sit on a
                    bench to read a good novel. However, being a vegetarian, I can hardly stand the smell of all
                    those hot dogs.\""
                }
                case bankbuilding
                    "\"The city bank is on Main street, right where it crosses Oak. I have an account
                    there, and I can tell you the service is a good, if not better, than with any of those
                    \"major\" banks.\""
                case school
                    "\"Are you looking for it? When you exit this building, turn right and walk for a while. You
                    can't miss it.\""
                case library
                    "\"It may not be the Library of Alexandria, but it's all mine. Well, in a manner of
                    speaking, of course.\""
                case bowlingbuilding
                    "\"The bowling alley isn't far from here. Just turn left when you leave here. It's been quite
                    a while since I went bowling, myself.\""
                case hotdog
                    "\"Bleh! The horrors they put in those...\""
                case squashracket
                    "\"Oh, I heard about squash, but never played it myself. Somehow I assumed it was a game for
                    overstressed businessmen. Can't help you there...\""
                case pen
                    "\"That's just too bad. I usually do keep a calculator in my purse, but today I left it at
                    home. You're not very lucky, sorry.\""
                case sharpener
                    "\"I used to keep a couple of those, but unfortunately I threw them all away a while ago. I
                    didn't need them anymore, and most of them didn't work properly anyway.\""
                case floppydisk
                    "\"Let me think... We did use to have older computers which used those... But they were all
                    thrown away. Or sold in a garage sale. I remember the bowling alley bought one, though I
                    doubt they actually used it in the end.\""
                case smalldictionary
                {
                    if smalldictionary is special
                        "\"Well, the one you borrowed should do the trick, now shouldn't it?\""
                    else
                        "\"Of course, we keep all kind of dictionaries here. Some of them should be just
                        perfect for you... assuming you have a library card, of course.\""
                }
                case book, books, dictionaries, encyclopedia, encyclopedias
                    "\"Seeing anything you like? Most of them can be borrowed, if you have a card.\""
                case librarycard
                    "\"Any citizen of Cheapsville can get a library card.  You fill a request form, and it takes
                    about one week. I realize this probably isn't what you wanted to hear. Sorry about that. But
                    once you get your card, you can allow anyone to use it, but are held responsible for what
                    gets borrowed with it.\""
                case requestform
                    "\"Come to think of it, I ran out of forms yesterday. This definitely isn't your lucky
                    day, is it?\"
                    \nShe gives you a \"sorry\" face. You can help but notice how deep her blue eyes are.\""
                case date
                {
                    "She blushes.
                    \n\"Well, I, er, I mean, well, sure, why not?\"
                    \nShe grabs a small piece of paper, and writes her name and phone number on it.
                    \n\"There,\" she says as she hands it to you, \"call me whenever you like.\"
                    \nShe resumes working at her desk, although she now looks at you with different eyes, and
                    a nice little smile."
                    move paper to you
                }
                case else
                    "\"Sorry, but I don't think I can help you with that.\""
        }
        object DoTell
        {
            select xobject
                case bet
                    "\"Well, it sure sounds interesting. Too bad I'm working all day, I might have even
                    decided to join and help you...\""
                case you
                    "\"Are you from around here? I don't remember seeing you before today?\"\nYou explain
                    to her that you're just visiting a friend. She frowns. \"Oh well...\""
                case smalldictionary
                {
                    if smalldictionary is special
                        "\"Well, the one you borrowed should do the trick, now shouldn't it?\""
                    else
                        "\"Of course, we keep all kind of dictionaries here. Some of them should be just
                        perfect for you... assuming you have a library card, of course.\""
                }
                case else
                    "\"Well, that's very nice.\""
        }
        xobject DoShow
        {
            select object
                case huntlist
                    "\"Well, it sure looks interesting. Too bad I'm working all day, I might have even
                    decided to join and help you... I presume you came in here for the dictionary, right?\""
                case smalldictionary
                {
                    if smalldictionary is special
                        "\"That's the one you borrowed, right?\""
                    else
                        "\"Well, you'd be allowed to borrow this dictionary provided you handed me a
                        valid library card.\""
                }
                case librarycard
                    "\"Yes, this does seems like a valid library card. You should be able to borrow books
                    with it.\""
                case hotdog
                    "\"Yeech! Please keep that stinking thing away from me, please.\""
                case else
                    return false
        }
        xobject DoGive
        {
            select object
                case smalldictionary
                {
                    if smalldictionary is special
                        "\"Well, you just borrowed it, so it's yours, for the time being.\""
                    else
                        "\"You want to borrow that dictionary? I'll need a valid library card, then.\""
                }
                case librarycard
                {
                    if Contains( you, smalldictionary ) and not smalldictionary is special
                    {
                        "\"You'd like to borrow that dictionary, right?\"
                        \nShe takes it from you, scan, demagnetize it with some device you're not really
                        familiar with, and then hands it back to you.
                        \n\"There you go, sir!\""
                        smalldictionary is special
                    }
                    else
                        "\"Yes, this does seems like a valid library card. You should be able to borrow books
                        with it.\""
                }
                case hotdog
                    "\"Yeech! Please keep that stinking thing away from me, please.\""
                case else
                    return false
        }
        object DoBorrow
        {
            "Well, you've already \"checked her out\" a lot, don't you think?"
        }
        object DoKiss
        {
            "Pushed by some strange instinct, you suddenly lunge toward the librarian, grab her gently but
            firmly, and start kissing her passionately. After a short surprise, she responds, and the kiss
            lingers some more, letting you enjoy the warmth of her sweet kiss.\nFinally, you let go of your
            embrance.
            \n\"Wow! I mean, hmm, well, that was...\"  Her face turns a cute shade of red. With a faint
            smile on her lips, she grabs a small piece of paper, and writes her name and phone number on it.
            \n\"There,\" she says as she hands it to you, \"call me whenever you like.\"
            \nShe resumes working at her desk, although she now looks at you with a whole different perspective."
            move paper to you
            counter += 2    ! two minutes
        }
    }
}

object mrright "Mr Right"
{
    nouns "right", "mr", "mister", "boyfriend"
    adjectives "mr", "mister",
}

object requestform "request form"
{
    nouns "form", "request"
    adjectives "request", "library", "card"
    article "a"
}

object date "date"
{
    nouns "date"
    article "a"
    is known
}


!----------------------------------------------------------------------------
! BOWLERS
!----------------------------------------------------------------------------
character npc_bowlers "bowlers"
{
    in bowlingalley
    nouns "bowlers", "players", "bowler", "men"
    adjective "bowling"
    article "the"
    long_desc
    {
        "You can see, all around the place, several bowlers practicing in different alleys. Most
        of them seem to be over 40, which seems... apropriate."
    }
    is hidden, plural
    before
    {
        object DoAsk, DoTell
        {
            "You don't really want to bother the bowlers, especially with the owner keeping his eyes
            on you."
        }

        xobject DoShow, DoGive
        {
            "You don't really want to bother the bowlers, especially with the owner keeping his eyes
            on you."
        }
    }
}

event in npc_bowlers
{
    select random( 8 )
        case 1
            "A loud cheer arises as one of the bowlers does a particular tough spare."
        case 2
            "A bunch of bowlers make fun at another, who just made a gutter ball."
        case 3
            "Bowlers come in and out of the place, sometimes swapping lanes."
        case else
            return true
}

!----------------------------------------------------------------------------
! STAN
!----------------------------------------------------------------------------
character npc_stan "Stan"
{
    in bowlingalley
    nouns "man", "guy", "stan", "owner"
    adjectives "owner"
    long_desc
    {
        "Stan (well, you assume it's his name, since it's written in large letters in the back of his
        bowling shirt) is probably the first good argument against this town you found today. He's
        unshaved, he looks unfriendly (no, make that mean) and keeps eyeing you in a scary way. Based on
        the way he interacts with the other bowlers, you deduce he owns the place."
    }
    short_desc
    {
        "Stan, the owner, watches you suspiciously from a short distance."
    }
    before
    {
        object DoAsk
        {
            select xobject
                case bowlingbuilding, npc_bowlers
                    "\"I owned this place for 18 years now. I've had my share of problems. And I've my
                    share of outsiders. Well guess what? They tend to come together. So you'd better
                    behave, pal!\""
                case bowlingball
                {
                    if Contains( bowlingalley, bowlingball )
                        "\"Well, it's hardly a professional ball, but one could make a good score out of
                        it. As for you though, I still have my doubts.\""
                    else
                        "\"See, this is practice morning. It means three things. One - It's free.  Two - You
                        don't play a standard game. You just pick a lane, bowl, and that's it.  Three - You
                        need to provide your own ball and shoes.\" He looks at your shoes, which, because you
                        are trendy and alternative, happen to be bowling shoes. \"Well, those can do, anyway.\""
                }
                case bowlinggame, bowlingshoes
                        "\"See, this is practice morning. It means three things. One - It's free.  Two - You
                        don't play a standard game. You just pick a lane, bowl, and that's it.  Three - You
                        need to provide your own ball and shoes.\" He looks at your shoes, which, because you
                        are trendy and alternative, happen to be bowling shoes. \"Well, those can do, anyway.\""
                case else
                    "\"Listen pal, if you came here to bowl, go ahead and play. If you didn't, just
                    get the heck out of here! I know everybody here, except you. So you'd better behave...\""
        }
        object DoTell
        {
            "\"Do I look like I actually \Bcare\b about your problems?\" Stan sneers."
        }
        object DoShow
        {
            "\"Well, it's hardly a professional ball, but one could make a good score out of
            it. As for you though, I still have my doubts.\""
        }
        object DoKiss
        {
            "For a moment, you wonder if Stan would be nicer if you gave if a big juicy kiss. Fortunately,
            your sanity takes over soon after." 
        }
    }
}

object bowlinggame "bowling game"
{
    in bowlingalley
    nouns "bowling", "game"
    adjectives "bowling"
    article "the"
    is hidden
    before
    {
        object DoPlay
        {
            return Bowling
        }
    }
}

object bowlingshoes "bowling shoes"
{
    nouns "shoes", "flats"
    adjectives "bowling"
    article "the"
    is known
}


!----------------------------------------------------------------------------
! NEW VERB ROUTINES
!----------------------------------------------------------------------------

routine DoRead
{
    ! There is no 'default response' - Reading is handled by each readable object
    return true
}

routine DoPutOn
{
    ! Because containers & platforms share the same core code, we can reuse DoPutIn
    return DoPutIn
}

routine DoBlow
{
    ! Fails by default
    "I don't see how you could blow that."
}

routine DoPlay
{
    ! Fails by default
    "Is that a game? A song? I'm afraid I'm not familiar with it..."
}

routine DoGiveUp
{
    "And mow your friend's lawn for the whole summer? NEVER!"
}

routine DoBuy
{
    ! Fails by default
    "I doubt you could actually purchase that. Not today, anyway."
}

routine DoBorrow
{
    ! Fails by default
    ! I check the held status here instead of in the verb def to allow 'borrow librarian'
    if not Contains( you, object )
        "You're not holding that."
    else
        "I don't precisely see how you plan to borrow that."
}

routine DoBowl
{
    if not location = bowlingalley
        "This isn't an appropriate location for bowling."
    else
        if not Contains( bowlingalley, bowlingball )
            "I don't see any bowling ball around here. That is, any \Bavailable\b one."
        else
            return Bowling
}

routine DoCount
{
    ! Fails by default
    "There's no need to count that."
}

routine DoPlayWith
{
    ! Fails by default
    print "To be honest with you, "; The( object ); " doesn't seem interested in any games."
}

replace DoKiss
{
    if object is not living
        "You need to get out more."
    else
    {
        print "You don't really feel attracted to "; The( object ); " in that special way."
        return true
    }
}

!DESIGN COMMENT: In the past years, the use of numerical "scores" in IF have become less and less popular.
!Here, since the goal is to get a bunch of items, I turned the score into a nice little checklist.
replace DoScore
{
    local bGotSomething = false
    "Well, let's see. At the moment..."

    if Contains( you, pen )
    {
        "- You're carrying the pen/calculator."
        bGotSomething = true
    }
    elseif Contains( friendshome, pen )
    {
        "- The pen/calculator has been brought at your friend's place."
        bGotSomething = true
    }
        
    if Contains( you, sharpener )
    {
        "- You have the pencil sharpener."
        bGotSomething = true
    }
    elseif Contains( friendshome, sharpener )
    {
        "- You left the pencil sharpener at your friend's house."
        bGotSomething = true
    }

    if Contains( you, smalldictionary )
    {
        "- You got your hands on a dictionary."
        bGotSomething = true
    }
    elseif Contains( friendshome, smalldictionary )
    {
        "- A dictionary's already resting at your friend's home."
        bGotSomething = true
    }

    if Contains( you, floppydisk )
    {
        "- You have the floppy disk."
        bGotSomething = true
    }
    elseif Contains( friendshome, floppydisk )
    {
        "- You brought the floppy disk to your friend's place."
        bGotSomething = true
    }

    if squash is special
    {
        "- You brought a squash racket in the house (although not the kind your friend expected)."
        bGotSomething = true
    }

    if bGotSomething
        "...and that's about it."
    else
        "...you haven't got much. But you keep your hopes high."

}

routine Bowling
{
    "You pick a free lane, grab a good hold on your ball, and shoot. Looking good... Looking good... Look - DOH!
    Oh well... You never were really good at this anyway."
    if not npc_stan is special
    {
        npc_stan is special
        "At least, some good comes out of this poor shot. Although he doesn't seem to trust you any more,
        Stan doesn't watch your every move, as he used to."
    }
    counter += 7    ! seven minutes
    return true
}

routine DogDeath
{
    "\n\n\nYou'll never be quite to remember the exact events that followed. You were told later on that
    there was some crazed pitbull sleeping quietly in the doghouse. You startled him, so he decided to rip
    one of your hands off. It didn't turn out to be a big deal -- the microsurgeon who was on call at
    Cheapsville General Hospital was able to reattach it easily, and your friend managed, with the help of his
    neighbor, to get the hand back before it had been gnawed on too severely. So much for the quiet \"small
    town\" feeling. Well, it might not be as bad as losing a limb, but...
    \n\n\B***  You have lost your bet  ***\b"
    endflag = 3
}

routine ReceptionistDeath
{
    "\n\n\nApparently, the poor receptionist doesn't appreciate being kissed without consent. She decides to
    empty most of her mace can in your face, and then quickly calls the police.
    \nYou explain that you are being controlled by an adventure game player who was merely trying every
    possible action, and after some discussion and apologies, she agrees not to press charges. Of course, in
    the meantime...
    \n\n\B***  You have lost your bet  ***\b"
    endflag = 3
}

routine KidsDeath
{
    "\n\n\nYou pucker up. The kids were already scared of you. After seeing you trying to kiss one of them, they
    decide you're one of those big bad maniacs their parents and teachers warned them against. Some of them
    start yelling like they're being murdered or something, and eventually some teachers come over and decide
    to keep you around \"to clarify matters\".
    \nYou explain that you are being controlled by an adventure game player who was merely trying every
    possible action, and in the end, everything turns out fine, except that...
    \n\n\B***  You have lost your bet  ***\b"
    endflag = 3
}