! Jorden Lowe ! CIS 487 ! 10/23/2006 ! Constant Story "Stranded"; Constant Headline "^A Text-based game^ by Jorden Lowe^"; Constant DEBUG; Include "parser"; Include "verblib"; Include "grammar"; !*************** Introduction *************** [ Initialise; location = Main_Hall; print "^^The night sky filed with clouds and rain as you are driving down a dark backwoods road. Your tire goes flat and the car spins out of control stoping with the help of a huge tree. What makes matters worse is the car is on fire and you must escape. As you are walking you see a house, maybe you can stop in for a moment and take a breather, and hey, maybe your phone will get some decent reception in these woods. As you enter the house you notice that the doors have locked. Time to look for a way to call for help. Good thing you brought your cell phone, but to use it you may need to get a better antanne and some higher ground...^^"; ]; !*************** Variables *************** Global has_ant = false; ! Checks to see if the player has the antenna !*************** Rooms *************** ! This is the starting point of the game ! Object Main_Hall "Main Hall" has light with name "Main Floor" "main floor" "main hall" "Main Hall", description "The main hall of this house is pretty large for a cabin in the middle of no where. Doesnt look like anyone lives here due to the amount of cobwebs and dust all around. You flick on your cellphone, it has a nice little flashlight for looking around. To the east you see a kitchen door open, to the west and northeast is 2 other doors on this floor. There are stairs that seem to lead to a door that is made of steel. The steel door has a crest of a gargoyle on the front of it.", w_to dress, e_to Kitchen, ! ! This checks to see if the north east room is locked or not ! ne_to [; if (locked_door has locked && locked_door hasnt open) print "That would not work, this door needs to be unlocked and opened.^"; else if (locked_door hasnt locked && locked_door hasnt open) "You still have to open the door."; else if (locked_door has open) return lockedR; ], ! ! This checks to see if the second floor is locked or not ! u_to [; if (steel_door has locked && steel_door hasnt open) print "That would not work, this door needs to be unlocked and opened.^"; else if (steel_door hasnt locked && steel_door hasnt open) "You still have to open the door."; else if (steel_door has open) return upstairs; ]; Object Kitchen "Kitchen" has light with name "Kitchen" "kitchen", description "You enter the kitchen, as you enter and look around you see various items scattered around. You begin to look around for a phone, but it doesn't look like this cabin has any modern features to it. The next idea is to search around for some material to make an antenna. Among the scattered items are silverware, pots, pans, aluminum foil, empty food rappers and bottles.", w_to Main_Hall; Object dress "Dressing Room" has light with name "dressing" "dressing room", description "As you enter this looks to be a dressing room. There were manicans along the right wall wearing old cowboy hats and wigs. On the left, there was a mirror with a desk. The desk had a few items on it such as makeup, eyebrow pluckers hair ribbons, bobby pins, wigs and scarves. On the back of the door you just came in is a fur coat.", e_to Main_Hall; Object lockedR "Locked Room" has light with name "locked" "room" "Locked" "Room", description "This house gets stranger as you enter this room. This room contains an old laboratory. On the wall is the good ol periodic table of elements you forgot long long ago, or perhaps never learned at all. There are a few rows of tables with beakers on them and bunsen burners underneath. whats left in the beakers looks to be film of whatever evaporated out of them. Right on the wall are two buttons. RED and GREEN, which shall you choose to push?", sw_to Main_Hall; !***** upstairs ***** Object upstairs "Upstairs Hallway" has light with name "upstairs" "hallway", description "Finally some higher ground, but you remember that the roof has some antenna on them, possible to catch lighting. Might have to find a room with a window up here to get better reception. As you walk up the stairs, you get a feeling that the boards are bad. You may want to examine the room before proceeding.", d_to Main_Hall, ! ! The upstairs bedroom is locked. ! e_to [; if (bed_door has locked && bed_door hasnt open) print "That would not work, this door needs to be unlocked and opened.^"; else if (bed_door hasnt locked && bed_door hasnt open) "You still have to open the door."; else if (bed_door has open) return upper_bed; ], ! ! Gives a hint where the key is. ! before[; examine: print "You look to see unstable floor boards, good thing you checked the floor out. While you were checking the floor you noticed a shiny object in the distance. Maybe a key..."; ]; Object upper_bed "Upstairs Bedroom" has light with name "upstairs" "bedroom", description "You made it to a room with a window! You try to dial out with your cell phone...", w_to upstairs, after[; ! ! If you have the aluminium then you win if you reach this room. ! if(has_ant == true) { deadflag = 2; print "You are able to call for some help and lay down on the bed to get some rest before they arrive."; } ! ! You have to go back and look for the aluminium. ! else { print "No reception on the cellphone!"; } ]; !*************** Doors *************** ! ! This is the room that is unlockable with the bobby pin. ! Object locked_door "locked door" has concealed static door openable lockable locked with name "locked" "lock" "door", description "This door looks old, and yet sturdy enough to keep you out. There is a keyhole, if only you could find something to open it with...", when_open "The door makes a creeking sound as it opens...", when_closed "The door closes with a loud thud.", door_to [; if (self in lockedR) return Main_Hall; return lockedR;], door_dir[; if (self in Main_Hall) return ne_to; return sw_to;], with_key bobby_pin, found_in lockedR Main_Hall; ! ! This room is unlockable through the red button in the Locked Room ! Object steel_door "steel door" has concealed static door openable lockable locked with name "steel" "steel door", description "This door is all steel and hitting this would only invite injury. there has to be something to open this...", when_open "A loud thud is heard throughout the house...", when_closed "The door closes with a loud thud.", door_to [; if (self in upstairs) return Main_Hall; return upstairs;], door_dir[; if (self in Main_Hall) return u_to; return d_to;], with_key Gswitch, found_in upstairs Main_Hall; ! ! This is unlockable with the old bedroom key. ! Object bed_door "Bedroom door" has concealed static door openable lockable locked with name "bed" "room", description "This door looks old, and yet sturdy enough to keep you out. There is a keyhole, if only you could find something to open it with...", when_open "The door makes a creeking sound as it opens...", when_closed "The door closes with a loud thud.", door_to [; if (self in upper_bed) return upstairs; return upper_bed;], door_dir[; if (self in upstairs) return ne_to; return sw_to;], with_key old_key, found_in upper_bed upstairs; !*************** Objects *************** ! ! This switch drops the player in a pit to die. ! Object Gswitch "Switch" lockedR has static switchable with name "green", describe "A green switch protrudes from one of the walls.", before[; push, switchOn, switchOff: print "Before you could react, it was a trap and fall in a pit to die..."; deadflag = 1; ], has concealed; ! ! This switch unlocks the second floor. ! Object Rswitch "Switch" lockedR has static switchable with name "red", describe "A red switch protrudes from one of the walls.", before[; push, switchOn, switchOff: print "You hear a loud click sound, must have been a door that unlocked..."; give steel_door ~locked; ], has concealed; ! ! This unlocks the locked door ! Object bobby_pin "Bobby pin" dress with name "pin" "bobby", description "It`s a small pin commonly used to unlock items and hold hair in place.", has concealed; ! ! This unlocks the upper bedroom ! Object old_key "Old bedroom key" upstairs with name "key" "old", description "It`s a small key. Looks old just like the rest of the house.", has concealed; ! ! This is one of the winning goals. ! Object foil "Aluminium foil" kitchen with name "aluminium" "foil", description "Old but still good to use.", before[; take: has_ant = true; ], has concealed;