! Haunted House ! ! Project for CIS587, Computer Game Design & Implementation ! at UofM Dearborn Fall 2001. ! Written by Brion Scheidel ! Constant Story "Return to the Haunted House (or How I Almost Ruined My Best Friend's Wedding)"; Constant Headline "^Project for CIS587, Computer Game Design & Implementation^ at UofM Dearborn Fall 2001.^Written by Brion Scheidel^^"; Constant LOOK_UNDER_CAN = 0; Constant MOVE_CAN = 1; Include "parser"; Include "verblib"; Include "grammar"; Attribute legible; Global read_a_note; ! ---------------------------------------------------------------------------- ! Grammar ! ! This grammar section includes extensions to the standard grammar library. ! ! ---------------------------------------------------------------------------- ! For reading the notes [ ReadSub; <>; ]; ! For plugging and unplugging the black-light and the chainsaw [ PlugInSub; "You can't plug in ", (the) noun, "!"; ]; [ UnPlugSub; "You can't unplug ", (the) noun, "!"; ]; ! For plugging and unplugging the black-light and the chainsaw Verb "plug" * "in" noun -> PlugIn * noun "in" -> PlugIn * noun "in" "to" noun -> PlugIn * noun "into" noun -> PlugIn; Verb "unplug" * noun -> UnPlug * noun "from" noun -> UnPlug; ! For filling the bottle and the snake tank Verb "pour" * "water" "into" noun -> Fill * "water" "in" "to" noun -> Fill * "water" "in" noun -> Fill; ! For going through the window Verb "crawl" * "through" noun -> Enter; ! For reading the notes Extend "read" first * legible -> Read; ! For filling the bottle and the snake tank Extend "fill" * noun "with" "water" -> Fill; Extend "push" * noun "with" held -> Push; ! For going through the window Extend "climb" * "through" noun -> Climb; ! For throwing the extension cord through the window Extend "throw" * noun "through" noun -> ThrowAt; Extend "throw" * noun "out" noun -> ThrowAt; Extend "drop" * noun "through" noun -> ThrowAt; Extend "drop" * noun "out" noun -> ThrowAt; ! Class for the Notes Class Note has legible with add_comment [; ! Only show this comment the first time any note is read if (read_a_note == 0) { read_a_note = 1; "You don't know who Joe or Frank are, but the note might prove useful. It's good burnable paper anyway."; } ], before [; Burn: if (Matches notin player) { "You have nothing to burn the note with."; } ! If player burns note in Skeleton_Room, assume he wants to burn the ! rope. if (Rope in Skeleton_Room && Matches in player && location == Skeleton_Room) { print "The note burns for a few seconds and you hold it up to the rope."; remove self; ! If the rope has already been burned through part-way if (Rope has general) { remove Rope; move Bone to Skeleton_room; move Skeleton to Skeleton_room; print " The rope catches fire like a dynamite fuse in a cartoon and burns up completely. A huge skeleton comes crashing down beside you. You see one bone fly off the skeleton's body in one direction, and you see the groom's wedding ring fly off one of the skeleton's fingers in the other direction.^"; if (Skeleton_Room.check_grooms_ring() == false) { print "You saw and heard the groom's ring hit the ground, but it disappeared from view after that. If only you had something better than the moonlight to see by.^"; } rtrue; } else { give Rope general; " The rope burns part-way through before the note burns up."; } } else { rfalse; } ]; [ Initialise; location = Outside_East; give player light; move Matches to Ghost_Room_Rat; move Brides_Ring to Snake_Room_Rat; print "^^^^^It's around midnight on October 30, the day before Halloween, and you are strolling home after a very busy evening. It all started with the rehearsal dinner for your best friend's wedding. Lots of food, drinks and fun. And, as best man, you gave a hilarious, well-received toast - just a preview of the one you will be giving tomorrow night at the wedding. Yes, the wedding will be on Halloween - your best friend and his fiancee are truly trick-or-treat type of people.^^ After dinner, the entire wedding party went to a haunted house not far from where you live, and everyone had a blast getting their wits scared out of them.^ It's been a very enjoyable evening, you think to yourself as you walk home from the haunted house. You whistle and jingle your keys in your pocket, thinking about the wedding rings your best friend gave you to hold on to until the wedding. They are very stunning, both made of brilliant white gold...^^ You freeze in your tracks as you realize something is very, very wrong. There should be more than just keys jingling in your pocket...^^ WHERE...ARE...THE...RINGS?!!!!!^^ You remember having them before you went into the haunted house... Oh, no! You were one of the last people out of the haunted house; they were closing it up as you left. If you hurry, there might still be somebody there who will let you in and help you search for them. If not, well, it looks like you might be in for some breaking-and-entering tonight...^^^"; ]; Object Holder_Room "Holder Room", has scenery enterable with name "forbidden room", description "This room is used to hold invisible objects. You should never see this room. There are no doors in or out. You are trapped here forever." ; !---------------------------------------------------------------------- Object Outside_East "Outside - the front of the Haunted House", has scenery enterable with name "moon" "haunted" "house" "building", description "^^You are standing in front of the Haunted House, on the east side of the building. The moon is nearly full, so it is not difficult to see, but the moonlight seems to give an eerie quality to everything it touches. You were just here a few hours ago, but is seems much more sinister and dangerous now that it is deserted.^^ There is a large front door on this side of the building, directly in front of you to the west.^ The north side of the building is to your north-west.^ The south side of the building is to your south-west.", sw_to Outside_South, nw_to Outside_North, w_to Front_Door, in_to Front_Door ; !---------------------------------------------------------------------- Object Doormat "doormat" Outside_East has static ! general if the player has found the note under it with name "doormat" "mat", initial "There is a large doormat in front of the door.", description "It looks like an ordinary doormat.", before [; Enter: "You get on the doormat."; Exit: "You get off the doormat."; Take,Push,Pull: "It seems to be permanently attached here, except for one loose corner."; LookUnder: if (self hasnt general) { give self general; move Note1 to player; "You lift up the loose corner of the doormat, see a faded note there, and you decide to take it."; } ] ; !---------------------------------------------------------------------- Note Note1 "faded note" Holder_Room with name "faded" "note" "paper", description "A faded note from Frank to Joe that you found under the doormat.", before [; Consult,Read: print "The note reads:^ ~Joe,^ I had to put the key in our secondary hiding spot - the kids keep finding it and sneaking in.^ Frank~^"; self.add_comment(); rtrue; ] ; !---------------------------------------------------------------------- Object Front_Door "front door" has static door openable lockable locked with name "front" "door" "massive" "brass" "knob", description "The front door is massive - much bigger than you remember it. There is a large brass knob with a skeleton key-hole below it.", when_open "The front door is open.", when_closed "The front door is closed.", door_to [; if (location==Outside_East) return Skeleton_Room; return Outside_East; ], door_dir [; if (location==Outside_East) return w_to; return e_to; ], found_in Outside_East Skeleton_Room, with_key Skeleton_Key, after [; Unlock: ! Only allow the door to be unlocked from the outside, and only if the ! Branch is inside the Key handle for leverage. give self locked; if (location == Outside_East) { if (second == Skeleton_Key) { if (Branch notin Skeleton_Key) { "You try to turn the key, but the lock is too stiff. Maybe if you had something you could use for leverage..."; } else { move Branch to player; give self ~locked; give self open; "Using the branch for leverage, you are able to turn the key and...you unlock the door! You take the branch out of the key's circle handle and remove the key from the door. The door swings open."; } } } else { "No matter how hard you try, you can't seem to unlock the door from the inside. Looks like you'll have to find another way out."; } ], before [; Close: give self ~open; give self locked; "The front door slams closed and you hear it lock solidly."; ] ; !---------------------------------------------------------------------- Object Outside_South "Outside - south of the Haunted House", has scenery enterable with name "lightbulb" "bulb" "moon" "haunted" "house" "building", description "This side of the building is a little less scary.^ There is a single bare light bulb here, shining down on a laminated map of the local neighborhood on the wall.^^ The east side (front) of the building is to your north-east.^ The west side (back) of the building is to your north-west.", initial [; ! Close the front door if the player left it open. ! This is done to enforce the fact that the only way in is through ! the door, and the only way out is through the window. if (Front_Door has open) { <>; } ], ne_to Outside_East, nw_to Outside_West ; !---------------------------------------------------------------------- Object Map "map" Outside_South has static scenery ! general if you've found the note under it with name "map", description "It's a laminated map of the local neighborhood, permanently affixed to the wall.", before [; Take,Push,Pull: print "The map seems to be permanently fixed in place.^"; if (self hasnt general) { ; } rtrue; LookUnder: if (self hasnt general) { move Note2 to player; give self general; "You start to lift up a corner of the map and a note falls out from behind it. You catch it before it hits the ground."; } ] ; !---------------------------------------------------------------------- Note Note2 "hastily scrawled note" Holder_Room with name "hastily" "scrawled" "note" "paper", description "A hastily scrawled note from Frank to Joe that you found behind the map.", before [; Consult,Read: print "The note reads:^ ~Joe,^ The key isn't here, you idiot!^ Frank~^"; self.add_comment(); rtrue; ] ; !---------------------------------------------------------------------- Object Outside_West "Outside - behind the Haunted House", has scenery enterable with name "moon" "haunted" "house" "building", description "You are behind the Haunted House. The Haunted House is to the east. This back wall holds the building's only window.^^ The south side of the building is to your south-east.^ The north side of the building is to your north-east.", se_to Outside_South, ne_to Outside_North ; !---------------------------------------------------------------------- Object Garbage_Can "garbage can" Outside_West has static container enterable openable ! general if it is by the tree with name "smelly" "garbage" "can", initial "There is a smelly garbage can here.", description "It looks like an ordinary garbage can.", find_key [aAction; if (Skeleton_Key in Holder_Room) { move Skeleton_Key to Outside_West; print "You see a skeleton key under the garbage can"; if (aAction==LOOK_UNDER_CAN) { move Skeleton_Key to player; " and take it."; } "'s original position."; } ], before [; Push,Pull: if (player in Top_Of_Garbage_Can) "You'll have to get off it first."; if (self has general) { give self ~general; "You push the garbage can away from the tree."; } give self general; print "You push the garbage can over to the tree.^"; self.find_key(MOVE_CAN); rtrue; LookUnder: if (player in Top_Of_Garbage_Can) "You'll have to get off it first."; if (self.find_key(LOOK_UNDER_CAN)) rtrue; Climb,Enter: <>; Take: "It's way too big to carry, but you could probably move it."; GetOff: <>; ] ; !---------------------------------------------------------------------- ! I need this object because I want the garbage can to be both a container ! (to hold the note) and a supporter (to be climbed on). Object Top_Of_Garbage_Can "top of the garbage can" Outside_West has static supporter open enterable concealed with before [; Climb,Enter: if (location == Outside_West) { PlayerTo(self,1); print "You jump onto the garbage can"; if (Garbage_Can has open) { ", careful not to fall inside."; } else { "."; } } GetOff: if (player in self) { PlayerTo(Outside_West,1); "You get off the garbage can."; } ] ; !---------------------------------------------------------------------- Note Note3 "stinky note" Garbage_Can with name "stinky" "note" "paper", description "A stinky, garbage-stained note from Frank to Joe that you found in the garbage can.", before [; Consult,Read: print "The note reads:^ ~Joe,^ Why would I put the key in the garbage can?^ Frank~^"; self.add_comment(); rtrue; ] ; !---------------------------------------------------------------------- Object Skeleton_Key "skeleton key" Holder_Room has container open ! general if already been described with name "skeleton" "key" "handle", description [; give self general; self.describe_self(); ], describe_self [; "It is a huge skeleton key with a large circle for a handle, big enough to shove a branch through, if you were so inclined."; ], before [; Receive: if (noun ~= Branch) { "That doesn't really fit well inside the skeleton key's circular handle."; } Take: ! If the player hasn't already examined the key, do it for him, so he ! knows about the circle handle. if (self hasnt general) { move self to player; print "Taken. "; self.describe_self(); rtrue; } ] ; !---------------------------------------------------------------------- Object Tree "tree" Outside_West, has static enterable container transparent open ! general if branch is already broken off with name "beautiful" "maple" "tree", initial "There is a tree here.", description [; print "It is a beautiful maple whose leaves are orange and red and falling off."; if (self hasnt general) { print " One sturdy looking branch almost reaches the open window.^"; } ], before [; Climb,Enter: if (player in Top_Of_Garbage_Can && Garbage_Can has general) { if (self has general) { "You can't reach any branches now that you have broken that lowest one off."; } else { move Branch to Outside_West; give Branch ~concealed; PlayerTo(Outside_West,1); give Tree general; "You grab the sturdy-looking branch and pull yourself up. Suddenly, you hear a loud crack and feel yourself fall to the ground. Luckily, you are not hurt, but there is now no way to enter via the window.^ The broken branch lies on the ground next to you."; } } if (player in Top_Of_Garbage_Can && Garbage_Can hasnt general) { "You might be able to reach the lowest branches if the garbage can was closer to the tree."; } "You can't reach the lowest branches."; ] ; !---------------------------------------------------------------------- Object Branch "large branch" Tree has concealed with name "large" "branch", initial "A large, sturdy-looking branch lies here.", description "It is a sturdy branch - ok, not sturdy enough to support you, but still, pretty sturdy.", before [; Take,Attack: if (Tree hasnt general) { <>; } rfalse; ] ; !---------------------------------------------------------------------- Object Outside_North "Outside - north of the Haunted House", has scenery enterable with name "moon" "haunted" "house" "building", description "The nearly full moon shines on some pavers that seem to lead nowhere.^ The west side (back) of the building is to your south-west.^ The east side (front) of the building is to your south-east.", initial [; ! Close the front door if the player left it open. ! This is done to enforce the fact that the only way in is through ! the door, and the only way out is through the window. if (Front_Door has open) { <>; } ], se_to Outside_East, sw_to Outside_West ; !---------------------------------------------------------------------- Object Paver "paver" Outside_North has static supporter enterable ! general if you've found the note under it with name "loose" "paver" "pavers//p", description "It looks like an ordinary paver, but it wobbles when you step on it.", before [; Take: if (self hasnt general) { ; } "The paver is much too large and heavy for you to carry."; Push,Pull,LookUnder: if (self hasnt general) { give self general; move Note4 to player; "You lift up one corner of the the paver, see a soiled note there, and you decide to take it."; } ] ; !---------------------------------------------------------------------- Note Note4 "soiled note" Holder_Room with name "soiled" "note" "paper", description "A soiled note from Frank to Joe that you found under the paver.", before [; Consult,Read: print "The note reads:^ ~Joe,^ The key isn't here - this is way too obvious!^ Frank~^"; self.add_comment(); rtrue; ] ; !---------------------------------------------------------------------- Object Skeleton_Room "Skeleton Room", has scenery enterable with name "fixture" "rafters" "doorway" "corner" "corners", description [; if (self hasnt visited) { give Front_Door ~open; give Front_Door locked; print "As soon as you enter the room, the front door slams closed behind you and you hear it lock solidly. You spin around to see who (or what) closed it, but there is nothing there.^^"; } print "When you were here earlier today with your friends, this room was full of skeletons. Now the skeletons are all gone except for one."; if (Rope in self) { print " A huge skeleton hangs here, swaying gently in the breeze that seems to constantly blow through the Haunted House."; } else { print " A huge skeleton sits here."; } print " The walls and ceiling of this old building have thousands of small cracks and holes which let in the breeze and the moonlight.^^ There is a doorway to the north and a doorway to the west.^ The front door is to the east.^"; self.check_grooms_ring(); ], check_grooms_ring [; ! See if the Groom's Ring should be in the Skeleton's Room or not. ! It should be in the Skeleton Room if it is in the Skeleton ! Room or the Holder Room AND the Black Light is plugged in AND the ! Rope has been burned through. if (Grooms_Ring in Holder_Room or self && Black_Light has general && Rope notin self) { move Grooms_Ring to self; if (location == self) { print "The black-light comes in handy now, as it illuminates the white gold groom's ring tucked away in a corner of the room.^"; } rtrue; } else if (Grooms_Ring in self) { move Grooms_Ring to Holder_Room; } if (Grooms_Ring in Holder_Room or self && location == self && Rope notin self) { print "You know the groom's ring is in here somewhere, but you can't find it in the dim moonlight. If only you had something better than the moonlight to see by.^"; } rfalse; ], after [; ! Called when entering the room. Go: self.check_grooms_ring(); ], e_to Front_Door, w_to Snake_Room, n_to Ghost_Room ; !---------------------------------------------------------------------- Object Rope "rope" Skeleton_Room has static ! general if burned part-way through with name "rope", initial "There is a rope here, tied to a large fixture on the wall and leading up into the rafters. At the other end of the rope is a huge skeleton, swaying gently in the breeze.", description "It looks like an ordinary rope.", before [; Burn: if (Matches in player) { "You won't be able to burn the rope directly, but maybe burning a piece of paper would work..."; } else { "You have nothing to burn it with."; } Take: "You can't seem to get it untied."; Attack: if (self has general) { "Although burned part-way through, it's still too tough to break."; } else { "It's too tough for you to break."; } ] ; !---------------------------------------------------------------------- Object Black_Light "black-light lamp" Skeleton_Room ! general when plugged in with name "black-light" "black" "light" "lamp", short_name [; print "black-light lamp"; if (self has general) { print " (plugged in to the extension cord)"; } else { print " (unplugged)"; } rtrue; ], initial [; print "There is a black-light lamp here. "; self.describe_self(); ], description [; self.describe_self(); ], describe_self [; print "It is a simple black-light lamp with no on/off switch"; if (self has general) { ", plugged into an extremely long extension cord. The light from it glows eerily and makes some objects glow brightly."; } else { ", unplugged."; } ], before [; PlugIn: if (self has general) { "It's already plugged in!"; } if (Extension_Cord in Player) { give self general; print "You plug the black-light into the extension cord and it gives off an eerie glow. You can see how this might help you find objects that are hidden away in dark corners.^"; Skeleton_Room.check_grooms_ring(); Ghost_Room.check_bottle(); rtrue; } else { "You don't have anything to plug it into."; } UnPlug: if (self hasnt general) { "It's not plugged in!"; } else { give self ~general; move Extension_Cord to player; print "You unplug the black-light and the eerie glow disappears. You hold the end of the extension cord in your hand.^"; Skeleton_Room.check_grooms_ring(); Ghost_Room.check_bottle(); rtrue; } Take: if (Black_Light has general) { move Extension_Cord to player; "You pick up the black-light lamp and the extension cord it's plugged into."; } Drop: if (Black_Light has general) { move Extension_Cord to location; "You drop the black-light lamp and the extension cord it's plugged into."; } ] ; !---------------------------------------------------------------------- Object Skeleton "skeleton" Skeleton_Room has static with name "skeleton", description [; if (Rope in self) { "It is hanging from one of the rafters, swaying gently in the breeze. You see the moonlight reflect off something shiny on one of the skeletons fingers - could it be one of the rings?"; } else { "It is a huge complete skeleton (well, almost complete - one bone seems to be missing)."; } ], before [; Take: if (Rope in Skeleton_Room) { "It's hanging up too high, out of your reach."; } else { "It's huge; you can't even move it, much less carry it."; } ] ; !---------------------------------------------------------------------- Object Bone "bone" Holder_Room with name "bone", description "It is a bone from the skeleton that broke off when the skeleton came crashing down.", before [; Drop,ThrowAt: if (location == Freddy_Room) { <>; } ] ; !---------------------------------------------------------------------- Object Grooms_Ring "groom's ring" Holder_Room with name "groom" "groom^s" "wedding" "ring", description "It is the groom's wedding ring!", after [; Take: if (Brides_Ring in player) { "You now have both rings - time to get out of here!"; } else { "You now have one of the rings - time to get the other one!"; } ] ; !---------------------------------------------------------------------- Object Ghost_Room "Ghost Room", has scenery enterable ! general if player is in the process of moving into this room with name "sheet" "sheets" "cobwebs" "webs" "ghost" "ghosts" "doorway" "corner" "corners", description "You know that they are only sheets and fake cobwebs, but the ghosts that fill this room seem to be alive as they sway in the breeze.^^ There is a doorway to the south and a doorway to the west.", initial [; StartDaemon(Ghost_Room_Rat); self.check_bottle(); ], check_bottle [; ! See if the Bottle should be in the Ghost Room or not. ! It should be in the Ghost Room if it is in the Ghost ! Room or the Holder Room AND the Black Light is plugged in. if (Bottle in Holder_Room or self && Black_Light has general) { move Bottle to self; if (location == self) { print "The black-light comes in handy now, as it illuminates an empty Mountain Dew bottle tucked away in a corner of the room, which glows a very ghastly green in the strange light.^"; } rtrue; } else if (Bottle in self) { move Bottle to Holder_Room; } rfalse; ], w_to Freddy_Room, s_to Skeleton_Room ; !---------------------------------------------------------------------- Object Matches "book of matches" Ghost_Room with name "pack" "book" "matches", description "It is a book of matches." ; !---------------------------------------------------------------------- Object Bottle "bottle" Holder_Room, has container open concealed ! general if full of water with name "bottle" "pop" "soda" "mountain" "dew", initial "There is a Mountain Dew bottle here.", description [; if (self has general) { "It is full of water."; } else { "It is empty."; } ], before [; Receive: if (noun == Water) <>; "The bottle is only supposed to hold liquids."; Fill: if (self has general) "The bottle is full already."; if (location == Bathroom) { move water_in_the_bottle to Bottle; give self general; "You fill the bottle with water from the sink."; } "There is nothing here with which to fill the bottle."; Empty: if (self hasnt general) "The bottle is already empty!"; remove water_in_the_bottle; give self ~general; "Your bottle is now empty."; ] ; !---------------------------------------------------------------------- Object water_in_the_bottle "bottled water" with description "It looks like ordinary water.", name "bottled" "water" "h2o", article "some", before [; Drink: remove water_in_the_bottle; <>; ] ; Object water_in_the_tank "tank water" with description "It looks like ordinary water.", name "tank" "water" "h2o", article "some", before [; if (action ~= ##Examine) { "The wire mesh covering the tank prevents you from doing that."; } ] ; !---------------------------------------------------------------------- Object Freddy_Room "Freddy Krueger Room", has scenery enterable with name "Freddy" "Krueger" "doorway" "corner" "corners", description "An unbelievably life-like Freddy Krueger mannequin stands in the center of this room, securely holding a chainsaw with the chain removed (safety first!). You don't recall Freddy ever carrying a chainsaw - wasn't that Jason?^^ There is a door to the north, a doorway to the south and a doorway to the east.", initial [; StartDaemon(Dog); ], e_to Ghost_Room, n_to [; if (Bone in Dog) { return Bathroom_Door; } else { "You start to go towards the door, but the huge dog blocks your way."; } ], s_to Snake_Room ; !---------------------------------------------------------------------- Object Mannequin "mannequin" Freddy_Room has static with name "mannequin", description "It looks just like Freddy Krueger!" ; !---------------------------------------------------------------------- Object Dog "dog" Freddy_Room has animate container transparent open with name "huge" "dog", initial [; if (Bone in self) { print "There is a huge dog sitting in the corner intent on chewing up a skeleton bone"; } else { print "There is a huge dog in front of the "; Bathroom_Door.describe_self(); } "."; ], description [; print "It is a huge boxer or rottweiler (it's hard to tell in this light. "; if (Bone in self) { "He seems very happy with the skeleton bone and ignores you."; } else { print "He looks mean and hungry and is guarding the entrance to the "; Bathroom_Door.describe_self(); " vigilantly."; } ], life [; Ask,Answer,Order: "The dog growls and looks at you menacingly."; Kiss: "You can't be serious."; Attack: "This dog looks really mean. You decide you don't want to mess with him."; Give: if (noun == Bone) { move Bone to self; "The dog snaps up the bone and joyfully bounds over to a far corner of the room to enjoy his new treat privately."; } else { if (Bone in self) { "Nothing can tear him away from the skeleton bone now."; } "He sniffs at ", (the) noun, " briefly, but ignores it and looks up at you expectantly and menacingly. Looks like nothing but human flesh (or maybe a bone) will interest him."; } ThrowAt: <>; ], before [; Take: "It won't let you get close enough for that."; LetGo: "Nothing can tear him away from the skeleton bone now."; ], daemon [; ! Do something approximately every 3rd turn. if (location == Freddy_Room) { if (Bone in self) { switch (random(15)) { 1: "The dog sits contentedly in the corner, gnawing away at the bone."; 2: "The dog whips his head up, tossing the bone in the air, and then catches it again - very talented!"; 3: "The dog drops the bone, circles it three times, then starts chewing on it again."; 4: "The dog looks thankfully at you for a second, then remembers it is a watch-dog and looks menacing again."; 5: "The dog thinks about barking, but decides to take a short nap instead."; } } else { switch (random(15)) { 1: "The dog keeps a watchful eye on you."; 2: "The dog growls at you and continues pacing."; 3: "The dog jumps in the air and performs a full front flip with a half-twist - very talented!"; 4: "The dog smiles at you - or is it frowing? Either way, it's pretty scary."; 5: "The dog thinks about napping, but decides to bark instead."; } } } else { StopDaemon(self); } ] ; !---------------------------------------------------------------------- Object Chain_Saw "chainsaw" Freddy_Room has static general ! general when plugged in with name "chainsaw" "chain" "saw", initial [; self.describe_self(); ], description [; self.describe_self(); ], describe_self [; print "The chainsaw is an ordinary (but useless) electric chainsaw"; if (self has general) { ", plugged into an extremely long extension cord."; } else { ", unplugged."; } ], before [; PlugIn: if (self has general) { "It's already plugged in!"; } if (Extension_Cord in Player) { if (Black_Light has general) { "The black-light lamp is already plugged into the extension cord."; } give self general; move Extension_Cord to Freddy_Room; "You plug the chainsaw into the extension cord."; } else { "You don't have anything to plug it into."; } UnPlug: if (self hasnt general) { "It's not plugged in!"; } else { give self ~general; move Extension_Cord to player; "You unplug the chainsaw and hold the end of the extension cord in your hand."; } ] ; !---------------------------------------------------------------------- Object Doritos "pile of Nacho Cheese Doritos" Freddy_Room has edible with name "pile" "nacho" "cheese" "doritos" "potato" "chips", initial "A small pile of discarded Nacho Cheese Doritos sits on the floor.", description "It is a small pile of discarded Nacho Cheese Doritos.", before [; Eat: "You take a bite of one and spit it out - very stale."; ] ; !---------------------------------------------------------------------- Object Extension_Cord "extension cord" Freddy_Room ! general if thrown through window with name "extension" "cord", initial [; if (location == Bathroom && self has general) { "The extension cord leads out the window, forming a secure line you can use to climb into and out of the window."; } else if (Black_Light hasnt general && Chain_Saw hasnt general) { "The end of an extremely long extension cord lies here."; } ], description "It is the longest extension cord you have ever seen. You imagine you could wonder all around this Haunted House dragging it behind you and you would never run out of cord.^ It is tied securely around a large post in the middle of the room and plugged in to an outlet far out of reach.", print_plugged_in_object [; if (Black_Light has general) { print "the black-light"; } else { print "nothing"; } ], move_plugged_in_object_to [ target; if (Black_Light has general) { move Black_Light to target; } ], before [; PlugIn: "The extension cord is tied around the post and securely plugged into the outlet in the Freddy Krueger room. Perhaps you want to plug something into the extension cord..."; UnPlug: "The extension cord is tied around the post and securely plugged into the outlet in the Freddy Krueger room. Perhaps you want to unplug something from the extension cord..."; Push,Pull: if (self has general) { if (location == Bathroom) { if (player in Toilet) { give self ~general; print "You pull the extension cord back through the window, "; self.print_plugged_in_object(); self.move_plugged_in_object_to(player); " still plugged in."; } else { "You can't reach it from here."; } } } "The other end is still tied securely around the post in the Freddy room."; Remove: if (self has general) { <>; } Insert,ThrowAt: if (second == Bathroom_Window) { print "You toss the end of the extension cord through the window, "; self.print_plugged_in_object(); print " still plugged in.^"; if (location == Bathroom) { give self general; move Extension_Cord to Bathroom; self.move_plugged_in_object_to(Outside_West); "It now forms a secure line you can use to climb into and out of the window."; } else { give self ~general; self.move_plugged_in_object_to(Bathroom); "You now have no secure line you can use to climb into and out of the window."; } } Take: if (Black_Light has general && Black_Light notin player) { <>; } else if (Chain_Saw has general) { <>; } rfalse; Drop: if (Black_Light has general && Black_Light in player) { ; } rfalse; ] ; !---------------------------------------------------------------------- Object Bathroom "Bathroom", has scenery enterable with description "You can tell just from the smell that this small room is the bathroom, even before you see the toilet shining in the moonlight streaming in through the window above it.^^ There is a door to the south.", s_to Bathroom_Door ; !---------------------------------------------------------------------- Object Bathroom_Door "bathroom door" has static door openable open with name "bathroom" "door", description "It looks like an ordinary door.", describe_self [; if (Bathroom has visited) { print "bathroom door"; if (location == Freddy_Room) { print " (to the north)"; } } else { print "door to the north"; } ], when_open [; print "The "; self.describe_self(); " is open."; ], when_closed [; print "The "; self.describe_self(); " is closed."; ], door_to [; if (location==Bathroom) return Freddy_Room; return Bathroom; ], door_dir [; if (location==Bathroom) return s_to; return n_to; ], found_in Bathroom Freddy_Room, before [; Go: if (Bone notin Dog) { "You approach the bathroom door, but the dog stops you. He growls menacingly, baring his sharp, slobber-covered teeth."; } ] ; !---------------------------------------------------------------------- Object Bathroom_Window "open window" with name "bathroom" "window", initial "The window is open, pretty high up on the wall.", description "It is a large open window, easily large enough to crawl through.", found_in Outside_West Bathroom, before [; if (action ~= ##Examine or ##ThrownAt && player notin Toilet || (player in Outside_West && Extension_Cord hasnt general)) "You can't reach the window from where you're standing."; Climb,Enter: if (player in Toilet) { if (Extension_Cord has general) { if (Grooms_Ring in player && Brides_Ring in player) { deadflag = 2; "You crawl through the window and climb down the extension cord with the 2 rings secure in your pocket. You have saved the wedding! You make your way home, trying to figure out how to incorporate the story of tonight's adventure into your wedding toast..."; } PlayerTo(Outside_West); "You crawl through the window and climb down the extension cord."; } else { "You'd surely hurt yourself if you went through the window without some sort of rope or line to climb down."; } } else { print "You climb up the extension cord and through the open window.^"; <>; } ] ; !---------------------------------------------------------------------- Object Toilet "toilet" Bathroom has static supporter enterable open with name "toilet", description "It looks like an ordinary toilet.", before [; Climb,Enter: PlayerTo(self,1); "You climb onto the toilet, careful not to slip inside. The window is at eye-level now."; ] ; !---------------------------------------------------------------------- Object Sink "sink" Bathroom has static container open with name "sink", description "It looks like an ordinary bathroom sink; the basin is filled with water." ; !---------------------------------------------------------------------- Object Water "water" Sink, has scenery with name "water", description "It looks like ordinary water.", before [; Drink: "You take a drink of sink-water."; Take: if (Bottle notin player) "You have nothing in which to carry the water."; <>; Insert: if (second == Bottle) <>; "You have nothing in which to carry the water."; Receive: if (noun == Bottle) <>; ] ; !---------------------------------------------------------------------- Object Snake_Room "Snake Room", has scenery enterable with name "doorway" "corner" "corners", description "This room, slithering with snakes when you were here earlier as a paying guest, is now deserted.^^ There is a doorway to the north and a doorway to the east.", initial [; StartDaemon(Snake_Room_Rat); ], n_to Freddy_Room, e_to Skeleton_Room ; !---------------------------------------------------------------------- Object Brides_Ring "bride's ring" Snake_Room with name "bride" "bride^s" "wedding" "ring", description "It is the bride's wedding ring!", after [; Take: if (Grooms_Ring in player) { "You now have both rings - time to get out of here!"; } else { "You now have one of the rings - time to get the other one!"; } ] ; !---------------------------------------------------------------------- Object Snake_Tank "snake tank" Snake_Room has static container open transparent ! general if already filled with water with name "snake" "tank" "cage" "glass" "wire" "mesh", description "It is made of very thick glass and has a mesh wire covering that barely allows you to stick two fingers in.", initial [; print "There is a glass snake tank covered securely with a wire mesh. The tank"; if (Snake_Tank has general) { print " is tank full of water, "; } else { print " contains a few inches of water,"; } print "and a discarded plastic spoon floats in it."; if (Brides_Ring in Snake_Tank) { print " On top of the spoon sits the bride's wedding ring."; } new_line; rtrue; ], before [; Open: "You can't get that wire mesh covering off."; Receive: if (noun == Water) <>; else "That won't fit in the tank."; Fill: if (self has general) "The tank is full already."; if (Bottle in player && Bottle has general) { give self general; move water_in_the_tank to self; ; print "The tank is now full of water. The plastic spoon"; if (Brides_Ring in self) { print " (and the ring it supports)"; } " has floated up to the top and is within reach of your fingers."; } "There is nothing here with which to fill the tank."; LetGo: if (self has general) { if (noun == Brides_Ring) { print "You stretch your fingers through the sturdy wire mesh covering the top of the tank, and you are able to pluck the ring off the floating spoon it's resting on.^"; } else if (noun == Spoon) { "You aren't able to get a good enough grip on the spoon to lift it out."; } } else { "The sturdy wire mesh covering the top of the tank won't let you reach far enough into the tank."; } ] ; !---------------------------------------------------------------------- Object Spoon "plastic spoon" Snake_Tank has concealed with name "plastic" "spoon", description "It looks like a spoon from a Frosty from Wendy's." ; !---------------------------------------------------------------------- ! Rats Class Rat has animate container transparent open with name "large" "rat", initial "There is a large rat here.", drop_ring[; move Brides_Ring to Snake_Tank; "The rat happens to be walking over the wire-mesh covered snake tank when it drops the bride's ring. The ring slips through the mesh and comes to rest on the discarded plastic spoon floating in the snake tank."; ], life [; Ask,Answer,Order: "The rat twitches its whiskers and looks at you hungrily."; Kiss: "You can't be serious."; Attack: if (Branch in player) { move Branch to self; print "You throw the branch viciously at the rat. It hits him squarely in the hind-quarters and he yelps, dropping what he's carrying. Glaring at you, he grabs the branch and scurries away.^"; if (Matches in self) { move Matches to Ghost_Room; } else if (Brides_Ring in self) { self.drop_ring(); } else if (Doritos in self) { move Doritos to location; } rtrue; } else { "Nothing you carry is big enough to scare this rat. And you certainly aren't going to attack it with your bare hands."; } Give: if (noun == Doritos) { move Doritos to self; print "You toss the Doritos to the rat. It sniffs them suspiciously, then drops what he's carrying in favor of the Doritos. Looking at you thankfully, he grabs the Doritos and scurries away.^"; if (Matches in self) { move Matches to Ghost_Room; } else if (Brides_Ring in self) { self.drop_ring(); } else if (Branch in self) { move Branch to location; } rtrue; } else { "He doesn't look interested."; } ThrowAt: if (noun == Doritos) { <>; } else if (noun == Branch) { <>; } "That won't do any good. Maybe something else would be more effective..."; ], before [; Take: "It won't let you get close enough for that."; LetGo: "He's going to have to be enticed (or forced) to drop what he's carrying."; ], daemon [; if (location ~= Snake_Room) { StopDaemon(Snake_Room_Rat); } if (location ~= Ghost_Room) { StopDaemon(Ghost_Room_Rat); } if (player in Snake_Room or Ghost_Room) { print "The large rat scurries around,"; if (Brides_Ring in self) { " carrying the bride's wedding ring in its mouth!"; } else if (Matches in self) { " carrying a book of matches in its mouth."; } else if (Branch in self) { " carrying a large branch in its mouth."; } else if (Doritos in self) { " eating some Doritos."; } else { " looking for something to eat."; } } ] ; !---------------------------------------------------------------------- Rat Ghost_Room_Rat "large rat" Ghost_Room ; !---------------------------------------------------------------------- Rat Snake_Room_Rat "large rat" Snake_Room ;