! ---------------------------------------------------------------------------- ! Moil 000601 CIS 587 Summer 2000 Project 2. ! by John Sas ! References from Museum One of the ! standard Inform 6 example games ! ! created: 05.27.2000 ! ! This game was created for CIS 587 and is for educational use only ! ! ---------------------------------------------------------------------------- Constant Story "MOIL"; Constant Headline "^Can you make it to work...^^"; ! Experimental version leave next line in until game is debugged Constant DEBUG; Constant OBJECT_SCORE 0; Constant MAX_SCORE 12; Release 1; Serial "000601"; ! Replace DrawStatusLine; Include "Parser"; Include "VerbLib"; ! -------------------------------------------------------------------------- ! Start the game off in a nice grassy meadow to throw the player off a bit. ! Helps set the mood. Object Meadow "Grassy Meadow" has light, with description "You are standing in a grassy meadow. The sun is shining and the sky is bright blue. The rays of the sun look kindly upon the land, and its warmth is like a mother's hug. There are a few clouds hanging like cotton puffs in the distance. To the East you hear a brook babbling. To the West you see a farm house. To the South a delicate butterfly flaps its wings as if beckoning you to follow.", e_to Bedroom, w_to Bedroom, s_to Bedroom; ! -------------------------------------------------------------------------- ! By setting the general property after the room is first visited the player only ! wakes up once. ! The room has light even though the description says it is dark. The player will ! believe most anything you tell them. Again setting the mood. Object Bedroom "Bedroom" has light, with initial [; if (Bedroom hasnt general) { print "^^The world around you goes black. You bolt upright in a cold sweat and find yourself sitting in bed. Your head is pounding and you feel pressure in your abdomen. An alarm clock is bleating loudly. There is a large lump under the covers next to you. Ah, yes that must be your spouse. As your eyes adjust to the semi darkness you can barely make out that...^"; give Bedroom general; } ], description [; print "The room is moderately sized. There is a Queen sized bed in the middle of the room with a nightstand to either side. The large lump on the right side of the bed is your spouse. A lamp sits on the nightstand on the North side of the room. A dresser with a trifold mirror stands on the South side of the room. The alarm clock on the dresser has a Glaring RED LED display"; ! Reminde the player that the alarm is still on. if (off_button hasnt general) print ", it is BLEETING LOUDLY"; print ". There is a hallway to the West."; ], w_to Hall; ! verbal candy so to speak. Doesn't do much just sits around maybe takes out ! the player once or twice. Object -> Spouse "Spouse" with name "Spouse" "lump" "bed" "covers" "quilt", description "Your spouse is sleeping under the covers. You think better of disturbing the peaceful slumber", has static scenery; ! The pile of clothes changes description to "business suit" when worn. ! The player needs to wear the clothes in order to win. Object -> Pile_of_clothes "pile of clothes" with name "pile" "of" "clothes", description !Check if clothes are being warn and change their discription. [; if (self has worn) print "Your business suit is slightly wrinkled, and your shoes need polishing. Good thing these clothes don't smell too bad!"; else print "There might be something here you can wear."; ], after ! Make sure clothes only give player points once. [; wear: if (Pile_of_clothes hasnt general) { give Pile_of_clothes general; score=score++; } ], has clothing; ! Verbal candy doesn't do anything but add athmosphere and maybe throw the player off ! a little. Object -> Lamp "lamp" with name "lamp", description "The shade cocked to one side. There is no bulb in the socket. It doesn't matter, you haven't used the thing in 8 years." has static; ! Has a subobject -> Off_button. When looked and ont off the alarm will say ! BLEETS LOUDLY!!! Alarm clock is made transparent so that Off_button can be seen. ! Alarm clock made static so it can't be taken or moved. Object -> "alarm clock" with name "alarm" "clock", before [; if (off_button hasnt general) print "The alarm BLEETS LOUDLY!!! "; else print ""; SwitchOff: <>; SwitchOn: <>; Examine: "There are about 15 switches on the top of this thing one of them should switch the alarm off."; take: print "You better not. You'll need it tomorrow morning."; push: <>; ], has transparent static; Object -> -> off_button "off switch" with name "switch" "button", description "One of these switches should switch the alarm off. ", after [; if (off_button hasnt general) print "The alarm BLEETS LOUDLY!!! "; else print ""; if (glasses hasnt worn) print "The RED numbers on the alarm clock are blurry. "; else print ""; SwitchOff: if (self hasnt general ) { score=score++; give self general; give Hall ~general; print "^Finally you operate the correct switch and the alarm is silenced. Your spouse stirs under the covers. A shiver runs up your spine. "; } push: <>; ], has switchable on; !verbal candy Object -> "dresser" with name "dresser", description "Just a cheaply made wood grain dresser with a trifold mirror.", has static scenery; ! Has a drawer subobject to hold glasses and wallet. Object -> Nightstand "nightstand" with name "night" "stand" "nightstand", description "A cheaply made wood finished plywood nightstand with 1 drawer", has scenery static container open; ! Drawer is initially closed (~open). Object -> -> Drawer "drawer" with name "drawer", description "Its a small drawer with a round brass colored knob.", has container ~open openable; Object -> -> -> Glasses "pair of glasses" with name "specs" "glasses", description "Thick black plastic frames mold around the thick slightly scratched lenses.", after ! Glasses need to be worn in order to get point. Once "general" is set ! glasses can not give players more points. Other objects like the TV and ! Alarm clock check to see if glasses are being "worn" if not they tell the ! player that things are blurry. [; wear: if (self hasnt general) { give self general; score=score++; "Ah, that's better you now see clearly."; } ], has clothing; Object -> -> -> Wallet "leather wallet" with name "wallet" "purse", description "It is a smallish wallet with a picture of your spouse and child. There is a $20.00 dollar bill, a medical card, a driver's license and your car insurance, which expires tomorrow. ", after ! Player must have wallet to win the game. ! If the player puts the wallet down then set flag. [; take: if (self hasnt general) { give self general; give player general; score=score++; } drop: give player ~general; ]; ! -------------------------------------------------------------------------- Object Hall "Hall" has light, with name "Hall" "Hallway", description [; print "You are in a hallway. Your bedroom is to the East. Your Daughter's room is to the North. The bathroom is to the West. The front room is to the South."; if (off_button hasnt general) ! Warning for player to turn off the alarm clock. "^^You hear the alarm clock BLEETING LOUDLY from the bedroom."; ], before !You forgot to turn off the alarm before leaving the room. !First turn in Hall warns player to turn off alarm. If alarm is not shut off !Next turn in Hall kills player (or next turn in Hall). The warning that the !clock can be heard in the Bedroom allows the player to go back to the bedroom !and turn off the alarm clock without being killed. However, the warning is !only good once and must be heeded immediately, otherwise the player is killed !if another turn is spent in the hall. [; if (off_button hasnt general) { give Hall general; } ], after [; if (Hall has general) { deadflag=1; "^You Exclaim, ~Drat! I forgot to turn off the alarm clock.~ You turn toward the bedroom just in time to see your spouse grab a gun from under the pillow. One shot is fired into the alarm clock and another into your head. Both targets are silenced. ^^The last thing you hear is a sweet mellow voice calling out, ~How many times must I tell you to be quiet when I'm sleeping?"; } ], e_to Bedroom, w_to Bathroom, n_to Child_Room, s_to Front_Room; ! -------------------------------------------------------------------------- Object Bathroom "Bathroom" has light, with name "Bathroom" "John", description [; print "As you look around the bathroom you see that you have been neglecting it. There are small patches of mildew in the grout between the lime green tile. There are bits of hair and a few misplaced toenail clippings on the sink. Rivulets of dried toothpaste, left over from last night, line the sink basin. Above the sink is a medicine cabinet with a mirror mounted on the door. The sink and toilet are facing the bathtub which hugs the East wall. There are damp towels covering the floor. ~Hmm, What's that smell?~"; ! Needed to cut the game short give the player a taste of what was missed. ! or could be added. if (Bathroom has general) "^^A voice in your head shouts...~Hey, time's a wasting. Shoo, you spent enough time in here.~ (What the heck, You got some points for taking a shower shaving, using the facilities, combing your hair taking an aspirin for that headache and all that other stuff)"; ], after ! Code to give player 5 points for entering the bathroom. [; if (Bathroom hasnt general) { give Bathroom general; score=score +5; } ], e_to Hall; ! -------------------------------------------------------------------------- ! Nothing happens in this room. However, it could easilly be expanded for a full game. Object Child_Room "Child's Bedroom" has light, with name "Bedroom" "Gina^s" "Gina", description "Gina's toys are everywhere, in boxes and on the floor. There is a poster of a red monster juggling the alphabet blocks ~E~, ~L~, ~M~, and ~0~ on the South wall (the poster is slightly crooked) and a bookcase full of stuffed animals on the East wall next to the child's bed. Shh, Gina is sleeping. There is a doorway to the hall in the south wall.", s_to Hall; ! Verbal candy. Object -> toys "toys" with name "toys", description "You see every toy you ever bought that girl. Dolls and blocks and a kitchen set with tea cups and a pot are scattered everywhere. ", before [; take: "You decide to leave them for you spouse to pick up. "; ], has static scenery; ! Verbal candy. Object -> monster "monster" with name "elmo" "monster" "blocks" "poster", description "Looking at that silly poster, you swear that monster winked at you.", before [; take: "You try to straighten out the poster and the monster sticks his tongue out at you Bpppppprrrt! You wipe your face and decide to leave the poster alone."; ], has static scenery; ! Verbal candy. Object -> Gina "Gina" with name "baby" "gina" "daughter", description "The little darling is sleeping so soundly you decide to let her rest. She coos softly when you are near.", before [; take: "Weren't you listening?? Leave the baby be!"; ], has static scenery; ! -------------------------------------------------------------------------- ! Need to look at couch to remove "concealed" from keys. Looking again at the ! Front_Room will show keys. Simulates looking in a room and not finding what ! you are looking for and then looking again, smacking your forehead and saying ! "I knew those were here along!" Object Front_Room "Front Room" has light, with name "Front" "Room" "Living", description "The walls of the front room are lavishly decorated. Expensive frames adorn the walls. The frames contain the great masterpieces of your young daughter. On the East wall is an entertainment unit complete with a 31 1/2~ television, radio, 8 track and a record player. An ugly couch is across from the entertainment unit. The Kitchen is to the East and a Hallway is off to the North.", n_to Hall, e_to Kitchen; ! Verbal candy. Object -> Picture "Picture" with name "Picture" "pictures" "frame" "master" "piece" "wall" "masterpiece", description "^^XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ^X+-------------------,----------+X ^X| ,, |X ^X| O/ , &&& |X ^X| /# /L| &&&&& |X ^X| LL /---L &&& |X ^X| ###### | |o| I |X ^X|##############################|X ^X+------------------------------+x ^XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX^", has static scenery; ! Need to turn on the TV to get weather report. Need to turn off TV or get killed ! when enterning the Kitchen. Same rules apply as with the alarm clock in the bedroom. ! Only used this one twice figuring the player will think, "He wouldn't do that to me ! more than once, would he? !TV is transparent to show subobjects, power_button and screen. Object -> TV "31 and 1/2~ television set" with name "tv" "television" "set", initial "You remember what a great deal you got on that TV set. Funny, you haven't seen one like it since.", before [; SwitchOn: <>; SwitchOff: <>; Examine: <>; take: print "You think twice and remember that it took three strong men to bring that TV into the house in the first place."; ], has transparent static; Object -> -> power_button "power button" with name "power" "button" "switch", after [; SwitchOn, SwitchOff: <>; ], has switchable; Object -> -> screen "television screen" with name "screen", before [; if (power_button has on && power_button hasnt general) { score=score++; give power_button general; } else print ""; if (power_button has general && power_button hasnt on && TV hasnt general ) { score=score++; give tv general; } if (power_button hasnt on) give kitchen ~general; Examine: if (power_button hasnt on) "The screen is black."; if (glasses hasnt worn) print "The TV looks Blurry. "; "The news is on. Something about road construction...Hmmm you think to yourself, I'll need to take an alternate route to work. ^^You hear a gruff voice from the bedroom, ~Turn that thing off or you'll be sorry! I'm trying to sleep in here.~"; ]; Object -> keys "Set of keys" with name "key" "keys", description "Your house key and your car key are on this key ring.", has concealed; Object -> Couch "green couch" with name "sofa" "couch" "chair", description [; print "That green color yeach! You would never have picked it. Too bad You lost that bet last year when you were picking out furniture. "; !Only print out if the keys are in the room and not held by player. if (keys in Front_Room) "You see something on the floor, by the couch."; ], ! Make keys visible. This doesn't prevent the player from getting or looking ! at the keys without looking at the couch first, but if the player doesn't know ! they are there then... before[; examine: give keys ~concealed; ], has static scenery; Object -> Entertainment_Center "Entertainment Center" with name "Entertainment" "Unit" "8" "track" "vcr" "record" "player" "stereo", description "The entertainment center houses all of the household's valuable electronic equipment. Believe it or not, the 8 track player still works. You remember listening to ABBA just yesterday. The vcr sits in its slot waiting to be used too bad you don't have any time to pop in a tape and relax.", before [; take: "Why are you robbing your own house? Put that down. You have more more important things to do!"; ], has static scenery; ! -------------------------------------------------------------------------- Object Kitchen "Kitchen" has light, with description "The walls are tan. Several cracks slither across the ceiling and a cob web is clings to the ceiling in the Southeast corner. There is a refrigerator, a sink, a stove, and a large Formica table with four mismatched chairs. There is a door leading outside to the North.", before [; if (power_button has on) give Kitchen general; ], after ! Kill player if the TV was left on in the Front_Room. Player has 1 turn ! to go back to the Front_Room and turn off the TV. [; if (Kitchen has general) { deadflag=1; print "^You cringe as you hear that Shrill gruff voice... ~I told you to turn that TV off!~ A darkness falls on the kitchen as your spouse enters. You are bludgeoned repeatedly with a large book titled "; style underline; print "Dealing With Stress. "; style roman; "You hear mad laughter as you collapse in a heap, maybe you better take today off."; } ], w_to Front_Room, n_to BackDoor; ! Verbal Candy Object -> "Coffee pot" with name "coffee" "pot", description "~Great!~ you think to yourself as you look at the coffee pot. ~We ran out of filters last night. No coffee for me.~", has static; ! Verbal Candy. Not needed. Doesn't show outside, grarage, or work. Object -> "map" with name "map" "blueprint" "floorplan" "picture", initial "A drawing of the house floorplan is stuck to the icebox, with a magnet. You think to yourself, ~That Gina, isn't she the most tallented daughter in the world!~", description [; font off; print "^+------------------------------------------+ ^|Blueprint | ^| Small | ^| BedRoom | ^| | Master | ^| Bathroom-----Hallway---------Bedroom | ^| | | ^| | | ^| | Back Door | ^| | | | ^| Front Room-------Kitchen | ^| | ^+------------------------------------------+^"; font on; ]; ! -------------------------------------------------------------------------- ! Two way door connecting the Outside to the Kitchen, visible in both the Kitchen ! and Outside. The door can is openable and lockable. Requires keys from Front_Room. Object -> BackDoor "Back Door" with name "Back" "Door", description "A plain white steel door with a dead bolt lock. ", when_closed [; if (self has locked) print " The locked back door fully protects your house from burglars. "; else print " The back door is unlocked. "; ], when_open [; if (location==Kitchen) print " You see a lovely view of your driveway through the back door. "; else print " You see a lovely view of your kitchen through the back door. "; ], door_to [; if (location==Kitchen) return Outside; return Kitchen; ], door_dir [; if (location==Outside) return n_to; return s_to; ], with_key keys, found_in Kitchen Outside, has static door openable lockable locked; ! -------------------------------------------------------------------------- Object Outside "Outside" has light, with name "Outside", description "You are standing in your driveway. To the South is the back door and to the North is your garage. ", before ! Hint that player forgot to wear clothes. [; if (Pile_of_clothes hasnt worn) print "^^The small hairs stand up on your back as a gentle breeze blows. You notice goose bumps forming on your arms and legs. Suddenly you feel cold. "; ], after [; if (location==Outside && Backdoor has locked && Backdoor hasnt general) { score=score++; give Backdoor general; } ], n_to Garage, s_to BackDoor; ! -------------------------------------------------------------------------- Object Garage "Garage" has light, with name "Garage", description "A fine garage stands before you. The siding looks fresh and new You think to yourself I did a fantastic job installing that siding. Your Furd Muxtang sits in the garage ready to take you to work. To the South is your back door. You work to the East. You step over to your car, get in, and buckle your seatbelt. ", after ! Hint player forgot to lock the door. [; if (Backdoor hasnt locked) print " You get a funny feeling...like you forgot to turn off the coffee pot. Ah, well no one is going to steal it.^"; ], s_to Outside, e_to Work; ! -------------------------------------------------------------------------- Object Work "Work" has light, with name "Work", description ! (x) Player looses under the following conditions. ! (x) Player did not put on clothes. ! (x) Player did not wear glasses ! (x) Player did not lock door. ! (x) Player does not have wallet. [; print "^You start the car's engine, turn on the radio and head off to work. Time is getting sort. Hopefully you will make it to work on time...^"; if (Pile_of_clothes hasnt worn) { print "^You get stopped by the police on the way to work. You are unable to explain why you are driving around the city naked. You are thrown in jail and never make it to work. Worse yet, your naked body freezes to death in the cold damp prison cell."; deadflag=1; } else if (Glasses hasnt worn) { print "^You pull out of the driveway barely missing the neighbor's house. As you drive everything is a blur. You hear angry horns BLARING as you narrowly avoid a 5th, ~HEY WATCH IT!!~, a 6th accident. You are three miles from work and the last thing you see is a dead fly on the front grill of an eighteen wheeler as it smashes into you. ^^As your spirit floats above the twisted wreck which was once your car, you wonder why you didn't see that truck coming."; deadflag=1; } else if (Backdoor hasnt locked) { print "^You hear on the radio that there was a burglary at your house and the burglars have a hostage. You quickly rush back home. As you get out of your car and run past the police barricade, the burglar fires a shot out of the front window. The police return fire. Bullets are flying everywhere. You feel a bullet graze your left ear, and another penetrate your heart. How could this terrible event have been prevented."; deadflag=1; } else if (player hasnt general) { print "You are in a hurry. You look to the left and to the right and then make an illegal left turn. From behind you see the flashing lights of a police car. He pulls you over and too late you realize you have no identification. You are halled off to jail. On the way to the station, the police officer grabs his chest, slumps in the driver's seat and swerves to the left. The police car hits a telephone pole and everything goes black."; deadflag=1; } else { print "^Well you made it to work with 22 seconds to spare.^^You think to yourself I wonder what adventures I'll have tomorrow morning..."; deadflag=2; } ]; ! -------------------------------------------------------------------------- [ Initialise; location = Meadow; "^^moil (moil) ^v. intr. moiled, moil-ing, moils. ^^1. To toil; slave. ^2. To churn about continuously. ^^n. ^1. Toil; drudgery. ^2. Confusion; turmoil. ^-------------------- ^[Middle English moillen, to soften by wetting, from Old French moillier, ^from Vulgar Latin *mollire, from Latin mollia (panis), the soft part (of ^bread), from neuter pl. of mollis, soft; see mel-1 in Indo-European ^Roots.] ^-------------------- ^moiler n.^^"; ]; include "Grammar";