Reply-To: "Kent Tessman" <kent@remove-to-reply.generalcoffee.com>
From: "Kent Tessman" <kent@remove-to-reply.generalcoffee.com>
Newsgroups: rec.arts.int-fiction
References: <i6k27ugvg97umtfd09snrjns170qbcrf20@4ax.com>
Subject: Re: [HUGO] How to door with two locking mechanisms (one on each side)
Lines: 55
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Message-ID: <VLdc8.5857$Lc2.756569@news20.bellglobal.com>
Date: Mon, 18 Feb 2002 15:47:52 -0500
NNTP-Posting-Host: 64.229.226.153
X-Complaints-To: abuse@sympatico.ca
X-Trace: news20.bellglobal.com 1014065269 64.229.226.153 (Mon, 18 Feb 2002 15:47:49 EST)
NNTP-Posting-Date: Mon, 18 Feb 2002 15:47:49 EST
Organization: Bell Sympatico
Path: news.duke.edu!newsgate.duke.edu!nntp-out.monmouth.com!newspeer.monmouth.com!cpk-news-hub1.bbnplanet.com!news.gtei.net!newsfeed1.cidera.com!Cidera!torn!webster!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail
Xref: news.duke.edu rec.arts.int-fiction:100098

Well, as far as the library is concerned, the 'locked' attribute is what
designates a door as locked.  How it gets 'locked' doesn't matter.  For
convenience, the library provides a set of verbs and routines that use the
'lockable' attribute and 'key_object' properties, but you don't need to.

Put a 'before' property on the door object that intercepts locking and
unlocking if you're inside the room (and don't need to use a key).

Something like this should work:

before
{
    object DoLock, DoUnlock
    {
        if location = inside_door
        {
            "You ";
            if verbroutine = &DoUnlock
            {
                "un";
                door is not locked
            }
            else
                door is locked
            "lock the door."
        }
        else
            return false
    }
}

Of course that's just the bare bones; you'll want to enhance it considerably
for any real location/setup.

You could also create a scenery object that represents the deadbolt or
something similar, and have manipulating that affect the locked state of the
door object.  Again, it's the 'locked' attribute that matters, not so much
how you get there.

--Kent

"Dana Clarke" <joeynipp@bellsouth.net> wrote in message
news:i6k27ugvg97umtfd09snrjns170qbcrf20@4ax.com...
> So far that I have seen, the door object is made such that one defines
> a key for it and that key is used to lock and unlock the door from
> both sides.  However, many real doors use a key on one side but some
> other locking mechanism on the other (not requiring a key).  Does
> anybody know how to implement this?
>
> Thank you in advance
>
> Dana
>


