Deluxe Doors by Emily Short Search for other extensions by this author Approved for the Public Library

Versions

Download version 4/150410For Inform 7 6L38

Links

Description

Allows for doors that are implemented as having independent 'faces' -- to put a knocker on that can only be seen from on side, for instance, or to allow the player to lock one side with a key but the other with a latch. Also introduces a 'latched door' kind.

Tags doors world-model

Documentation

Deluxe Doors allows for doors to have two sides, so that they can be unlocked differently from different directions and also so that they can have things visible on one face but not on the other. It also allows for doors to be latched rather than locked and unlocked with keys. Deluxe Doors requires Plurality and Locksmith by Emily Short. Chapter: Two One-sided Doors Section: Setting Up To set up a pair of doors, we use the "door-unity" relation, expressed with the phrase "is a half-door of". Thus Porch is a room. The house door is south of Porch. It is a lockable door. Through the house door is the Living Room. The porch door is north of Living Room. Through the porch door is the Porch. The porch door is a door. The porch door is a half-door of the house door. creates a pair of one-way doors that are now understood to be linked. We can also use the adjective "a halved door" to refer to doors that are only half of a larger entity, and "the reverse side of (a given door)" to refer to that door's other half. This now means that objects can be added to one side of a door, as in A brass knocker is part of the house door. with some special implications: it will be visible and touchable when the player is on the "house door" side -- that is, standing on the Porch looking in. That's the easy part. The trickier part is that it will also be visible and touchable when the player is in the Living Room, if the porch door/house door combo is open. Section: A Warning This does require a little authorial self-discipline. If you have a place in your code where you say now the gilded door is open; that doesn't ensure that its other half is open. Instead, Deluxe Doors provides a couple of phrases to use instead: safely lock the gilded door safely open the gilded door safely close the gilded door safely unlock the gilded door Using these will guarantee that both halves of a door will be maintained in their proper configuration. Chapter: Latched Doors Section: Setting Up The latched door features here can be used without the Deluxe Doors at all, if we like. A latched door is defined to be one that has a latch and thus can be opened without a key (and will in fact give an error message if the player tries to use a key instead). We can just write The porch door is a latched door. to invoke this; every latched door will automatically have one door-latch object assigned to it. Example: ** Denise - We have a door that can be locked on one side and latched on the other; and another character we can annoy by endless knocking. *: Include Deluxe Doors by Emily Short. Porch is a room. "Here is your front porch, relatively tranquil because it is not your living room. Being inside has become more and more of a torture every day of late." The house door is south of Porch. It is a lockable door. Through the house door is the Living Room. The initial appearance of the house door is "The door into the house [if open]stands open[otherwise]is firmly shut[end if]." The player carries a silver key. The silver key unlocks the house door. Instead of going inside in the Porch, try going south. Instead of exiting in the Living Room, try going north. The porch door is north of Living Room. "The door to the porch [if open]is thrown invitingly wide[otherwise]is shut[end if]." Through the porch door is the Porch. The porch door is a latched door. The porch door is a half-door of the house door. A brass knocker is part of the house door. The description is "The brass knocker scowls at you: the old witch has a ring clenched in her teeth. Her incisors look almost like vampire fangs." Understand "witch" or "old" or "ring" or "teet" or "incisors" or "vampire" or "fangs" as the brass knocker. The description of the Living Room is "It's completely decorated by Denise, cleaned by Denise, and managed by Denise. The faintly bitter odor in the air is Denise's vetiver room scent." Denise is a woman in the Living Room. "Denise herself is bent over her antique sewing machine, pumping hard at the pedals and muttering under her breath." [The sewing machine prop is left as an exercise to the reader.] Every turn when the knocker is just-knocked and the location is the Porch and the porch door is closed: say "'[one of]Coming[or]Just a minute[or]Hang on[or]AAAARGH[stopping]!' calls a muffled voice from within."; let rude comment be "Forget your key[one of][or] again[stopping]?"; if the porch door is unlocked, now rude comment is "It was open! Why didn't you try opening it yourself?"; try Denise opening the porch door; if the porch door is open, say "'[rude comment]' asks Denise[one of][or], a little ungraciously[or], looking frankly irritated[stopping]. [one of]Since you're not a guest, she doesn't bother staying at the door, but wanders back to what she was doing[or]Muttering, she goes back to her task[or]She sets her jaw angrily and retreats from the door[stopping]."; Every turn: now the knocker is not just-knocked. The knocker can be just-knocked. Understand "knock [knocker]" or "knock on/with [knocker]" or "use [knocker]" as attacking. Instead of attacking the knocker: say "You knock loudly with the brass knocker."; now the knocker is just-knocked. Understand "knock on [something]" as knocking on. Knocking on is an action applying to one thing. Instead of knocking on the house door, try attacking the knocker. A thing can be soft or hard. A thing is usually hard. A person is usually soft. A wearable thing is usually soft. Report knocking on something soft: say "[The noun] [are] too soft for knocking to give any interesting effect." instead. Report knocking on something: say "You rap your knuckles against [the noun], to no effect." Test me with "x latch / open door / close door / knock on door / close door / lock door with key / knock on door / x knocker / x latch / in / x knocker / x latch / close door / x knocker / x latch / latch door / open door".