Constant DEBUG; Constant Story "Coming Home"; Constant Headline "^A Simple Home Adventure^ Copyright (c) 1997 by Andrew Katz.^"; Include "Parser"; [ NewRoom i; ! for some reason it closes doors after you have left the ! room you went into. Still not correct for bathroom, but ! otherwise good since we want to go back and forth. objectloop(i ofclass connector && i in location) give i ~open; ]; ! Object LibraryMessages Include "VerbLib"; Include "Grammar"; Include "doors"; ! credit to L. Ross Raszewski [ Initialise; InitDoors(); ! goes with doors.h location = front_yard; startdaemon(hungerpee); ]; Include "help.inf"; ! based upon Christminster by Gareth Rees Verb 'drive' * noun -> drive; [driveSub; if (AfterRoutines()==1) rtrue; "You can't drive ", (the) noun, "."; ]; Verb 'knock' * -> knock * 'on' noun -> knock; [knockSub; "Hey, your hands are too small to make much of a sound."; ]; [ dirty_rooms i; switch(scope_stage) { 1: rfalse; 2: objectloop (i provides dirty) PlaceInScope(i); rtrue; 3: "There is no reason to clean that."; } ]; Extend only "clean" replace * scope=dirty_rooms -> rub; Class Room has light; Class Person with number, ! used to count the turns for the daemon has animate proper; Property garage_to; CompassDirection garage_obj "garage wall" compass with name "garage", door_dir garage_to; Property house_to; CompassDirection house_obj "house wall" compass with name "house", door_dir house_to; Property bathroom_to; CompassDirection bathroom_obj "bathroom wall" compass with name "bathroom", door_dir bathroom_to; Room front_yard "Front Yard" with description "In front of you and to the north is a split level house. To your left is a stone driveway which ends in a garage.", n_to front_door, in_to front_door, house_to front_door, garage_to garage_door, ne_to side_yard; Room side_yard "Side Yard" with description "The side of the house is to your west. A worn sidewalk and steps lead up to a door. In front of you was once a gate to the backyard. Now all that is left is a cylindrical metal fence post.", s_to front_yard, sw_to front_yard, house_to kitchen_door, e_to kitchen_door, in_to kitchen_door, n_to back_yard, nw_to back_yard; Room garage "Garage" with description "You are standing in the garage. It is stacked floor to ceiling with useless junk. In the back is a broken freezer.", out_to garage_door; Room dining_room "Dining room" with description "You are in the dining room, a room with a high ceiling. At the west end are closets and at the east end is an opening to the kitchen. Just north of the kitchen is the stairway heading up. Below you and to the north is the living room. In the center of the room is the dining room table.", out_to front_door, s_to front_door, e_to kitchen, d_to living_room, n_to living_room, u_to hallway; Room kitchen "Kitchen" with description "You are in the kitchen. On the east side is the food preparation area with cabinets and appliances. On the west side is the kitchen table. In between is a wooden extension lined with a mug collection. To the north and down a few steps is the play room.", out_to kitchen_door, e_to kitchen_door, w_to dining_room, n_to den, d_to den; Room back_yard "Back Yard" with description "You are standing in the backyard. Next to the door is a worn out patio and a crumbling brick barbeque. The rest of the yard has patches of grass and several tall trees.", e_to side_yard, se_to side_yard, s_to back_door, in_to back_door, house_to back_door, sw_to shed; Room shed "Shed" with description "You are standing in a shed. It really is just an open storage area sharing a common wall with the back of the garage.", n_to back_yard; Room den "Play Room" with description "You are in the den, also known as the play room. The main feature of this room is the TV set. Around it are a couch, and several chairs. To the north is the back door. You can also get to the bathroom or downstairs to the basement from here.", n_to back_door, out_to back_door, d_to basement_door, ! how do I make synonym downstairs for d for down? s_to kitchen, u_to kitchen, w_to living_room, bathroom_to bathroom_door_ds, in_to bathroom_door_ds; Room bathroom_ds "Downstairs Bathroom" with name "downstairs" "bathroom", dirty false, description [; if (self.dirty) "You are in a disgusting place with urine and feces all around."; else "You in the downstairs bathroom with a toilet and sink."; ], out_to bathroom_door_ds, after [; go: if (~~self.dirty) hungerpee.pee = 0; give bathroom_door_ds ~open; ]; Room bathroom_us "Upstairs Bathroom" with name "upstairs" "bathroom", dirty false, description [; if (self.dirty) "You are in a disgusting place with urine and feces all around."; else "You in the upstairs bathroom with a toilet and sink and a bath/shower."; ], out_to bathroom_door_us, after [; go: if (~~self.dirty) hungerpee.pee = 0; give bathroom_door_us ~open; ]; Room hallway "Upstairs Hallway" with description "There are a bunch of doors here. In back of you is a railing looking down on the stairway you just used.", d_to dining_room, w_to bedroom_door_3, n_to bedroom_door_2, ne_to bedroom_door_1, e_to bathroom_door_us, bathroom_to bathroom_door_us, in_to bathroom_door_us; Room bedroom_1 "Master Bedroom" with description "You are in the master bedroom. At one end is a double twin bed with a small TV off to the side. At the other end is a closet, and a dresser with a full length mirror.", out_to bedroom_door_1, s_to bedroom_door_1, before [; take: if (mom in self) "Mom says, ~Don't take ", (the) noun, ".~"; ]; Room bedroom_2 "Allison's Bedroom" with description "You are in the bedroom where Allison sleeps when she is visiting. In this small room is a twin bed and a tall dresser and a closet.", out_to bedroom_door_2, s_to bedroom_door_2; Room bedroom_3 "Unused Bedroom" with description "You are in the unused bedroom. Many years ago 2 boys slept here. Now it is just piled with useless junk. At the west end is another door.", out_to bedroom_door_3, e_to bedroom_door_3, w_to bedroom_door_4; Room bedroom_4 "Ken's Bedroom" with description "You are in Ken's bedroom. Many years ago you slept here but now Ken has transformed it to a world of ashes, birds, and countless other odds and ends.", e_to bedroom_door_4, out_to bedroom_door_4; Room basement "Basement" with name "basement", description "You are in the basement. This area is mainly used for storage and doing laundry. Many years ago it was a play area, but now everything is covered with black soot from a bad oil burner over 20 years ago.", u_to basement_door; ! upstairs Room living_room "Living Room" with description "You are in the livingroom. This rarely used room has a piano at one end and a stereo in the other. Both are not working properly. Covering the back window are dark drapes.", e_to den, s_to dining_room, u_to dining_room; Room train_station; Person allison "Allison" train_station with name "Allison", description "Your younger sister is a short woman with frizzy blond hair, freckles and broad shoulders.", life [; Ask, Answer, Tell, Order: if (location == dining_room) "Allison says: ~Thank you for picking me up at the station. Where is my nephew?~"; ], daemon [; if (self.number == 6) move self to den; if (self.number == 17) move self to bedroom_2; if (self.number == 23) move self to dining_room; self.number++; if (self.number == 24) self.number = 0; if (location == bedroom_2) print "Allison says: ~Get out.~^"; ]; Person mom "Mom" kitchen with name "Mom" "grandma" "Naomi" "mommy", description "Your mother is a short broad woman with red hair (dyed) who looks younger than her years.", life [; Ask, Tell: ! need more specific conversation if (location == kitchen) "She says: ~Do you want something to eat and drink?~"; "She says: ~Please go through these papers.~"; Answer, Order: "~Huh?~"; ], orders [; rub: noun.dirty = false; "Mom quickly cleans ", (the) noun, " and returns."; open: if (noun == refrigerator) <>; else "You can open ", (the) noun, " yourself."; ], daemon [; if (self.number == 17) move self to bedroom_1; if (self.number == 23) move self to kitchen; self.number++; if (self.number == 24) self.number = 0; ]; Person ken "Ken" shed with name "Ken", description "Ken is a tall thin young man with thinning hair. He looks rather shabby with a stubble of beard and dirty finger nails. His breath smells like smoke.", react_before [; take: "Ken says to you ~Don't take ", (the) noun, ".~"; ], life [; Ask, Answer, Tell, Order: if (location == shed && allison in train_station) { print "Ken says: ~You have to pick up Allison at the train station.~^"; starttimer(self,2); rtrue; } if (location == shed) "Ken says: ~I'm burying a dead bird.~"; if (location == den && basement_door hasnt open) "Ken says: ~Do you need any help?~"; give: if (noun == jewelry) { move noun to self; "Ken says: ~Thanks. I can sell it to buy marijuana.~"; } if (noun == money) { move noun to self; "Ken says: ~You stole my social security money!~"; } ], orders [; open: if (location == den && noun == basement_door && basement_door hasnt open) { if (jewelry in ken && money in ken) { print "Ken says: ~I'll show you how to open it.~^"; basement_door.special_open = false; <>; } else "Ken says: ~You have to give me a present.~"; } ], time_left, time_out [; move self to back_yard; ], daemon [; if (self.number == 2) move self to den; if (self.number == 12) move self to bedroom_4; if (self.number == 23) move self to shed; self.number++; if (self.number == 24) self.number = 0; ]; Person sid "Papa Sid" den with name "Papa" "Sid" "dad", life [; "He does not say anything intelligable."; ], description "Once a friendly outgoing heavyset man, now old and confused.", eating [; move self to kitchen; if (random(2) == 1 && chicken_r in refrigerator) { chicken_r.number--; if (chicken_r.number == 0) remove chicken_r; } ], daemon [; switch(self.number) { 1 to 17: if (self in den) if (remote in den) { if (random(4) == 1) self.eating(); } else { if (random(2) == 1) self.eating(); } if (self in kitchen) if (random(2) == 1) { if (location == bathroom_ds) bathroom_us.dirty = true; else bathroom_ds.dirty = true; move self to den; } 18: move self to bedroom_1; 23: if (location == bathroom_us) bathroom_ds.dirty = true; else bathroom_us.dirty = true; move self to den; } self.number++; if (self.number == 24) self.number = 0; ]; Connector garage_door "Garage Door" with name "garage" "door", description "The garage door is corrogated white metal. The bottom seal is cracked and bent and just above the seal is a rusted line where a handle was once attached.", garage_to garage, out_to front_yard, before [; open: if (crowbar notin player) "The garage door is stuck."; ], after [; open: "You force open the door with the crowbar."; ], has scenery openable; Connector front_door "Front Door" with name "front" "door" "house" "frontdoor", description "The front door is a thick wood frame door with an old screen door attached to it. To the right of the door is a hanging black plaque of a family of cats. Perhaps it means something.", in_to dining_room, out_to front_yard, with_key house_keys, before [; open: if (location == dining_room && self has locked) give self ~locked; ], has scenery openable lockable locked; Connector kitchen_door "Kitchen Door" with name "kitchen" "door" "side" "house", description "The side door is a wood frame door. A screen door hangs loosly off one hinge.", in_to kitchen, out_to side_yard, with_key house_keys, before [; open: if (location == kitchen && self has locked) give self ~locked; ], has scenery openable lockable locked; Connector back_door "Back Door" with name "back" "door" "house" "backdoor", description "The back door is difficult to close or open because of the carpet." , in_to den, out_to back_yard, with_key house_keys, before [; open: if (location == den && self has locked) give self ~locked; ], has scenery openable lockable locked; Connector basement_door "Basement Door" with name "basement" "door", description "The door has a small chain fixing it to the wall.", special_open true, d_to basement, u_to den, before [; open: if (self hasnt open && self.special_open) "You need to tell someone to open it for you."; ], has scenery openable; Connector bathroom_door_ds "Bathroom Door" with name "bathroom" "door", bathroom_to bathroom_ds, out_to den, has scenery openable; Connector bathroom_door_us "Bathroom Door" with name "bathroom" "door", bathroom_to bathroom_us, out_to hallway, has scenery openable; Connector bedroom_door_4 "Ken's Bedroom Door" with name "ken^s" "bedroom" "door", in_to bedroom_4, out_to bedroom_3, before [; open: if (actor == player && self hasnt open && ken in bedroom_4) "You must knock first"; ], has scenery openable proper; Connector bedroom_door_3 "Unused Bedroom Door" with name "unused" "bedroom" "door", in_to bedroom_3, out_to hallway, has scenery openable; Connector bedroom_door_2 "Allison's Bedroom Door" with name "allison^s" "bedroom" "door", in_to bedroom_2, out_to hallway, has scenery openable proper; Connector bedroom_door_1 "Master Bedroom Door" with name "master" "bedroom" "door", in_to bedroom_1, out_to hallway, has scenery openable; Object crowbar "crowbar" shed with name "crowbar" "bar", react_before [; take: if (crowbar in player) "You cannot pick up ", (the) noun, " since you are carrying the crowbar."; ! I would like this to be checked after before for car ], before [i; take: objectloop (i in player) "You cannot pick up the crowbar since you are carrying something else."; ]; Object house_keys "house keys" dining_room with name "house" "keys", article "the"; Object glass_bowl "glass bowl" dining_room with name "glass" "bowl", description "A clear hand blone glass bowl is on the dining room table.", after [; drop: remove glass_bowl; "Crash! You are in big trouble!"; ]; Object garbage_can "garbage can" side_yard with name "garbage" "can", description "Just a boring large metal can which has seen better days." has container openable; Object hose "hose" back_yard with name "garden" "hose"; Object old_car "old car" garage with name "old" "car", description "There is a late model bright red car here.", before [; drive: if (allison notin train_station) "Why do you need to drive the car? Allison is already home.^"; take: "The car is too heavy to lift."; ! want before react_before ], after [; drive: ! may wish to make this a sub adventure give garage_door ~open; move allison to dining_room; startdaemon(allison); ! have all these people in synch startdaemon(ken); startdaemon(mom); startdaemon(sid); give front_door ~locked; print "^You drive to the train station and pick up your sister Allison. You take her back to the house. You park the car back in the garage and close the garage door. She unlocks the front door and goes inside the house.^You are in the:"; PlayerTo(front_yard,2); rtrue; ]; Object jewel_box "Jewel studded box" garage with name "jewel" "box", description "There is a jewel studded box here. It is an object of rare beauty.", with_key old_key, after [; open: "There is a note inside."; ], has container openable lockable locked; Object note "note" jewel_box with name "note", description [; "Congradulations! You have won the game!^ Feel free to quit whenever you want."; ], has scenery; Object jewelry "jewelry" bedroom_1 with name "jewelry", has pluralname; Object money "sack of money" bedroom_4 with name "sack" "money"; Object dead_bird "dead bird" bedroom_4 with name "dead" "bird"; Object refrigerator "refrigerator" kitchen with name "refrigerator" "frig", before [; open: if (actor == player) "You cannot open the refrigerator by yourself."; ], after [; open: starttimer(self,2); <>; ], time_left, time_out [; give self ~open; ], time has static container openable; Object soda "soda" refrigerator with name "soda" "coke", description "thirst quenching", before [; drink: if (hungerpee.pee == 0) hungerpee.pee = 1; "It was thirst quenching."; ], has pluralname; Object chicken_r "chicken pieces" refrigerator with name "chicken" "pieces", description "white meat covered with flavored bread crumbs", number 6, before [; take: if (chicken_y in player) "Do not get greedy! You already have some."; self.number--; if (self.number == 0) remove chicken_r; move chicken_y to player; ! before was a trick since eat automatically did a take action if (verb_word == 'eat') <>; "Now you have some of Mom's delicious chicken pieces."; ], has pluralname; Object chicken_y "your chicken pieces" with name "my" "chicken" "pieces", description "white meat covered with flavored bread crumbs", before [; drop: if (location == kitchen && refrigerator has open) { remove self; chicken_r.number++; "You put them back into the refrigerator."; } else "You must place them back in the refrigerator if you do not want them."; ], after [; eat: hungerpee.hunger = 0; if (hungerpee.pee == 0) hungerpee.pee = 1; rfalse; ], has proper edible; Object old_key "old key" basement with name "old" "key"; Object remote "remote control" den with name "remote" "control", description "The remote control is needed to operate the TV."; Object blocks "wooden blocks" den with name "wooden" "blocks", has pluralname; Object lava_lamp "lava lamp" living_room with name "lava" "lamp"; Object games "games" basement with name "games", has pluralname; Object hungerpee with hunger 0, pee 0, daemon [ i; switch(self.hunger) { 21 to 40: print "You are getting hungry.^"; 41 to 59: print "You are starving to death.^"; 60: print "You are too weak to take another step.^"; deadflag = 1; } self.hunger++; if (self.pee > 10) print "You have to go to the bathroom.^"; if (self.pee == 40) { print "You can't hold it in any longer and you go on the floor.^"; deadflag = 1; } if (self.pee > 0) self.pee++; if (random(6) == 1) objectloop(i ofclass connector && i has lockable && i hasnt open && i hasnt locked) { give i locked; print "Someone just locked " , (the) i, ".^"; } ], has scenery concealed;