! ****************************************** ! Denise George ! CIS 587 ! Project #2 -- Interactive Fiction Game ! October 6, 2001 ! ****************************************** Constant Story "Fortune Hunter^"; Constant Headline "Interactive Fiction Game for CIS 587 by Denise George^"; Include "Parser"; Include "Verblib"; Include "Grammar"; !******************************************************************************** ! Definitions !******************************************************************************** verb "use" * noun "to" "take" noun -> UseTake; Extend "use" * noun "to" "get" noun -> UseGet; verb "knock" * noun "over" -> KnockOver; Extend "knock" * "over" noun -> Knock; verb "lift" * noun -> Lift; verb "find" * noun -> Find; verb "dump" * noun -> Dump; verb "spill" * noun -> Spill; Extend "take" * noun "with" noun -> TakeWith; Extend "get" * noun "with" noun -> TakeWith; Extend "light" first * noun -> Light; Extend "blow" * "out" noun -> BlowOut; Extend "dig" * "in" noun -> DigIn; Extend "break" first * noun -> Break; Extend "set" first * noun "to" "idea" -> SetI; Extend "unlock" first * noun "with" "idea" -> UnlockW; verb "?" * -> Menu; verb "?map" * -> Map; !******************************************************************************** ! Subs !******************************************************************************** [UseTakeSub; "What a strange idea?"; ]; [UseGetSub; "What a strange idea?"; ]; [KnockOverSub; "Trying to break everything?"; ]; [KnockSub; "Trying to break everything?"; ]; [LiftSub; <>; ]; [FindSub; "That really won't help."; ]; [DumpSub; "That's not something you can dump."; ]; [SpillSub; "That's not something you can spill."; ]; [TakeWithSub; "What a strange idea?"; ]; [LightSub; "What a strange idea?"; ]; [BlowOutSub; "What a strange idea!"; ]; [DigInSub; "That doesn't sound like it would work."; ]; [BreakSub; "No need to vandalize the place."; ]; [SetISub; "You can't set that to anything."; ]; [UnlockWSub; "That's not something you can unlock."; ]; [MenuSub; print "^To see a map -- ?map^^"; if (player in Foyer) "To move try: ^ east ^ west ^You might need to use something in this room as sort of a tool.^"; else if (player in LivingRoom) "To move try: ^ east ^You might try looking inside some things.^"; else if (player in Library) "To move try: ^ west ^ enter 'something' ^You might moving some things around.^"; else if (player in SecretRoom) "To move try: ^ up ^ climb 'something' ^ enter 'something' ^You might moving some things around.^"; else if (player in Corridor) "To move try: ^ east ^ west^"; else if (player in VaultEnd) "To move try: ^ east^"; else rtrue; ]; [MapSub; if (player in Foyer or Library or LivingRoom) "-------------------------------------------------^ | | | |^ | | | |^ | | | |^ | | | Library |^ | | |^ | Living Foyer | |^ | Room |^ | |^ | |^ | | | |^ | | |---| |^ | | | C | |^ --------------------[---]------------------------^ ^^^"; else "Sorry, no map available"; ]; !******************************************************************************** ! Declarations !******************************************************************************** ! message that will be found on one note ! this is an encrypted message -- ! **numbers correspond to the letters starting at first letter ! **putting letters together consecutively gives --- "green white blue" Constant Clue_1 "^^The Grapes of Wrath, Steinbeck (458)^ Of Mice and Men, Steinbeck (68)^ For Whom the Bell Tolls, Hemingway (45)^ The Crucible, Miller (8)^ The Great Gatsby, Fitzgerald (16)^ Black Boy, Wright (12)^ Huckleberry Finn, Twain (26)^"; ! message that will be found on one note ! this is an encrypted message -- ! **each pair of numbers gives a numeric result, numbers correspond to ! **letters in the alphabet ! **putting letters together consecutively gives --- "Vault code is "idea" Constant Clue_2 "^^ 18 + 4 / 22 + 20 - 9 + 8^ - 17 * 5 - 11 + 1 * 1.8^ + 10 - 10 / 2.25 + 1 / 5^^"; Global PushState = 0; !used to determine if correct sequence pushed Attribute broken; Attribute canMove; !******************************************************************************* ! ! Foyer ! ! The foyer has a front door, a closet, a mirror on the wall, a painting on ! the wall, some coat hooks, and an umbrella hanging on one hook. ! In the closet, there is a shelf with a box on it and a rod with a hanger ! on it. ! ! Objective-- ! The player needs to get the box which contains a candle that will ! be needed. To reach the box, the player must use the umbrella to ! take the box. !******************************************************************************* Object Foyer "Foyer" with name "walls", description "The foyer is quite large with a number of paintings on the walls. There is also a mirror above a bunch of hooks on the wall for hanging coats. To your left is a small closet. To the east is a doorway into what appears to be a library. To the west is an opening into a large living room.", w_to LivingRoom, e_to Library, has light; !~~~~~~~~~~~~~~~~~~~ !~ Front Door ~ !~~~~~~~~~~~~~~~~~~~ Object -> FrontDoor "front door" with name "door" "front", description "It's just a regualar door.", before [; Enter: "You can't leave. You haven't found what you came for yet."; ], has enterable door concealed static; !~~~~~~~~~~~~~~~~~~~ !~ Mirror ~ !~~~~~~~~~~~~~~~~~~~ Object -> Mirror "mirror" with name "mirror" "looking" "glass" "reflection", description "It is an oval shaped mirror with a decorative wooden frame.", before [; Take: "The mirror is much to heavy to carry around with you."; Break: "You wouldn't want seven years of bad luch, now would you?"; ], has concealed static; !~~~~~~~~~~~~~~~~~~~ !~ Hook ~ !~~~~~~~~~~~~~~~~~~~ Object -> Hook "hook" with name "hook" "coat" "hooks" "peg" , description [; print "The hooks are ordinary metal hooks for hanging things on."; if (Umbrella hasnt general) " There is an umbrella hanging on one of the hooks."; rtrue; ], has concealed static supporter; !~~~~~~~~~~~~~~~~~~~ !~ Umbrella ~ !~~~~~~~~~~~~~~~~~~~ Object -> Umbrella "umbrella" with name "umbrella", !general if taken off hook description "The umbrella is a black umbrella with a wooden handle, the kind that hooks at the end.", before[; UseTake,UseGet: if (second == Box && Box in player) !*player already has the box "You already have the box."; if (second == Box && Box hasnt general) { !*box is on the shelf so use to get box if (self in player) { !*player has the umbrella move Box to player; give Box ~general; "Using the umbrella to reach further back on the shelf, you manage to pull the box close enough to reach. You pick up the box."; } else { !*player doesnt have umbrella "That's a good idea, but you don't have the umbrella."; }; }; ], after [; Take: give self general; !*take off hook "You pick up the umbrella. It might come in handy."; Drop: give self ~concealed; !*make it show up if dropped PutOn: if (second == Hook) !*put on the hook so give not general to indicate give self ~general; ], has concealed; !~~~~~~~~~~~~~~~~~~~ !~ Painting ~ !~~~~~~~~~~~~~~~~~~~ Object -> Painting "Painting" with name "painting" "picture" "paintings" "pictures", description "The paintings are landscapes.", before [; Take: "What would be the point of that?"; ], has concealed static; !~~~~~~~~~~~~~~~~~~~ !~ Closet ~ !~~~~~~~~~~~~~~~~~~~ Object -> Closet "closet" with name "Closet" "closet" "door", description [; if (self hasnt open) "All you can see is the door of the closet which is a normal wooden door."; !* closet is open so describe inside "The closet appears to be empty. There is a shelf and a rod with a single empty hanger on it."; ], after [; Open: "You open the closet."; Enter: "It's pretty small. You probably wouldn't fit."; ], has concealed static openable container; !~~~~~~~~~~~~~~~~~~~ !~ Shelf ~ !~~~~~~~~~~~~~~~~~~~ Object Shelf "shelf" Closet with name "shelf", description [; if (Box hasnt general) !*box is on shelf "The shelf is high but you can see a small box toward the back."; !*box isnt on shelf so empty else "The shelf is high but it doesn't look as if there is anything on it."; ], has concealed static supporter; !~~~~~~~~~~~~~~~~~~~ !~ Rod ~ !~~~~~~~~~~~~~~~~~~~ Object Rod "rod" Closet with name "rod" "pole", description "It's just a wooden pole to hang hangers on.", has concealed static; !~~~~~~~~~~~~~~~~~~~ !~ Hanger ~ !~~~~~~~~~~~~~~~~~~~ Object Hanger "hanger" Closet with name "hanger" "hanger", description "The hanger is just a metal hanger on which to hang coats or clothing.", has concealed; !~~~~~~~~~~~~~~~~~~~ !~ Box ~ !~~~~~~~~~~~~~~~~~~~ Object Box "box" Closet with name "box", !*general if not on shelf description "According to the label, it is a box of candles.", before [; Take: !* box is on shelf if (self notin player && self hasnt general) "You can't seem to reach the box."; TakeWith: if (self in player) "You already have ",(the) self, "."; !* using umbrella and box is on shelf if (second == Umbrella && self hasnt general) { if (Umbrella in player) { move self to player; give self ~general; "Using the umbrella to reach further back on the shelf, you manage to pull the box close enough to reach. You pick up the box."; } else { "That's a good idea, but you don't have the umbrella."; }; }; ], after [; Drop: give self general; !*indicate not on shelf give self ~concealed; !*make it show up if dropped ], has concealed container openable; !~~~~~~~~~~~~~~~~~~~ !~ Candle ~ !~~~~~~~~~~~~~~~~~~~ Object Candle "candle" Box with name "candle", !general if lit description "It's a white stick candle.", before [; Light: !*candle is not lit if (self hasnt general) { !*player has matches so can light if (Match in player) { !*candle is in holder so keep lit if (self in Holder) { give self general; !* candl is lit if (Holder in player) { give SecretRoom light; give Corridor light; give VaultEnd light; }; "You light the candle using the matches."; !*candle is not in holder, so put out } else { give self ~general; !* candle is not lit give SecretRoom ~light; "You light the candle with the matches, but after a moment the wax starts to drip down on to your hand and burn you. You have to blow it out. If you only had something to put the candle in."; }; !* player doesnt have matches } else { "You don't have any thing to light the candle with."; }; !*candle is lit } else { "The candle is already lit."; }; PutOn, Insert: !* trying to put in holder if (second == Holder) { move self to Holder; "You put the candle in the candlestick holder. It fit's perfectly."; }; Blow, BlowOut: !*candle is lit if (self has general) { !*make candle not lit, and rooms dark give self ~general; give SecretRoom ~light; give Corridor ~light; give VaultEnd ~light; "You blow the candle out."; !* not lit so can't blow out } else { "The candle is not lit."; }; ]; !******************************************************************************** ! ! Living Room ! ! The living room has a sofa, an armchair, a table, a stand with a picture ! frame on it, a shelf with a book on it, and a plant. ! The picture frame contains a piece of paper. The plant has a key buried ! in the dirt. ! ! Objective-- ! The player needs to find and get the key from the plant. To reach the ! the frame, the player must get onto the sofa. To find the paper in ! the frame the player must open or break the frame. !******************************************************************************* Object LivingRoom "Living Room" with name "doorway", description [; print "There is a large sofa arranged kitty-corner in the corner with a photo in a frame on a stand behind it. In the opposite corner, sits a matching arm chair. There is a coffee table in the center of the room. There is a small shelf along one wall and there is "; !*plant is dumped if (plant has general) print "a plant,which has been dumped on the floor, close to the doorway."; !*plant not dumped else print "a house plant close to the doorway."; !*frame is broken, so on the floor if (Photo has broken) print " There is a broken picture frame on the floor."; "^To the east is the Foyer from which you've come."; ], e_to Foyer, has light; !~~~~~~~~~~~~~~~~~~~ !~ chair ~ !~~~~~~~~~~~~~~~~~~~ Object -> Chair "chair" with name "armchair" "arm-chair" "arm" "chair", description "It's a red arm chair that matches the sofa. It looks as comfortable as the sofa.", has concealed static enterable supporter; !~~~~~~~~~~~~~~~~~~~ !~ sofa ~ !~~~~~~~~~~~~~~~~~~~ Object -> Sofa "sofa" with name "couch" "sofa", description "It's a red plush sofa. It looks very cushy and comfortable.", has concealed static enterable supporter; !~~~~~~~~~~~~~~~~~~~ !~ stand ~ !~~~~~~~~~~~~~~~~~~~ Object -> WoodenStand "stand" with name "wooden" "stand", description [; print "All you can see is the top of the stand which is made of wood. "; !*frame is still on the stand if (Photo hasnt general) "There is a picture frame on it."; ], has concealed static supporter; !~~~~~~~~~~~~~~~~~~~ !~ shelf ~ !~~~~~~~~~~~~~~~~~~~ Object -> L_Shelf "shelf" with name "shelf" "bookshelf", description "It is a small shelf with a book lying on top.", has concealed static supporter; !~~~~~~~~~~~~~~~~~~~ !~ book ~ !~~~~~~~~~~~~~~~~~~~ Object -> L_Book "book" with name "book", !book has general if open description [; !*not open so describe outside if (self hasnt general) "It looks like a very old book. The cover is worn and faded, the title is unreadable."; !*open so describe inside "You look at the page it is open to and read a few lines. It seems to be a mystery story that involves deciphering clues."; ], before [; !*can't reach the book if in chair or sofa if (player in Sofa || player in Chair) "You'll need to get off the ", (the) parent(player), " first."; Take: "The book would be of no use to you."; ], after [; Open: give self general; ], has concealed static openable; !~~~~~~~~~~~~~~~~~~~ !~ photo ~ !~~~~~~~~~~~~~~~~~~~ Object -> Photo "picture frame" with name "photo" "frame" "picture", !general if not on stand description [; if (self hasnt broken) "It's a frame containing a picture of a young woman. The picture must be very old from the look of it."; !* it's broken so describe broken else "The picture frame is laying on the floor broken."; ], before [; !*frame is on stand so player can't reach unless on sofa if (self hasnt general && player notin Sofa) "You cannot reach the picture frame from where you are."; Take: !* if not broken player can take if (self hasnt broken) { give self general; !!taken from stand rfalse; !*it's broken } else { "You pick up some of the pieces and accidently cut your hand. That wasn't a very smart idea, now was it?"; }; Open: !* player hasn't yet taken paper so find paper in frame if (BluePaper hasnt general) { "You pull the back of the frame open. Behind the picture there is a piece of blue paper."; !* paper is already found so find nothing } else { !! frame is broken so can't open if (self has broken) "The frame is broken. You can't open it."; else "You find nothing of interest."; }; ThrowAt,Break: !*not broken so player can break or throw if (self hasnt broken){ if (self notin player) { if (action == ##Break) "You can't break it if you don't have it."; else "You can't throw it if you don't have it."; !* player has frame so can be broken } else { give self broken; move self to LivingRoom; !* move from player print "You throw the picture frame to the floor, shattering it. "; !* paper hasn't been taken so find if (BluePaper hasnt general) print "In the pile of broken pieces, you notice a small folded paper."; rtrue; }; !* frame broken } else { "The frame is already broken, laying in pieces on the floor."; }; KnockOver,Knock: !* not already broken so can break if (self hasnt broken) { give self broken; give self general; !!moved from stand move self to LivingRoom; print "You knock the picture frame off of "; if (parent(self) == LivingRoom){ print "the shelf. "; } else { print (the) parent(self), ". "; }; print "It falls off on to the floor, shattering. "; !* if paper not already found if (BluePaper hasnt general) print "In the pile of broken pieces, you notice a small folded paper."; rtrue; !* already broken } else { "The picture frame is broken, laying in pieces on the floor."; }; ], after [; Drop: give self ~concealed; !*make show up if dropped PutOn,Insert: give self ~concealed; !*make show up if dropped if (second == WoodenStand) give self ~general; !* on the stand ], has concealed broken; !~~~~~~~~~~~~~~~~~~~ !~ table ~ !~~~~~~~~~~~~~~~~~~~ Object -> Table "table" with name "table" "coffee" "center", description "It is an oblong dark wooden table.", has concealed static supporter; !~~~~~~~~~~~~~~~~~~~ !~ plant ~ !~~~~~~~~~~~~~~~~~~~ Object -> Plant "plant" with name "plant", !*if dumped has general description [; !* plant is dumped if (self has general) { print "It's a house plant in a pot, but it has been dumped over and the dirt has spilled out onto the floor. "; !*key hasnt been take yet if (SilverKey hasnt general) "You can see a silver key in the dirt."; rtrue; } !*plant is not dumped "It is a leafy tree-like plant in a large pot."; ], before [; !* can't reach plant from chair or sofa if (player in Sofa || player in Chair) "You'll need to get off the ", (the) parent(player), " first."; Take: "The plant is too heavy to carry around with you."; Dump,Spill: !* not dumped if (self hasnt general) { give self general; print "You dump the plant and the dirt out of the pot and on to the floor."; !* key hasnt been taken yet if (SilverKey has general) " In the dirt you see a silver key."; rtrue; !* already dumped } else { "The plant is already dumped."; }; Dig,DigIn: !* not dumped if (self hasnt general) { !*key hasnt been taken yet if (SilverKey hasnt general) "You dig in the plant's pot. In the dirt you see a silver key."; !*key already taken else "You dig in the plant's pot, but find nothing."; !* already dumped } else { "You can't dig in the plant's pot. It is dumped all over the floor."; }; ], has concealed; !~~~~~~~~~~~~~~~~~~~ !~ SilverKey ~ !~~~~~~~~~~~~~~~~~~~ Object -> SilverKey "siver key" with name "silver" "key", !general if found and taken once description "It is a small silver key.", after [; Take: give self general; !*found and taken Drop,PutOn,Insert: give self ~concealed; !*if dropped, show it ], has concealed; !~~~~~~~~~~~~~~~~~~~ !~ window ~ !~~~~~~~~~~~~~~~~~~~ Object -> Window "window" with name "window", description "You look through the window and see that it is quite windy outside. The leaves are blowing all about.", before [; Enter: "Why not just use the front door?"; ], after [; Open: "You open the window. You feel a cold blast of air. It is very windy and cold outside"; ], has concealed openable static enterable; !~~~~~~~~~~~~~~~~~~~ !~ blue paper ~ !~~~~~~~~~~~~~~~~~~~ Object -> BluePaper " blue paper" with name "blue" "paper" "note" "letter", !*general if taken from frame description [; !* player has it so show writing if (self in Player) { print "You examine the paper closely. You can barely make out what it says."; print (string) Clue_1; !* player doesnt have it, so general description } else "It is a blue piece of paper with some sort of note written on it. The writing is very faded."; ], after [; Take: !* not taken from frame yet if (self hasnt general) { give self general; !* taken from frame !* if frame broken, take from pieces if (Photo has broken) "You carefully pick through the broken pieces of the picture frame and retrieve the paper."; }; Drop,PutOn,Insert: give self ~concealed; !*make it show up ], has concealed; !******************************************************************************** ! ! Library ! ! The library has an armchair, a stand with a candlestick holder on it, a desk ! with seven drawers, a desk chair,a rug with a trap door hidden under it, ! and bookshelves. Under the chair, there is a wood section that must be ! pressed to open the trap door. The center drawer of the desk has matches in ! it which are needed to light the candle. Also, the candlestick holder is ! needed for the candle to stay light. ! ! Objective-- ! The player needs to find and get the matches from the center drawer to ! light the candle. To keep the candle lit, the holder must be taken and ! the candle put in it. The player must find the trap door under the ! rug and move the chair and push the wood section of the floor to open ! the trap door. !******************************************************************************* Object Library "Library" with name "room", description "The library's north, south, and east walls are composed of built in bookshelves. There is a large desk with a chair to one side of the room. Beside the desk, sits a waste basket. On the opposite side of the room, there is an armchair with a stand next to it. The floor is a beautiful hardwood floor, but in the center of the room it is covered by a large area rug.^ To your west is the Foyer, from which you came.", w_to Foyer, has light; !~~~~~~~~~~~~~~~~~~~ !~ bookshelves ~ !~~~~~~~~~~~~~~~~~~~ Object -> Shelves "bookshelf" with name "bookshelves" "shelves" "shelf" "bookshelf" , description "The bookshelves are made of dark wood and are filled with books.", has concealed static; !~~~~~~~~~~~~~~~~~~~ !~ books ~ !~~~~~~~~~~~~~~~~~~~ Object -> books "books" with name "books" "book" , description "There are hundreds of books on the shelves, too many to look at them all. Nothing seems out of the ordinary or catches your interest.", has concealed static; !****** !* The following objects are only defined in case the player attempts to find the !* books listed in the encrypted message Object -> GW "The Grapes of Wrath" with name "The" "Grapes" "of" "Wrath", description "You can't see any such thing.", before [; if (action ~= ##Find) "You can't see any such thing."; Find: "You look all through the books but can't find that book anywhere."; ], has concealed static; Object -> MM "Of Mice and Men" with name "Of" "Mice" "and" "Men", description "You can't see any such thing.", before [; if (action ~= ##Find) "You can't see any such thing."; Find: "You look all through the books but can't find that book anywhere."; ], has concealed static; Object -> WB "For Whom the Bell Tolls" with name "For" "Whom" "the" "Bell" "Tolls", description "You can't see any such thing.", before [; if (action ~= ##Find) "You can't see any such thing."; Find: "You look all through the books but can't find that book anywhere."; ], has concealed static; Object -> C "The Crucible" with name "The" "Crucible", description "You can't see any such thing.", before [; if (action ~= ##Find) "You can't see any such thing."; Find: "You look all through the books but can't find that book anywhere."; ], has concealed static; Object -> GG "The Great Gatsby" with name "The" "Great" "Gatsby", description "You can't see any such thing.", before [; if (action ~= ##Find) "You can't see any such thing."; Find: "You look all through the books but can't find that book anywhere."; ], has concealed static; Object -> BB "Black Boy" with name "Black" "Boy", description "You can't see any such thing.", before [; if (action ~= ##Find) "You can't see any such thing."; Find: "You look all through the books but can't find that book anywhere."; ], has concealed static; Object -> HH "Huckleberry Finn" with name "Huckleberry" "Finn", description "You can't see any such thing.", before [; if (action ~= ##Find) "You can't see any such thing."; Find: "You look all through the books but can't find that book anywhere."; ], has concealed static; !~~~~~~~~~~~~~~~~~~~ !~ desk ~ !~~~~~~~~~~~~~~~~~~~ Object -> Desk "desk" with name "desk" , description "It's large desk with three drawers to each side of the chair and a center drawer.", has concealed static enterable supporter; !~~~~~~~~~~~~~~~~~~~ !~ waste basket ~ !~~~~~~~~~~~~~~~~~~~ Object -> WasteBasket "waste basket" with name "waste" "basket" "trash" "garbage", description "It's a wicker basket.", before [; Dump,Spill: "There's nothing in it."; ], has concealed; !~~~~~~~~~~~~~~~~~~~ !~ desk chair ~ !~~~~~~~~~~~~~~~~~~~ Object -> DeskChair "deskchair" with name "deskchair" "desk-chair" "chair", description "It's a large brown-leather chair.", has concealed enterable supporter; !~~~~~~~~~~~~~~~~~~~ !~ center drawer ~ !~~~~~~~~~~~~~~~~~~~ Object -> CenterDrawer "center drawer" with name "drawer" "center", description "It's a drawer like most drawers. It has a handle in the center.", after [; !*can't reach the desk from the armchair if (player in Lib_Chair) "You'll have to get out of the arm chair first."; Open: "You look in the drawer and find that it contains some pencils and pens. You notice that mixed in with the pencils and pens is a pack of matches."; ], has concealed static openable container; !~~~~~~~~~~~~~~~~~~~ !~ match ~ !~~~~~~~~~~~~~~~~~~~ Object -> -> Match "matches" with name "matches" "pack" "match", description "They are ordinary matches.", after [; Drop: give self ~concealed; !*make show up ], has concealed; !~~~~~~~~~~~~~~~~~~~ !~ pencil ~ !~~~~~~~~~~~~~~~~~~~ Object -> -> Pencil "pencil" with name "pencil" "pencils", !*general if player has description [; !* if already taken or dropped if (self hasnt concealed || self in player) "It's just an ordinary pencil"; "There are various kinds of pencils, but there's nothing special about any of them."; ], before[; Take: !* already taken if (self has general) "One pencil will probably due."; ], after [; Take: !* pencil already taken from drawer if (self hasnt concealed) { give self general; "You pick up the pencil."; !*still in drawer } else { give self general; if (CenterDrawer has open) { "You take one of the pencils."; } else { give CenterDrawer open; "You open the drawer and take one of the pencils."; }; }; Drop,PutOn,Insert: give self ~general; give self ~concealed; ], has concealed; !~~~~~~~~~~~~~~~~~~~ !~ pen ~ !~~~~~~~~~~~~~~~~~~~ Object -> -> Pen "pen" with name "pen" "pens", description "There are various kinds of pens, but there's nothing special about any of them.", before[; Take: if (self has general) "One pen will probably due."; ], after [; Take: if (self hasnt concealed) { give self general; give self concealed; "You pick up the pen."; } else { give self concealed; give self general; if (CenterDrawer has open) { "You take one of the pens."; } else { give CenterDrawer open; "You open the drawer and take one of the pens."; }; }; Drop: give self ~general; give self ~concealed; ], has concealed; !~~~~~~~~~~~~~~~~~~~ !~ lt drawer ~ !~~~~~~~~~~~~~~~~~~~ Object -> LT_Drawer "top left drawer" with name "drawer" "left" "top", description "It's a drawer like any other drawer.", after [; !* can't reach from chair if (player in Lib_Chair) "You'll have to get out of the arm chair first."; Open: "This drawer appears to be empty."; ], has concealed static openable; !~~~~~~~~~~~~~~~~~~~ !~ lm drawer ~ !~~~~~~~~~~~~~~~~~~~ Object -> LM_Drawer "middle left drawer" with name "drawer" "left" "middle", description "It's a drawer like any other drawer.", after [; !* can't reach from chair if (player in Lib_Chair) "You'll have to get out of the arm chair first."; Open: "This drawer appears to be empty."; ], has concealed static openable; !~~~~~~~~~~~~~~~~~~~ !~ lb drawer ~ !~~~~~~~~~~~~~~~~~~~ Object -> LB_Drawer "bottom left drawer" with name "drawer" "left" "bottom", description "It's a drawer like any other drawer.", after [; !* can't reach from chair if (player in Lib_Chair) "You'll have to get out of the arm chair first."; Open: "This drawer appears to be empty."; ], has concealed static openable; !~~~~~~~~~~~~~~~~~~~ !~ rt drawer ~ !~~~~~~~~~~~~~~~~~~~ Object -> RT_Drawer "top right drawer" with name "drawer" "right" "top", description "It's a drawer like any other drawer.", after [; !* can't reach from chair if (player in Lib_Chair) "You'll have to get out of the arm chair first."; Open: "This drawer appears to be empty."; ], has concealed static openable; !~~~~~~~~~~~~~~~~~~~ !~ rm drawer ~ !~~~~~~~~~~~~~~~~~~~ Object -> RM_Drawer "middle right drawer" with name "drawer" "right" "middle", description "It's a drawer like any other drawer.", after [; !* can't reach from chair if (player in Lib_Chair) "You'll have to get out of the arm chair first."; Open: "This drawer appears to be empty."; ], has concealed static openable; !~~~~~~~~~~~~~~~~~~~ !~ rb drawer ~ !~~~~~~~~~~~~~~~~~~~ Object -> RB_Drawer "bottom right drawer" with name "drawer" "right" "bottom", description "It's a drawer like any other drawer.", after [; !* can't reach from chair if (player in Lib_Chair) "You'll have to get out of the arm chair first."; Open: "This drawer appears to be empty."; ], has concealed static openable; !~~~~~~~~~~~~~~~~~~~ !~ chair ~ !~~~~~~~~~~~~~~~~~~~ Object -> Lib_Chair "arm chair" with name "armchair" "arm-chair" "arm" "chair", !general if moved back description "It's a brown leather winged-back chair.", before [; Push,Pull: !* can't reach from deskchair, can't push if in it if (player in Lib_Chair or DeskChair) "You'll have to get out of the chair first."; !* in original position if (self hasnt general) { give self general; "You move the chair back some. You notice that there is something different about the flooring where the chair was sitting. There is a rectangular section of the wood that looks different."; !* moved back } else { give self ~general; "You push the chair back to it's original location."; }; ], has concealed static enterable supporter; !~~~~~~~~~~~~~~~~~~~ !~ wood section ~ !~~~~~~~~~~~~~~~~~~~ Object -> Section "wood section" with name "rectangular" "wood" "section" "retangle", !general if pushed in and trap door unlocked description [; !* chair has been moved away if (Lib_Chair has general) "This section of the flooring looks slightly different, the color is off a little."; !* chair is over it else "You can't see the wood section with the chair over it."; ], before [; Push: !* can't reach from chair if (player in Lib_Chair or DeskChair) "You'll have to get out of the chair first."; !* chair is moved away if (Lib_Chair has general) { give self general; !* trap door unlocked give TrapDoor open; "You push on the section of wood and it gives. Then you hear a sort of clicking noise."; !* chair is over the section } else { "You can't reach it unless you move the chair."; }; Pull: "You can't seem to get a hold on the section to pull it."; ], has concealed static; !~~~~~~~~~~~~~~~~~~~ !~ stand ~ !~~~~~~~~~~~~~~~~~~~ Object -> Lib_Stand "stand" with name "wooden" "stand", description [; print "It's an ordinary stand. "; !* holder has been taken if (Holder hasnt general) print "A candlestick holder is on it."; rtrue; ], has concealed static supporter; !~~~~~~~~~~~~~~~~~~~ !~ candle holder ~ !~~~~~~~~~~~~~~~~~~~ Object -> Holder "candlestick holder" with name "candlestick" "holder", !general if taken from stand description [; if (candle notin self) "It's a brass candlestick holder, but there is no candle in it."; "It's a brass candlestick holder."; ], after [; Take: give self general; !* taken from stand !*candle is already in it and lit if (candle has general) { give SecretRoom light; give Corridor light; give VaultEnd light; }; Drop,PutOn,Insert: give self ~concealed; !*make it show up ], has concealed container supporter openable open; !~~~~~~~~~~~~~~~~~~~ !~ rug ~ !~~~~~~~~~~~~~~~~~~~ Object -> Rug "rug" with name "rug" "carpet" "large" "area", !general if moved away from door description [; !* section was pushed and door unlocked if (Section has general) "It is a brightly-colored rug that covers a large portion of the room. There seems to be something under it."; !*not unlocked "It is a brightly-colored woven rug. It covers a large portion of the room."; ], before [; !* can't reach from chair if (player in Lib_Chair or DeskChair) "You'll have to get out of the chair first."; Lift, LookUnder: !* rug is moved away from door if (self has general) "You find nothing of interest."; !* not moved give TrapDoor general; !*trap door found "You lift the rug and look under it. You can see that there is some sort of trap door in the floor. You realize that you'll have to move the rug to get to it though."; Push, Pull: !* moved away from door if (self has general) { give self ~general; "You push the rug back to where it was initially."; }; !* not moved so move away from door give self general; print "You drag the rug to the side"; !* trap door hasnt been found yet if (TrapDoor hasnt general) { give TrapDoor general; print ". You can see that there is some sort of trap door in the floor."; !*player has already found the trap door } else print " revealing the trap door."; rtrue; ], has concealed static; !~~~~~~~~~~~~~~~~~~~ !~ trap door ~ !~~~~~~~~~~~~~~~~~~~ Object -> TrapDoor "trap door" with name "trap" "door", !general if found description [; !* haven't found it yet so dont describe accidently if (self hasnt general) { "You can't see any such thing."; !* door already found } else { !*rug is over door if (Rug hasnt general) print "Lifting the rug, you see that i"; !* rug is moved else print "I"; print "t is a square door that almost blends completely with the wood flooring."; !* trap door is unlocked if (Section has general) " You see that the door is now slightly open."; rtrue; }; ], before [; !* rug hasnt been moved so can't do anything if (Rug hasnt general) "You can't get to the trap door with the rug in the way."; Open: !* trap door is unlocked if (Section has general) { "You pull the door open further. Through the opening, you can see that there is some sort of room below the Library."; !* door is locked } else { "You try to get the door open but you can't seem to budge it."; }; Enter: if (location == Library) { !* door is locked if (self hasnt open) { "You can't seem to open the door to go in it."; !* door isn't locked } else { print "You go into the trap door.^^"; PlayerTo(SecretRoom); rtrue; }; }; ], after [; Close: give self ~open; !* door is locked give Section ~general; !* door is locked so need to push ], found_in Library, has static enterable openable concealed; !******************************************************************************** ! ! Secret Room ! ! The secret room has a table, a bench with a locked chest on it, a wine rack ! behind which is a hidden entrance, and a ladder back up to the library. ! The wine rack has four bottles, blue, green, white, and burgundy, on it. ! The wine rack can not be moved unless the wine bottles are pushed in a ! certain sequence. ! ! Objective-- ! The player needs to push the wine bottles in a certain sequence to be ! able to move the wine rack and discover the hidden entrance. The ! sequence is green, white, blue. Also, the player needs to find the ! paper which is in the trunk. The trunk requires a key to open.. !******************************************************************************* Object SecretRoom "secret room" with description "The room is dusty and full of cobwebs. In the center is a small table. Along the south wall is a bench that runs the length of the wall. There is a trunk on the bench. To the west is a wine rack.^In the north-east corner is a ladder leading back up to the trap door from which you came.", u_to Library, ne_to Library; !~~~~~~~~~~~~~~~~~~~ !~ cobwebs ~ !~~~~~~~~~~~~~~~~~~~ Object -> Cobwebs "cobwebs" with name "cobweb" "cobwebs" , before [; "That's an odd thing to want to do."; ], has concealed static; !~~~~~~~~~~~~~~~~~~~ !~ ladder ~ !~~~~~~~~~~~~~~~~~~~ Object -> Ladder "ladder" with name "ladder" , description "It's an ordinary ladder that leads up to the trap door.", before [; Climb: print "You climb the ladder back up to and through the trap door."; playerto(Library); rtrue; ], has concealed static; !~~~~~~~~~~~~~~~~~~~ !~ bench ~ !~~~~~~~~~~~~~~~~~~~ Object -> Bench "bench" with name "bench" , description "It's long work bench. There is a trunk on it.", has concealed static enterable supporter; !~~~~~~~~~~~~~~~~~~~ !~ trunk ~ !~~~~~~~~~~~~~~~~~~~ Object -> Trunk "trunk" with name "trunk" , description "It's a small trunk with a lock.", with_key SilverKey, before [; Take: "The trunk will be of no use to you."; ], has concealed openable container lockable locked; !~~~~~~~~~~~~~~~~~~~ !~ yellow paper ~ !~~~~~~~~~~~~~~~~~~~ Object -> ->YellowPaper "yellow paper" with name "yellow" "paper" "note" "letter", description [; !*player has the note so show writing if (self in Player) { print "You examine the note closely. It says: "; print (string) Clue_2; !*player doesnt have so give general description } else "It is a yellow piece of paper with some sort of note written on it."; ]; !~~~~~~~~~~~~~~~~~~~ !~ Table ~ !~~~~~~~~~~~~~~~~~~~ Object -> S_Table "table" with name "table" , description "It's an ordinary square table.", has concealed static enterable supporter; !~~~~~~~~~~~~~~~~~~~ !~ wine rack ~ !~~~~~~~~~~~~~~~~~~~ Object -> WineRack "wine rack" with name "wine" "rack" , !general if moved !canMove if correct sequence description [; !*Bottle has been take from rack if (BurgundyBottle has general) "It is a wooden wine rack. There are green, frosted-white, and blue bottles in it."; !*Bottle is still on rack "It is a wooden wine rack. It holds only a few bottles of wine. On the top shelf are a blue bottle and a burgundy. There is a green bottle on the middle shelf and a white frosted bottle on the bottom shelf."; ], before [; Push, Pull: !*can't be moved yet if (self hasnt canMove) "You try to move the rack, but it seems to be locked in place."; !*in original position if (self hasnt general) { give self general; give HiddenDoor general; "You slide the wine rack along the wall to the north. A hidden entrance is revealed which was concealed by the wine rack."; !* moved away from door } else { give self ~general; "You slide the wine rack back to it's original position."; }; ], has concealed static supporter canMove; !~~~~~~~~~~~~~~~~~~~ !~ green bottle ~ !~~~~~~~~~~~~~~~~~~~ Object -> GreenBottle "green bottle" with name "wine" "green" "bottle", description "It's a green wine bottle with a cork.", before[; Take: "You attempt to pick up the bottle, but it seems to be stuck in place."; Push: !*call sequence routine to set pushstate Sequence(GreenBottle); "You push the bottle toward the wall and it gives slightly. You hear a clicking sound."; Pull: "It seems to be stuck."; ], has concealed static; !~~~~~~~~~~~~~~~~~~~ !~ blue bottle ~ !~~~~~~~~~~~~~~~~~~~ Object -> BlueBottle "blue bottle" with name "wine" "blue" "bottle", description "It's a blue wine bottle with a cork.", before[; Take: "You attempt to pick up the bottle, but it seems to be stuck in place."; Push: !*call sequence routine to set pushstate if (Sequence(BlueBottle) == true) give WineRack canMove; "You push the bottle toward the wall and it gives slightly. You hear a clicking sound."; Pull: "It seems to be stuck."; ], has concealed static; !~~~~~~~~~~~~~~~~~~~ !~ white bottle ~ !~~~~~~~~~~~~~~~~~~~ Object -> WhiteBottle "white bottle" with name "wine" "white" "frosted" "bottle", description "It's a white frosted wine bottle with a cork.", before[; Take: "You attempt to pick up the bottle, but it seems to be stuck in place."; Push: !*call sequence routine to set pushstate Sequence(WhiteBottle); "You push the bottle toward the wall and it gives slightly. You hear a clicking sound."; Pull: "It seems to be stuck."; ], has concealed static; !~~~~~~~~~~~~~~~~~~~ !~ burgundy bottle ~ !~~~~~~~~~~~~~~~~~~~ Object -> BurgundyBottle "burgundy bottle" with name "wine" "burgundy" "bottle", description "It's a burgundy wine bottle with a cork.", before [; Drink: "You haven't anything to open the bottle with. And besides, that would hardly help you accomplish anything."; ], after [; Take: give self general; !* moved from wine rack ], has concealed; !~~~~~~~~~~~~~~~~~~~ !~ hidden door ~ !~~~~~~~~~~~~~~~~~~~ Object -> HiddenDoor "hidden door" with name "hidden" "entrance" "door", !*general if found description "The door blends very well with the wall.", before [; if (self hasnt general) "You see no such thing"; Enter: if (location == SecretRoom) { !* wine rack is in the way if (WineRack hasnt general) { "You can't get to the door."; !* wine rack has been moved } else { PlayerTo(Corridor); rtrue; }; !* player is in the corridor } else { PlayerTo(SecretRoom); rtrue; }; ], has concealed door openable enterable; !********************************************************************************** ! ! Corridor ! ! The corridor goes from east to west. The secret room is at the east end and ! the vault is at the west end. ! !********************************************************************************** Object Corridor "Corridor" with description "You are standing in a long corridor. To the east is the door to the secret room. You are unable to see what is at the west end.", e_to SecretRoom, w_to VaultEnd; !******************************************************************************* ! ! Vault end of corrider ! !******************************************************************************* Object VaultEnd "West end of Corridor" with description "At this end of the corridor is a door to a vault.", e_to Corridor; !~~~~~~~~~~~~~~~~~~~ !~ Vault door ~ !~~~~~~~~~~~~~~~~~~~ Object -> VaultDoor "vault door" with name "vault" "door", description "It is a large metal door with a combination lock.", before [; UnlockW: give self ~locked; "You set the combination to idea. If this is the right code the door should open now."; Open,Enter: if (self hasnt locked) { print "You must have had the right code because the door opens. You have found what you were looking for. The vault is full. There are stacks of money, jewels, gold and many other valuable items."; !*game over, player wins deadflag = 2; rtrue; }; !* door is locked "You can't open the vault, it seems to be locked."; ], has concealed enterable static openable locked; !~~~~~~~~~~~~~~~~~~~ !~ Comb lock ~ !~~~~~~~~~~~~~~~~~~~ Object -> Lock "combination lock" with name "combination" "lock", description "It's a strange type of lock. The lock can be set to a four letter combination.", before [; SetI: give VaultDoor ~locked; "You set the combination to the four letter sequence i-d-e-a. If this is the right code the door should open now."; ], has concealed static; !******************************************************************************** !**This stuff happens randomly through the game !** Object RandomStuff with daemon [; if (random(15) == 8) { print "^^"; switch(random(5)) { 1: "You hear the floorboards creak in the quiet house."; 2: "Tree branches scraping against the roof of the house startle you for a moment."; 3: "You think you hear the sounds of faint footsteps. It must be your imagination."; 4: if (player in LivingRoom) { if(Window has open) "A cold gust of wind blows through the window, giving you a chill."; else "The window rattles from the strong winds outside."; } else { "You hear what sounds like a door creaking somewhere in the house. You pause for a moment to listen."; }; 5: if (candle has general) { give candle ~general; give SecretRoom ~light; give Corridor ~light; give VaultEnd ~light; "All of a sudden, the candle goes out. There must be a draft from somewhere."; } else "You feel a cold draft from somewhere in this old house."; }; }; ]; !******************************************************************************** ! Routines !******************************************************************************** [Sequence bottle; if (PushState == 0) if (bottle == GreenBottle) { PushState = 1; }; if (PushState == 1) if (bottle == WhiteBottle) PushState = 2; else if (bottle == GreenBottle) PushState = 1; else PushState = 0; if (PushState == 2) if (bottle == BlueBottle) rtrue; else if (bottle == GreenBottle) PushState = 1; rfalse; ]; [Intro; style bold; print "Fortune Hunter"; style roman; print "^Type '?' for help^"; !* Intro "^You have just entered the Pindale's Mansion. You know that the old man keeps all his valuables hidden here. You also know that he has a propensity for puzzles and riddles. You know finding his stash won't be easy, but you're bond and determined to do so. You've managed to gain entrance to the house now all you have to do is find what you came here for.^"; ]; !******************************************************************************* [Initialise; location = Foyer; !* start player in foyer give Photo ~broken; !* frame starts not broken give WineRack ~canMove; !* wine rack starts locked in place StartDaemon(RandomStuff); !* begin random occurances Intro(); rtrue; ];