!*************************************! ! Dustin Kelley ! ! U of M Dearborn ! ! CIS 487, Fall 2005 ! ! Assignment 1: Interactive Fiction ! ! Due: 10/17/05 ! !*************************************! Constant Story "BRAINFREEZE"; Constant Headline "^The Pursuit of the B.F.S.^by Dustin Kelley^"; Constant DEBUG; Constant MAX_SCORE = 5; Include "parser"; Include "verblib"; Include "grammar"; [ Initialise; location = Bedroom; print "^^^^^You just got home from a long, grueling day at work, and you feel horrible. You can't go anywhere yet because you have misplaced your keys, and you just can't seem to find them. Also, your bladder is about to burst from drinking so much water throughout the day, so you need to find a way to empty it out. But to make things even worse, you have a terrible burning headache and your head is pounding so much that it feels like your brain is on fire. There is only one thing that could cool it down... you need a Big Freaking Slurpee!^^"; ]; !Globals ***************************************************************************** global CupClean = False; global PlayerHasDollar = False; global PlayerHasLid = False; global PlayerHasCup = False; global PlayerHasChair = False; global PlayerHasKeys = False; global PlayerUsedToilet = False; !New words/extensions **************************************************************** Verb "use" * noun -> Use * noun "on" noun -> Use; Verb "wash" * noun -> Wash * noun "in" noun -> Wash * noun "with" noun -> Wash; Extend "unlock" * noun -> Unlock * noun "with" noun -> Unlock; !Rooms ******************************************************************************* Object Bedroom "Bedroom" has light with description "Your room of nightly rest. The peacefully quiet nature of this room relaxes and calms you. Getting in bed right now is tempting, although you won't be able to sleep with the burning headache you have. Next to the bed is your desk, which is a mess.", e_to Living_Room; Object Living_Room "Living Room" has light with description "The Living Room is the center of your home. Across from the Couch you see your Television. Normally, you'd like to relax out here and watch some TV after work. But not today... not with this headache.", w_to Bedroom, s_to Foyer, e_to Bathroom, n_to Dining_Room; Object Foyer "Foyer" has light with description "The first room you see after walking in the door from outside, The Foyer lets you know you're home. Just the sight of it gives you a feeling of relaxation when you walk in the door. There is nothing of interest here at the moment though, aside from the exit to the outside world.", n_to Living_Room, s_to Driveway; Object Bathroom "Bathroom" has light with description "The Bathroom is a very ordinary bathroom, with all of the regular accommodations, but you can't even see them at the moment. Your current state of mind allows you to only see the one thing you have a use for at the moment... ", w_to Living_Room; Object Dining_Room "Dining Room" has light with description "The Dining Room is very decorative, yet calm. The chandelier above the table adds a touch of elegance to any dinner event, and can even be dimmed for a romantic candle-light dinner. That doesn't concern you at the moment though... all you want right now is a Big Freaking Slurpee!", s_to Living_Room, e_to Kitchen; Object Kitchen "Kitchen" has light with description "The Kitchen has a very modern look to it, which is very appealing. It is not the most conveniently oriented arrangement, but it is still functional. Plus, it just looks awesome. ", w_to Dining_Room; Object Driveway "Driveway" has light with description "Outside, your Car is parked in the Driveway. When you have everything ready to go, you will get in your car and drive down the parkway to the Eleventy-Seven a couple miles away. You don't just WANT a Big Freaking Slurpee... now you NEED it. Your head feels like it's burning up to the point of exploding!", n_to Foyer; !Objects ***************************************************************************** Object Bed "Bed" Bedroom has static concealed supporter enterable with name "Bed" , description [; if (player notin bed) "Your warm, comfy bed beckons you, tempting you to lay down in it and enter the relaxing dream world as you sleep."; if (player in bed) "This bed is quite relaxing, especially after a long day at work. But unfortunately, it is not helping your burning headache."; ], before [; Take: "You can't carry this, it's far too large and heavy!"; Examine: if (player in bed) "You are laying in the bed!"; ], after [; Enter: "This bed is extremely comfortable! You feel very relaxed. But unfortunately, it is not helping your burning headache."; ]; Object Desk "Desk" Bedroom has static concealed supporter with name "desk" "table" "nightstand" "night" "stand", description "Your computer desk is cluttered, but nothing you see is useful at the moment. Although there is a Dollar bill on it that seems to be calling your name..."; Object Dollar "Dollar" Desk with name "dollar" "bill" "money" "cash", description "You see a Dollar! This is just enough money to fill up your Big Freaking Slurpee Cup at Eleventy-Seven!", after [; Take: PlayerHasDollar = True; score++; "You take the dollar. Now you have enough money to fill up your Big Freaking Slurpee Cup at Eleventy-Seven!"; Drop: score--; ]; Object Couch "Couch" Living_Room has static concealed supporter enterable with name "couch" "sofa", description "The dark blue leather cushions are filled with a soft, yet firm stuffing that engulfs you in comfort when sat on. This is usually the first place you go after coming home from work. Sometimes stuff falls out of your pockets here."; Object Television "Television" Living_Room has static concealed supporter with name "television" "tv" "tube", description "Your 34-inch widescreen HDTV-ready television is off, but you usually like to watch it after work. The picture is so crisp... you love it.", before [; SwitchOn: "You don't feel like watching TV right now."; SwitchOff: "The TV is not on!"; ]; Object Table "Table" Dining_Room has static supporter with name "table", description "The Dining Room Table is quite a sight to see. It's shimmering glass surface always looks perfectly cleaned, without a smudge at all to be seen. It has been the topic of many coversations. It is of no use at the moment though."; Object Chair "Chair" Dining_Room has supporter enterable with name "chair" "seat", description "The Dining Room Chair is a rather comfortable chair to sit in during a good dinner, with it's padded seat. You notice a couple footprints indented in the padded seat. This chair is apparently not only used for sitting...", after [; Take: PlayerHasChair = True; Drop: PlayerHasChair = False; ]; Object Cabinet "Cabinet" Kitchen has static container openable with name "cabinet" "cupboard", description "The Kitchen Cabinet is a little hard to reach sometimes, since it was built just a tad too high. The modern look of the kitchen decor was just too hard to pass up though. It's not that big of a deal to you, as you sometimes just use other household objects to aid in reaching this hard to reach Cabinet.", before [; Open: if (player notin Chair) "The cabinet is too high to reach. You need something to stand on..."; ], after [; Open: if (player in Chair) give Cabinet open; ]; Object Drawer "Drawer" Kitchen has static container openable with name "drawer", description "The Kitchen Drawer is easily accessible, being located at roughly your waist level. You don't remember what is in there though, as you don't use it very often..."; Object Sink "Sink" Kitchen has static container open with name "sink" "tub", description "The Kitchen Sink looks like it hasn't been used in a while, although it surprisingly looks very clean. You would usually find a pile of dishes in there, but not today... you washed them in it last night."; Object BFS_Cup_Lid "Big Freaking Slurpee Cup Lid" Drawer with name "lid" "top", description "This is the Lid to your Big Freaking Slurpee Cup. With so much slurpee in it, the Lid prevents it from spilling.", before [; Take: PlayerHasLid = True; if (CupClean == True) BFS_Cup.description = "Your Big Freaking Slurpee Cup! It is clean now, and you have the Lid too! It is ready to go!"; Drop: PlayerHasLid = False; if (CupClean == True) BFS_Cup.description = "Your Big Freaking Slurpee Cup! It is clean now, but it is still missing the Lid..."; if (CupClean == False) BFS_Cup.description = "Your Big Freaking Slurpee Cup! It looks kinda dirty, and it is missing the Lid..."; ], after [; Take: score++; PlayerHasLid = True; Drop: score--; PlayerHasLid = False; ]; Object BFS_Cup "Big Freaking Slurpee Cup" Cabinet with name "big" "freaking" "slurpee" "cup", description "Your Big Freaking Slurpee Cup! It looks kinda dirty, and it is missing the lid...", before [; Take,Examine: if (PlayerHasLid == True && CupClean == False) BFS_Cup.description = "Your Big Freaking Slurpee Cup! It looks kinda dirty, but at least you have the lid..."; if (PlayerHasLid == True && CupClean == True) BFS_Cup.description = "Your Big Freaking Slurpee Cup! It is clean now, and you have the Lid too! It is ready to go!"; Wash: if (BFS_Cup notin Sink) "You must put it in the sink before you wash it!"; if (BFS_Cup in Sink && PlayerHasLid == True) { BFS_Cup.description = "Your Big Freaking Slurpee Cup! It is clean now, and you have the Lid too! It is ready to go!"; CupClean = True; "You washed the Big Freaking Slurpee Cup in the Sink."; } if (BFS_Cup in Sink && PlayerHasLid == False) { BFS_Cup.description = "Your Big Freaking Slurpee Cup! It is clean now, but it is still missing the Lid..."; CupClean = True; "You washed the Big Freaking Slurpee Cup in the Sink."; } ], after [; Take: PlayerHasCup = True; if (CupClean == True) score++; Drop: PlayerHasCup = False; if (CupClean == True) score--; ]; Object Keys "Keys" Couch with name "keys" "key" "ring" "keyring", description "This is your key ring, containing keys for your car and house. Don't leave home without them!", before [; Use: if (player in Driveway) give Car ~lockable ~locked; "You have unlocked the car!"; ], after [; Take: score++; PlayerHasKeys = True; Drop: score--; ]; Object Toilet "Toilet" Bathroom has static openable with name "toilet" "seat" "pot" "potty" "pooper", description "Well... it's a toilet. It's a good place to empty your bladder, that's for sure.", before [; Use: if (Toilet hasnt open) "It's not a good idea to use a toilet that's not open..."; if (Toilet has open && PlayerUsedToilet == False) { PlayerUsedToilet = True; score++; "With a great sigh of relief, your bladder no longer feels as if it is going to explode."; } if (Toilet has open && PlayerUsedToilet == True) "You don't need to use the Toilet right now."; Enter: "You don't need to sit on the toilet. This task can be accomplished while standing..."; ]; Object Car "Car" Driveway has static container enterable openable lockable locked with name "car" "auto" "automobile" "vehicle", description "Your blue sports car sits alone in the driveway. When you are ready to go, this will be your means of getting to Eleventy-Seven to get your Big Freaking Slurpee.", with_key Keys, before [; Take: if (Car hasnt locked) "You can't take this, you must get in first!"; if (Car has locked && PlayerHasKeys == True) "You must get in the Car first!"; if (Car has locked && PlayerHasKeys == False) "You need the keys!"; Enter: if (Car hasnt open) "You must open the Car first!"; if (Car has open && PlayerHasCup == False) { deadflag = 1; "You made it to Eleventy-Seven to get your Big Freaking Slurpee, but there was one problem... you forgot your Big Freaking Slurpee Cup!!! It was too late to go back and get it... your head was already starting to catch fire. Your head eventually exploded. Only a BRAINFREEZE could've helped..."; } if (Car has open && PlayerHasDollar == False) { deadflag = 1; "You made it to Eleventy-Seven just in time to get your Big Freaking Slurpee, but there was one problem... you forgot your Dollar! Since you had no money, you were not able to purchase a refill for your Big Freaking Slurpee Cup, and therefore did not get a Big Freaking Slurpee. It was too late to go back and get it... your head was already starting to catch fire. Your head eventually exploded. Only a BRAINFREEZE could've helped..."; } if (Car has open && PlayerHasCup == True && PlayerHasDollar == True && PlayerHasLid == False) { deadflag = 1; "You made it to Eleventy-Seven to get your Big Freaking Slurpee, but there was one problem... you forgot the Lid to your Big Freaking Slurpee Cup!!! During the ride back home you hit a pot hole in the road, causing your Big Freaking Slurpee to spill all over the inside of your car. In a panic, you tried saving it... but as you were distracted, you accidentally swerved into oncoming traffic and caused a 13-car pile-up. Needless to say, you did not live through the tragedy."; } if (Car has open && PlayerHasCup == True && PlayerHasDollar == True && PlayerHasLid == True && CupClean == False) { deadflag = 1; "You made it to Eleventy-Seven to get your Big Freaking Slurpee! But there was one problem... after you got home, you drank your Big Freaking Slurpee continuously until it was all gone. Later on, you felt sick to your stomach. Just as you were about to call 911, you remembered that you forgot to wash your Big Freaking Slurpee Cup before you left. Apparently it was loaded with germs and bacteria, which now lead to your death. You become fatally ill, and your lifeless body falls to the floor."; } if (Car has open && PlayerHasCup == True && PlayerHasDollar == True && PlayerHasLid == True && CupClean == True && PlayerUsedToilet == False) { deadflag = 1; "You made it to Eleventy-Seven to get your Big Freaking Slurpee! But there was one problem... after you got home, you drank your Big Freaking Slurpee continuously until it was all gone. You were so excited to consume your Big Freaking Slurpee that you forgot to use the Toilet before you left. You remembered that your bladder was full from drinking water all day long at work. Adding this Big Freaking Slurpee to it was just too much, and it caused your bladder to explode inside you, resulting in your death."; } if (Car has open && PlayerHasCup == True && PlayerHasDollar == True && PlayerHasLid == True && CupClean == True && PlayerUsedToilet == True) { deadflag = 2; "You made it to Eleventy-Seven to get your Big Freaking Slurpee! Your clean Big Freaking Slurpee Cup was the perfect Big Freaking Slurpee container! On the ride back, you hit a pot hole. Luckily you had your Big Freaking Slurpee Cup Lid on to prevent it from spilling all over the car. You made it back home to sit on the couch and enjoy the whole Big Freaking Slurpee without any hassle at all, since your bladder was emptied before you left the house. You drank so much so fast that it gave you at BRAINFREEZE and cooled off the burning headache you had from work. Excellent! Now you retreat to your bedroom, climb in your nice, comfy bed, and let your mind drift into the dream world in order to end this crazy day. Not only did you achieve BRAINFREEZE to save the day, but it saved your life!"; } Open: if (Car has locked && PlayerHasKeys == False) "It is locked, you need the Keys!"; if (Car has locked && PlayerHasKeys == True) "The Car is locked!"; ]; !Word Subs *************************************************************************** [ UseSub; ]; [ WashSub; ];